Live data from Hacker News

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

ask.slashdot.org

181–190 of 199 posts

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

#181
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

You can also:

  [socket, window, file].map(&:close)
That just sends the :close message to each object in the set and returns a set of the results of each object evaluating that message. Yay, Smalltalk.

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

#182
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…

Do you mean handwritten, or just a printed hardcopy? If it was handwritten, cue loading up my handwriting as a font and typing it anyway. ;)

A couple of my programming instructors use a build system that compiles your code with three different compilers, and runs it with various tests and diffs the output with a master copy (or sometimes stress-testing and tracking memory/time/probe counts). One of them also ran valgrind on submissions. So you'd get your "accuracy score" on the same day or so as the programs were due, then the teacher/TAs would grade the source and dock points for bugs not found in the test, supreme ugliness, etc.

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

#183
post #18

Earlier quoted context omitted.

And in programming you don't have to worry about capturing the audience, the development of the characters, the story arch, being clear but not being obvious, etc. Both in programming and writing, the actual writing part is the easiest part. And while bad programmers can make a program work, and bad writers can tell a story, it takes good ones to do it coherently, efficiently and enjoyably. It's not the exact same th…

They're not nearly the same thing. The scope of modern literature has hardly moved in hundreds of years. Compare Updike, Roth, or Mitchell to Dante or Shakespeare -- they'd seem like near contemporaries in programming. In contrast, in the past, programs to do Newtons method or compute trig tables were often the full scope of a program. You certainly never had a Halo 3, Windows 7, Google Search, or WordLens applicatio…

You're looking at a pretty mature art form, although "hardly moved" seems inappropriate for a time period that includes the rise of the novel.

You might better compare the films of 100 years ago to the films of today to see an increase in complexity similar to the march of programming progress.

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

#184
post #149

Earlier quoted context omitted.

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…

The author argues that good code should be written for people. If good code were written only for people there'd be no quicksort. No fast implementations of FFT. Probably no fast versions of memcpy. The reason is that coding is not primarily about writing for other people. Look at Donald Knuth's code. Extremely well-written, yet certainly doesn't stand on its own. And there are certainly design decisions that optimiz…

The author never claimed the code should be written only for people, then it wouldn't work, would it? You're either trolling or mistaking the rest of us for complete morons.

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

#185

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…

Do you know all of the operators as well? All of the special variables? A significant portion of the regex syntax?

You don't have to know all of those to be a good Perl developer. You have to know how to read the documentation.

Everyone has their favorite ways to do things and people tend to have very strong preferences.

None of that sounds like a programming language problem.

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

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

No, because that makes it harder to understand what it's doing.

Without looking at an example of working code, how is it possible to say that one particular phrasing is so obviously better than any other that it and it alone should be allowed to exist?

I appreciate in Perl very much the postfix conditional expression syntax because it exploits the end weight linguistic property and allows me to emphasize the most important part of the statement when the situation warrants. I believe that makes my code clearer because it looks different from the Algol-standard conditional syntax.

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

#187

Earlier quoted context omitted.

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.

No, because that makes it harder to understand what it's doing. Without looking at an example of working code, how is it possible to say that one particular phrasing is so obviously better than any other that it and it alone should be allowed to exist? I appreciate in Perl very much the postfix conditional expression syntax because it exploits the end weight linguistic property and allows me to emphasize the most imp…

> Perl ... allows me to emphasize the most important part of the statement when the situation warrants.

Yes. The ordering of elements in a sentence is its "thematic" structure, just as important in communicating as the "transitive" structure of sentences, i.e the relationship between nouns, verbs, etc. Most programming languages copy the transitive structure of natural languages, but not many allow the programmer to freely choose the thematic structure.

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

#188
post #184

Earlier quoted context omitted.

The author argues that good code should be written for people. If good code were written only for people there'd be no quicksort. No fast implementations of FFT. Probably no fast versions of memcpy. The reason is that coding is not primarily about writing for other people. Look at Donald Knuth's code. Extremely well-written, yet certainly doesn't stand on its own. And there are certainly design decisions that optimiz…

The author never claimed the code should be written only for people, then it wouldn't work, would it? You're either trolling or mistaking the rest of us for complete morons.

My current theory is that programming is quite literally writing.

That's what the author wrote.

Lets take another (stupid) quote from the author: Most code sucks because we have the fluency equivalent of 3 year olds trying to write a novel.

There's no absolute nature regarding the state of ability for any given task. There is no way to map fluency in English to fluency in any other domain. It just doesn't make sense.

This is just all around lazy thinking. It's buying into a metaphor because you either don't have the ability or desire to actual think about the real issues. edw earlier in this thread actually took a little time to think about the issue. This slashdotter made no effort, had no substance, no data, just a cheap metaphor that fell apart upon first glance.

or mistaking the rest of us for complete morons

How's this for lazy thinking -- I use duck typing.

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

#189
post #76

Earlier quoted context omitted.

What you think code reviewing is for?

No, traditional code reviewing is just spot checking. That is analogous to having an editor only look at a few passages of a novel. An editor needs to work with the whole text. This is the trouble with formal code reviews. Pair programming attempts to solve this by making all code get reviewed as it gets written. Like it or hate it, that at least tries to solve the core problem.

I suppose we're not "traditional" in this sense, but at Facebook we do somewhat more in-depth code reviews than just spot checking. Generally if you're modifying an existing system, you get one or two people who're familiar with that system (and thus know the big picture of code design, layout, etc) to review your diff.

If you're writing something totally new, you usually throw ideas and mocks (either UI or code-structure) until you decide on a solution that works.

I've found this to be pretty good at helping newer engineers write good (and idiomatic) code without hindering development speed much.

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

#190

Earlier quoted context omitted.

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").

AFAIK in Quebec the preferred term is "courriel", which is a portmanteau of "courrier électronique" in the same manner that "email" is a portmanteau of "electronic mail". (Funny that we're talking about Anglicisms in French, given the vast number of English words of French origin - like "portmanteau".)

I remember reading that the word courriel is in fact a Quebecois invention.
Post reply on HN