r/programming • • Nov 28 '15

Coding is boring, unless…

https://blog.enki.com/coding-is-boring-unless-4e496720d664
671 Upvotes

390 comments sorted by

View all comments

436

u/[deleted] Nov 28 '15 edited Nov 28 '15

I think there's a lot of cringeworthy stuff in this article, but more than anything, the way the author talks about "legacy software" seems to signal an attitude that's very endemic in developer culture. Any well thought out software project really ought to have clearly defined boundaries upfront--this isn't to say we should waterfall the entire specification. If we have an application used in a production setting with clearly defined boundaries and goals, my question is why on earth is it a bad thing that we stopped adding features, and are doing more maintenance, if the software meets requirements? If the software meets the requirements, great, if not it's a regression, and we have bug fixes for that. The best software is often boring, because the best software is usually simple, well-defined, and has good abstraction; the end goal should be to produce pieces of software that go and go and go, and only require a small part if any of our limited capacity for cognizance. Often requirements do change, but hopefully the original application has facilities for IPC or is modular, and additions or changes can be introduced sanely. Requirements may also change enough, hopefully infrequently, to warrant embarking on either a major overhaul or an entire rewrite. Above all, these processes should be carefully considered before undergoing what may be needless work. It, on the contrary, seems the author is advocating churn for churns sake. I enjoy greenfield development just as much as many of the other developers working with me, but it's really the candy of the development world; more often than not, users seem to detest churn, and every rewrite potentially throws away hard learned lessons of the past and costs business money that may not have been necessary. Software maintenance is absolutely part of the job, and as a developer or software engineer, it's absolutely something you can't and shouldn't avoid, and would absolutely be a major red flag for working with the author.

313

u/[deleted] Nov 28 '15

I think there's a lot of cringeworthy stuff in this article, but more than anything, the way the author talks about "legacy software" seems to signal an attitude that's very endemic in developer culture.

It does get a little silly to hear a start-up talk about how one should deal with legacy systems. It's a bit like listening to people who don't have children talk about parenting.

184

u/raiderrobert Nov 29 '15

It's also a little limited in vision. I've known people who are totally cool with jumping into legacy code and improving it. For them it scratches the "putting things in order" itch. Not realizing that there are people like this is a huge red flag for me. It suggests that he expects everyone to be very much like him.

32

u/njharman Nov 29 '15

"putting things in order" itch.

Bingo. That's me. I also really like data "munging". The biggest thing to learn that will help manage / hire / whatever developers, is this.

Developers are different. Vastly. There is no one-size fits all anything. Carefully match the person to the role.

85

u/mearkat7 Nov 29 '15

My problem with legacy is that it is never treated as "putting things in order". When i'm asked to make a change to a legacy system it's only ever treated as if you're going to to apply a quick(usually poor quality) fix that will only serve as a bandaid until it breaks again. If it was as you described it and you can fix things up and you were allowed the time to do so i'm sure people would have a far less negative attitude towards it. Every time I go back into a legacy system I see how much better i've become at programming so improving my past mistakes is very rewarding but only if I've got the time alotted which is very very rarely unfortunately.

57

u/Jdonavan Nov 29 '15

My problem with legacy is that it is never treated as "putting things in order". When i'm asked to make a change to a legacy system it's only ever treated as if you're going to to apply a quick(usually poor quality) fix that will only serve as a bandaid until it breaks again

But that's because your your corporate culture. Not because it's legacy code.

50

u/[deleted] Nov 29 '15

This is huge. I actually enjoy taking legacy code and making it better. I don't last long at a company where the emphasis is on, "fix it just enough to ship it."

One of my favorite projects was an internal website I'd been given to completely rework, but still meet the requirements document that they had on file. I actually found it fun to untangle the mess, compartmentalize everything, put tests around it, revamp the UI, and wind up delivering something that was literally 100x more performant than the old website. Despite the performance increase, I still managed to retain almost all of the "legacy" core business code.

But, for that particular project, I had wide latitude on the delivery timeline. The company realized that they didn't spend enough time initially on the app, despite how widely used it was in the organization.

Not a lot of companies can actually see that type of value, though. They just see new features and quick bugfixes as the sources of value. They don't eventually see that technical debt piles up, and eventually in order to even deliver anything, you wind up working around that debt, which in turn makes the system that much more of a mess.

14

u/gray_aria Nov 29 '15

I'm pretty sure that those people who sees value in quick fixes sees them more like necessary evils, that's why they are "quick". If they could they would ignore the bugs.

18

u/[deleted] Nov 29 '15

Oh, they'd absolutely ignore them. The position I left just last week had one criteria for adding a bug to the sprint:

Is the customer currently complaining about it?

No? Then screw it. No matter that it's a ticking timebomb that we could easily fix now, not 6 months from now when we have a million rows in a table and the system grinds to a halt because we did a SELECT without a WHERE clause and then filtered the entire collection in code. And even then, rather than admitting that someone screwed up, they want to blame the ORM, not that someone didn't actually understand how to use it.

11

u/daronjay Nov 29 '15

Select without where. Why even have a database? They should write a flat file and open it into memory.

6

u/[deleted] Nov 29 '15

It was more a nuance of the framework (Entity Framework from Microsoft) than willfully being that dumb.

I'm on mobile so providing a code example would be tough, but basically EF works with extension methods, and it treats a table in the database as a collection. You can chain extension methods together to filter data, do joins, aggregate, and most notably for this situation, transform one object to another. But, the order of chaining the methods is important, because it dictates what type of SQL command is generated behind the scenes.

Essentially, if I did:

MyTable.Where(obj => prop.Value == "foo").Select(obj => SomeTransform(obj))

I'd get a SQL query with a WHERE clause, then that would return a collection of transformed objects. But if I did:

MyTable.Select(obj => SomeTransform(obj)).Where(obj => prop.Value == "foo")

It would select the ENTIRE table, transform every object, then filter the results in memory.

→ More replies (0)
→ More replies (3)
→ More replies (2)

16

u/bilog78 Nov 29 '15

But that's because your your corporate culture. Not because it's legacy code.

The thing is, corporate culture is the only one that cares about legacy code. Outside of corporate culture you mostly have start-ups with the attitude shown in the article (“if you have legacy code, you're doing it wrong”) and FLOSS project with the Cascade of Attention-Deficit Teenagers and their “let's rewrite everything from scratch every two year”.

It's extremely rare to find a context which is interested in maintaining legacy code in a “programmer-positive” manner.

→ More replies (10)
→ More replies (1)

13

u/[deleted] Nov 29 '15

I enjoy working on legacy code. I like reading other people's code. I like to learn what ideas they had, see what compromises had to be made with their time constraints, and figure out what could be improved. I enjoy it much more than working on features.

10

u/hamburglin Nov 29 '15

Then you won't be at a start up or switching to the next project after 3 months :)

→ More replies (1)
→ More replies (3)

0

u/[deleted] Nov 29 '15

[deleted]

34

u/[deleted] Nov 29 '15

"the programmer's paradox: software engineering"

Link here.

If you feel gross from reading OP's article, reading this will help.

11

u/JW_00000 Nov 29 '15

Especially relevant:

There is also a persistent fear that any lack of perceived freedom will render the job of programming boring. This is rather odd, and clearly self-destructive, since continuously re-writing ‘similar’ code gradually loses its glamour, resulting in a significant shortening of one’s career. It’s fun and ego fulfilling the first couple of times, but it eventually gets frustrating. Solving the same simple problems over and over again is not the same as really solving challenging problems. We do the first, while claiming we are really doing the second.

7

u/hu6Bi5To Nov 29 '15

All this leads me on to the question: does it have to be either, or?

I've witnessed both extremes: teams who collectively denounce tools they were enthusiastic about the week before, then set about re-writing everything that used it even though they didn't finish the job properly the previous time; also teams who were so scared to change anything that they all their dependencies had been frozen-in-time since 2007.

In real-world engineering there are disciplines that combine both. To borrow the cliched example: a bridge. The primary purpose of a bridge is to not fall down and kill everyone, but bridges can also be remarkable structures and landmarks in their own right.

→ More replies (1)
→ More replies (1)

26

u/MasterLJ Nov 29 '15

The best software is often boring, because the best software is usually simple, well-defined, and has good abstraction;

Well said. When you know the framework, the implied rules, the known issues... it's boring. Sure, it's exciting when you don't fully understand the framework, the hidden landmines, the lack of support, or the missing features... but it's not going to produce great software.

7

u/[deleted] Nov 29 '15

The fun part for me is figuring out which two existing solutions to combine to solve my problem.

→ More replies (1)

18

u/Eirenarch Nov 28 '15

I actually love working on legacy software as long as I am allowed to upgrade every library and framework to the latest version if I see fit. Of course that assumes that the legacy project is not in some dead technology like VB6.

40

u/[deleted] Nov 28 '15

as long as I am allowed to upgrade every library and framework to the latest version if I see fit.

This is something to be very careful with. Outside of the mandatory security updates, updates really should be carefully weighed, as they are just as likely to introduce regressions, as the contracts binding the underlying libraries and systems are subject to change in often subtle ways. It's certainly important to be forward looking, but I find developers, unlike their ops-brethren, more often than not do not give enough considerations to either why they need an update nor do they do they test it and let it soak enough in a non-critical environment to verify that correctness and accuracy has been retained. Again this is not to say we shouldn't upgrade, but the risk-reward arguments should be more substantial and concrete than "this is new and shiny" that I seem to see regularly.

21

u/jplindstrom Nov 29 '15

Staying up to date is scary with a large, sprawling, untested mess of a code base. We've all seen them.

If you adopt a strategy of keeping up to date regularly and have a test suite that breaks when it should, it's time and effort well spent.

→ More replies (3)
→ More replies (1)

68

u/_Garbage_ Nov 28 '15

This!

So many people out there thinks that learning new technology is the goal of your job. If you are not learning new technology once a year, you are not learning.

IMO, solving problems is my job. If I can solve some problems without code, that's probably the best solution I can give to my customers.

→ More replies (31)

0

u/[deleted] Nov 29 '15

[deleted]

→ More replies (1)
→ More replies (17)