Habits of top engineers
engineercodex.substack.com
engineercodex.substack.com
- Are you bad at regular expressions, but feel you could get away by just processing text with some loops and split statements? Don't. Use RegExes - every single time until you are good at it.
- You don't really understand database joins and normalization, but you feel you could just make two queries and merge things in your backend code? Nope - go learn joins properly.
- You're overwhelmed by large CSS stylesheets and are tempted to write some inline style or important! statement? Nope - read up on CSS taxonomies and structures...
etc...
I'm quite proficient with regular expressions but rarely reach for them outside of throwaway scripts. I'd much rather use some loops and split statements, frankly.
A few times i've seen a number of lines of code that was easily replaced with a single line of regexp matching and value extraction via named capture groups. The amount of code that comes out of "some loops and split statements" quickly turns into spaghetti code, especially when you need to extract values and/or reference what would be other capture groups.
In my experience, as long as you provide (at least) one sample of the expected input, a regexp is essentially self-documenting.
But then once I worked in a few startups, I realized the point was to just ship as fast as possible. I lost the Hard Way mindset and settled into a life of wide, shallow knowledge. As a result I now feel like a glorified plumber, not at all what I set out to be. So I’m trying to figure out how to get back to that state, but it’s difficult to slow down once you’ve gotten used to moving fast.
For many people the only time they can "practise" RegEx (etc.) is outside of office hours.
There is probably significant overlap in a Venn diagram of "1% engineer" and "20-40 year old single person with no children or social life"
In all seriousness though, I agree. Maybe I’m just sad that I’m getting older (39) and don’t have the time or energy to toss away an entire weekend on some new tech, meanwhile watching all the young kids have all the fun. I miss it a bit.
Ehh, i disagree about regex
Regex is great tool with shitty API, at least when used in code, not in config files
When things arent trivial I suggest writing parser, so your loops and splits instead of ugly monsters
I think it may be related to ADHD because I’m getting paid the same and there’s no rush to move onto something else. The work environment is quite good.
My current coping mechanism is to work on two (but never more) projects concurrently and swap between them every few days.
The last 10% of polishing is hard, and the 10% after that is even harder.
Working on multiple projects helps me too.
In bodybuilding, this is called "periodization", I'd say that's a pretty accurate term to describe this.
What cycle times/scheduling works best for you? how do you deal with the dread of picking up a topic again after letting it go mentally?
A trick I've learned is, when possible, to start with tests and documentation.
This is incredibly “draw the rest of the owl”. If it was easy to do that we would all do that.
Step one to become a good developer: be a skilled developer.
Thanks for that. Also, overlapping skill is less useful than you make it out to be. They also all have arms and eyes. That’s not what sets them apart. Engineers of some standing all follow these very basic guidelines. That does not an 1% engineer make. In fact, there is no definition of this fabled one percent engineer. At least not in this article so I cannot be sure what this is about.
The fact this article starts out with referencing big companies and leading positions - AKA status and power - also signals that these people he regards so highly are at least also talented politicians and/or entrepreneurs.
The post isn’t meant to be a tutorial on becoming a top engineer though.
https://i.imgur.com/rCr9A.png ("How to draw an owl")
If you can see the difference between ugly, complex code and aesthetic, simple code, and you're willing to spend extra time to go over your code and make it better, you'll develop the skills to write it better in the first place.
This won't teach you taste (years of maintenance and exposure to other people's code will do that) but it will teach you the skill of living up to a style.
You don't have to code fast if you don't need to write a solution for the problem ten different times.
On that first one: "Every outperformer I knew had the style guide internalized"
No thanks.. It's the year 2023, just install an autofixing linter which fixes the code for you, and then worry about other things.
Method names are not logic. You really don't use distinctive method names or formatting to orient yourself and your colleagues? That sounds awful.
Plus, when you’ve spent enough time with the code in varied environments, you start to internalize what it should look like. Seeing something that doesn’t match the style guide will stand out as looking funny.
I don’t think they were suggesting that you need to memorize every minute detail of your prettier config to be a good engineer. Rather, a good engineer has focused on writing clean-looking code so intensely for so long, to know it automatically.
For example recently I had to learn MCU development. I bought some STM32 devboard, I learned ARM assembly, I learned how to use ld, as, gdb, st-util, st-flash. I wrote led blink with assembly and I can understand every single line in every file that compiles into final firmware, I can understand every byte in the firmware, I know where to find every ARM instruction. I'm not going to use assembly language other than reading some disassembly dumps, however I find it a necessary part. I'm not going to hardcode GPIO register addresses after those learning projects, I'll use CMSIS, however I need to understand the overall structure of manuals, so I did it with bare assembly and then bare C.
I know that some folks are fine with firing up STM cube IDE, autogenerating some template code and fill in missing parts, not even caring much about registers. That might be my way in the future, however I still think that it's incredibly important to have solid foundations and build knowledge upon this foundation, rather than some weak "magic".
Via an Army friend: "Slow is smooth, and smooth is quick."
Miracle doesn't exist overnight. You build a miracle by small steps in small iteration.
That's how you build software the right way.
I am surprised this got upvoted.
Smarter engineers see the world through a different lens. They don't need ultra clear code because they are too smart and as a result their coding style reflects that. Things that are obviously easy to read to them actually aren't easy to read in general but they don't know that because they're too smart.
The stupidest engineer often attacks pointless stylistic choices. First off style in general is more important to them because they aren't as smart... But additionally they can't differentiate between pointless stylistic conventions and ones that arent. For example, I've seen this:
// More comments
// Comment
//This is a comment
Get corrected in a review to this: // More comments
// Comment
// This is a comment
Which is fine, but.Stupider engineers tend to follow certain common human ocd conventions. The corrected code does not practically improve the code at all even from a readability standpoint... it's just jarring to the ocd tendencies of the stupider engineers who cant tell the difference between his own ocd instincts and actual practicality of readable code.
Auto formatters help alleviate these things a bit, but not always.
I admit I'm more on the stupider side in terms of engineering.
Where do idioms fit into this? An example might be golang, ‘c’ could be a perfectly fine idiomatic variable name in go if it’s used very soon after initialisation.
> Don’t follow rules blindly
I think this section could be improved by changing it to talk about being pragmatic vs dogmatic
I think partly it's down to the "if it ain't broke don't fix it" mentality - once it's working there's a temptation to leave it as is and move on to the next task, especially if you're under time pressure.
In fact the time just after you've got it working is the time you have maximum knowledge about the code and the problem it solves, so that's the best time to refactor. Even something as simple as renaming variables and functions to be consistent and reflect what they actually do (rather than what you thought they would do when to started) can make a huge difference.
Maybe the term senior engineer has been overused and now we need a new term for "pretty experienced at the job"?
There is only one way to become a senior role in computer science: be good in communication with humans.
Style and ultra neatness are not central to achieving higher ranking in software engineering.
If you have any constructive feedback, that’d be more helpful.