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.

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)

2

u/cogman10 Nov 29 '15

I'm in this position now, and, to be frank, it is kind of a blast. We have a core product that was done poorly and is huge. We have few feature requests and lots of maintenance to do and because the business sees the value of stabilizing and improving, we are allowed to polish and clean this thing without being pushed down a dark hole of poor fixes.

3

u/[deleted] Nov 29 '15

I feel like if your software faces the people who are bankrolling the project, improving the usability and look of existing features can go a long way towards showing the stakeholders what a great job you're capable of.

I've been on both sides of that. With the aforementioned application, the stakeholders raved about how great it was to use. It went from being a chore to use to speeding up their department's workflow. They actually requested more funding for us to give other apps in their department the same treatment.

Contrast that with the place I just left: management didn't consider us having delivered anything if we didn't add some major functionality every two weeks. Because we were given such short deadlines, features consistently came out buggy and half-baked. The users of our software got upgrade fatigue and dreaded every new release as much as we dreaded releasing it. But, management, rather than seeing the value in fixing bugs and enhancing stability, would ask, what are y'all actually doing? when new features weren't being churned out.

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.

2

u/[deleted] Nov 29 '15

Core FOSS projects care about this. See the Linux kernel for how this is done correctly (and now sometimes being criticized because of the tone being used to do it correctly).

2

u/bilog78 Nov 29 '15

Core FOSS projects care about this. See the Linux kernel for how this is done correctly (and now sometimes being criticized because of the tone being used to do it correctly).

I wouldn't classify the Linux kernel as being “legacy code”. On the contrary, it's extremely dynamic and evolves at an incredible pace, and from the driver perspective it's consistently unstable, API- and ABI- wise, so you can never expect an out-of-tree driver written for version X to even build, let alone run, with any other version of the kernel. But it is true that it is one of the (sadly few) FLOSS projects that holds the tenet of (trying to) never breaking the user experience —as long as your hardware is supported in-tree.

2

u/[deleted] Nov 29 '15

To me the Linux kernel is the very definition of "actively maintained legacy code".

The hub-bub I referred to was in direct reference to trying to set a culture to not break things outside the kernel, while still making progress on the kernel.

→ More replies (4)

2

u/gasche Nov 30 '15 edited Nov 30 '15

Let me disagree. I contribute to the OCaml compiler (the compiler distribution of the OCaml programming language), which is a free software project with a culture very different from what you are describing now. Programming language implementations have strong backward-compatibility requirements (user code must keep working), so big rewrites must be done very carefully and gently evolving existing systems is strongly favoured. A part of the development activity is about evolving rather old code (initially written in the 90s) in a tasteful way, and it's actually very interesting -- most of the code is fairly clean, old code is not very different from recent code. Other FLOSS projects that I interact with or see around have a similar emphasis on long-term compatibility and careful evolution of the code.

Your vision may be influenced by desktop software (KDE, Gnome) that has very different software lifecycles. One problem with "fashionable" UIs is that you need to change deeply every few years; also, the needs of desktop users keep changing rather fast, for example with the cloud synchronization, or the desktop-and-mobile hybrids that are being worked on now. But even those projects have managed to build software islands inside the project that are stable and carefully maintained -- consider GStreamer or Krita for example (both started in 1999).

→ More replies (2)