3 ms·
?? I'm not complaining about code appearance. My code is completely different from his code; I use the same principles as the stuff he uses in K - create a UNI
by rzwitserloot 19y ago
??
I'm not complaining about code appearance. My code is completely different from his code; I use the same principles as the stuff he uses in K - create a UNIQUE set and check if the size of the unique set is smaller.
Trivial examples have a fundamental failure in that programming in general doesn't scale up without side effects. It's like special effects: If you try to run a scene by creating miniatures, certain effects, such as wind blowing across water, and speed, do not remain the same. You need to tweak stuff endlessly to make it 'look right' and even then there are practical issues.
I get that screencasts can't very well delve into a 3-man-year project. This does not mean that because the issue cannot be represented in a screencast, that it doesn't exist.
Take static typing for example. For trivial-to-small code samples, static typing is completely useless cruft. In LARGE (man-month or 3 with multiple developers), it's definitely useful. This is somewhat hard to explain in a screencast.
I've gone toe to toe with Slava Pestov of Factor recently regarding a JSON parser and a basic non-blocking I/O webserver, both from scratch, and factor code was smaller than java code by a factor of 90%. In other words, where I had 10k LOC, he had 9k LOC. That's a virtual wash in my book, and nothing like the usual numbers claimed.
It also depends on programming style. I find this perfectly acceptable java:
someContainer.add(title = new Label("Title Goes Here"));
whereas most java programmers would rip this up into two lines. This goes into the meaning of a 'line of code'. A massive perl one-liner clearly is much more heavy than something like "a = 5". Almost all java vs. other code contests I've seen, the relative weight of each java line is on average way less. Just because a language likes to use a lot of punctuation doesn't mean it's inferior.
I'm not apologizing for java - in fact there are tons of changes I'd like to see. I'm just saying that trivial examples and pointless comparisons (LOC comparisons without any form of context or attempt to normalize vs. statement complexity) aren't convincing.