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.

It's not what programming languages do, it's what they shepherd you to (2020)

219 pointsby goranmoominover 3 years ago

28 comments

jerfover 3 years ago
A somewhat more established term for this is &quot;affordance&quot;. See the results for <a href="https:&#x2F;&#x2F;duckduckgo.com&#x2F;?q=programming+language+affordance" rel="nofollow">https:&#x2F;&#x2F;duckduckgo.com&#x2F;?q=programming+language+affordance</a> , for instance.
评论 #29838271 未加载
kerblangover 3 years ago
Do not be fooled into thinking, &quot;The language made me do it&quot; when the <i>culture</i> that surrounds the language made you do it. Different technologies have cultures brought on by often self-appointed leadership figures, even anonymous ones. Those leadership figures can popularize abuse by convincing others that it&#x27;s a well-established cultural norm, simply because we tend to loathe non-conformity.<p>Third-party frameworks are often used to establish one&#x27;s self as a leader and establish abusive practices. Once the foothold is firm, it becomes literally &quot;The framework made me do it.&quot; Cultural norms mandate the framework, and the framework forces the abuse. If anyone protests about the consequences of abuse, blame is redirected back at the language.<p>To any onlooker, the consensus seems clear: Your language sucks! Those same onlookers are happy to reinforce this perception because they are busy trying to establish competing cultures &amp; leaders of their own. &quot;You should try <i>my</i> language!&quot; Of course their primary goal is not to <i>help</i>, but to improve their own status by rising the tide and lifting their own boat. If they wanted to really help, they would work on establishing <i>better</i> culture instead of jockeying for <i>popular</i> culture.
评论 #29840743 未加载
评论 #29845134 未加载
评论 #29840623 未加载
评论 #29841538 未加载
评论 #29847409 未加载
jgiliasover 3 years ago
It&#x27;s pretty hilarious how a good part of the comment section here is some variation of what the article starts out with:<p>Person A: &quot;Programming language X is bad, code written in it is unreadable and horrible.&quot;<p>Person B: &quot;No it&#x27;s not. You can write good code in X, you just have to be disciplined.&quot;
评论 #29837753 未加载
评论 #29837293 未加载
评论 #29837616 未加载
Animatsover 3 years ago
I&#x27;ve become worried about Rust as &quot;async&quot; worms its way into more crates. &quot;Async&quot; is optimized for I&#x2F;O bound programs. The special case of a large number of slow network connections talking to a server, web services, is what it&#x27;s really used for. If you have multiple compute-bound tasks crunching away, it&#x27;s a mismatch.
评论 #29835902 未加载
评论 #29837135 未加载
评论 #29837190 未加载
评论 #29837307 未加载
评论 #29837459 未加载
评论 #29836156 未加载
评论 #29839578 未加载
评论 #29836922 未加载
评论 #29837347 未加载
评论 #29837289 未加载
cutlerover 3 years ago
PHP has to be the worst offender with its pseudo-Java boilerplate enshrined in its PSRs. PHP is a perfectly fine procedural language but version 5 was like the Second Coming of Christ with its religious devotion to all things OOP. I don&#x27;t know about shepherding - with PHP it&#x27;s more like being beaten over the head with a club.
评论 #29837563 未加载
评论 #29840242 未加载
评论 #29841298 未加载
评论 #29836854 未加载
评论 #29835793 未加载
评论 #29836330 未加载
wruzaover 3 years ago
This shows how much programmers hate distraction. Perl doesn&#x27;t really shepherd you into regexp, it&#x27;s just easy to s&#x2F;&#x2F;&#x2F; in it, so you think: hmm, searching for a good xml library takes time, replacing is fast and non-distracting. In C, replacing in a string is so much harder, so you&#x27;re okay with setting up a parser and using it. If only Perl had this <i>out of box</i>:<p><pre><code> use xml; foreach (xml::select(&lt;STDIN&gt;, &quot;item[color=orange]&quot;)) { $_-&gt;setattr(&quot;color&quot;, &quot;red&quot;) } print(xml::result) </code></pre> But just install XML::Parser you could say! Well, look here: [123] and tell how to do the above from it quickly. You can&#x27;t. You still want regexp-like selector thing and Perl semantics, not just a deep hash of hashes of arrays of hashes which loses Perl&#x27;s appeal instantly.<p>Better languages have better tools to work with out of box, and these tools match the language spirit. There is no XML Parser for Perl on CPAN, they all are for some other language that Perl isn&#x27;t.<p>[1] <a href="https:&#x2F;&#x2F;metacpan.org&#x2F;pod&#x2F;XML::Parser" rel="nofollow">https:&#x2F;&#x2F;metacpan.org&#x2F;pod&#x2F;XML::Parser</a><p>[2] <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;487213&#x2F;whats-the-best-xml-parser-for-perl" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;487213&#x2F;whats-the-best-xm...</a><p>[3] <a href="https:&#x2F;&#x2F;metacpan.org&#x2F;pod&#x2F;XML::LibXML" rel="nofollow">https:&#x2F;&#x2F;metacpan.org&#x2F;pod&#x2F;XML::LibXML</a>
评论 #29836839 未加载
评论 #29837700 未加载
评论 #29838763 未加载
评论 #29837272 未加载
评论 #29837191 未加载
lamontcgover 3 years ago
Yeah I really don&#x27;t like this.<p>It reinforces the idea that the best programming languages should be dumbed down to avoid people ever abusing features.<p>I fully support the right to carry and bear footguns and that programmers need to be trained in the responsible use of them.<p>So things like unicode identifiers (allowing the use of π as a variable name), custom operators and operator overloading (so `matrix * vector` rather than `matrix.VecMult(vector)`) can all be used in certain domains to produce perfectly readable domain-specific code. They can also be abused, but that isn&#x27;t an argument against their use.<p>The argument by the author seems to be around a case where in perl bashing on XML with regexps is easier than XML parsing, which sounds like proper XML parsing needs to be made simpler, easier, more performant, more standardized or whatever it is about proper XML parsing that causes perl authors to not use it. Somehow there&#x27;s too much friction there which needs to be addressed.<p>The way this argument usually winds up though is someone argues that regexp parsing needs to be made worse to punish people for using it in order to shepherd them into the &quot;better&quot; way.
pdimitarover 3 years ago
Yeah, that&#x27;s very true. Try and do FP in Java or C++ or PHP or Python and see where it gets you.<p>And before I get a ton of &quot;ackchyally you can do X&quot; guys, yes you technically can but there&#x27;s friction and you are implicitly not encouraged to do so.<p>I like languages that push you to think about X or Y so you can&#x27;t miss it. Case in point: strong static types in many languages, or lifetimes&#x2F;ownership in Rust.
评论 #29864260 未加载
评论 #29839095 未加载
评论 #29838653 未加载
评论 #29841199 未加载
dackover 3 years ago
This resonates - I&#x27;ve thought about certain technique and language couplings as &quot;impedance mismatches&quot;, where the technique itself is fine and good, but the language makes it a horrible experience that&#x27;s not worth it.<p>The example that I&#x27;ve run into most is trying to write functional immutable code in Java. I have just never gotten it to work well - of course there are libraries that have weird workarounds (that aren&#x27;t compatible with standard data types or libraries), or tons of boilerplate you could write, but ultimately Java just fights you the whole way. It&#x27;s not really worth going down that path imo, and better to switch to something like kotlin or scala if you can.
评论 #29836303 未加载
评论 #29841956 未加载
评论 #29839101 未加载
评论 #29841122 未加载
评论 #29836759 未加载
Const-meover 3 years ago
That might be true for perl, but I don’t believe that’s true for programming languages in general.<p>&gt; C++ shepherds you into providing dependencies as header-only libraries.<p>There’re many C++ libraries provided as DLLs too, like QT. Just because the standard library is mostly header-only, doesn’t mean that’s always a good idea for other libraries.<p>&gt; Java does not shepherd you into using classes and objects, it pretty much mandates them.<p>Maybe, but modern C#, despite similar to Java in many regards, doesn’t promote any particular coding style. Classes and objects are working fine, but so is FP or procedural. And there’re decent libraries, both Microsoft’s and third party, implementing reactive and actor approaches.
deepsunover 3 years ago
I wounder whether Java is usually used for extra-large projects just because it shepherds developers into more-less readable way of doing things.<p>So that even multi-year hundred-people dozen-companies project still at least runs.<p>Of course, I&#x27;ve seen with my own eyes that even that could be broken with enough courage (seen a company ignoring all NPEs in main()), but on average Java projects stay more readable, than, say, Python.
评论 #29839519 未加载
grahamleeover 3 years ago
It&#x27;s interesting when the creators had a clear intention to shepherd people one way and the programming community went another. Both Objective-C and Java (which was informed by ObjC significantly, including having a few implementors hired from NeXT) clearly intend for low level, C-style imperative code to be isolated early behind a message-passing interface and for systems to be built out of message-passing between objects. This is most explicit in Brad Cox&#x27;s book describing the ObjC way, &quot;Object-Oriented Programming: an Evolutionary Approach&quot;. In practice, a lot of Objective-C software and quite a lot of Java software is designed as big C-style procedures which call into APIs using object methods.<p>Similarly, the OP describes Perl, which is designed using a postmodern philosophy: however you think about your problem, you can solve it that way! In practice as OP describes many people reach for regex.
评论 #29838964 未加载
bullenover 3 years ago
When I was studying Masters in Physics Engineering in Uppsala I spent all my time in the Sun+Solaris computer labs instead of going to the lessons we had in our Math and Physics courses.<p>I fell into the rabbit hole of HTML+.js+Applets and just couldn&#x27;t do anything else. I made my first HTTP server that I ran on the university account without anyone noticing! :) I found Karl Hornells javaonthebrain.com (little did I know he was sitting in the building next to me):<p>You don&#x27;t need to code Java in a stupid way, here is how you do it like C without cache misses: <a href="http:&#x2F;&#x2F;www.javaonthebrain.com&#x2F;java&#x2F;iceblox&#x2F;iceblox.java" rel="nofollow">http:&#x2F;&#x2F;www.javaonthebrain.com&#x2F;java&#x2F;iceblox&#x2F;iceblox.java</a><p>&quot;Java does not shepherd you into using classes and objects, it pretty much mandates them.&quot; - Well it mandates ONE class, you do you!
评论 #29837365 未加载
lmmover 3 years ago
This seems like a rediscovery of <a href="https:&#x2F;&#x2F;www.haskellforall.com&#x2F;2016&#x2F;04&#x2F;worst-practices-should-be-hard.html" rel="nofollow">https:&#x2F;&#x2F;www.haskellforall.com&#x2F;2016&#x2F;04&#x2F;worst-practices-should...</a>
tyingqover 3 years ago
&gt;Perl shepherds you into using regexps...Note that there is nothing about Perl that forces you to do this. It provides all the tools needed to do the right thing.<p>It does have index() and rindex(), but doesn&#x27;t have a begins_with(), ends_with(), and other string functions that Python, Ruby, PHP, java, etc, have. You can roll your own, but there are arguably things missing.
评论 #29839981 未加载
评论 #29842292 未加载
mikewarotover 3 years ago
My favorite programming language remains Pascal, I wonder that that says about me? I&#x27;ve been described as slow but reliable.
评论 #29835632 未加载
评论 #29836635 未加载
AtNightWeCodeover 3 years ago
Not only programming languages. Tools does this too like GIT.
throwaway984393over 3 years ago
<i>&quot;Perl has several XML parsers available and they are presumably good at their jobs (I have never actually used one so I wouldn&#x27;t know). [...] This is a clear case of shepherding. Text manipulation in Perl is easy. Importing, calling and using an XML parser is not.&quot;</i><p>The people writing those lame scripts have the same logic the author does. &quot;Must be hard, probably? So I won&#x27;t even try to learn, I&#x27;ll just use this regex&quot;<p>A Shepherd&#x27;s job is to keep the flock safe. If the blind are leading the blind, that is a <i>lack</i> of shepherding. It&#x27;s not shepherding users to use regex. It&#x27;s letting the sheep roam free and they&#x27;re falling off the cliff.<p>Perl&#x27;s problem has always been that it is too easy to use. 97% of people who write Perl aren&#x27;t even programmers. It doesn&#x27;t shepherd you, it lets you write programs even when you don&#x27;t know what you&#x27;re doing.<p>We should require drivers licenses in order to program. Programmers think they are capable even when they&#x27;re not, and their false confidence and laziness leads to shitty code that causes problems. Same for people who try to drive without passing a driver&#x27;s test. It just causes harm.<p>We should set legal engineering requirements for code just like for other trades. Otherwise some idiot is going to assume XML parsers are super annoying without even looking at them and try to use regex.
crate_barreover 3 years ago
This can derail the convo a bit, but one of the major criticism of React as a view layer library is that it shepherds you into doing a whole lot, much like a framework.
评论 #29836250 未加载
meijerover 3 years ago
Among other things, F# shepherds you into avoiding cyclic dependencies which is really nice both for readibility and proper module design.
Tozenover 3 years ago
I will have to say that I like the direction that the V programming language (vlang) is going. It has blended many good qualities of Oberon&#x2F;Pascal, C, and Go. I&#x27;ve read a lot of debates among C and Pascal advocates, so good to see newer languages trying to find middle ground.<p>Debatably, the Go language has put itself somewhere in the middle, as a more modern acceptable compromise and blend with its own twists.<p>The V language is continuing on the path of where Go went, where readability, maintainability, and simplicity is more evident. Doing so, where it feels like a more natural feature. At the end of the day, many want to be more focused on the problems to be solved, not tripping over the eccentricities and traps of the language.<p>Clearly, perfection will probably never be achieved. But, I do like where various newer languages are going, as it shows progress. Usability, being easy to learn and teach, as well as being more practical about common programming issues.
评论 #29836360 未加载
评论 #29836077 未加载
评论 #29836594 未加载
oaieyover 3 years ago
I am a long term C# dev and have my educated guesses in what I am shepherd to ... But I am very curious about your opinion here since I am probably blind to this.<p>And to keep the discourse focused on the interesting things, let us exclude &quot;into Microsofts hands &#x2F; into Azure cloud&quot;.
评论 #29837545 未加载
hoshover 3 years ago
“The medium is the message”. <a href="https:&#x2F;&#x2F;youtu.be&#x2F;ImaH51F4HBw" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;ImaH51F4HBw</a><p>McCluhan applied his thinking to radio and television, but that idea is applicable to computer software and language platforms.
mwattsunover 3 years ago
I like to translate ideas programmers talk about it to more commonly recognized bits of wisdom, so for this one I&#x27;m going with<p>&quot;if all you have is a hammer, everything looks like a nail&quot;<p>When I looked it up, I was surprised this is of fairly recent origin by Abraham Maslow in 1966<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Law_of_the_instrument" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Law_of_the_instrument</a>
flohofwoeover 3 years ago
&gt; C shepherds you into manipulating data via pointers rather than value objects.<p>Overly simplified IMHO, this was probably true for K&amp;R C, but in more recent C versions (e.g. in the last two decades or so), passing structs around by value is fine and often preferable.<p>(in general I agree with the article though, the shepherding side effect of programming languages is probably more important than the syntax and feature set)
评论 #29839256 未加载
PicassoCTsover 3 years ago
Now imagine what bad behaviors &quot;No Code&quot; languages encourage in new programmers.<p>Lots of them blatantly encourage there users to &quot;copy&amp;paste&quot; instead of using functions and structures.<p>And if they try to encourage good behavior, the sales people start to bugger the developers to &quot;make it simpler&quot; and the result is again a 9000 lines long papyrus of copy &amp; paste.
评论 #29837608 未加载
dkarlover 3 years ago
I don&#x27;t buy that &quot;shepherding&quot; is a strong inherent quality of a language, except in the negative sense that a language can make a particular style of programming impractical, and I don&#x27;t buy that calling for &quot;discipline&quot; in a language is a denial of its inherent nature. &quot;Discipline&quot; boils down to acceptance of the lessons of experience, and it becomes easier over time.<p>Around the turn of the century, Java seemed to require a lot of &quot;discipline&quot; because the people who were embracing OO at the same time they were embracing Java did all kinds of stupid things. They created deep object hierarchies with unnecessary layers and strained relationships, and their systems were slow because simple operations like formatting a date required ten different object allocations and acquiring a mutex lock or two. The GoF patterns book, a good and well-intentioned book, was co-opted as a kind of extremist OO programming handbook, so that if you got stuck trying to apply OO to a problem, you could always find a way to move forward by adding <i>even more OO</i>. Languages like Java enabled this (some said encouraged it) and a lot of people thought it was impossible for programmers to rein in the tendency for Java codebases to blow up with OO excess. Meanwhile, a lot of fanboys thought that OO shouldn&#x27;t be reined in, that the way out was through, and they doubled down on their principles.<p>In other words, OO was the hot new thing, and early adopters using OO languages like Java had a tendency to spiral into an OO frenzy that created ridiculously convoluted codebases and slow, complex systems.<p>But this wasn&#x27;t inherent to Java. It was a combination of Java&#x27;s ability to write that kind of code, along with a naive zeal for exploring the kind of solutions you could build using inheritance-based OO. Even the fanboys warned that you could, if you weren&#x27;t sufficiently dedicated to OO principles, write procedural code in Java, putting your logic in static methods and your data in behavior-free, non-encapsulated record-style classes.<p>Twenty years later, we no longer think of Java as a language that infects people with an insatiable desire to create inheritance spaghetti, which they can only resist through discipline. It selects for people who are infected with that desire, sure, but an average programmer coming to Java will be leery of building complex inheritance hierarchies and using inheritance to solve problems it isn&#x27;t well-suited for. It isn&#x27;t discipline any more; it&#x27;s just something people know to do, for their own sake. Building deep inheritance hierarchies and FactoryFactoryFactoryFactories is foolishness, not the one natural way to use Java.<p>Right now, I think something similar is happening in functional programming. I wouldn&#x27;t be surprised if every fundamentally new programming model suffers from the same growing pains, until the lessons are learned, blind optimism becomes educated appreciation, the zealots are forced to find something else to be fanatical about, and we no longer say it takes &quot;discipline&quot; to avoid the pathologies but merely an awareness of what has been learned from past mistakes.
weakfishover 3 years ago
This is why I enjoy Go, it shepherds you to write clear and uniform code that cannot be mistaken. This is &#x27;boring,&#x27; true, but I will die on the hill that engineering should be boring if that&#x27;s what produces a robust outcome. Elegant functional trickery can be cool in a personal project, but I don&#x27;t want to spend 2 hours deciphering someone else&#x27;s elegance when trying to solve a business problem.
评论 #29836368 未加载
评论 #29835857 未加载
评论 #29835844 未加载
评论 #29836651 未加载