I consider it is a good factor for programmers (or any employee, actually) to be lazy. I really suppose hiring managers ought to search the laziest developer they’ll discover.
All proper, individuals, put your pitchforks down and let me clarify.
On Twitter the opposite day, somebody requested if one ought to use semicolons in JS. My take? I do not trouble. To me, it is wasted typing, wasted effort for no profit. It would not make the code any higher or simpler to learn, and it’d save a number of milliseconds right here and there. I am all about that. I am all about selecting the trail of least resistance, what I known as “the bottom effort choice” in my tweet.
This induced a little bit of a storm in a teacup, and triggered a number of people:
Ew. Lowest effort choice? That ethos couldn’t result in nice software program…
That being stated, after I’m velocity coding on @LeetCode I’ve begun dropping the semicolons. I’m so ashamed of myself. 🤦♂️😜
— Zakery Kates (@zakkates) November 11, 2022
I disagree. Semi-colons are there to separate the tip of every line and due to this fact serve a goal to each compiler and programmer. There isn’t any means low effort is at all times the most effective coverage – it simply results in lazy programming.
— Daniel Hartgrove (@danhartgrovexyz) November 12, 2022
There’s a number of legitimate technical factors there, however the response that bothered me most was the fast “ewww, low effort? That is for losers.” intestine response. It bothers me as a result of they misinterpreted what I meant. I wasn’t speaking about slacking off and never doing a great job.
I consider these responder learn “the bottom effort choice”, and understood “low effort on a regular basis”. That isn’t what I imply. I used to be speaking about true laziness, the way in which Larry Wall describes it in the Perl book:
The standard that makes you go to nice effort to cut back total vitality expenditure. It makes you write labor-saving packages that different individuals will discover helpful, and doc what you wrote so that you don’t need to reply so many questions on it. Therefore, the primary nice advantage of a programmer.
You see, expensive reader, we’re not speaking about slacking off right here. It is not about copying and pasting code manually till it is time to go clock out and go residence, as a result of you possibly can’t be bothered to jot down a script with regexp or two that may do the job for you in seconds. Writing the script takes extra effort initially, however will save hours of tedious labor down the road. And possibly assist your colleagues. And offer you extra free time to work on one thing extra fascinating, or simply to calm down for a bit for those who really feel prefer it.
I need to take the trail of least resistance, sure, nevertheless it’s solely to get extra high quality, to scale, to hurry issues up, and in the end, to keep away from spending valuable firm time on ineffective BS.
Moreover, I no longer believe laziness is real anyway.
I got here throughout one other instance simply the opposite day. A collegue was implementing a brand new (non permanent) fee function on one in all our websites. We would have liked to trace when customers finalised a purchase order on the location in each Common Analytics and GA4. As a result of there have been a number of odd parameters within the monitoring, he was planning on triggering the occasions in his code, utilizing Universal Analytics’s measurement protocol and GA4’s measurement protocol instantly to trace all this. Remember we already had a completely fledge Google Tag Supervisor setup, with each UA and GA4 configured.
My Lazy mind simply went “do we actually must do all that work for a non permanent function?”. Turns on the market was a easy, low-code answer: simply push information in regards to the buy within the datalayer, and tweak GTM to set off the occasions accurately. Growth. All carried out in a number of hours.
I spent the remainder of the day watching TV. Simply kidding.