Live data from Hacker News

Who wrote this shit?

heltweg.org

101–110 of 300 posts

Re: Who wrote this shit?

#101

This is a good mind set to cultivate, but then I remember working on non-legacy projects. My current project was started in the middle of 2021. The same people have been working on it for 6 months. I've been working on a related project and shifted over at the beginning of the year. I know the constraints and there haven't been deadlines. The staff engineer decided to pick technology by what's cool. They haven't inve…

This field is growing so quickly the ratio of experienced to new devs is out of balance. It takes a critical mass of experienced devs on a team or in an org or the scenario you're in is the default.

And even that critical mass won't be enough if leadership implicitly or explicitly reward shiny visible progress and ignores structural work and integrity.

The experiences we've probably all seen of new buildings going up quickly and then looking like trash just a couple years later are great examples. The problem is that approach "works" during boom years because everyone can move on fast enough to make the problem someone else's.

Re: Who wrote this shit?

#102
post #19
post #4

My favourite is when you're a solopreneur working in your own repos and still asking yourself "who wrote this shit?!"

I heard a saying once: "all developers should be embarrassed about code they wrote more than a year ago" as a (cheeky) measure of ongoing growth and development. :-)

The code you wrote a year ago should have good points and bad. If it is just bad, then you either started programming a year ago, or should perhaps start thinking about changing jobs.

If you are actually improving then there should be some good in there (you got better from two years ago right?). If you can't identify that good, then either you are just chasing fashion (that perfectly good construct from two years ago is now out of fashion so it is "bad"), or you haven't improved your ability to tell good code from bad and just calling it bad because you are unfamiliar with it.

If you want to actually get better at code then you should do a real review of the code you wrote a year ago. Where did bugs occur in the code you wrote? Is there something that you could have done to make it less error prone? Is there code you wrote that is easy to understand? What design choices can you make so that more code ends up in the good code camp? How were the bugs detected? Can I integrate that in to what I do for testing? Then actively practice moving your code in the good direction and away from the bad.

Anything less is chasing fashion and using familiarity as a good and unfamiliarity as bad. "As is" it is a pithy blog post for Coding Horror, but won't get you there. Pursuing greatness requires directed improvement

Re: Who wrote this shit?

#103
Great post!

I am the main consumer of most of my legacy code, so I make sure to do the best job possible.

Nevertheless, I always end up, wanting to rewrite it from scratch.

I don't, and do the best I can, to make sure the product is of as high a quality as possible, and ship it.

Re: Who wrote this shit?

#104

Earlier quoted context omitted.

I find that half the time I'll wonder who wrote it, realize I wrote it, start to rework it, and then realize why I wrote it that way in the first time, add a comment and move on.

Same here. Sometimes I add comments like "don't change this shit!" to remind myself that there is a reason why it is like that.

Those comments would help if future me would listen to them. "Huh, I wonder why I put that in here... let's see what happens if I change that shit."

Re: Who wrote this shit?

#105

This is a good mind set to cultivate, but then I remember working on non-legacy projects. My current project was started in the middle of 2021. The same people have been working on it for 6 months. I've been working on a related project and shifted over at the beginning of the year. I know the constraints and there haven't been deadlines. The staff engineer decided to pick technology by what's cool. They haven't inve…

As they say, legacy code is the code you wrote before lunch.

Re: Who wrote this shit?

#106

I get this. It's true, a lot of code is written and we don't know the circumstances that led to it. Those circumstances could have led to monstrosities -- I have created a good many myself. I try to empathize with those people and commits of the past. HOWEVER, sometimes we see things that no mess of external pressure and crazy circumstance could have produced. No, these gems are born out of individual madness (maybe…

I like the self-aware comment/plea of "FIXME".

Re: Who wrote this shit?

#107
post #58

Like the old joke: Debugging is like a murder mystery where you're simultaneously the investigator, the victim, and the murderer.

Or this:

Code as if the next guy is a violent psychopath who knows your address.

Re: Who wrote this shit?

#108
post #4

My favourite is when you're a solopreneur working in your own repos and still asking yourself "who wrote this shit?!"

On the other end, it's fun when you encounter a bug and go search for an answer and end up reading an answer on Stack Overflow that _you wrote_ 5 years ago and totally forgot about it.

Equally fun is using a package or a part of it that you haven't used for a few years and going to read the docs for a certain feature... and realising you're the one that wrote those docs :)

Re: Who wrote this shit?

#109

In my first corporate job out of college (a NOC at an ISP) I was asked to update the documentation for troubleshooting quality of service issues. I checked our wiki for what was already there and it horrendous. I started to mentally thrash the person and was going to go confront them about it. When I checked the edit history I was greeted by a single edit and my username a week after I started the job. I learned a gr…

Well anyone would be pissed if the only documentation was written by some asshole on his first week.

Re: Who wrote this shit?

#110
post #4

My favourite is when you're a solopreneur working in your own repos and still asking yourself "who wrote this shit?!"

I am working on a fairly ambitious project. It is in the stages where we are nearing the end, and the tofu is getting firmer.

I had an issue, last week, where a bug was caused by an omission I left from an SDK that I wrote, maybe, eight years ago. It was a simple thing. I didn't add a "RefCon" to a server interaction, so I couldn't attach a reference context to a callback. This is a classic pattern, that I've used for decades, and I have no idea why the hell I didn't add it to this SDK. I suspect that it might be that the SDK was for a fairly wide audience, and I probably thought that they wouldn't understand it. So here I am, paying the price for underestimating my user base (which, so far, is Yours Truly).

Anyway, the "fix" was to implement a semaphore, and treat the call as blocking, which is awful. I really need to go back and change the SDK, but that's a fairly fundamental change, that I can't afford, right now (the SDK tofu is rock-hard).

Such is the life of a shipping developer...

Post reply on HN