Live data from Hacker News

What can you do in 2k LOC of C?

h4ck3r.net

61–70 of 110 posts

Re: What can you do in 2k LOC of C?

#61
post #39

Earlier quoted context omitted.

It's a show of thanks for taking the trouble to give a solid answer backed by facts. Just as bad memes are publicly swatted down, good work (even small) should be praised to set an example for others.

If actual facts are that rare in software engineering, then that's one hell of a "code smell". It really wasn't hard to get.

Facts are pretty common in (good) software engineering, but they're rare in Internet discussion. Hence, solid facts in Internet discussion tend to rack up points.

Re: What can you do in 2k LOC of C?

#62
post #47

Earlier quoted context omitted.

> http://pastebin.com/s2usuqDq I'm going to save this for the next time someone asks why there aren't more females in CS/programming. I just tell them that this kind of code is held in high esteem, instead of being ridiculed for the stupidity that it is.

Are you saying that women can't appreciate elegance and brevity? Perhaps your kind of attitude is why there aren't more females in programming.

Or perhaps it's people who mistake obfuscation for elegance and brevity.

Re: What can you do in 2k LOC of C?

#63
post #62

Earlier quoted context omitted.

Are you saying that women can't appreciate elegance and brevity? Perhaps your kind of attitude is why there aren't more females in programming.

Or perhaps it's people who mistake obfuscation for elegance and brevity.

I'd love to hear why that code doesn't embody brevity?

As for obfuscation, it's rather straightforward -- it's just concise. A lack of instant understanding doesn't indicate that a piece of code is without merit, or not honest and straightforward.

Re: What can you do in 2k LOC of C?

#64
post #27

Earlier quoted context omitted.

That's interesting, but damn is that some ugly code. Slightly obfuscated on purpose? Though of course it wouldn't win the IOCCC. On the other hand, it's notable that many IOCCC submissions happen to pack a lot of functionality in often less than 2k. I remember reading a few descriptions of some the winning entries, but I can't find that now. Here's a glimpse though: http://cboard.cprogramming.com/brief-history-cprogr…

"That's interesting, but damn is that some ugly code" I would disagree. That code is beautiful. Elegance and brevity; it's as close to a pure expression of the coder's thoughts as it's reasonably possible to get.

Excuse me, but in my programming thought flow, there are checksums and limits, not c's and l's, and my code reflects that. Do I not qualify as a coder?

Re: What can you do in 2k LOC of C?

#65
post #19

Earlier quoted context omitted.

This is also why we have many more softwares available now. The improvement in hardware specs are so useful not only because it is faster, but also because we can do much more without having to care about the details. Writing tiny, efficient libraries is cool, but it takes a lot of time, everything else being equal, so if you can afford not doing it, you don't.

> This is also why we have many more softwares available now. Assuming English isn't your first language, that would be phrased "much more software"; software is always singular.

More precisely, it's a mass noun (as opposed to a count noun).

Count noun: a program, some programs

Mass noun: some software. (you can't say "a software" or "some softwares")

Re: What can you do in 2k LOC of C?

#66
post #19

Earlier quoted context omitted.

This is also why we have many more softwares available now. The improvement in hardware specs are so useful not only because it is faster, but also because we can do much more without having to care about the details. Writing tiny, efficient libraries is cool, but it takes a lot of time, everything else being equal, so if you can afford not doing it, you don't.

> This is also why we have many more softwares available now. Assuming English isn't your first language, that would be phrased "much more software"; software is always singular.

http://www.ar.media.kyoto-u.ac.jp/members/david/

"David Cournapeau

a French PhD student in signal processing at Kyoto University"

France and Japan...he hasn't exactly been living in places where English is prominently spoken with grammatical accuracy...cut him some slack. In fact, he made the exact same error of pluralizing "software" as "softwares" on his website.

Re: What can you do in 2k LOC of C?

#67
post #55

Earlier quoted context omitted.

I can think of plenty of comments that were /actually/ insightful, though. This feels like, "oh, wow, you know how to use science! +1". sad.

It's not sad at all. HN is, for me at least, primarily a place for learning. I scan comments for people speaking of facts and first-hand experience, or links to similar things. You provided some hard data, and some people who appreciated it pressed the up arrow. It's nothing more than that, and certainly not sad.

Fair enough. I wish it was less rare though.

Re: What can you do in 2k LOC of C?

#68

Earlier quoted context omitted.

"That's interesting, but damn is that some ugly code" I would disagree. That code is beautiful. Elegance and brevity; it's as close to a pure expression of the coder's thoughts as it's reasonably possible to get.

Excuse me, but in my programming thought flow, there are checksums and limits, not c's and l's, and my code reflects that. Do I not qualify as a coder?

I obviously can't speak to Arthur Whitney's state of mind circa some summer afternoon 1990, but I don't believe the code is an attempt to obfuscate or be snobby/elitist at all. He was simply trying to express the basics of an idea in a terse form. It's the APL way.

I, for one, am happy simply finding the code 'of interest'. It's not great code, it's the initial sketch of an idea (I'll bet you AW would admit that readily (plus Roger Hui refers to it as "Incunabulum", which seems a bit tongue in cheek)) -- but, it's certainly not something you see every day, and it is thought provoking.

Re: What can you do in 2k LOC of C?

#69

Earlier quoted context omitted.

"That's interesting, but damn is that some ugly code" I would disagree. That code is beautiful. Elegance and brevity; it's as close to a pure expression of the coder's thoughts as it's reasonably possible to get.

Excuse me, but in my programming thought flow, there are checksums and limits, not c's and l's, and my code reflects that. Do I not qualify as a coder?

Quick, what does the i stand for in "for (i=0; iIt was a quick prototype written by one APLer, for another APLer, using mutually understood conventions. For example, its dyadic verbs ("V2" functions) use the variable names 'a' and 'w'. For a while, I wondered why (maybe they stood for "Arthur" and "Whitney"?), but after reading Iverson's _A Programming Language_, I realized APL usually uses lowercase alpha (α) and omega (ω), which look like 'a' and 'w' in ASCII. Details like that would need no explanation.

Likewise, in

    typedef struct a{I t,r,d[3],p[2];}*A;
t is type (is it boxed? 0 or 1), r is rank (number of dimensions), d is the dimensions (hardcoded to a max of 3; a 2x3x4 matrix has d={2,3,4}), and p is a variable-length array sized by malloc-ing extra space; that's where the values go, either longs or void pointers). That'll save you some time if you ever try to pick the rest apart. :)

APL code is often terse to the point of seeming cryptic, just math papers are. You get used to it, and it's that way for a reason.

Post reply on HN