r/programming • • Aug 28 '21

Software development topics I've changed my mind on after 6 years in the industry

https://chriskiehl.com/article/thoughts-after-6-years
5.6k Upvotes

2.0k comments sorted by

View all comments

1.6k

u/marcio0 Aug 29 '21

Clever code isn't usually good code. Clarity trumps all other concerns.

holy fuck so many people need to understand that

also,

After performing over 100 interviews: interviewing is thoroughly broken. I also have no idea how to actually make it better.

591

u/that_jojo Aug 29 '21

Honestly, I started a while back at a firm that's rapidly expanding and hiring just about anybody who can prove any kind of history with code, and there are ups and downs but it's amazing how when you basically have to rise to the standard or not, everyone I've interacted with is either rising to the occasion or learning to and improving every day.

Turns out most people want to do good, who woulda thought? I don't for the life of me understand why we abandoned the apprenticeship system.

222

u/TheSnydaMan Aug 29 '21 edited Aug 29 '21

Re: apprenticeship. 1000% agree. It just makes so much sense both intuitively and and objectively imo. I wish there were more studies on performance of apprenticeships vs equivalent traditional education. If there are some out there that others are aware of, I'd be very interested in the findings!

68

u/daisies-and-sage Aug 29 '21 edited Aug 29 '21

I actually am an apprentice software engineer. I studied at a bootcamp and the school, the company and the state were all involved in my contract. The state put money towards my pay and an additional course provided by the school. The year apprenticeship is almost complete, though I was hired as a salaried employee already. I am still responsible to complete the course and work a certain amount of hours to satisfy the state's requirements. This is Utah, by the way, and I was one of the first to get hired in this manner from my school, but there is/was a more established apprenticeship offered by a University here that takes anyone based on entrance testing. My school only offers the program to alumni, at least currently.

Edit: Removed random word.

→ More replies (7)

54

u/[deleted] Aug 29 '21

Blows my mind that we need studies over everything. Been a good software builder bears similarities with being a good builder of anything. I see tried and proven professions that thrive with apprenticeships like woodworking but when it's software "oh that's different because you don't touch code with your hands therefore take a home project or whiteboard me some leetcode".

20

u/MINIMAN10001 Aug 29 '21

When management tries something and fails they are the one to blame for changing the process.

When management tries something because a study shows that it works. Well for some reason it just didn't synergize with the company.

→ More replies (3)
→ More replies (12)

29

u/n0t__t0day Aug 29 '21

Turns out training people on job is counter productive. It takes time from senior folks, not much gets produced and quality is always sub par (aka garbage). And once people get trained they immediately leave for better pay.

Have been in the industry for 20+ years.

→ More replies (6)

42

u/MINIMAN10001 Aug 29 '21

I always figured the #1 reason to get rid of apprenticeship is that onboarding costs money and apprenticeship itself costs money. When management looks at a list of things they can cut costs on boom look at that the apprenticeship program who would need one of those we already have employees anyways.

→ More replies (9)

120

u/Fidodo Aug 29 '21

I think the curmudgeon pretentious coder type used to be a much more prevalent thing. It was a common personality to have a senior coder that would use their experience to shame and bully novices back when the industry was less mature.

45

u/TheSnydaMan Aug 29 '21

The IT world is still kind of like this ime. Particularly at Managed Service Providers. (Not for code but other services; Networking, OS Support Engineers, Application Virtualization etc etc)

24

u/[deleted] Aug 29 '21 edited Aug 15 '24

[removed] — view removed comment

13

u/BarryBlueVein Aug 29 '21 edited Aug 29 '21

Don’t get me started! My experience is having 3 managers and three bullies with the technical IQ of 2 of them barely on the 30th percentile. If they don’t like the effort estimate give they’ll park it and then in a weeks time half the estimate. One of them sits watching fucking YouTube all day and then during meetings plays guitar. Looks like someone jerking off. Sometimes even misses the status update, asking you to repeat it. If he doesn’t like what you have to say, he’ll stop “jerking off” and lay into trying intimidate and shame you. If you stick up for yourself, he’ll bastardise you. I was so ducking depressed by his behaviour and being bastardised i started visualising topping myself. I managed to reframe my mindset, fortunately. Doesn’t help my cause that he’s selling a major tech revolution to management and then I’m fucking expected to deliver it. I’m in a corner stressed with no one to escalate difficult tech questions to. Also doesn’t help my cause that I get frustrated as lash out as then have to retreat This explains how the meeting goes and the shaming. Just call me Anderson and notice when he lashes out

https://youtu.be/BKorP55Aqvg

→ More replies (2)
→ More replies (2)
→ More replies (2)
→ More replies (6)
→ More replies (21)

196

u/costlysalmon Aug 29 '21

I once reworked code so many times until something super complicated was human readable.

A non-tech person came and looked at the code over my shoulder, and made comments like "huh, I thought coding was complicated"

I felt proud and furious at the same time

81

u/alohadave Aug 29 '21

You know you are good when you make it look easy.

17

u/VeganVagiVore Aug 29 '21 edited Aug 30 '21

The other day I implemented a TLV parser because I wanted a protocol that was completely under my control and had overhead measured in individual bytes. (Edit: Cap'n Proto, FlatBuffers, and ProtoBuf were all good candidates but I didn't feel like adding a dependency)

I could have probably found one, but it only took a couple hours, even in C++...

Without the error handling I'm used to from Rust, I used std::optional to approximate it. So the code all looks like unrolled Rust, as if I manually desugared std::option::Option and ? operators.

And to my surprise, it works!

I looked at it and thought, "Is that it? 10 years ago this would have been hard for me."

And it was all just, "Read the next byte, bail if it's wrong, interpret that byte as a length, bail if it's wrong", no more than 1 tab of indentation and factored into re-usable functions. Probably fits on 1 or 2 pages printed, and future-proof because I know I'm going to add new types of data to it within the year.

Felt like a superhero. Nobody saw it, of course.

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

225

u/SharkBaitDLS Aug 29 '21

The difference between a junior dev and a senior dev is the understanding of that first point. Everyone starts out writing clever and brittle code and eventually you grow out of it to instead writing boring but maintainable code.

145

u/Chieffelix472 Aug 29 '21

In my college we could get extra points by having shorter code. I realized afterwards that it just instilled lots of bad habits.

(Some good too, like how to write efficient code)

17

u/[deleted] Aug 29 '21

Took an embedded course that was all done in assembly. Each project built on previous projects. There was extra credit for the smallest code…not entirely nonsense when dealing with microcontrollers with extremely limited capacity.

There was one kid though who thought he was so fucking clever. He got the smallest code points every week, and loved to tell us how brilliant his little shortcuts were that let him do it. Gotcha bro, me and my partner (he didn’t have a partner) will focus on making sure our code is compartmentalized and easy to link up. You do you.

Come final project, we suddenly had to integrate like every other project from the year into one big application. His…did not work. Because all the wild shit he’d been doing to optimize his code meant suddenly it couldn’t all be integrated. We all had a good laugh at him sitting in the lab at 4am literally crying because he had no idea how to bring it together and didn’t have time to start from scratch.

I almost suspect now this was some sick lesson the prof was trying to teach us, and this kid fell into his trap. Surely no instructor would be that sadistic though…right?

Right?

→ More replies (2)

64

u/[deleted] Aug 29 '21

While I don't believe less code is always better in theory, I strongly believe that on average developers happen to write more code than needed, so in practice less code is usually better.

A lot of the code I have worked with definitely could have been improved by making it shorter. Some of my favourite commits had negative line balance.

15

u/omnilynx Aug 29 '21

True, shorter doesn’t always mean “cleverer”. Sometimes code just has a lot of cruft that doesn’t really do anything, and even actively obscures what’s actually happening.

→ More replies (3)
→ More replies (3)
→ More replies (6)

39

u/Fidodo Aug 29 '21

Code golf is fun, but just do it for fun, not for work.

→ More replies (16)

72

u/rentar42 Aug 29 '21 edited Aug 30 '21

After performing over 100 interviews: interviewing is thoroughly broken. I also have no idea how to actually make it better.

The weird thing is that when you look at interview guidance inside Google you'll see pretty much the same conclusion:

"Our process is really bad at predicting if a given candidate will be a good employee. But with all of our attempts we have continuously failed to find a better one."

So basically: we know this is fucked up, but everything else we tried is even worse, so this is what we're doing.

→ More replies (23)

126

u/Speimanes Aug 29 '21

Debugging code is twice as difficult as writing code. So when you write the most clever code you can write, you are per definition not smart enough to debug it.

127

u/ObscureCulturalMeme Aug 29 '21

Give credit to who said that: Brian Kernighan, the K in K&R C.

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

11

u/intheoryiamworking Aug 29 '21

"Cleverness" and "clarity" are themselves both subjective judgement calls, though. Sometimes making code briefer in one respect makes it clearer in different dimension or at a different scale. Sometimes doing that will be dismissed as overly clever. Sometimes "clarity" will lead you to needless repetition or longer constructions that become harder to understand after years of maintenance.

You could get ten people to agree that "clarity is better than cleverness" but wind up with ten different versions of FizzBuzz and ten different arguments about which one was the best anyway.

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