TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Programming is boring art

120 pointsby tomkwongalmost 5 years ago

25 comments

combatentropyalmost 5 years ago
Comments are harsh on what I took merely as a pedagogical example, but maybe it&#x27;s because y&#x27;all have been burned so many times. I agree with you who advise to resist speculative programming. Don&#x27;t write it till you need it, since all code incurs a burden of maintenance.<p>But I would like to address a tangent: extracting configuration from code. Let&#x27;s take the article&#x27;s example and change it a little. I&#x27;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&#x27;t know Julia.) So this might be your first draft:<p><pre><code> response = HTTP.get(&#x27;https:&#x2F;&#x2F;www.example.com&#x2F;&#x27;); if (response.status !== 200) { email(&#x27;someone@example.com&#x27;, &#x27;something is wrong&#x27;); } </code></pre> Instead of abstracting this into more general functions, I might simply move the literals to the top of the file:<p><pre><code> url = &#x27;https:&#x2F;&#x2F;www.example.com&#x2F;&#x27;; ok = 200; to = &#x27;someone@example.com&#x27;; msg = &#x27;something is wrong&#x27;; response = HTTP.get(url); if (response.status !== ok) { email(to, msg); } </code></pre> 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.<p>Is there a name for this kind of refactoring?
评论 #23367279 未加载
评论 #23367808 未加载
评论 #23367315 未加载
MaxBarracloughalmost 5 years ago
&gt; 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.<p>It does one well-defined thing, and does it well! That&#x27;s the good kind of &#x27;inflexible&#x27;.<p>&gt; A skillful programmer looks at the problem and says, hey, why don&#x27;t we build an abstraction layer to make it more flexible?<p>In this example, the additional complexity just doesn&#x27;t seem justified. You ain&#x27;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.<p>&gt; 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.<p>You&#x27;ve just introduced an exponential explosion into your testing burden. The pay-off: additional functionality that <i>might</i> be useful later.<p><i>edit</i> On reflection I suppose it&#x27;s not a &#x27;exponential explosion&#x27;, it&#x27;s merely a &#x27;multiplicative explosion&#x27;.<p>&gt; Enjoy your programming life. It&#x27;s a fun art!<p>The article doesn&#x27;t go into detail on what it means here, but the more serious the software work, the less the artistic mindset applies. [1]<p>I think the most sensible approach to software engineering is to draw satisfaction from solving a challenging problem well. Things like &#x27;programmer freedom&#x27; strike me as false idols.<p>That said, I&#x27;m a sucker for elegance (a famously subjective commodity), so maybe I&#x27;m a hypocrite.<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;You_aren%27t_gonna_need_it" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;You_aren%27t_gonna_need_it</a><p>[1] <a href="https:&#x2F;&#x2F;www.fastcompany.com&#x2F;28121&#x2F;they-write-right-stuff" rel="nofollow">https:&#x2F;&#x2F;www.fastcompany.com&#x2F;28121&#x2F;they-write-right-stuff</a>
评论 #23365720 未加载
评论 #23367239 未加载
评论 #23365747 未加载
TheOtherHobbesalmost 5 years ago
These articles reliably confuse art with craft and technique.<p>Art is about giving other people rich, engaging experiences that distill and&#x2F;or highlight some element of relatable human emotional, psychological, and&#x2F;or sensual experience.<p>The more unusual, original, and insightful the experience, the more interesting the art.<p>Doing something difficult with elegance is not art. Solving problems is not art. Complex but comprehensible systems that have &quot;beauty&quot; are not art.<p>If there&#x27;s no emotional or sensual content, there&#x27;s no art - just technique.<p>There&#x27;s nothing wrong with technique, and art isn&#x27;t better or worse than technique on its own terms. But they&#x27;re <i>different languages</i> with different goals.<p>Calling software abstraction &quot;art&quot; is like watching someone who has discovered a for loop trying to persuade you they&#x27;re an expert developer.
评论 #23366583 未加载
评论 #23367923 未加载
评论 #23365742 未加载
评论 #23368088 未加载
评论 #23371668 未加载
评论 #23367527 未加载
rswailalmost 5 years ago
I don&#x27;t consider programming an art in the term of humanities (eg painting&#x2F;drawing&#x2F;music etc) but more a craft (eg cabinet making, stonemasonery).<p>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.<p>There are journeymen programmers, they have a few years experience, understand some of the nuances, know a bit about what doesn&#x27;t work, can use the word &quot;strategy&quot; both correctly and ironically.<p>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.<p>The same applies to programming, both in the small and in the large.
评论 #23368029 未加载
phkahleralmost 5 years ago
One of the most beautiful pieces of code I&#x27;ve ever read is this:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;solvespace&#x2F;solvespace&#x2F;blob&#x2F;master&#x2F;src&#x2F;srf&#x2F;ratpoly.cpp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;solvespace&#x2F;solvespace&#x2F;blob&#x2F;master&#x2F;src&#x2F;srf...</a><p>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.
评论 #23365966 未加载
评论 #23368371 未加载
评论 #23364852 未加载
评论 #23364580 未加载
cheezalmost 5 years ago
&gt; A skillful programmer looks at the problem and says, hey, why don&#x27;t we build an abstraction layer to make it more flexible?<p>No he doesn&#x27;t
评论 #23367766 未加载
评论 #23367150 未加载
horsawlarwayalmost 5 years ago
I don&#x27;t disagree with your title. I pretty strongly disagree with your content.<p>You started with a simple solution that nicely handles the current needs.<p>You then over-engineered a solution so badly that you haven&#x27;t even noticed the &#x27;url&#x27; param isn&#x27;t used in the last method you&#x27;ve shown.<p>You went from simple enough a junior dev can make meaningful changes, to bloated enough the original author is fucking it up.<p>Don&#x27;t do this. Wait until you actually have a REAL use case for adding complexity.
评论 #23366277 未加载
评论 #23365861 未加载
评论 #23365828 未加载
评论 #23365808 未加载
7373737373almost 5 years ago
<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Asemic_writing" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Asemic_writing</a><p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Artist%27s_book" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Artist%27s_book</a>
评论 #23365059 未加载
评论 #23364701 未加载
Tade0almost 5 years 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.<p>The consensus was that I&#x27;m a writer.<p>Also there&#x27;s one thing I ask everyone seeking to get into programming: &quot;are you resistant to boredom?&quot;<p>This appears to be a good predictor of future success.
评论 #23365586 未加载
评论 #23366774 未加载
评论 #23365836 未加载
评论 #23369227 未加载
评论 #23365415 未加载
dkerstenalmost 5 years ago
&gt; A skillful programmer looks at the problem and says, hey, why don&#x27;t we build an abstraction layer to make it more flexible?<p>A skillful programmer doesn&#x27;t add layers of abstraction unless there&#x27;s a good reason or need to.
评论 #23365938 未加载
评论 #23366133 未加载
trmswalmost 5 years ago
Upvoting this just for the title ... and was disappointed by the article. Rats.
评论 #23366588 未加载
评论 #23364428 未加载
gherkinnnalmost 5 years ago
&gt; <i>How boring is it to produce something of the same shape over and over again.</i><p>Same applies to any text written. Yet, few people would argue there aren’t any artists among novelists, screenwriters, and poets.
评论 #23364165 未加载
评论 #23364199 未加载
评论 #23364181 未加载
mateusakalmost 5 years ago
Any skillful programmer will tell you this is horrible. The 3 rules of thumb of programming are:<p>1. Paradigm purity is worthless 2. You ain&#x27;t gonna need it. 3. Less complexity is better.<p>You just broke all of them.
jerzytalmost 5 years ago
Git 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.
评论 #23369187 未加载
7532yahoogmailalmost 5 years ago
I find these kinds of near-journal-article-for-self fairly useless. If you think our stuff is boring where&#x27;d you leave intel&#x2F;amd etc doing statistical process control in the domain of mother nature that&#x27;s got the standard model in her favor? More boring? Less? Or dumb question?<p>Abstraction is a sort of entropy &#x2F; Shannon &#x2F; Kormogorov issue. So let&#x27;s discuss it there not semi-liberal-arts school fogginess.<p>Folks let&#x27;s please keep science in science. One day if QC gets commercial all these flowery articles will disappear. QC is math based. We&#x27;ll need to deal or get left behind, and by then all this handwaving won&#x27;t matter in the least.<p>Now, the other bad of software dev is that today&#x27;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.<p>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.
zabzonkalmost 5 years ago
IMHO, alert() should be called at a higher level by something that calls check().
tjchearalmost 5 years ago
A bit tangential, but since OP mentioned abstraction, I&#x27;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.<p>Here&#x27;s a contrived example:<p><pre><code> if (a &lt; b &amp;&amp; c == d) createUserProfile(); </code></pre> Instead, do this:<p><pre><code> if (userIsAuthenticated()) createUserProfile();</code></pre>
notsag-hnalmost 5 years ago
When the developer is inexperient, programming is similar to art. You see hacky stuff and sometimes &quot;innovation&quot; that a senior engineer would just call dirty code. Senior engineers however don&#x27;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&#x27;s so far away from art, regular APIs aren&#x27;t art, databases aren&#x27;t art, operating systems aren&#x27;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&#x27;s as standard as possible and let me tell you that is the opposite of art.
willjpalmost 5 years ago
I 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&#x2F;communication. I would say the same about programming. I find programming more interesting and engaging, but that&#x27;s just me.
评论 #23366413 未加载
spicyramenalmost 5 years ago
In 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
euskealmost 5 years ago
I 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.<p>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.
alexashkaalmost 5 years ago
Life itself is boring art. Everything else is just an extension of that.
评论 #23364892 未加载
评论 #23364717 未加载
cutleralmost 5 years ago
Good 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.
DyslexicAtheistalmost 5 years ago
programming isn&#x27;t art. it&#x27;s &quot;life imitating art imitating life&quot;
gorpovitchalmost 5 years ago
When 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&#x27;s fun and satisfying to write elegant code, but your company hired you to produce value, not art.
评论 #23365195 未加载
评论 #23368662 未加载