Live data from Hacker News

"My current theory is that programming is quite literally writing."

ask.slashdot.org

161–170 of 199 posts

Re: "My current theory is that programming is quite literally writing."

#161
post #148
post #144

Earlier quoted context omitted.

Just curious, is that taken from an actual language? Because I've wanted a feature like that for ages.

It exists in Ruby: [socket, window, file].each{|item| item.close()} http://codepad.org/GqNp94Iw It sort-of exists in Lisp-inspired languages (anything from Arc to Lua to Io) with appropriate boilerplate, for example: function apply(tbl, func) for key, val in ipairs(tbl) do func(val) end end apply({socket, window, file}, function (item) item.close() end) http://codepad.org/SNWO1Y6K

It also exists with slightly different boilerplate in Perl:

$_.close() for $socket, $window, $file;

Re: "My current theory is that programming is quite literally writing."

#163

Earlier quoted context omitted.

Translation?

"Yes, delivery. We can do it." Edit: - I should point out that the French word for delivery is livraison ; but like most languages, day-to-day Quebecois French is porous enough to borrow words from other languages where expedience warrants. Hence le week-end (not le fin-de-semaine ), frencher (to French kiss), etc. As a further digression, I should point out that it seems less common (i.e. less acceptable) to drop an…

Of course, the French Academy tries to crack down on this; I remember cases like trying to push out "email" in favor of the native "courrier électronique" (literally: "electronic mail").

Re: "My current theory is that programming is quite literally writing."

#164
post #144
post #52

Earlier quoted context omitted.

Better prose is: "He rushed to the exit, leaped down the stairs, and ran for the train." Better programming is to factor out the action: [socket, window, file]*.close()

Just curious, is that taken from an actual language? Because I've wanted a feature like that for ages.

I believe it exists in Cω via "generalized member access" without recourse to map/foreach-type constructs.

Re: "My current theory is that programming is quite literally writing."

#165
post #144
post #52

Earlier quoted context omitted.

Better prose is: "He rushed to the exit, leaped down the stairs, and ran for the train." Better programming is to factor out the action: [socket, window, file]*.close()

Just curious, is that taken from an actual language? Because I've wanted a feature like that for ages.

When I wrote that I meant it to be pseudocode, but it does seem to be valid Groovy syntax:

    class A{
      def close(){println "closed"}
    }
    def a1= new A()
    def a2= new A()
    [a1, a2]*.close()

Re: "My current theory is that programming is quite literally writing."

#166

Earlier quoted context omitted.

Who is the average Perl developer? I'm a student. I should probably know less about Perl than a junior Perl programmer - and I know almost all the keywords. Is simple.wikipedia.org really better than wikipedia.org for the average English speaker? If your only argument is that simpler language lets more people understand, why bother saying words like "unknowable"? Why not say "not knowable"? Isn't it superfluous to ha…

Do you know all of the operators as well? All of the special variables? A significant portion of the regex syntax? The four different ways to call subroutines and the effects that each method has? The list goes on and on and on. I work with about a dozen Perl developers and there are only a couple of us that know a significant portion of the language. Problems occur when someone uses a less common piece of syntax and…

You could have been easier to understand if you simply said "nope, you're wrong". But instead, you went on for three paragraphs describing your point of view. You even used a word I had forgotten the definition of: "operators" (Yes, I had to look up the exact definition). Yet I understood everything you said with no ambiguousness.

Was this incorrect? Was explaining your point of view inefficient or causing problems in understanding? I think you inadvertently showed how expressive language has enormous benefits, even if people can never understand it 100%.

Re: "My current theory is that programming is quite literally writing."

#167
post #67

Earlier quoted context omitted.

> The fewer ways to express something, the better. Your last sentence could be rewritten "It is better to express things in as few ways as possible", or "Having fewer ways to express something is better". English, however, allows you to omit the main verb for the causation in a parallel construction, you were able to write it shorter, and with a 3-syllable climax after a pause at the end for effect. Shouldn't program…

No, because that makes it harder to understand what it's doing. Remember that programming languages are not learned at a very young age and continuously trained for decades the way natural languages are.

The era of programming languages is only beginning, and perhaps within a generation or two programming languages will be learnt at a young age and continuously trained for decades.

Perhaps there'll only be a small number of languages that people learn, so people will have a "native" programming language in the way people have a native natural language.

Re: "My current theory is that programming is quite literally writing."

#168

>We should be immersing students in good code. We should be burying them in idiom after idiom after idiom, allowing them to acquire the ability to program without explanation. Does anyone have suggestions of some good code to read?

You'll probably have the best luck dissecting a program you're interested in.

Re: "My current theory is that programming is quite literally writing."

#169

Earlier quoted context omitted.

Translation?

"Yes, delivery. We can do it." Edit: - I should point out that the French word for delivery is livraison ; but like most languages, day-to-day Quebecois French is porous enough to borrow words from other languages where expedience warrants. Hence le week-end (not le fin-de-semaine ), frencher (to French kiss), etc. As a further digression, I should point out that it seems less common (i.e. less acceptable) to drop an…

Just a side note, in France too we say week-end... Fin-de-semaine is usually used to mean at the end of the week (for example what people would say at work if they expect the answer to come before friday evening..)

Re: "My current theory is that programming is quite literally writing."

#170
post #84
post #3

I think he's right. In college, my CS 2 class was taught by a professor very different than the rest of the teachers there. He wanted all of your programming assignments on paper[1]. Then, you'd get it back with every possible bug marked in your program, and he very rarely missed any[2]. That was the first time in college I thought "I really need to learn how to do that!" I went to a state school, so maybe all you gu…

One thing I picked up (luckily) early on was that when you are learning something the fastest way to actually learn it was try to help other people learn the same thing. For programming this meant helping out on assignments in the labs, reviewing code etc. Very quickly you find yourself seeing a wide variety of bad practices and can recognize common mistakes and good practices. As a bonus you have to actually know th…

this is very true. at my current company the last person who worked with the huge part of the code i write left about a month after i started. this left me constantly scrambling to figure out how to fix bugs that would come up in parts of the code i never even knew existed. I was managing ok but when we hired new developers, me having to teach them the little bit i knew caused me to understand the code way better than i had before.

I've decided my new method of training employees will have the most recently hired employee train the new hire.

Post reply on HN