Live data from Hacker News

Software engineers hate code

dancowell.com

61–70 of 235 posts

Re: Software engineers hate code

#61
post #27
post #8

> This is the best-kept secret of the software engineering profession: engineers hate code. Especially code written by other people. It's why they love working on greenfield projects so much. No code, no maintenance, no headaches! Except that I've met lots of engineers who were the opposite. They hate greenfield projects and prefer maintaining existing code. I noticed this broad division of personality early in my ca…

Indeed! This phenomenon has been a great source of freelancing customers for me. Startups naturally thrive on an early team that loves building new things, but the flip side is that they rarely seem to go back to fix existing stuff. That leaves a gap for people like me, who prefer to take something that works poorly and make it bulletproof. For some reason this quite often seems to involve db access patterns but ther…

Startup teams also aren’t great as they should be at being even slightly kind and thoughtful to their future selves.

Understanding greenfield usually means iteration, a small amount of conceptual architecture and organization before dialing into the matrix to go full Neo can go a long, long way.

Specifically, it’s easier for startups to create productive new beginners in their codebases.

Re: Software engineers hate code

#62
Reading and untangling code is the best part of coding in my opinion. It’s like solving a fun puzzle and trying to incrementally evolve a system.

What I hate is inconsistency. Inconsistency is what makes code intolerable to work with, because changing it becomes so much harder.

Consistency, in the way I mean it, does not mean DRY or over-abstraction. What I mean is, pick a mindset or design philosophy and stick to it. Don’t randomly switch between exceptions and returning errors. Don’t over-abstract some areas early on and then spaghetti code other areas. Have some consistency in how you do this.

For example, have a rough standard for when something is X or Y. Either accept spaghetti code for areas and keep things uncoupled as much as possible (my preferred), or have some concept of abstraction you apply to new layers. Just rough examples.

If it turns out you did it wrong, which is likely, then it is relatively easy to reason about a change. But as soon as you lose the consistency then it becomes a nightmare. Don’t have special snowflakes in your code.

The last thing I’ll write is.. sometimes the over-generalization this article makes is used as a weapon to justify sunk cost fallacy. Sometimes throwing away a part of your codebase and starting from scratch is the best thing to do. But you should work with it for a bit to understand the code before doing so.

Re: Software engineers hate code

#63

This is like writing “mechanics hate bolts”. Yea, mechanics love to complain about metric and imperial sizes and when they don’t thread in correctly, but at the end of the day a good mechanic loves seeing a smooth running car. Similarly, a good software engineer loves it when they have a smooth running service. Updates work without hiccup and the system can be inspected to see how things are running. Having clean and…

What percentage of code you have worked with in your career is that beautiful code that you love to work with? To make it more fair, code you wrote yourself doesn't count, because you aren't an objective observer -- and more importantly, have a different relationship to it making it easier to work with since you wrote it, and often to your own preferences. I think I agree with you, it's just that... the actual way so…

A healthy percentage of the open source projects companies I’ve worked for have used and opened PRs against I would call pretty good looking. Ruby on Rails was always nice to read through and well documented. I also find a lot of datasheets and RFCs to be highly elegant and beautiful, if not a bit dense and verbose. It just depends sometimes, what makes something like art beautiful.

I disagree strongly that “the actual way software is written …”, though it does feel like trying to write clean code is an uphill battle sometimes.

Back to the shop analogy. Cleaning up oil spots and maintaining well polished tools requires time and care.

Re: Software engineers hate code

#64

> Don't write new code when you can use, improve or fix what already exists. If you must write new code, write only what you need to get the job done. While the article resonates with me alot, I would like to, in the best spirit of the article, propose an addendum to that line: When modifying existing code, do a very careful cost-benefit analysis; On the one side is the cost of a rebuild. On the other side is the pro…

> And many of those costs have a nasty tendency to remain hidden until they suddenly don't, and at that point, people often already expended inordinate amounts of resources on them.

Any business that employs software developers knows exactly how much it costs to employ them. If that math doesn’t work then the software developers loose their jobs. This basically establishes a baseline for “value” that must be delivered, at minimum.

Above the baseline, software devs are left to their own devices: There will be no hard accounting of weather development effort is “worth it”, rather it’ll mostly be about whether people feel like it was. (This is sort of the origin of “too much money spoils things”.) As long as the effort doesn’t destroy everything, it can be argued that it was a success!

So, the “hidden” costs are actually “bearable costs” because the business is just fine. The costs are “revealed” only when they’re no longer bearable. Ironically, well designed software “hides” the costs much longer than poorly designed, so what is missing is that we don’t have a great way of assigning value to in-house developed software that “just works”. Developers don’t even really think about it much because they get paid for writing code.

I think that’s why the advice…

> Use what already exists

… becomes very hard, in practice, for devs to follow, even though it’s excellent advice. It’s a problem for management to solve.

Re: Software engineers hate code

#65

This is like writing “mechanics hate bolts”. Yea, mechanics love to complain about metric and imperial sizes and when they don’t thread in correctly, but at the end of the day a good mechanic loves seeing a smooth running car. Similarly, a good software engineer loves it when they have a smooth running service. Updates work without hiccup and the system can be inspected to see how things are running. Having clean and…

> LGTM culture What are you referring to specifically here? A culture where nobody is actually doing reviews and just LGTMing everything?

Yep

Re: Software engineers hate code

#66

I've been a software developer for almost 10 years and during that time I've questioned many times why I keep on going. A while ago I realized that the biggest thing that I like about software development is the simplicity within it's complexity. What I mean by this is; software either works or it doesn't. In many other professions this is not the case. So while there are many things that could be done better and mor…

I find it to be more nuanced. Your code has to work correctly in a bunch of scenarios. Some are very simple to see, others are nuanced corner scenarios.

A good developer will write code that passes many of these scenarios, but even the best will miss some. And an inexperienced developer might write code which passes some basic scenarios.

So, “this code works” is really a range, not a binary condition.

Re: Software engineers hate code

#67
> we deprecate it as legacy and replace it with something new. Rolling green fields forever!

That's a good way to put it. The nuance is that, most of the time, "deprecated" means "not going anywhere anytime soon, so now we have 2+ subsystems for the same thing."

You really do need someone with a grand plan to keep this in check.

Re: Software engineers hate code

#68
post #8

> This is the best-kept secret of the software engineering profession: engineers hate code. Especially code written by other people. It's why they love working on greenfield projects so much. No code, no maintenance, no headaches! Except that I've met lots of engineers who were the opposite. They hate greenfield projects and prefer maintaining existing code. I noticed this broad division of personality early in my ca…

[flagged]

This makes no sense to me... Greenfield projects have problems that legacy projects don't (What language to use, what framework to use, where/how to deploy, etc.), and vice versa (How do I design my feature with the existing limitations of the system in mind, do I need to to redesign a part of the existing system to get it to work, etc.).

None of that has anything to do with "Time thinking about the problem", nor does either one imply that its questions are easier or harder to answer in all scenarios. They're just very different questions, but some devs prefer dealing with the issues a greenfield project presents.

Re: Software engineers hate code

#69
post #46
post #34

Earlier quoted context omitted.

I am one of those who prefer working on existing code. I like making things better, understanding how a code works is thrill, adding new features on existing premises. I am also an amateur fiction writer, and I notice the same thing in it. I like planning, but the first draft writing is a chore to me. An effort to vomit all my ideas as words. Then, I love rewriting. Revisiting what I wrote and improving it, fixing it…

hah humans are interesting! I'm the opposite. I love starting a codebase, I also make music and it's way easier for me to make 100 cool unique sketches live and improvised but not finish anything. it really takes all kinds

My favorite musical partnerships have a balance of a starter and (me) a finisher. I really struggle with producing raw material, but am good at revising, reworking, and cutting out fluff and my best writing partners are great at spewing out ideas, most of which are cut. It together, we are able to make something we’re both excited about.

Re: Software engineers hate code

#70
post #40

> Don't write new code when you can use, improve or fix what already exists. If you must write new code, write only what you need to get the job done. While the article resonates with me alot, I would like to, in the best spirit of the article, propose an addendum to that line: When modifying existing code, do a very careful cost-benefit analysis; On the one side is the cost of a rebuild. On the other side is the pro…

> when the predictions say, that, forseeably, the company will lose money down the line because we waited to long for a rebuild, it may be time to pitch that to whoever allocates resources. Only developers who love greenfield or need a new framework on the CV would suggest a company could lose money by not rebuilding. If the developers are not competent enough to write maintainable code or maintain existing code, the…

> If the developers are not competent enough to write maintainable code or maintain existing code

Or if the old system simply doesn't work with modern environments.

Or if it depends on long abandoned frameworks.

Or if the business grows but the old implementation scales badly or not at all.

Or if it depends on components that incur licensing fees that become prohibitively expensive when it's scaled up.

Or if there are other legacy systems on different technical baselines that it could work with better after being rebuilt on the same base.

Or if its tech simply requires more maintenance than an alternative, thus binding dev resources the company could otherwise use more productively.

There are alot of reasons why maintaining an old system may be an undesireable move in the long run, that have exactly zero to do with the competence of the developers involved.

Post reply on HN