3 ms·
Here's an old joke about the progression from junior to mid-level to senior developer: Junior dev: My code is simple, straightforward, and easy to understand.
by jawns 2y ago
Here's an old joke about the progression from junior to mid-level to senior developer:
Junior dev: My code is simple, straightforward, and easy to understand.
Mid-level dev: My code is clever, innovative, expressive, hyper-optimized, and ingenious.
Senior dev: My code is simple, straightforward, and easy to understand.
In software development, "clever" solutions are like poems. In the best poems, there are usually multiple layers of meaning, nuances and subtleties, some harder to tease out than others. Sometimes you have to sit with a poem for a while before you are able to truly drink it all in. To mid-level engineers, writing this sort of poetic code has an intoxicating appeal. It allows them to flaunt their talents, demonstrate their mastery of the language, and impress their colleagues with their ingenuity.
But more often than not, what is really needed is the code version of ordinary prose: straightforward, with a preference for clarity over succinctness, easy for others to understand, easy to edit, and with fewer surprises and deviations from convention than a poem. With prose, particular the sort of no-nonsense style found in wire news reports and explanatory journalism, the best work is easy for the reader to comprehend and lends itself to being edited. For instance, a skilled copy editor can condense it to fit, if need be.
- yieldcrv 2y agoI just say, bell curve meme
- dheera 2y agoReality: This is mostly because mid-level dev needs to justify their existence in order to not get laid off or PIP and is worried about losing their H1B and having to uproot their entire family in 60 days notice. Hyper-optimized, hard-to-read code that only they understand is one way to increase reliance on them while giving a reason that can be put into a promotion doc. Mid-level jobs are worried about maintaining their job. Junior dev doesn't care because they can go wherever, they aren't worried about the uprooting, and well-written code is a ticket to a multiple new jobs. Senior dev doesn't care because they have saved enough money, have permanent status, and if the company doesn't want them they aren't worried about there being better opportunities. They have enough online evidence of their competence and don't need to prove themselves.
- ern 2y agoThis is mostly because mid-level dev needs to justify their existence in order to not get laid off or PIP and is worried about losing their H1B and having to uproot their entire family in 60 days notice. Hyper-optimized, hard-to-read code that only they understand is one way to increase reliance on them while giving a reason that can be put into a promotion doc. Mid-level jobs are worried about maintaining their job. That seems to be a matter of survival overriding ethics and professional pride. I know I came up with some really cringeworthy and complex solutions as a mid-level dev, but I would never have done it deliberately. If people are put into a situation where they need to purposefully write substandard code to not get deported, it's something that needs to be fixed.
- strken 2y agoWhen I was a mid-level dev, the overly complicated code I wrote came about because I read an article on e.g. Ruby metaprogramming, got excited, wondered why we didn't use reflection more, and found a place where I could apply it. Perhaps you thought about job security, but that seems like part of your personal journey and isn't tied to seniority. I was just inexperienced and a touch arrogant, as mid-level engineers must be. At higher levels, the reason I don't write code like that is because I've been burnt too many times by the new hotness. It is slightly about job security, but only because I fully expect that any crazy shit I fling out today will eventually hit the fan and come back to me, probably at 3am during on-call.
- aidos 2y agoWith a slight difference that junior dev tends be proud of the code they’re added while a senior will be proud of the code they’ve removed…
- latentsea 2y agoSo much this.
- TheCoelacanth 2y agoI don't think it's accurate, though. Junior devs often write overly complicated code because they don't really understand the problem they're trying to solve. Junior devs write unintentionally complex code, mid-level devs write intentionally complex code, senior devs write simple code.
- bluGill 2y agoSometimes seniour devs write complex code but hide the complexity behind a simple interface.
- drewcoo 2y agoHiding complexity behind a simple interface is not clever. It's smart. It's also the facade design pattern. https://en.wikipedia.org/wiki/Facade_pattern https://en.wikipedia.org/wiki/Facade_pattern
- _heimdall 2y agoI'd include this as table stakes for a senior dev. You don't always need to work on complex code, but I'd expect they work to go to a senior dev and I'd expect complexity to be hidden behind a simple interface.
- Tao3300 2y agoBest summarized in meme format: https://x.com/nice_byte/status/1466940940229046273 https://x.com/nice_byte/status/1466940940229046273
- RangerScience 2y agoMostly, yeah - although Good poems give you clear meaning now, and deep meaning later. I think probably great code is like that, too. It’s clear in how it addresses the immediate needs, but it’s deep in how it sets up addressing later, subtler, or less proximal needs. Git itself comes to mind. At the basic level, it’s super straightforward: you have diffs, you put them in a row, that’s a branch. Easy. Clear. Then you want to do something weird, and lo and behold, you can. The “cleverness” - maybe call it the “clever simplicity” - that it’s built out of makes it possible, and “easy”. The deep part of the poem, that you didn’t need to understand in the beginning, starts becoming apparent and meaningful.
- m463 2y agoI've seen junior devs write code carefully, putting time and effort into it. The code was ornate and almost too over-commented. mid-level devs become more pragmatic, but can skimp on both elegance and simplicity vs complication. What's interesting is that decent senior dev code sometimes almost looks careless, but really works well in the end. For example, immediately exiting with an error instead of complex error recovery. (the latter would just move the problem around and make finding and fixing the root cause more troublesome) Another thing would be duplicating code instead of doing some complex re-use with complicated conditionals.
- JohnBooty 2y agoWhat's interesting is that decent senior dev code sometimes almost looks careless, but really works well in the end. I absolutely love this description. In a lot of ways, YAGNI is what really sets senior code apart. When I was a more junior dev, I thought senior code often looked under-engineered, but in hindsight I realized I was over-engineering things at the time. Another thing would be duplicating code instead of doing some complex re-use with complicated conditionals. God, I wish I could go back in time and burn this into my brain.
- hu3 2y agoAnother example is some devs chain maps and array filters when a mundane for loop would do.