6 ms·
Are you a lazy programmer?
- breakingcups 5y agoApparently a lazy programmer does not spellcheck. Also, this does not seem lazy to me at all: > A lazy programmer writes a lot of tests, so QA junks do not waste their time. > A lazy programmer documents their code, so thar [sic] coworkers do not waste their time.
- imafish 5y agoAgreed. Would rather say: A lazy programmer documents their code so they do not have to waste time explaining it in person. A lazy programmer writes thorough automated tests so they do not have to waste time on repetitive manual testing.
- yoz-y 5y agoDo we have the same definition of lazy? A truly lazy programmer does neither. If they still have their job it’s because if stuff blows other people know that it’s easier to fix by themselves rather than chase the lazy programmer to fix their shit.
- yarcob 5y agoA lazy programmer writes a bunch of tests, writes just enough code that they pass, then creates a PR and lets someone else find all the corner cases they didn't bother to think about.
- fiddlerwoaroof 5y agoThere’s an old programming meme about laziness being invoked here: http://threevirtues.com/ http://threevirtues.com/
- yoz-y 5y agoThis virtue should always be accompanied by knowledge of this table though: https://xkcd.com/1205/ https://xkcd.com/1205/ I know that I am guilty of automating stuff for way too long :)
- nicklecompte 5y ago> A lazy programmer documents their code, so thar [sic] coworkers do not waste their time. I have been compelled to write detailed documentation specifically because I was getting tired of being asked questions about it[1]. Though I would say the issue isn’t really laziness so much as general asociability and a need to focus... [1] It does nothing to stop the flow of questions but it does mean I’m more likely to give an answer that’s actually correct :)
- thrower123 5y agoDid anyone ever read the documentation? Serious question. I've spent a lot of effort writing internal and external documentation for various systems over the years, and I'm not sure anybody ever read any of it.
- tigroferoce 5y agoI think that clean code is more useful than documentation. However in some cases it's not clear why some code was written that way, more than how it was written. In that case a couple of lines of documentation helps IMO. Also, if you write relatively small and short functions and you document the goal, the inputs and the result, then the code is quite self explanatory.
- nicklecompte 5y agoIt really depends on the domain. I think your comment is generally true for “most code,” since most code involves relatively simple concepts familiar to most programmers, and is performing a fairly clear task. But there are many functions where it is reasonable to have even hundreds of words worth of comments: - anything that heavily uses intrinsics and requires the programmer to have a detailed mental model of the CPU in order to analyze (e.g. making an ASCII table of the register state at each major step of the program). Likewise with assembly programming, though obviously that’s a special case. - a particularly sophisticated graph-theoretic algorithm, for which the “comment” might be essentially a short CS paper explaining how the algorithm works, giving its time/space complexity, and proving correctness - the “main function” for simulating a physical or financial system, which might required detailed descriptions of the equations, parameters, and various options I am working on some compiler stuff and have taken to literate programming for basically everything that’s not a simple utility.
- yawnxyz 5y agoI started documenting my code so future me doesn't need to spend a lot of time figuring it out...
- Igelau 5y agoI'm guessing the typos were a trap, considering their proximity to "silly and tiring things".
- golergka 5y agoI've been moving a large codebase to use unit and integration tests lately, and it's definitely saved me a lot of time compared to what I would spend on manual testing. And also, as a programmer I enjoy the process of writing and debugging tests much more than manual testing, so even if it wasn't a time saver, it would still make my job more enjoyable.
- shoto_io 5y agoReminds me of a quote by Kurt von Hammerstein-Equord, a German general: I divide my officers into four classes as follows: The clever, the industrious, the lazy, and the stupid. Each officer always possesses two of these qualities. Those who are clever and industrious I appoint to the General Staff. Use can under certain circumstances be made of those who are stupid and lazy. The man who is clever and lazy qualifies for the highest leadership posts. He has the requisite nerves and the mental clarity for difficult decisions. But whoever is stupid and industrious must be got rid of, for he is too dangerous.
- tigroferoce 5y agoI read the same statement, attributed to other German generals, namely Rommel and Von Moltke I think.
- CyanDeparture 5y agoWhat about the people who are clever and stupid?
- saltyfamiliar 5y agoThey make great comedians.
- dang 5y agohttps://quoteinvestigator.com/2014/02/28/clever-lazy/ https://quoteinvestigator.com/2014/02/28/clever-lazy/
- shoto_io 5y agoNice! > In conclusion, this was a difficult expression to trace because it was complex, and it could be articulated in myriad ways. Currently, the earliest example located by QI appeared in English in 1933 and was credited to Kurt von Hammerstein-Equord.
- lenkite 5y agoHow can you be industrious and lazy ?
- mjhagen 5y agotoo lazy to reply to this in a meaningful way
- mattacular 5y agoReplace lazy with the word good and I agree with everything in this post.
- cloudrkt 5y agoDeploy on a friday is still a no go for us.
- linkdd 5y agoWhen you work on weekends too, a friday is just like any other days.
- imdsm 5y agoOr when you have a robust CI process in place
- enw 5y agoFor any somewhat complex architecture, even with great tests and canaries there will be unexpected issues.
- lostcolony 5y agoI've yet to see the place that had the level of testing, and infallability of the CI process, to where I wanted to deploy on a Friday. Yeah, it may be a low chance that anything will go wrong, and an equally low chance we'll be unable to easily rollback, but so few things can't wait until Monday that I want to roll those dice.
- linkdd 5y agoI have 100% code coverage in my unit tests + behavioral tests (with cucumber). And yet, problems still happen. Programming is the art of adding bugs to an empty text file.
- wdfx 5y ago
- happytoexplain 5y agoSeems like the author was trying to draw a correlation between good practices and "laziness", which is a cute analogy that makes sense in many cases, but then they forgot and just started listing all good practices.
- valyagolev 5y agoLarry Wall's three virtues of a programmer: laziness, impatience, and hubris
- imdsm 5y agoI feel like this is an attempt to add to this while throwing in a plug at the bottom. These are all too specific and subjective, and I don't think they're as applicable to all lazy programmers as the three virtues are to all (good) programmers.
- Sebb767 5y ago> A lazy programmer do not deploy in production, they instruct Jenkins to do that. Therefore a lazy programmer is not afraid of deploying on Friday afternoon. Just because Jenkins does the final "cp && restart" does not mean that critical bug will not ruin your weekend. The tests mentioned before help, but the unexpected is, per definition, unexpected. In fact, when the house is burning, I found CI deploys to be quite a slowdown. But this might just be me.
- tigroferoce 5y agoOP here: I agree on some level. I have perfected my vim skills by actually modifying the production php source code in my youth. However as things get more and more complex, it helps to script them down so that you don't have to remember a set of commands in a given order. I see the deploy script in this case as a "documentation for lazy" :-).
- Sebb767 5y agoFair enough. Our CI does build+deploy and we're on a bit of a budget, so the process tends to be `git push`, wait 5-10 min for the pipeline to complete, check if it worked, repeat otherwise. But that's really something to optimize in our infrastructure; in an ideal case, I'm on your side :)
- gomseb 5y agoWell, I guess the point here is to rollback to the previous version and find and fix the bug on Monday.
- denimnerd42 5y agoI'm curious how many companies have a working rollback. I think the majority probably have to keep patching until they get it right or get it stable.
- lunfard00 5y agomaybe because by definition you lose data on rollbacks? You can re-run all events/messages (if your company architecture supports it) but that gets more complicated, usually patching is easier and faster. Also, downtime.
- winstonchecksin 5y agoI agree on many but not all of these points. This list is setting some expectations, and what I mean is that some programmers here will see this list since it’s trending on HN and lose their self esteem or try to forcefully change their behavior to meet this bar. > A lazy programmer is super efficient, does in a couple of hours what would take a whole day to others, so that they can spend the rest of they lingering on the couch feasting on Netflix. This is a crazy high, unrealistic bar. It’s almost comical. > A lazy programmer startes at the code for hours, trying to figure out the way to write as little code as possible. I may or may not want someone on my team to do this, depending on what it is their working on, its significance, etc. but staring at your code for hours on anything you work on probably means you’re not great at making trade offs and haven’t considered if what you’re doing is actually worth trying to over optimize. > A lazy programmer uses the basic UI template the hosting service provides them and then they say it’s brutalism. This is some pretentious gate keeping. Does the lazy programmer also hack into government “mainframes” in 10 seconds? > A lazy programmer do not deploy in production, they instruct Jenkins to do that. Therefore a lazy programmer is not afraid of deploying on Friday afternoon. Jenkins isn’t a solution to when you deploy. You could have all the tooling for effortless deployments but not have enough test cases, canaries, etc. And your software failing, especially if it’s a service, could have a blast radius that now impacts several other teams and their on calls on a late Friday. And it might not even realistically be in your control to get the automation quality to the bar you’d love to have because of competing priorities and ROI. If you’re someone young at HN, please take this stuff with a grain of salt. This document sets realistic standards of what it means to be a lazy programmer (in a good way) the way the Kardashians set standards on beauty with their fake photoshopped Instagram images.
- 908B64B197 5y ago>> A lazy programmer stares at the code for hours, trying to figure out the way to write as little code as possible. It's easy to write a lot of code really fast. Then bolt in on an existing application and write as much code doing the bolting as you wrote initially. Reading a lot means getting an understanding of what you are about to extend, figuring out the best way of doing it and what's already provided by the application.
- lhousa 5y agoAn here is the https://1x.engineer/ https://1x.engineer/
- yoz-y 5y agoI really like this one. In my opinion, good long term successful software is best built by a bunch of this kind of 1x engineers.
- Stratoscope 5y agoThis is pretty great. I would gladly work with any 1X engineer like that. My favorite bit of humor is: • Writes code that &emdash; gasp &emdash; has bugs. The misspelled and non-decoded em dashes started out as an actual mistake but are now kept in because of the delicious self-reference: https://github.com/cutenode/1x.engineer/issues/9 https://github.com/cutenode/1x.engineer/issues/9
- 908B64B197 5y agoThat list also applies to 10xer. Not all 10x are jerks.
- Igelau 5y agoThis is the best, though "Respects and upholds community Codes of Conduct." kind of feels like a 1.5x criteria. A true 1x hasn't read the CoC, and if they have, they didn't memorize it or see the e-mail about the latest updates. Though they will course-correct if you tell them they've erred. This is incredibly important: "Willing to admit when they're wrong, and aren't afraid to say "I don't know." There's incredible power in being able to show your hand with an open understanding of how it could be better.
- tompazourek 5y agoIsn't 1x supposed to be the average software engineer? If yes, then this doesn't align very much with my experience :-( Or is it supposed to be that many people are less-than-one-x and aspire to be 1x?
- deleted 5y ago[deleted]
- chrisbrandow 5y agoTalk about misunderstanding the meaning of the word, “lazy”… ;-)
- ilgattodelvicin 5y agoIn case you are a lazy js dev and you speak italian you could even apply here https://www.linkedin.com/jobs/view/2474608042 https://www.linkedin.com/jobs/view/2474608042 :)
- coolgoose 5y agoHa, interesting. I actually wrote something that matches the same thing a while back. https://alexandrubucur.com/blog/2020/why-developers-should-be-lazy/ https://alexandrubucur.com/blog/2020/why-developers-should-b... (insert Spiderman meme)
- kstenerud 5y agoNot by that definition, I'm not. Look, I get that you're trying to cleverly put in a bunch of rules that "make a good programmer", but rules do not the master make. A master knows the best practices and rules, knows why they apply, and knows where their usefulness ends. Many of the properties here range from naive to downright dangerous. Example: - "A lazy programmer do not deploy in production, they instruct Jenkins to do that. Therefore a lazy programmer is not afraid of deploying on Friday afternoon." Using a tool to deploy does not remove all of the risks of deployment. If you deploy on Fridays, you WILL eventually be there on Saturday fixing a problem. - "A lazy programmer is a master of delegation. After they delegated a task, they immeditaly forget about it." Also very bad advice. Forgetting about a delegated task removes you from the chain of responsibility. If you're delegating, it's on YOU to follow up. Otherwise things get lost in the chaos. I'm not going to run through all of them. Please just disregard this site and take lists of "a good programmer does..." as a red flag for the company promoting it. A good engineer is not made through lists and rules. If it were that easy, we'd all be good engineers.
- ipaddr 5y agoYour countpoints are solid advice for a good programmer. For a great programmer you are missing that they control the environment as well. If you know who you are delegating to you know what will be returned, when and how that is going to affect the next step. As a great programmer you are 15 moves ahead. Why would you worry about chaos? There is a lack of trust in your plan if fear of chaos exists. You are Michael Jordan and can see the entire court. As an average developer I don't trust anything will work even if it was just tested.
- gabereiser 5y agoUpvoted because every counter point presented was on target and with solid examples. The article for me read a little tongue in cheek but there are some serious errs in reasoning for some of these. Just toxic behavior.
- athrowaway3z 5y agoIf i had to take a cynical guess, this was written by someone who thought: "Programmers respect laziness ( See Bill Gates quote ). So attaching my beliefs to the idea of a 'lazy programmer' and putting it on a dedicated domain my virtue signaling has a higher effectiveness" I'm a little sour because apparently "writing a blog" is not hip anymore and we need dedicated domain for every brain fart.
- TCS_ 5y agoDecent ad.
- self_buddliea 5y agoI was expecting something about lazy initialisation.
- tartoran 5y agoA lazy programmer thinks a lot before they write a single line or code. A lazy programmer produces the simplest and most graspable solution. A lazy progammer has the easiest time explaining their solution.
- quickthrower2 5y agoThe lazy programmer rejects mainstream society, lives in a tent and forages and never has to work again.
- Vinnl 5y agoI know it's mostly just a meme, but I find the idea that laziness is a virtue unfortunate; IMHO it's one of the worst vices a programmer/team player can have. Not taking five extra minutes to explain what you did when submitting a Pull Request - that's laziness, and forces your team mates to spend more time and mental effort on understanding what's going on. Not going back over your diff one last time before submitting it for review - that's laziness, and it puts the onus on discovering things you forgot on your team mates. Not going through the effort of making individual changes easy to revert - that's laziness, and it forces the future maintainer (possibly yourself) to put in extra work at a time when they're under stress, e.g. when fixing a critical bug. I could go on.
- w0mbat 5y agoIt's "lazy" in the sense that you look for the simplest most leveraged way of doing something well, not "lazy" as in negligent. A lazy programmer takes time to search for the things that the OS will do "for free". Keeping up with and using, the latest developments in OS libraries. This can save you a lot of coding, and gives you capabilities that are likely to keep working on diverse future hardware. A lazy programmer will check in the smallest possible fix when fixing other's code. The simplest change takes time to isolate, but it causes the least disturbance and reduces chance of side-effects and new bugs. It also makes the change comprehensible to others, which saves time having to explain it. If you do something right the first time, you don't have to do it again, and in order to do that you have to do it simply and carefully or you will never get it right.
- Vinnl 5y agoYeah I know that that's the origin of the meme (I mean, it's literally in the post), bit when it becomes a quip it still rubs me the wrong way when it's actually true, bit not in the good way. I guess basically, I'd just like to remove the positive connotations with the term, and instead just focus on the actual virtue: working efficiently. Of course, it's not a major issue. It's just semantics, and I'm not that much of a 'language matters' type of person.
- Igelau 5y ago
- karmakaze 5y agos/lazy/effective/g
- mikewarot 5y agoThis is an infuriating mix of great and horrible ideas, in a horrible attempt at either humor, or sarcasm, in quantum superstition.
- 0x4d464d48 5y agoStill somewhat hard working but getting lazier by the day. I work as hard as I can to be as lazy as I can.
- intrasight 5y agoDid anyone look at sassform? Impressions? Alternatives?
- jhardy54 5y ago> A lazy programmer do not edit long files, they teach regular expressions how to edit the file in their place. A lazy programmer uses a proper parser instead of trying to write a parser in regular expressions.
- mezi 5y agoThis was quite underwhelming, even for a dumb advertisement with spelling errors. >"A lazy programmer writes a lot of tests, so QA junks do not waste their time." I'm really trying to wrap my head around this sentence, but it just doesn't make sense. Also please just don't talk down to QA like that. 0/10, this site actively makes me not want to work there.
- serf 5y agoif you're going to try to sell me folksy wisdom do me the favor of warning me that it's for an advertisement before-hand, please. I felt cheated after reading that page with as positive an outlook as possible -- while disagreeing left and right mentally -- only to find out on the last line that it was a self-promotion for a company. I can't wait to read 'The Hacker's Manifesto, Brought to you by Microsoft'. What a crummy feeling; and congratulations 'Saasform', I associate it with that name.
- xrd 5y agoYes, of course, I started my career with Perl. http://threevirtues.com/ http://threevirtues.com/