Live data from Hacker News

A bunch of programming advice I'd give to myself 15 years ago

mbuffett.com

181–190 of 327 posts

Re: A bunch of programming advice I'd give to myself 15 years ago

#181

I like this a lot. While those commenters who say it is too advanced for novices have a point, I feel these are still issues worth thinking about - and coming back to - as they learn. The one exception is “Bad code gives you feedback, perfect code doesn’t. Err on the side of writing bad code.” My experience with bad code is that it does not tell me much; instead, it presents inscrutable and baffling mysteries. From t…

I think you got the wrong idea from that sentence; the author is talking more about the feedback you get from your end-users and/or customers, rather than development feedback a la debug info.

No I actually do mean the feedback you get as a developer when you realize which “bad” decisions actually end up being tech debt and which were totally fine and just saved time

Re: A bunch of programming advice I'd give to myself 15 years ago

#182
> Our server models are exactly the same as the DTOs we would write, so I just serialized those, instead of writing all the boilerplate, we can write DTOs as needed later if needed

I worked on a system that used the protobuf types generated for communicating between services everywhere. There was absolutely nothing in any of the components of the system that didn't depend directly on the generated protobuf code. What made it even worse is that a backend system we called had multiple endpoints that used the same name for similar but slightly different things, so there wasn't, e.g. just a single Passenger type, but a bunch of different Passenger types across various packages.

Re: A bunch of programming advice I'd give to myself 15 years ago

#183

Earlier quoted context omitted.

Possibly my all-time favourite XKCD, Is it worth the time?¹ , demonstrates two important points. If you only do something very rarely anyway, spending time to automate it won’t have a great ROI. But for things you do moderately often that take a minute or even just a few seconds, you can afford to spend a surprisingly large amount of time optimising them and still get a big pay-off over a time frame measured in years…

> If you only do something very rarely anyway, spending time to automate it won’t have a great ROI For code-editing, maybe. But in general software engineering, there are tasks that I have to do maybe once a year or less that are always way more painful than they need to be because I don't remember the details, and anytime I automate even part of them (or yes, just document a little better), it turns out to be well w…

Do hard things more often. https://martinfowler.com/bliki/FrequencyReducesDifficulty.ht...

Re: A bunch of programming advice I'd give to myself 15 years ago

#184

I'll add one point. You are not your job. Don't take things personally at work. And never be afraid to leave if you're not fitting in with your company . I've left jobs over a few reasons, primarily bad managers, increased compensation, and bad code . If people are writing bad code at your company, to the point where you know it's going to come back to haunt you later, it's okay to just walk away . Don't embarrass an…

Related, the computer doesn’t care about you and isn’t judging you when it throws an error. Your code has the bug, not you. Stop feeling shitty about yourself and go fix it.

I find it helpful to blame all my bugs on the stupid computer not knowing how to listen, then comb through to code to find what the computer was too dumb to understand. When I find it, I realize that in my haste I had accidentally misspoken to the computer who was doing the best it could to please me, I correct it and promise to explain myself better next time, then apologize.

I find it therapeutic to externalize to inanimate objects.

Re: A bunch of programming advice I'd give to myself 15 years ago

#185

I wish more articles talked about the usefulness of integration tests over unit tests. Personally, I feel that unit tests are overrated and rarely give the required confidence to inform the team whether something is ship ready, whereas integration tests on the common workflows means that even when a bug is introduced, very few users are affected.

It seems from my experience that when you're working on a core library or tool where the API is the product and it's going to be widely used by lots of other teams, or even companies in the case of open source, then unit tests are very important. If you're on a product team they probably are a waste of time.

Re: A bunch of programming advice I'd give to myself 15 years ago

#186
post #136

Earlier quoted context omitted.

> You need to take the time to understand why the bug happened, or you’re just going to be patching wallpaper instead of fixing the plumbing leak. I think many would like to probe deeper but aren't afforded the time between sprint tasks. Management often pushes back for solutions that are good enough compared to exploration with an unknown duration until the solution is found.

Of course this can vary wildly, but I've never felt afraid to defy management on that one. Half the time, they don't even need to know. And the other half of the time... what are they going to do? Fire me? Fine, then their project will be filled with nothing but wallpaper-patchers and I'll be somewhere else doing good work. (And of course, sometimes just patching the wallpaper is the right course of action, but it's…

Yeah, at a certain point I just stop caring what management thinks and just doing what I think is right. I usually don't get the recognition I think I deserve for preventing future issues but no one complains either.

Re: A bunch of programming advice I'd give to myself 15 years ago

#187
post #164

I'll add one point. You are not your job. Don't take things personally at work. And never be afraid to leave if you're not fitting in with your company . I've left jobs over a few reasons, primarily bad managers, increased compensation, and bad code . If people are writing bad code at your company, to the point where you know it's going to come back to haunt you later, it's okay to just walk away . Don't embarrass an…

Unless you have a lot of flexibility in terms of where you work, this type of advice is becoming less relevant in an IT job market that's in free fall. Much fewer devs can just jump ship at will than between 2003 - 2022.

> Unless you have a lot of flexibility in terms of where you work, this type of advice is becoming less relevant in an IT job market that's in free fall. > Much fewer devs can just jump ship at will than between 2003 - 2022.

Citation needed. Good developers are just as in demand now as they have ever been.

Re: A bunch of programming advice I'd give to myself 15 years ago

#188

The one piece of advice I would give myself 15 years ago: In the corporate world be very good at administration. You only need to just be good enough at programming to not get fired. Everybody has opinions on software techniques and nobody measures anything, so it’s really just a popularity/tool game. The only goals are retain employment or promote out of software, being good at software is just a distraction from th…

[flagged]

Re: A bunch of programming advice I'd give to myself 15 years ago

#189
post #137
post #11

Most of this advice has already clicked with me, but this part: > If you can't easily explain why something is difficult, then it's incidental complexity, which is probably worth addressing That's a real eye-opener. Hope I remember this next time I implement something complex. The thing is, I don't think this stuff would've helped me much when I was a junior dev. A lot of them are just too nuanced.

'Addressing' can be ambiguous. Writing comments to explain why it's right and needs to be this way? Or changing the code without considering if they have enough knowledge of the rest of the codebase. There's also a chance it's not understood yet to easily explain it. A key part of joining a team is remaining open to the fact that just because I don't understand something, doesn't mean there isn't understanding in it.

Sometimes there's understanding, sometimes the person who did understand has left the team. This is why it's worth writing good commit messages and going back to read them when there's a funny piece of code. A lot of my commit messages are to the effect of "I did it this way to be backwards compatible with how it always worked. It still looks funny to me though" Then at least future person knows I don't have a good reason for it and they can dig deeper or get PMs to sign off on something better if they want.

Re: A bunch of programming advice I'd give to myself 15 years ago

#190

Earlier quoted context omitted.

Could you expand a bit on what you mean by administration?

Writing ample clear documentation, precision of communication, dutifully fulfilling all timesheets, logging of work performed, attending all requested meetings, and always delivering work on time.

[flagged]
Post reply on HN