11 ms·
Programming is boring art
- gherkinnn 6y ago> How boring is it to produce something of the same shape over and over again. Same applies to any text written. Yet, few people would argue there aren’t any artists among novelists, screenwriters, and poets.
- crawfordcomeaux 6y agoIt's as boring as one's ability to be mindful, non-judgmental/accepting of the moment, and ability to be grateful for whatever's happening right now. These are all skills I'm pretty sure not mentioned in most programming books/blogs, much less schools. Boredom comes from within. Pointing at a thing and saying "that's boring" is a conflation of what's really going on: "I haven't learned to enjoy myself in this context yet and am blaming the context for it."
- narrationbox 6y agoDoes copywriting count as art? Or is it merely the equivalent of CRUD-style boilerplate?
- gherkinnn 6y agoDepends on your definition of art. Good copywriting must be a very skilful trade. Not sure about the whole "must serve no purpose other than itself" aspect.
- tomkwong 6y agoOP here. What you said is very true. Visual impression isn't the only dimension. Nowadays, it seems that most people (especially the younger generation) just want to watch a video than reading a book. There is bounded to be something missing with a different medium.
- 7373737373 6y agohttps://en.wikipedia.org/wiki/Asemic_writing https://en.wikipedia.org/wiki/Asemic_writing https://en.wikipedia.org/wiki/Artist%27s_book https://en.wikipedia.org/wiki/Artist%27s_book
- tomkwong 6y agoInteresting. Thanks for the share. I wonder if programming fonts could achieve that - like the original author could specify a font for a portion of the code eg. a “destroy_context” or “drop_connection” function could have a scary look.
- 7373737373 6y agoYeah! Or syntax highlighting that confers some emotional valence to runtime behavior (allocating resources - say, calling a constructor for instantiating objects - having a different color)
- tomkwong 6y agoAnother way to express semantics is the use of Unicode in source code. For example, I have this Julia package that performs Box-Cox transformation, and I was able to use bold face for vector data and greek letters for the parameters as found in research paper and literatures. https://github.com/tk3369/BoxCoxTrans.jl/blob/master/src/BoxCoxTrans.jl#L37-L48 https://github.com/tk3369/BoxCoxTrans.jl/blob/master/src/Box...
- klysm 6y agoI’ve been conflicted about using verbose names or symbols for mathematical expressions in code, and I don’t think there’s an easy answer for when to use them. For simple arithmetic expressions, it seems like verbose names are superior because it’s easier to derive their meaning and we already understand the operators at play. When translating complex expressions, however, we usually a priori understand the meaning of the expression with our algebraic mental model and it makes sense to use that nomenclature. At the same time though, someone who is unfamiliar with the particular source of the algebra used would find such code quite opaque. For something like the Box-Cox transform I think it makes sense to use the symbols widely employed by the mathematical nomenclature. This certainly also depends on the language you are using and the ability to define arbitrary in/postfix operations. It’s also rather annoying to type them, but that’s also probably because I just haven’t developed a workflow for it.
- zabzonk 6y agoIMHO, alert() should be called at a higher level by something that calls check().
- trmsw 6y agoUpvoting this just for the title ... and was disappointed by the article. Rats.
- tomkwong 6y agoAppreciate the upvote anyways LOL
- trmsw 6y agoYou're welcome. It's an attention economy these days
- cambalache 6y agoSo the clickbait worked.Congrats OP!
- phkahler 6y agoOne of the most beautiful pieces of code I've ever read is this: https://github.com/solvespace/solvespace/blob/master/src/srf/ratpoly.cpp https://github.com/solvespace/solvespace/blob/master/src/srf... If you have a basic understanding of spline and NURBS surfaces but never knew how you might actually implement that, well there it is. Incredibly readable IMHO.
- kgraves 6y agosorry, but I see no beauty in this.
- phkahler 6y agoYou have to read it to see the straight forward simplicity in it. Like I said, it also helps to have a high level understanding of the subject matter. The culmination at the end - finding the intersection point of 3 parametric surfaces - is artful IMHO.
- mathgladiator 6y agoI'm right there with you.
- paulcole 6y agoI see a lot of beauty in this.
- amelius 6y agoIf you want to write truly beautiful geometric code, watch this: https://www.youtube.com/watch?v=tX4H_ctggYo https://www.youtube.com/watch?v=tX4H_ctggYo Discussed here: https://news.ycombinator.com/item?id=22282452 https://news.ycombinator.com/item?id=22282452
- phkahler 6y agoI kid you not, I just watched that 2 days ago at the suggestion of a friend. It will take more viewings and study to digest. Really amzing!
- alexashka 6y agoLife itself is boring art. Everything else is just an extension of that.
- loltyler1 6y agoHave an upvote fellow depressed
- 7373737373 6y agoDepends on your Serotonin level
- alexashka 6y agoDoes it? The only people I know who don't lead a boring life if you look at what they do minute by minute, day by day, are fictional characters in books, movies, etc. That's why we like entertainment - because it cuts out the boring bits :) The art part is more interesting. Is there art to someone's life? I'd say yes, but that's because I'm artistic. If you ask most people, they'll probably be confused by the question. Is your life 'boring art'? 'Huh' is the answer I most expect :)
- 7373737373 6y agoI'll quote someone >I can sympathize with a lot of nihilist outlooks on existence, but just because a lot of these might be true, they're not the only ways you can view your flesh or your place in these patterns, as an animal or as a cog in a machine. There are other elements to existence, like imagination, that is a good example. Emotions are a great vehicle for building your own universe and reality, where your function as an animal or cog in a machine doesn't force you into some rote role that drags you into this stripped down reality of raison d'être being purely utilitarian and unchangeable. You mentioned imagination, but emotions make things real. Does it really matter if your imagined reality isn't concrete or factual? What matters is your happiness, right?
- jodrellblank 6y agoThat's like someone who eats a lot of junk food complaining that other food is tasteless. Then people who give it up are surprised to see carrots and milk taste sweet now. That adrenaline action movie junkies think moment by moment life is boring, doesn't mean it is.
- gorpovitch 6y agoWhen I hear people talking about programming as an art, I usually assume that the decisions they make about their code tend to be about how elegant and beautiful it is, not efficient and valuable. It's fun and satisfying to write elegant code, but your company hired you to produce value, not art.
- saagarjha 6y agoElegant and beautiful things are often also efficient and valuable.
- tomkwong 6y agoRight, there is also difference between short-term value and long-term value.
- combatentropy 6y agoPaul Graham agrees: http://www.paulgraham.com/taste.html http://www.paulgraham.com/taste.html
- MaxBarraclough 6y ago> what does Hardy mean when he says there is no permanent place for ugly mathematics? He means the same thing Kelly Johnson did: if something is ugly, it can't be the best solution. There must be a better one, and eventually someone will discover it. I don't think Hardy's take really stands up today. There is at least one mathematical fact which has been proven through exhaustive computerised tests, and which no-one has (yet) been able to prove without using computers. Ugly? I suppose so. Is there a 'place for it'? I don't see why not. https://en.wikipedia.org/wiki/Four_color_theorem#Proof_by_computer https://en.wikipedia.org/wiki/Four_color_theorem#Proof_by_co...
- MaxBarraclough 6y ago> how elegant and beautiful it is, not efficient and valuable Perhaps a nitpick, but 'correct' deserves a mention somewhere. As others have said, elegance in code should generally align with efficiency and correctness.
- golemiprague 6y agoI wouldn't say it is an art, more like a craft in the good cases and plain technical at worst
- Tade0 6y agoThis brought me back to the time my SO tried to explain an 84 year old lady she was assisting what is it that I do for a living. The consensus was that I'm a writer. Also there's one thing I ask everyone seeking to get into programming: "are you resistant to boredom?" This appears to be a good predictor of future success.
- ironmagma 6y agoHmm, interesting. I can’t tell, though, if that question means, “do you not bore easily?” or “do you avoid boredom at all costs?”
- Tade0 6y agoSomething must have been lost in translation then. Pardon, I half of my vocabulary was shaped by RPGs. I was thinking of the former.
- WalterBright 6y agoI find football/baseball games to be incredibly boring. I posit that successful ball players must be highly resistant to boredom.
- perl4ever 6y agoI consider myself very easily bored, and that's why I ended up programming, because every bit of coding is about eliminating repetition.
- gfxgirl 6y agoYes I bore easily. Which is why I love programming. It's like having the largest set of legos possible. Infinite possibilities. Making games, graphics, diagrams, music, art, photos. Glad that I bore easily and programming is not boring.
- frou_dh 6y ago> This brought me back to the time my SO tried to explain an 84 year old lady she was assisting what is it that I do for a living. The consensus was that I'm a writer. Maybe relevant talk from DHH coming to the same conclusion: https://youtu.be/9LfmrkyP81M https://youtu.be/9LfmrkyP81M
- spicyramen 6y agoIn college a teacher asked us if programming was an art. There is the element of creation, copying and some may say beauty. The artist or programmer in this case use their knowledge, creativity and experience to create something new intangible and subjective appreciation but results can be life changing or solve a really complex problem. In terms of boredom this is subjective sometimes I find it really fun try to solve a problem or fix a bug
- MaxBarraclough 6y ago> There is nothing wrong with this function. Really. It does exactly what it should do with the least amount of code. In fact, this is probably what I want to deploy in production as well. But, it is inflexible. It does one well-defined thing, and does it well! That's the good kind of 'inflexible'. > A skillful programmer looks at the problem and says, hey, why don't we build an abstraction layer to make it more flexible? In this example, the additional complexity just doesn't seem justified. You ain't gonna need it. [0] Unnecessary abstractions cause bugs, bloat, and baggage. The article then goes on to acknowledge this, but I really question the chosen example. > Just having these few abstractions opens up a lot of possibilities. Why? Let’s suppose that you have 3 different kinds of fetchers and 3 kinds of notifiers. Now, you can easily compose 3 x 3 = 9 different kinds of health checks. You've just introduced an exponential explosion into your testing burden. The pay-off: additional functionality that might be useful later. edit On reflection I suppose it's not a 'exponential explosion', it's merely a 'multiplicative explosion'. > Enjoy your programming life. It's a fun art! The article doesn't go into detail on what it means here, but the more serious the software work, the less the artistic mindset applies. [1] I think the most sensible approach to software engineering is to draw satisfaction from solving a challenging problem well. Things like 'programmer freedom' strike me as false idols. That said, I'm a sucker for elegance (a famously subjective commodity), so maybe I'm a hypocrite. [0] https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it [1] https://www.fastcompany.com/28121/they-write-right-stuff https://www.fastcompany.com/28121/they-write-right-stuff
- horsawlarway 6y agoDing ding ding. I agree one hundred percent. This isn't elegant, this is needlessly over engineered and now much more likely to slow development. The biggest cost isn't lines of code, it's understanding abstractions. What happens when an "abstractnotifier" blows up? Where does the error happen? what are the possible side effects? What systems might be impacted? What happens when 'alert's start failing? Is it queued/buffered? Do I need to worry about OOM errors on systems? Will it retry? I lead a team of developers - This kind of abstraction tends to slow everything down. The only place it fits is during a refactor of software delivering real business value already. Basically - You can do this if you know exactly what your requirements are, and this nicely solves them. If you do this before you understand EXACTLY what you need, you're going to be wrong. You will abstract the wrong pieces, with the wrong assumptions. I promise you. Then later you have to rip it all apart anyways, except now instead of 4 simple lines with clear consequences, you have a bloated monster of bad assumptions.
- cutler 6y agoGood Clojure and Ruby code, in that order, is the closest to art. Structure and Interpretation of Computer Programs (SICP) also deals with abstraction so elegantly you could consider it art.
- cheez 6y ago> A skillful programmer looks at the problem and says, hey, why don't we build an abstraction layer to make it more flexible? No he doesn't
- dwaltrip 6y ago100% agreed. Code should only be as flexible as necessary to solve the intended problem along with a very cautious estimation of how that problem will evolve in the future. Small critique: s/he
- cheez 6y agoWas on mobile, punctuation is a PITA but normally I use s/he
- zelphirkalt 6y agoOn the other hand looking into my internal glas orb and expecting the next possible or useful use-case amd making my code flexible / abstract, while keeping it readable, enough to also represent that use-case has saved me hours time and time again. I think there is something to say for not overdoing it, but for not mindlessly implementing only the thing either. Thinking about what is the next abstraction that includes the functionality your want to implement and also is useful to implement anyway, because you already expect the need for flexibility in a certain direction. It depends probably on what type of software you write. Just a few procedures in a legacy code or a little command line tool, standing on its own for example. Certainly implementing only "the thing" gets the job done though. Perhaps doing more is doing more than what one is paid for.
- cheez 6y agoI write code that lasts decades and I can promise you a glass orb is unnecessary.
- TheOtherHobbes 6y agoThese articles reliably confuse art with craft and technique. Art is about giving other people rich, engaging experiences that distill and/or highlight some element of relatable human emotional, psychological, and/or sensual experience. The more unusual, original, and insightful the experience, the more interesting the art. Doing something difficult with elegance is not art. Solving problems is not art. Complex but comprehensible systems that have "beauty" are not art. If there's no emotional or sensual content, there's no art - just technique. There's nothing wrong with technique, and art isn't better or worse than technique on its own terms. But they're different languages with different goals. Calling software abstraction "art" is like watching someone who has discovered a for loop trying to persuade you they're an expert developer.
- reikonomusha 6y agoI think you got it on the nose. I think folks who engage in more “traditional” arts (painting, music making, ...) really develop a distinction between these often interacting concepts. When playing an instrument, you distinguish between creative interpretation (art), musicality & sonic control (aural craft, imho), and manual or corporeal dexterity (technique). Of course, one’s ability to communicate a musical interpretation is propped up by the (In very rare circumstances I might consider a program to be art, like the original metacircular Lisp evaluator, even if the author’s express intent wasn’t to appeal to somebody’s emotions.)
- mpalmer 6y agoIf it's possible to have "bad art", then it doesn't really follow that only beautiful or conceptually interesting programs qualify as art. Either it's all art - the beautiful and the interesting with the boring and ugly - or none of it is. Maybe you'd agree 'artfully constructed' covers what you mean? I think art is contextual. Some art comes with that context built into the mind of the observer, like paintings or music, or something that tells a story - and there are many, many ways to tell a story. Other art has its context declared for the observer, like Duchamp's 'ready-made' sculptures.
- combatentropy 6y ago
- horsawlarway 6y agoI don't disagree with your title. I pretty strongly disagree with your content. You started with a simple solution that nicely handles the current needs. You then over-engineered a solution so badly that you haven't even noticed the 'url' param isn't used in the last method you've shown. You went from simple enough a junior dev can make meaningful changes, to bloated enough the original author is fucking it up. Don't do this. Wait until you actually have a REAL use case for adding complexity.
- enneff 6y agohttps://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it
- MrGilbert 6y ago> You then over-engineered a solution so badly that you haven't even noticed the 'url' param isn't used in the last method you've shown. I think he wrote 'site' instead of 'url', so I'd call it a typo, but... I agree with what you wrote. For me, the article transports a wrong message. It's a thin line between YAGNI, KISS and OMGINTWNT[0] [0]:"OMG, I NEVER THOUGHT WE'D NEED THAT!" - made this one up, sorry.
- tomkwong 6y agoOP here. Thanks for the note. The intention to illustrate the power of abstraction. Based upon yours and other people's comments below, perhaps it wasn't the best example. I did correct the typo about 'url'. Best regards.
- buzzkillington 6y agoA good rule of thumb is to abstract inherent complexity and not incidental complexity. Loggers are examples of incidental complexity. There is nothing fundamental about sending the warning by email vs slack vs irc. The way to deal with this is not to keep adding more and more options, because you end up with combinatorial growth in the number of interactions, it's to make it company policy that you only use email and discipline anyone who doesn't.
- deleted 6y ago[deleted]
- DyslexicAtheist 6y agoprogramming isn't art. it's "life imitating art imitating life"
- dkersten 6y ago> A skillful programmer looks at the problem and says, hey, why don't we build an abstraction layer to make it more flexible? A skillful programmer doesn't add layers of abstraction unless there's a good reason or need to.
- JoeAltmaier 6y agoThe article was presuming a need? Otherwise there's nothing to discuss. Yes, pedantically this approach is only used in certain circumstances. Then, a skillful programmer has a ready set of skills. And so on.
- deleted 6y ago[deleted]
- mateusak 6y agoAny skillful programmer will tell you this is horrible. The 3 rules of thumb of programming are: 1. Paradigm purity is worthless 2. You ain't gonna need it. 3. Less complexity is better. You just broke all of them.
- willjp 6y agoI was a commercial artist for 10 years. The same is true of art. In the visual art world everything boils down to contrast. It may be colour, composition, sequences of shots, silhouettes, animation, or otherwise - but at the end of the day everything boils down to contrast. There is nothing mystical or romantic about art. At the end of the day, it is just a set of rules of manipulation/communication. I would say the same about programming. I find programming more interesting and engaging, but that's just me.
- sneilan1 6y agoHey! I’m a person who’s really serious about transitioning from programming to art. Can I pick your brain?
- euske 6y agoI think that when you look at things at a microscopic-level, everything looks boring and unoriginal. For example, every phenomenon on Earth (and beyond) is just an interaction between atoms. Looks pretty boring. As the OP mentioned, beauty is created by abstraction; an ability to look at the bigger picture and make sense of it. So I agree that abstraction is the most interesting thing in writing software.
- combatentropy 6y agoComments are harsh on what I took merely as a pedagogical example, but maybe it's because y'all have been burned so many times. I agree with you who advise to resist speculative programming. Don't write it till you need it, since all code incurs a burden of maintenance. But I would like to address a tangent: extracting configuration from code. Let's take the article's example and change it a little. I'll decompose it, since it already has become a function, but often the first step is just a series of statements. (I will also port it to javascriptish pseudocode, since I don't know Julia.) So this might be your first draft: response = HTTP.get('https://www.example.com/'); if (response.status !== 200) { email('someone@example.com', 'something is wrong'); } Instead of abstracting this into more general functions, I might simply move the literals to the top of the file: url = 'https://www.example.com/'; ok = 200; to = 'someone@example.com'; msg = 'something is wrong'; response = HTTP.get(url); if (response.status !== ok) { email(to, msg); } The only reason I know to do this is to maybe make changes easier. Even if you never need to generalize your code to other uses, you may need to update it for reasons outside your control. For example, someone leaves the company, and now you need to email someone-else@example.com. Or marketing changes the URL. Is there a name for this kind of refactoring?
- tomkwong 6y agoI don't know if there's any name about this specific refactoring change :-) In general, it is best to create small functions that takes few dependent variables for the intended flexibility. The first judgment here is to decide whether a value should be a constant or variable. Constants would then be declared at the top, and variables come in as function arguments. You reminded me that another pattern to handle this is to put some of these values as configuration parameters. For example, the email alert may need to be sent to different people for different environments - DEV, QA, and PROD.
- ehnto 6y agoIn the grand-parent comment's example, you just want it to be more readable, because it is a once off block of code, so that whoever maintains it next can easily figure out what it is doing. Moving it into a function doesn't stop it from being a once off block of code, and we need to be careful not to increase complexity for the sake of it. By your last paragraph you had already introduced a configuration store and the concept of environments!
- rswail 6y agoI don't consider programming an art in the term of humanities (eg painting/drawing/music etc) but more a craft (eg cabinet making, stonemasonery). There are assemblers, people that can follow a set of IKEA instructions and end up with a reasonably stable bookshelf. The average starting developer out of college is at this level. There are journeymen programmers, they have a few years experience, understand some of the nuances, know a bit about what doesn't work, can use the word "strategy" both correctly and ironically. Then there are master craftsmen, they understand the material they are working with. Know when to use an IKEA wooden dowel and when a custom joint is required. They build cabinetry that can be on display for its own inherent structure and leverage the natural capabilities of the material. The same applies to programming, both in the small and in the large.
- qznc 6y agoProgramming can be everything. I agree that most programming is craftsmanship. Code like the Obfuscated C Contest is art. The code that orchestrates your cloud servers is more like engineering. Prototypes in language research is science.
- tjchear 6y agoA bit tangential, but since OP mentioned abstraction, I'd like to add this: One of the marks of a readable piece of code is that it does not mix different levels of abstractions. Here's a contrived example: if (a < b && c == d) createUserProfile(); Instead, do this: if (userIsAuthenticated()) createUserProfile();
- jerzyt 6y agoGit is art. All programming is a solution to a problem. Some of the problems are very pedestrian and the solution is very boring. There have been many version control systems before Git. I remember using SCCS, RCS, CVS, ClearCase and finally Git came along, and just redefined the whole concept. Sure, the CLI may be clunky at times, but the fundamental problem of version control is solved. I suspect, that historically, Git may be considered as a bigger accomplishment for Linus Torvalds than Linux. After all, Linux is a clean room implementation of Unix, whereas Git is completely original.
- frou_dh 6y agoI thought the origin story of Git was that Linus wanted to recreate the workflow he had with BitKeeper after the Linux project lost access to it. I've never touched BitKeeper so have no idea how similar they actually are.
- 7532yahoogmail 6y agoI find these kinds of near-journal-article-for-self fairly useless. If you think our stuff is boring where'd you leave intel/amd etc doing statistical process control in the domain of mother nature that's got the standard model in her favor? More boring? Less? Or dumb question? Abstraction is a sort of entropy / Shannon / Kormogorov issue. So let's discuss it there not semi-liberal-arts school fogginess. Folks let's please keep science in science. One day if QC gets commercial all these flowery articles will disappear. QC is math based. We'll need to deal or get left behind, and by then all this handwaving won't matter in the least. Now, the other bad of software dev is that today's work is generously semi-formal at best in commercial settings. Not because CS is art, but because requirements gathering, human factors, corporate culture are strongly reactive in the software realm, where mother nature is directly absent. Here we could help each other to understand management and management us to move this whole ediface along. And here less technical articles ala HBR work well.
- notsag-hn 6y agoWhen the developer is inexperient, programming is similar to art. You see hacky stuff and sometimes "innovation" that a senior engineer would just call dirty code. Senior engineers however don't do art unless they are explicitly doing it like with computer graphics or other kinds or computer-based art generation, or through movements like hacktivism that are certainly quite poetic. Otherwise it's so far away from art, regular APIs aren't art, databases aren't art, operating systems aren't art. Many engineers have the need to call themselves artists, you should have taken drawing lessons if you wanted to be artists because regular engineering for business is maintainable just if it's as standard as possible and let me tell you that is the opposite of art.