Live data from Hacker News

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

ask.slashdot.org

141–150 of 199 posts

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

#141
post #10

Oh come on. Programming is not writing. When you're reading a novel you don't have to worry about concurrent access to a resource, threads, asynchronous events, or even much less conditional branching. With all due respect, I think this is just an inane post. That said, I can't blame the guy for dropping software development and moving to Japan to teach ESL. I often entertain similar fantasies all the time - programm…

When I'm programming, I like to call race conditions "dramatic irony."

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

#142

Earlier quoted context omitted.

meh. i work at a small shop. most of the code i see that sucks was written by competent programmers under high schedule pressure. the code is clearly not well understood anymore, but if you trace the history you can see it's due to a few years of tacking on features as quickly as possible. the technical debt surely slows us down sometimes, but hey that was a business decision, maybe even a correct one! core business…

I get tired of the "blame the shitty programmers" line of thought. We're all shitty programmers. Yet we all "understand variable scope" and "what the code was supposed to do." Some of us have such a large ego that we think it's others. No, Sancho. It's you. Code gets complex as hell very quickly. If it was building a house, it would be built in a week and architected on the fly. The person mixing the concrete, who ha…

I agree that we are too slow to point the blame at ourselves. It's healthy to be self-critical.

That said, there are programmers who are legitimately lacking both in basic skills and desire to attain those skills. It's orthogonal to the problem you're talking about, but these people do exist, and they're not as uncommon as one might hope. I can teach the difference between pointers and references; I can't teach you to care.

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

#143
post #44

Earlier quoted context omitted.

Uniformity in code is bad - it tells you that there's a common concern or pattern which should be factored out. Uniformity in code style is essential, the same way it is for prose.

Is it? In prose you say "first he rushed to the exit door, then he leaped down the stairs, finally he ran to get the train" while in programming it is better to write socket.close(); window.close(); file.close()

You don't want to write one paragraph like a romance novel, another like a patent application then a third like an advert.

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

#144
post #52
post #44

Earlier quoted context omitted.

Is it? In prose you say "first he rushed to the exit door, then he leaped down the stairs, finally he ran to get the train" while in programming it is better to write socket.close(); window.close(); file.close()

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.

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

#145
post #14

Earlier quoted context omitted.

All true facts unfortunately. To get better teachers you have to attend a "teaching" college/university. This name is detrimental, as most students would probably be happier at such a place. The "research" university really isn't for everyone but they get the most prestige and people think, oh I should go there learn from the "brightest mind in the field".

The value of Stanford, MIT, CMU, etc. isn't that the professors are so good at teaching; it's that they are smart student aggregators. Nothing motivates you like not being the smart one anymore.

That might be true of some people. For someone coming from a small town where everyone told him that he would go on to do amazing, wonderful things, it can be very depressing for him to learn that he is nothing special.

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

#146

Earlier quoted context omitted.

Why?: die unless $file; if (!$file){ die; } Which is neater? Should I not be able to write the first one?

The problem is that the language becomes virtually unknowable. Perl has a ridiculous amount of syntax. I am sure that I could find half a dozen lines of Perl code that the average Perl developer would not understand because everyone only knows part of the language.

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 have these words in your vocabulary?

Being able to accurately express an idea quickly has it's value.

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

#147
post #10

Oh come on. Programming is not writing. When you're reading a novel you don't have to worry about concurrent access to a resource, threads, asynchronous events, or even much less conditional branching. With all due respect, I think this is just an inane post. That said, I can't blame the guy for dropping software development and moving to Japan to teach ESL. I often entertain similar fantasies all the time - programm…

> programming is a great way to have the zest for life sucked straight out of you

Sounds like you're in the wrong field. Just because you find the thing a drudge doesn't mean others feel the same way, and personally I find the cynical 'well real-world programming is ultimately crap' specious and poisonous - to you it is, to me it is not. Why are you still doing it? And why are you stating it like it's some immutable fact we are all avoiding somehow?

Personally, I find programming a wonderful, amazing thing even when working on the most incredibly dreary software, and of course considerably more so when working on the more interesting stuff.

This kind of stuff is unfortunately common and applicable any + all professions + activities out there. If everybody listened to the nay-sayers, nobody would have tried doing anything.

tl; dr: haters gonna hate.

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

#148
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.

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

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

#149
post #112

Earlier quoted context omitted.

They have one more thing in common; the text is read by other people . And the better written, the more effortless it is to understand. I think this aspect of it is what the slashdot author is mostly talking about, suggesting that if you write code as if you were writing to the next programmer , rather than to just the computer, your code will be better for it. Clearly, programming and writing isn't the same thing. N…

Unfortunately, this metaphor breaks at the onset. Programs aren't primarily written to be read by people. They're primarily meant to enable functionality. Readability of code is important, but not the ultimate ends -- it is part of the means. But the important part of my post was that programming is about automation. It's not about weaving a story, even for the next programmer. It's about building abstractions for au…

The author argues that good code should be written for people. The metaphor doesn't break just because you disagree with the author's point.

IMHO, any dolt can produce code that only works. All too often I have to sift through horrible code that works, and I think the author is right in that if the programmer who wrote that (sometimes that's me, sometimes it's someone else) had had the next programmer in mind when he/she wrote it, it'd be much less of a pain.

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

#150
post #10

Oh come on. Programming is not writing. When you're reading a novel you don't have to worry about concurrent access to a resource, threads, asynchronous events, or even much less conditional branching. With all due respect, I think this is just an inane post. That said, I can't blame the guy for dropping software development and moving to Japan to teach ESL. I often entertain similar fantasies all the time - programm…

> programming is a great way to have the zest for life sucked straight out of you Sounds like you're in the wrong field. Just because you find the thing a drudge doesn't mean others feel the same way, and personally I find the cynical 'well real-world programming is ultimately crap' specious and poisonous - to you it is, to me it is not. Why are you still doing it? And why are you stating it like it's some immutable…

Point taken. I wish I were you!
Post reply on HN