12 ms·
Discipline Doesn’t Scale
- jevgeni 6y agoAnyone who ever tried starting Lotus/IBM Notes cares about latency and performance now. I’m sure the JVM was great for the perceived developer productivity, but it doesn’t make a better product.
- mdwhatcott 6y agoThe lack of discipline doesn't scale even more than discipline.
- jchook 6y agoI love this article but long for a more specific term than "discipline".
- dllthomas 6y agoA more precise phrasing of the sense intended by the article would be that reliance on discipline doesn't scale. Encourage discipline, supply it as you're able, but recognize that when the concern is important it probably calls for additional measures.
- User23 6y agoNot making a mess of it is the most challenging task we face when working on complex or even simple problems. A disciplined approach is essential to not making a mess of things.
- smitty1e 6y agoDiscipline for its own sake is certainly wasteful. What grieves me is lack of inquisitive ness and communitcation. If we're not deepening our understanding of how things work, and working together, then things get wobbly. True story: delimited text data ingest file. Guy wrote a C language file to hack the upper byte off the characters, and then write them back to disk. At a glance we think "C! This was a performance thing." Except laboriously writing each character after hacking it in twain and discarding the upper byte isn't a performance hack. It's a "didn't RTFM on the python open() command and try the encoding argument, so we did a C hack" move. Encoding="utf-16" worked great. I'd take a victory lap, except for every time I'm clever, there are two where I look an ass. Discipline may not scale, but teamwork and inquisitiveness paper over a multitude of shortcomings.
- scottlamb 6y agoI think it's also important to remember that these things we sometimes consider character traits can be quite situational: In the absence of deadlines or other external pressure, I sometimes write beautiful, uselessly incomplete code. With mild deadline pressure, I do all right. In a toxic, death march environment, I can see how teamwork and inquisitiveness might drain away and someone would write the terrible code you just described. (See also: fundamental attribution error. I wrote the bad code because of the death march. He wrote the bad code because he's intellectually lazy.)
- wccrawford 6y agoI've seen quite a few junior developers that either lack the "inquisitiveness" or that it's too weak to overcome even a self-imposed deadline. They get things "working" but don't take time to understand the system first. As senior developer, I have to go in and stop them repeatedly and make them rework it. Up until now, I've told them why it's wrong and that basically does all their thinking for them. Now I'm wondering if I need to drag that step out and make them come up with the solution instead. The problem I've been debating lately is how to instill that inquisitiveness in my junior and mid-level devs when they lack it. (I'd been saying they don't think holistically, but I think inquisitiveness is a good work for a trait that will lead to that.) I'm thinking maybe I change my code reviews to have some video chat time where I lead them through the problem instead of telling them.
- danbolt 6y agoGiven the time and emotional effort I've given to hear out some of my colleagues' strong opinions on computer programming in the past, reading this felt a little cathartic.
- Hokusai 6y ago> But along with the term of experience goes the breadth. You see, the person who learned reference counting in 1995 and thinks that you can only really understand programming if you manually type out your own reference-changing events, presumably didn’t go on to use garbage collection in Java in 1996. I think that the article misses two points. In one side the more accessible writing code is, the better. To reduce the amount of knowledge and discipline that you need to code is good. On the other side, discipline is still needed to design APIs, or just to maintain consistency between calculations and data as it moves thru your system, or keep technical debt in check. > does that mean our tools should not let us write code for which there’s no test? That depends on how your team/company wants to work. If you are doing Test Driven Development, it seems good that the tool forces you to do the test first. But, TDD is not the only or best way of developing software, so generic tools needs to support different paradigms. I love code formarters for all this reasons. They relieve developers of the need to follow some basic code style guidelines, you use less self-discipline on writing good style and more on writing good APIs. But, to have a code formatter you need an agreed standard. I try to make to write code easier for myself and other people, because implementing business requirements is already hard by itself. The more time you have to spend "coding" and the more you can spend thinking, the better.
- nemo44x 6y agoI hate these articles that feature a programmer who works within a certain domain and assume all programming tasks are similar. Yes, it would appear there is an anti-pattern of programmers that feel like going lower level for certain things matters. It doesn’t always. Programming computers has multiple levels of abstraction for solving different problems. But there’s also this idea that the magical compiler does good enough abd there’s no reason to challenge the assembler. But there are programming problems where that is in fact essential. It’s not a kissing contest. Writing great asm or C is as challenging as writing great css. But to be sure, knowing what your code actually requires hardware to do is really valuable. It matters and we don’t have abstraction in many cases to abstract that away totally. It doesn’t hurt to have a good idea on how the machine works.
- tonyarkles 6y ago> Writing great asm or C is as challenging as writing great css I would argue that writing great asm that is more efficient than your idiomatic C code is going to be a very very challenging task on modern non-embedded CPUs. The compiler definitely knows more than I do about how the internal architecture works and which instructions to reorder to prevent stalls etc
- Const-me 6y ago> writing great asm that is more efficient than your idiomatic C code is going to be a very very challenging task SIMD intrinsics are not idiomatic C, they are idiomatic assembly. Here's an example when they improved by a factor of 3.6: https://stackoverflow.com/a/63759887/126995 https://stackoverflow.com/a/63759887/126995 That's not an unusual outcome.
- mtzet 6y agoThis easily turns into a strawman. Does writing good C code include checking the disassembly and reworking the C code when the compiler produces bad results? I've seen several examples of the compiler being brilliant until suddenly a simple change makes it not brilliant at all anymore. Compilers are just tools.
- 6y ago
- Animats 6y agoOver a decade ago I used to argue this with the C++ committee people. Back then, they were not concerned about memory safety; they were off trying to do too much with templates. The C++ people didn't get serious about safety until Rust came along and started looking like a threat. Now they're trying to kludge Rust features into C++ by papering over the unsafe stuff with templates, with some success. But the rot underneath always comes through the wallpaper. Too many things still need raw pointers as input. The encouraging thing today is that we're kind of converging on good practices in language design. - You really want to declare types for function parameters. The compiler needs that information for checking, and the programmer, and the maintenance programmers who follow behind, need that information so they know how to call the thing. On the other hand, you can usually infer the result types of expressions by a simple forward process. So C++ gained "auto", Rust and Go started off with that arrangement, Javascript got TypeScript, and Python is getting there via a side trip through unchecked type declarations. - The three big questions in C: "How big is it?", "Who can delete it?", and "What locks it?" C gives no help with any of those. C++ now tries to address the first two. All the garbage-collected languages address the first two. Rust addresses all three. - The idea that locks should be connected by syntax with the data they are locking took far too long to become accepted. Partly because the Ada rendezvous and the Java synchronized object didn't work well. Even Go doesn't do that very well. But language design seems to be coming around. When and if thread-type concurrency comes to Javascript, the webcrap crowd will create race conditions everywhere without automation in locking.
- jchw 6y agoI think this is a little oversimplified, because I’m pretty sure C++0x had move semantics and usable smart pointers prior to Rust really entering the public conscience/probably before it existed. AFAICT Rust takes a lot of inspiration from how you would “fix” C++, in ways that you could never actually do in C++ because it would break backwards compatibility.
- boardwaalk 6y agoI suppose it depends on what you would consider being “serious” about memory safety. I view move semantics as not a memory safety thing at all (in fact, use-after-move can be exactly as ugly as use-after-delete), and smart pointers as a “let’s just make things marginally better than raw raw new/delete” thing. Smart pointers in C++ can still be null, after all. Calling C++ not serious about seems a reasonable take to me. Of course Rust didn’t invent all of its solutions from scratch.
- deleted 6y ago[deleted]
- juped 6y ago>but I do occasionally still hear people telling less-experienced developers that they should learn C to learn more about how their computer works. Your computer is not a fast PDP-11, all you will learn is how the C virtual machine works. Yes, this is wrong in that sense, but by learning C you learn how C works, and therefore how your computing systems, which are going to be C at some level because we live in Unix's world, work.
- quickthrower2 6y agoI think there is a meme (in the true sense of the word, not a silly picture) where the basis of languages like C and assembler is implanted in say JavaScript and how it does things. For example references vs. values and how this affects closures. Why have a lexical scopes? All this stuff which confuses the fuck out of new programmers, might be simpler if they learned C first. I think this can trip newbies up. Especially from bootcamps, who don't understand why their code is working, and I feel like replying with "well think about how the object is stored in memory" because none of the stuff that's built on that will make sense without it. I'd like to understand more myself. It would be useful to have some idea of what the compiler is doing with things like lexical scopes. I think that's the only way to really understand them as the abstractions are too leaky.
- xxxtentachyon 6y agoI think that’s all still addressed by him saying (paraphrased here) “learning C doesn’t teach you your system; it teaches you the C virtual machine.” You could just as easily teach the usefulness of lexical scoping and memory layout by teaching people a simplified version of a modern JavaScript engine and teaching them to inspect the accompanying intermediate representation. Bootcamps don’t dive into these things and give attendees intuitions for some model of computing because they know what people are paying for (learning the level of JS necessary to land a job as quickly as possible).
- andi999 6y agoAlthough I think learning C opens up your accessible domains of programming widely. I mean, if you know C it doesnt even take a weekend to learn (the basics of) CUDA. Or you can just buy an simple embedded system and do data aquisition easily. Also there is a reason C is often under the hood of other programming languages like Python, Tcl, and (I read on the internet) Julia, Ruby and Perl. I dont mean you can then write these languages, but you can look under the hood and read the source code (also if you want to write extensions it is useful).
- User23 6y agoWhenever I hear the term discipline in the context of computing I always think of Dijkstra's excellent book A Discipline of Programming[1]. His definition of discipline makes a lot more sense to me than the one in this article. And discipline in the sense of proficiency with the predicate calculus absolutely does scale. [1] https://www.goodreads.com/book/show/2276288.A_Discipline_of_Programming https://www.goodreads.com/book/show/2276288.A_Discipline_of_...
- calinet6 6y agoYep. General point: systems scale, people don't. Or rather, human systems are flimsy.
- gok 6y ago> And yet, for some people the problem with software isn’t a lack of automation but a lack of discipline. Software would be better if only people knew the rules, honoured them, and slowed themselves down so that instead of cutting corners they just chose to ignore important business milestones instead. Who is arguing this?
- nightowl_games 6y agoAs a Mid Range Millenial, I fall right into age range who cut their teeth in an era just past this guy: the jquery web dev. It's amazing to read this because I think I was part of the group that began the exponential curve of new technologies. I wasn't exposed to this "hazing" at all. I was believed in. I was valued. I was encouraged to explore. The religion of the time was to work on things that increased developer productivity time. Performance be damned. It flowed naturally at the time. Computers were (and are) fast enough to create these web apps! We just need to get more features (and better looking ones!) out the door! And now here I am sitting on the other side, looking at all my peers work and thinking "slow down, everyone. We've made too much stuff. We need to organize and catalogue and refine and optimize" It's like culture is a Tick/Tock cycle. This guy was a Tock - a refinement of existing technology. I was a Tick - an explosion of new technology. And now (I believe) we are witnessing another Tock - a refinement, a culling of the weak, a centralization. I love reading the historical programmers account. As I near 30 I realize, that I will become that, a history lesson for the fresh minds of the era. I think I have lots to teach you. I need only to refine, cull, centralize, and catalogue my thoughts. Piece them into theories of abstraction, class hierarchies of ideas, if you will. For I experienced the polar opposite of this. I experienced the explosion. And yet still, I agree. Discipline doesn't scale. This encoding of discipline into system. I agree with it. That defines a large part of my job - to take the "best practise" and encode it into the day-to-day. This concept: "discipline doesn't scale" is fundamental to our history. It seems trivially true. This prose is excellent, this history lesson is important and valued, and the fable of this story rings true.
- pm90 6y agoShort of external factors (sharp recession in tech), I don't see the culling phase happening. If a recession did happen and orgs started cost cutting, I imagine that R&D would drop somewhat, and you would see fewer new projects and toolkits perhaps? Even then its hard to see the pace of innovation (for lack of a better word) slowing. It seems to me that technology is now in the stage, where its everywhere. Every industry that is quick to adopt new software gains a competitive advantage over its peers, in so many industries. This unreasonable effectiveness of software seems to feed itself. I would love to see studies that measure/quantify the blooming and culling of technologies so we could talk about these things with more than just anecdata.
- jariel 6y agoIf it's always the 'same kind of discipline' then of course what is needed is a higher level of abstraction so the programmer is freed from having to keep track of said 'disciplined parts' and focus more on other problems. C++ while obviously useful, while it obviously 'works', and while it's existence in the context of history is also obvious ... is a giant clusterF of an anti-pattern programming language. The 'smaller, better language trying to get out' should have happened long ago, it didn't so maybe that will be Rust, but that's a big big leap and it's going to take many years yet.
- aogaili 6y agoThe author is arguing for automation against human nature. Anything that can be automated can be scaled better. Too many words to communicate simple idea.
- fjfaase 6y agoOne of the most important reasons why we write programs, is because computers are slow and have limited memory. Computers only appear fast due to a host of tricks. The most important trick is the memory pyramid: with at the top a small number of very fast accessible memory (think CPU registers) and at the bottom a very fast but many orders of slower accessible memory (think the whole of the internet). And a lot of business is about moving data up and down the pyramid. It looks like most software engineers are still unaware of this. Why do we still encode Unicode strings as UTF-8 strings in memory, why not as double linked of Code points? Not because we cannot, but because it is faster and uses less memory. Another big problem is related to multi-user modifications of shared data structures and that high-level semantic modelling is hard for most people. If multiple agents (people) are modifying a data structure, then those changes need to be combined in a semantic correct way. A complication factor is the fact that most data structures are distributed (also due to the memory pyramid) and that a lot of effort is needed to synchronize modifications.
- heavenlyblue 6y agoWhat makes a double-linked list better?
- fjfaase 6y agoThe double-linked list was just an example. Could also have been any other list container for Unicode code points, where each code point uses a fixed size of memory (at least 21 bits). You might even use a data structures where a 'base' character with (optional) combining characters are treated as a single unit, because for many operations they should be treated as a unit.
- babesh 6y agoAutomate when it makes sense to automate. Different situations can call for different tradeoffs. Because of Moore’s Law, technical advancements, and because of the increasing economic benefits of programming, this tradeoff has shifted to more automation over time. These trends are still occurring. As in automation of manufacturing, the tradeoffs are sometimes not as obvious as they appear. Keep an open mind and consider the future.
- dwaltrip 6y agoThere's an interesting comment below the blog from someone named Alex (not me): > As a proponent of discipline, I see things a bit differently. You’re coming at it from the perspective of “In software, we automated X, and now X is no longer a problem, therefore, we should just keep automating as far as we can”. That’s one pattern. > I’m seeing from the perspective of: “There’s no way to automate everything, and professionals always need discipline, so let’s start with that, and then see what else can/should be automated”. My pattern is from looking at the history of every other industry in the world. > Discipline is the rule, not the exception. When cars crash, we test and license people, and issue citations for people who visibly break the rules, and increase driver education. We don’t ban manual transmissions (not enough automation!), or install breathalyzer interlocks in every vehicle. Self-driving cars may solve our remaining problems, someday, but that’s a long-term solution. > Similarly, it may be possible in software to automate our way out of many classes of bugs (I’m skeptical), but that’s a long-term solution. Discipline is something we can adopt today. > Two points you didn’t really seem to address: > First, there’s diminishing returns on technology as preventative measure. Manual refcounting is way better than malloc/free. Automatic refcounting is quite a bit better than manual refcounting. Tracing GC would be a little better than that. Every problem is like this. When you’re down at the “malloc/free” level, advocating for discipline seems silly. (Why not just fix the bad tech first? It’s not hard to improve on.) But once you’re up to about the ARC level, discipline is clearly worthwhile. You don’t need to wait for a perfect tracing GC to advocate for social solutions. > When there were only 10 cars in the whole state and no roads, licensing and education are probably not high on your list. But once you’ve got an Interstate Highway System, you need licensing, and education, and laws against drunk driving. Nobody in 1965 said “People are dying in car crashes — we’ve got to automate this by developing self-driving cars ASAP!” You look at the limiting factors. At some point, more technology is a huge cost, in time and money, and a social solution would be cheaper and more effective. > Second, you seem to be using “discipline” to mean only an internal personal strength of will, but that’s not really what the word means. Yes, we know that relying on willpower alone doesn’t scale. The goals are quality and accountability, and in almost every other field, we accomplish this through laws, regulations, certifications, trade groups, professional associations, and so on. Those do work. Check your dictionary: the definition of the word “discipline” includes rules and punishment! > Your surgeon is not performing a splenectomy while drunk, but that’s not because there’s a breathalyzer installed on the door of every operating room. We didn’t use technology to solve that problem. We used training, regulation, and (severe) penalties. > That’s what software development needs today. We can’t keep pretending that more automation is going to solve everything. You’re not going to find a new “GC” level advancement every year, because there aren’t dumb inefficiencies like “malloc/free” still sitting around. Once the low-hanging fruit of basic automation have run out, there’s no substitute for professional discipline.
- austincheney 6y agoThis is perhaps one of the most serious problems with software as an industry. More precise is that human investment doesn't scale, which includes: discipline, education, training, mentoring, and so forth. That is true for all industries. Other industries know human investment doesn't scale, but even still it is absolutely professional and so it must still be accounted for. Software intentionally ignores this and then looks for things to blame when the tech debt becomes overwhelming.
- dusted 6y agoWhile hardware engineers come up with faster and faster computers, software engineers come up with slower and slower and slower software. While I agree that having nice and easier thing is nice, and easier, performance is always relevant, if not for pride or principle, at least think about the environment, computer processors and memory chips consume electricity, and are really inefficient.. How many percentage of the consumed energy turns into the desired product (computation)? Les than 1%, a CPU using 100 watt is pretty much a 100 watt room heater with a side-effect of also performing some computation.. That's a _WAY worse fuel efficient than a Model T, and yet we treat computational power and memory capacity as infinitely cheap.
- pm90 6y agoDo you think the market is not pricing it correctly? In the dawn of computing, machines were far less common, much more expensive, and society was willing to pay programmers boatloads of money to write optimized code because that was cheaper. The hardware engineers did an excellent job, they reduced costs of computing by a lot. Society is not willing to pay programmers boatloads of money to write optimized code; because hardware is cheap, they can do fine without that optimization. Whether we thing the pricing is correct or not is a different question I guess. We could theoretically raise computing prices artificially (say through taxation).
- imoverclocked 6y ago... or reduce software engineering salaries. Arguably, people want faster software if they also want faster hardware.
- pizza234 6y agoWell, consider Slack as an example. Performance-wise, it's bottom of the barrel quality. A single developer has done, in this compartment (Ripcord), much better than their team did. If we want to consider similar languages, Microsoft did enormously better with VSC. The result is, sadly, that Slack is still widely used.
- 6y ago
- pm90 6y agoI like the point the author is making. It appears that the examples themselves are talking of changes over long periods of time, that the programming community benefits from. Are there examples where this applies to shorter time periods? e.g. the discussion on the evolution of C++ language is fantastic, but it took place over.... years? A decade? If I'm this person in my org trying to write better software for my project, does it really help to not be more disciplined? Before the invention of reference counting, wouldn't the developers who did know how the thing really worked be more productive? I think this is important to call out, and not go to the other extreme. Discipline is definitely not scalable, but neither is ... the lack of it? Inertia is very strong in production software systems.
- dfabulich 6y agoThere are two kinds of discipline; one scales, and the other doesn't. Consider this line from the article: > you don’t need TypeScript to write good React Native code, just Javascript and some discipline The author provides this as an example of the "disciplinarian" approach, which the author says "doesn't scale." It's an interesting example, because learning a new way to code requires discipline. IME, the main obstacle to TypeScript is that you have to have the discipline to learn TypeScript and endure the compile errors it generates. I think you could rewrite the author's example the opposite way: "You don't need to write careful JavaScript, you just need enough discipline to learn and use TypeScript" But this is a different kind of discipline; it's the discipline to seek out a "better" (or at least more scalable) way of doing things. You typically hear static-typing fanatics calling dynamically typed languages "undisciplined." TypeScript is an order of magnitude less popular than pure JavaScript, even considering just new code on Github. TypeScript may be better, but it isn't taking over the world--not yet, at least--because it requires (enforces!) more discipline to get started.
- sergeykish 6y ago> does that mean our tools should not let us write code for which there’s no test? I've heard not so good stories about 100% code coverage. Metrics do not scale. Software development is a balancing act of visible results, technical debt, available workforce etc etc. Life (cells and above) is not perfect but it matches environment. > no strong motivation to become more disciplined Bug on production bug is much better motivation to write tests than some discipline. Write code so other people want to work with or search another place. > either torpedo your whole idea or turn it into not doing the thing (see OOP, Agile, Functional Programming) A lot of languages are not OOP by Alan Kay, Agile and SCRUM subverted. That is marketing, when benefits is in the badge not in the substance. Those who chased idea do well.
- andi999 6y agoI do not think that memory is the biggest problem here, with RAII it "only" requires medium discipline, but UB is the dragon in the closet here. Avoiding UB requires a huge amount of discipline (or luck)
- einpoklum 6y agoWell, discipline is indeed difficult to scale; however: * There is no automation for writing good code and for good design - and that too requires discipline. * In many cases, harnesses which relax discipline requirements have costs: dependencies, larger surface area for compromising security, performance... * Very often, the mass of undisciplined coders rely on libraries and other core pieces of code written with a lot more discipline.
- didibus 6y agoHum, I think this person is missing the other side. It isn't that discipline will save you, it is that some programmers want power and control, and don't like restrictions. Those programmers do sometimes believe they know better, or just prefer and enjoy the creativity given to them. Thus any language that restricts you isn't something they favour.
- emotional_fool 6y agoTLDR: Humans make mistakes, use better tools/languages that prevent this, since discipline can't enforced. Wasted few minutes reading this blog post.
- ozim 6y agoNot wasted. That is important point for arguing with people who say things like 'ORMs are bad I can write my SQL queries', 'Angular is bad I have my perfect approach for vanilla js'. When such person will have to explain their 'perfect' approach to 10 developers and then such person will have to keep doing code reviews so that approach is still used by those 10 developers it will be an eye opener
- renox 6y agoEspecially since GCs aren't free in memory usage nor in latency.. But yes, if you don't care too much about these two a GC is a good default.
- jb1991 6y ago> Back in my day, everybody knew “no Markdown around town” and “don’t code in an IDE after Labour Day” what the heck do those phrases mean?
- theaeolist 6y agoNo idea. According to Google these phrases only appear in this blog post. A strange kind of common knowledge.
- martinleslie 6y agoThey're references to old fashioned sartorial etiquette: https://sartorialnotes.com/2016/09/02/never-wear-brown-in-town/#:~:text=%E2%80%9CNever%20wear%20brown%20in%20town,escape%20the%20opprobrium%20of%20colleagues.&text=%E2%80%9CIf%20you%20work%20in%20insurance,black%20Church's%20or%20Cheaneys.%E2%80%9D%E2%80%9D https://sartorialnotes.com/2016/09/02/never-wear-brown-in-to... and https://learningenglish.voanews.com/a/why-americans-don-t-wear-white-after-labor-day/5060464.html https://learningenglish.voanews.com/a/why-americans-don-t-we...
- ChrisMarshallNY 6y agoPersonally, I think Discipline is one of the things that separate “coders” from “engineers.” This sounds like it’s really a treatise on “learning to build a house by making your own nails.” Of course that won’t scale. Especially if most houses, these days, are prefab, and don’t use too many nails. But learning how to stay out of flood plains, and selecting good prefab sources, is vital to being a builder. The first one is a fundamental discipline, that also applied to “make your own nails” building, while the second is unique to the new way we do things. I like to write code that has a future. I want people to be able to take it over, so I use header documentation, and a consistent coding style. I originally learned Machine Code (I started as an EE). I’ve written embedded operating systems and drivers. A lot of what I learned, doesn’t apply to writing high-level application code in Swift (what I do nowadays), but it did give me the discipline to power through the “boring” stuff that is vital to writing good, maintainable, extensible code. I think maybe there is a confusion between “discipline” (the type that manifests as patience, consistency, and craftsmanship), and “experienced inflexibility,” which is not always applicable (and sometimes, downright destructive, like old-fashioned C++ programmers refusing to use smart pointers).
- bluetomcat 6y agoOur contemporary corporate and social culture doesn't encourage or reward discipline. We produce mostly throwaway stuff that has to be released as soon as possible on the market, or else the company goes out of business. The incentives for craftsmanship and diligence are just not there.
- ChrisMarshallNY 6y agoSadly, you are correct, but that’s not new. This has been the case throughout history. I was just thinking about the difference between “good,” and “excellent.” If we look at the difference between a Henkels kitchen knife, and a Japanese Takayuki knife, we are talking exponentially divergent costs. The Takayuki is definitely a lot better than the Henkels, but is it twenty times as good, as the price difference might suggest? But Henkels makes far better knives than most of the disposable crap out there. It costs more; usually two or three times as much as a “standard quality” knife. Worth it, though. That’s sort of the “sweet spot” I aim for, and we don’t get there, without discipline, consistency, and patience.
- scandox 6y ago> The performant is often not talked about in the same sentences as its usual companion species, the irrelevant. What I find is that programmers I've worked with who have been the most preoccupied with performance always seems to have focused their optimizations in the least valuable areas. It's as if performance mania is directly correlated with a kind of architecture blindness.
- lioeters 6y agoThis week I had to deal with the exact thing you mention. A pull request for "performance optimization", basically a proposal to unwrap a higher abstraction to do it at a lower level, manually and directly. Yes, it does save a few function calls and instantiating a class - but that's not where the real bottleneck is. The proposed changes would require rewriting large amounts of code elsewhere, making the logic more verbose and complex. It took some effort to convince the person that the trade-off isn't worth it. I tried to be diplomatic, but I'm afraid they took it personally that the pull request was declined. I wish I could have proved my objection with some metrics - how many milliseconds were shaved off by the proposal, versus the increased "cyclomatic complexity", as a measurement of its detrimental effect on the code base.
- _pastel 6y agoThat burden of proof sounds backward; the person making the optimization should be benchmarking. Rather than rejecting outright, did you consider blocking the pull request and asking for benchmarks demonstrating that the optimization was worth the complexity increase? Maybe they would learn more from that process than from an explanation of why they are misguided.
- lioeters 6y agoGood point - I could have asked for a benchmark to prove that the optimizations are worth it. The person put effort into the code, and I didn't feel that they were convinced of my argument against it. Their changes were more efficient logically, and I'm sure it would have saved a few milliseconds per call - whereas my claim of increased complexity was a more subjective judgement. In the end, it came down to trust/authority - but they might have been more convinced, or felt better about the decision, if I could produce some numbers from my side, like a measurement of cyclomatic complexity based on static code analaysis. Perhaps that could have justified the existing higher abstractions, to weigh their (almost negligible) performance cost against the value of reduced complexity - keeping the code base simpler to understand.
- timwaagh 6y agoThe problem with a call for discipline is that it's a call for discipline.
- ozim 6y agoYes of course, that is why 'special forces' in military are special, most of people are just cannon fodder. Military orgs around the world are turning into smaller head counts of disciplined people. That is known since the Battle of Thermopylae but maybe getting lost from time to time. There is also a lot of military tech that is trying to prevent soldiers from shooting themselves in the foot, which fails from time to time. We also know that just adding more developers to project is not increasing velocity and that small focused teams outperform large teams by orders of magnitude. Problem we have to tackle are big orgs that need a lot of code and have high dev turnover. That is why frameworks like angular and tools first are so important, they help to scale code better than plain code or plain js.
- archibaldJ 6y agoComing from the FP perspecitve, I think a useful way is to see things in terms of striking a balance between "knowing the value of everything and the cost of nothing" and "knowing the cost of everything and the value of nothing" and it is extremely context-sensitive esp with respect to the team of people making the software. As humans we tend to forget that programmers are ultimately just machines that turn coffee into reads and writes = )
- solidist 6y agoDiscipline Doesn't Scale, Defaults Do.
- jlnthws 6y agoDiscipline is all what matters, automatizations are imperfect and temporary tools. Simply put: all abstractions are leaky, all abstractions have trade-off, and you cannot necessarily rely on some abstractions in every context. The GC example that the author uses is a good one: having GC in a language does not magically remove all memory allocation issues. Believing this means you just don't have much experience programming (or you've been very lucky). I've been working mostly with GC languages and we have memory leak every now and then, good luck to fix that without discipline. Embedded software frequently relies on (very) limited compilers and libraries, most of the time there are no GC and until recently there were even no malloc/free for $B things shipped to space: only static arrays and discipline my friend! TCP is another good example: sometimes you need to craft you own congestion management, packet discard rule or what not. ORMs have made my life easier but I've still had to spend days on complex hundreds lines SQL reports. The list goes on. It's not "I had to go through this, you should too" out of frustration. It's because at some point the same kind of issue will appear again, even though the current available abstractions may seem to shield us from it. It might not scale as easy as you wish, yet you need some disciplined seniors to review and teach your juniors. This very article ironically proves it :)
- dexen 6y ago"Do Things that Don't Scale"[1] - Paul Graham, July 2013 -- [1] http://paulgraham.com/ds.html http://paulgraham.com/ds.html
- hliyan 6y agoI would say that the validity of this argument depends entirely on the availability of hardware. To take an extreme example, reference counting would have been completely infeasible in the days of assembly programming. An assembly programmer who had this insight would have had to wait decades for the hardware to catch up. I'm sure more and more tools, language constructs and compiler features will emerge in the coming years to reduce the cognitive load on developers so that they can focus more and more on the business logic. But that doesn't invalidate the some of the discipline you need to make software fast and stable today.
- sethammons 6y agoI'm reminded of the blameless postmortem training we got john allspaw from etsy. "Try harder", "do better", "be more safe" are all discipline based solutions, and they don't scale. You have to outline specific steps, checklists, procedures, etc that will allow you avoid mental discipline and use processes. The same thing applies to dev work. IDEs, pipelines, scripts, etc, but also language design. Let type systems do the heavy lifting. You should shift as much from your head to a machine/process as possible. Less artisan, but more efficient.
- wrs 6y agoStarting the article with the history of “but you know what’s better?” just reinforces that there’s always a level where discipline is important. We will never reach the end of the “you know what’s better” cycle. So discipline itself, though not a particular discipline, is something a good programmer always needs. (Which is true of every other craft/skill as well.) For the record, I do tell people they should learn C so they have a better idea of how computers work. That emphatically does not mean I want them to start writing actual production code in C, unless there’s an extremely good reason (and that hasn’t happened for me in a decade or two). Advising people to gain a deeper understanding of their tools is not “hazing”.
- deleted 6y ago[deleted]