• 2 Posts
  • 3 Comments
Joined 1Y ago
cake
Cake day: Jun 30, 2023

help-circle
rss

While the term “rubber duck debugging” typically involves explaining the code to an inanimate object, in this case, you’ve been using me […]

…well… that’s an awkward moment of silence…


LLMs as interactive rubber ducks (or Q&A trainers)
I initially wrote this as a response to [this joke post](https://lemmy.world/post/18144181), but I think it deserves a separate post. As a software engineer, I am deeply familiar with the concept of rubber duck debugging. It's fascinating how "just" (re-)phrasing a problem can open up path to a solution or shed light on own misconceptions or confusions. (As and aside, I find that among other things that have similar effect is writing commit messages, and also re-reading own code under a different "lighting": for instance, after I finish a branch and push it to GitLab, I will sometimes immediately go and review the code (or just the diff) in GitLab (as opposed to my terminal or editor) and sometimes realize new things.) But another thing I've been realizing for some time is that these "a-ha" moments are always mixed feelings. Sure it's great I've been able to find the solution but it also feels like bit of a downer. I suspect that while crafting the question, I've been subconsciously also looking forward for the social interaction coming from asking that question. Suddenly belonging to a group of engineers having a crack at the problem. The thing is: I don't get that with ChatGPT. I don't get that since there's was not going to be any social interaction to begin with. **With ChatGPT, I can do the rubber duck debugging thing *without* the sad part.** If no rubber duck debugging happens, and ChatGPT answers my question, then that's obvious, can move on. If no rubber duck debugging happens, and ChatGPT *fails* to answer my question, then by the time at least I got some clarity about the problem which I can re-use to phrase my question with an actual community of peers, be it IRC channel, a Discord server or our team Slack channel. --- So I'm wondering, do other people tend to use LLMs as these sort of interactive rubber ducks? And as a bit of a stretch of this idea---could LLM be thought of as a tool to practice asking question, prior to actually asking real people? --- PS: I should mention that I'm also not a native English speaker (which I guess is probably obvious by now by my writing) so part of my "learning asking question" is also learning it specifically in English.
fedilink

I mean, the guy has some good points (and a good microphone and a radio voice) but I don’t think the first video you linked is very well done, especially the intro. Starting with “this is the most important video because it’s going to tell you something that nobody tells you” is a great way to sound …kind of like a narcissistic crackpot.

E.g. the one with 3800 lines is pretty good. (BTW I realized already subbed to his channel earlier…)


I love Christopher Okhravi’s take on inheritance:

Only Use Inheritance If You Want Both of These

spoiler

the “only use inheritance when …” turns out as pretty much “never use inheritance”


Are SW design patterns guilty until proven otherwise?
I started writing this as an answer to someone on some discord, but it would not fit the channel topic, but I'd still love to see people's views on this. So I'll quote the comment but just as a primer: > The safest pattern to use is to not use any pattern at all and write the most straight forward code. Apply patterns only when the simplest code is actually causing real problems. First and foremost: Many paths to hell are paved with design patterns applied willy-nilly. (A funny aside: OO community seems to be more active and organized in describing them (and often not warning strongly enough about dangers of inheritance, the true lord of the pattern rings), which leads to the lower-level, simpler patterns being underrepresented.) But, the other extreme is not without issues, by far. I've seen too many FastAPI endpoints talking to db like there's no tomorrow. That is definitely "straight forward" approach but the first problem is already there: it's pretty much untestable, and soon enough everyone is coupling to random DB columns (and making random assumptions about their content, usually based on "well let's see who writes what there" analysis) which makes it hard to change without playing a whack-a-bug. And what? Our initial DB design was not future proof? Tough luck changing it now. So new endpoints will actually be trying to make up for the obsolete schema, using pandas everywhere to do what SQL or some storage layer (perhaps with some unit-of-work pattern) should be doing -- and further cementing in the obsolete design. Eventually it's close to impossible to know who writes/expects what, so now everyone better be defensive, adding even more cruft (and space for bugs). My point is, I guess, that by the time when there are identifiable "real problems" to be solved by pattern, it's far too late. Look, in general, postponing a decision to have more information can be a great strategy. But that depends on the quality of information you get by postponing. If that extra information is going to be just new features you added in the meantime, that is going to be **heavily** biased by the amount of defensive / making-up-for-bad-db junk that you forced yourself to keep adding. It's not necessarily going to be easier to see the right pattern. So the tricky part is, which patterns are actually strong enough yet not necessarily obtrusive, so that you can start applying them early on? That's a million dollar question. I don't think "straight forward" gets you towards answering that question. (Well, to be fair, I'm sure people have made $1M with "straight forward code", so that's that, but is that a good bet?) (By the way, real world actually has a nice pattern specifically for getting out of that hole, and it's called "your competitor moving faster & being cheaper than you" so in a healthy market the problem should solve itself eventually...) --- So what are your ideas? Do you have design patterns / disciplines that you tend to apply generally, with new projects? I'm not looking for actual patterns (although it's fine to suggest your favorites, or link to resources), I'm mainly interested in what do people think about patterns in general, and how to apply them during the lifetime of the project.
fedilink