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.

The danger of "language" in programming (2009)

34 pointsby phowatover 11 years ago

11 comments

kbensonover 11 years ago
I think it&#x27;s worth bringing Perl into this discussion, as a language designed by linguists to to make it easier to express yourself in ways similar to how you think. Thinking about this, it puts the following statement into new light:<p><i>Natural languages are exclusively used to talk to people, while programming languages are also used to talk to machines.</i><p>We <i>also</i> use programming languages to communicate to other programmers (which includes our future selves). Making clear delineations as above can serve to help define a problem, or arbitrarily reduce your options without cause. I think this is the latter.<p>Perl has many, many nuances. This is often derided by people that prefer more rigid languages. I like to think that it helps me see the programmer intent and thought process more clearly through the code.<p>Obviously there are downsides to this, just as there are downsides to overly rigid languages. Again, differentiating them based on what we <i>assume</i> they will excel at early may not be beneficial for us. People that move freely between different language dichotomies seem to have success in choosing the right tool for the job, whether that be algorithm, language or platform.
评论 #6972143 未加载
评论 #6972209 未加载
评论 #6972146 未加载
doglesover 11 years ago
I disagree with this argument. Modern programming is done with groups of people; you are not only communicating your intent to the machine, you are communicating your intent with fellow engineers. It is in this case that nuance is important. For example, C++ references and pointers are exactly the same as far as the machine cares. But the difference is important for communicating intent to other engineers.<p>This isn&#x27;t to say that C++ lacks significant flaws, but I don&#x27;t think nuance and variety of expression is one of them.
评论 #6972019 未加载
candybarover 11 years ago
Another thing that&#x27;s easy to forget is that human languages often evolve to be difficult to learn, with this difficulty later being used as a social weapon against outsiders and a marker of status. This evolution is at times deliberate, other times accidental, but all languages go through this phase - where there&#x27;s no such difficulty, insiders invent jargons and slangs to create the barrier.<p>Though now I think of it, programming languages aren&#x27;t immune from this phenomenon either!
zimbatmover 11 years ago
Another danger is the focus on the syntax or maybe standard library when talking about &quot;programming language&quot;. Programming is done in an environment. Things like editor support, debugging capabilities, compatibility with operating systems, speed of execution... they all count towards the usefulness on a programming environment and are often overlooked when comparing fizzbuzz implementations.
ianstormtaylorover 11 years ago
<i>&gt; There are two ways to deal with bugs. Correcting them, and avoiding them.</i><p>Does anyone on HN know of other places to read more about this idea? I strongly believe it, and think it&#x27;s incredibly important to being able to argue for refactoring and code quality. I&#x27;d would love to read more about it if there are good articles out there.
评论 #6972845 未加载
mjp94over 11 years ago
The comparison made between English and C++ (spoken&#x2F;written language and programming language) makes me wonder if people should even be comparing the two at at all. They do serve similar purposes in a sense, but what I&#x27;m wondering is if we would even compare them if they both weren&#x27;t called &quot;languages&quot;? If the words used for programming language and written&#x2F;spoken languages were completely disjoint, would this point even be brought up?
评论 #6971816 未加载
评论 #6971636 未加载
评论 #6971859 未加载
hercyniumover 11 years ago
<i>There are two ways to deal with bugs. Correcting them, and avoiding them.</i> ... <i>Of these two, the only one that is significantly influenced by the structure of programming languages is avoidance.</i><p>This is an interesting statement to me, and one that I think may be telling towards the author&#x27;s experience as a programmer. This is not my way of saying he is a poor or inexperienced programmer! I skimmed through a few other articles on the site and what stood out to me is that he is heavily &quot;academic.&quot; Some of the best programmers I have worked with had deep academic experience and were quite adept at writing fast, concise, correct code in many different languages.<p>What stands out to me is the absence of something that (as is my personal observation) most experienced programmers in non-academic settings begin to realize at some point... While <i>avoiding</i> bugs (by, for example, choosing a language with strict type-checking, or immutable data&#x2F;vars) is quite important, writing code <i>that can be easily corrected</i> is arguably just as important!<p>In regards to just the use of a programming language, this comes down to choosing a careful balance of constructs - syntax, features, naming, etc. Coding standards for a project or organization are not just there to stoke somebody&#x27;s ego or cater to the &quot;lowest common denominator&quot;. Well-chosen standards and conventions are there to simultaneously avoid bugs <i>and</i> make code easier to debug and maintain - which is what one must do to make corrections!<p><i>It is therefore crucial to insist on it when choosing (or designing) one.</i><p>This sentence is what really drove me to comment: No programming language can prevent all bugs. Not even <i>most</i> bugs.<p>In practice, I have even found that constructs and limitations that are intended to prevent bugs of one type can lead to bugs of some other type. In the worst cases, these limitations can lead to programmers making code that is much more verbose and complicated, which, of course... leads to more bugs that are <i>harder</i> to correct.<p>IMO, one should choose a language based on many, many more criteria than &quot;avoidance of bugs.&quot; Personally, one of <i>my</i> top criteria is to choose a language with which those who will write and maintain the software (now <i>and in the future</i>) are going to be most productive.
评论 #6972184 未加载
sengstromover 11 years ago
I got a syntax error somewhere on this line: &quot;Not because it&#x27;s wrong (although it is), but because it&#x27;s right.&quot;<p>This is interesting however - how about substantiating it with a concrete example? &quot;C++ does have many nuances. It is a very interesting and very subtle language, to the point even machines (namely compilers) disagree about its meaning.&quot;
评论 #6971857 未加载
toolsliveover 11 years ago
Isn&#x27;t the original statement about C++ a variation on the Sapir-Whorf hypothesis ? <a href="http://en.wikipedia.org/wiki/Linguistic_relativity" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Linguistic_relativity</a>
评论 #6972107 未加载
vincvincover 11 years ago
Let me add a short side-note from the &#x27;Natural Language&#x27; side of the table.<p>TLDR: Comparing programming languages and human languages is a dangerous thing, not just because people differ from machines when being told to do something, but even more so because since the daily use of NL by humans is so fundamentally based on our biological and cognitive context, that if you really think about it, the parallels in functionality of these two types of &#x27;language&#x27; are interesting to consider but greatly limiting.<p>Human language works something like this: Agent A wants or feels something. If this even in a slight way involves another agent (B), big chance that A will choose to communicate something to B.<p>Before deciding what to say, (among others) the following is considered:<p>- A knows that B shares a tremendous amount of similar information with her<p>- About most of this info, A knows that B knows that A knows this, therefore:<p>- A can expect B to infer anything that A would like B to infer from what she says.<p>Results:<p>- The code (language) used itself does not contain even 10% of the information necessary to &#x27;understand&#x27; the situation and what A motives are for speaking. It merely contains lots of very multifaceted and nuanced pointers of which any two agents would disagree on what&#x27;s got the priority. [1]<p>- A huge part of day-to-day communication is extra-linguistic.<p>Take this example:<p>You and me walk to the campus library together. I notice a certain bike and point your attention to it. Since you know that I know that it&#x27;s your girlfriend&#x27;s, you take it as me saying &quot;hey! your GF&#x27;s there too!&quot;. However, you two might&#x27;ve broken up. If I know this, I might point at it to say &quot;maybe we&#x27;d better relocate, mate.&quot;. However, this totally depends on you knowing that I know (so that you know that I mean this and not the opposite), and me knowing that you know that I know (so I can assume that you will infer what I actually meant out of possible meanings).[2]<p>And this is just pointing. Image when we start using language to talk about the bike, or about other people and what they told us. Imagine all the management of meta-knowledge required.<p>Basically, we all do this on a daily basis. We have been trained from birth to make these kinds of considerations subconsciously in order to effectively communicate with others. And not just about what the other person knows. Also about what he expects, what kind of words he uses, what he is looking at, etc.<p>For more, read something like Tomasello&#x27;s &quot;Origins of Human Communication&quot; to get started. The more you know about this, the more you notice it around you (and start using it to your advantage). Fun stuff!<p>[1] I believe this is one of the reasons Google Translate will keep sucking.<p>[2] above example also courtesy of Tomasello, but retold from memory, so forgive me if I&#x27;ve gotten too creative!
mkramlichover 11 years ago
There&#x27;s also often no one single language that a modern software system is expressed in. Even when there&#x27;s ostensibly only one language used (Python, eg.) the total system behavior of a website is also typically expressed in SQL, sh, provisioning APIs, web server config, database config and possibly a variety of other DSLs.