5 ms·
Code's Worst Enemy
- raju 19y ago"Going back to our crazed Tetris game, imagine that you have a tool that lets you manage huge Tetris screens that are hundreds of stories high. In this scenario, stacking the pieces isn't a problem, so there's no need to be able to eliminate pieces. This is the cultural problem: they don't realize they're not actually playing the right game anymore." Well Said... On another note, has anyone here played with Groovy? I played it for a while, and I am not sure why there seems to be so much negativity about it.
- johnrob 19y agoA lot of people, myself inlcuded, want to shun Groovy because it lives in Java land. We are bitter people.
- HiddenBek 19y agoStevey had a series of articles where he implemented Sokoban in a bunch of JVM languages, and Groovy did very poorly. I can't find a live version of the article, but here's archive.org's copy: http://web.archive.org/web/20060720091555/www.cabochon.com/~stevey/sokoban/docs/article-groovy.html http://web.archive.org/web/20060720091555/www.cabochon.com/~... Groovy just seems pointless to me. It's taken too long to get anywhere, and I can't think any reason to use it over JRuby, Rhino or Scala. JRuby and Rhino have the benefit of being implementations of popular languages, basically getting years of experience, tooling, docs and code for free. Scala adds novel ideas not found in other JVM languages, and makes certain types of problems much easier than they would otherwise be. Groovy is a less powerful version of Ruby with a Java like syntax. It's awfully hard to get excited about that.
- rzwitserloot 19y agoOne of Groovy's stated aims is that any .java file is also valid groovy. It's a strict superset in other words. ... which is, in a word, retarded. I like java, but, if you're gonna start over, please, oh, please, fix some of the things that need fixing but aren't getting fixed because of backward compatibility issues. You've got a blank slate, use it!
- deleted 19y ago[deleted]
- michaelneale 19y agoWhat annoyed me was his complaint about if (a = b) ... - yet I believe every other dyn language does that perfectly validly.
- MuddyMo 19y agoHighly recommended piece from a guy who's been in the trenches.
- vegashacker 19y agosound. byte. heaven. some choice clips: "The lesson you eventually learn is that code always changes, always always always, and as soon as you have to change the same thing in N places, where N is more than 1, you'll have earned your scar." "The other seminal industry book in software design was Design Patterns, which left a mark the width of a two-by-four on the faces of every programmer in the world, assuming the world contains only Java and C++ programmers, which they often do." " 'It's not that Java is verbose!' he added." "An 'X programmer', for any value of X, is a weak player." "I can't exactly wish for something painful to happen to Java developers, since hey, it's already happening; they've already taught themselves to pretend it's not hurting them."
- Xichekolas 19y agoNo Joke! My favorite was this little gem: "Bigger is just something you have to live with in Java. Growth is a fact of life. Java is like a variant of the game of Tetris in which none of the pieces can fill gaps created by the other pieces, so all you can do is pile them up endlessly." Doing Java for the day job has made this painfully clear to me. Trying to refactor and get more DRY is a lot of effort. And this was just hilarious... "Plus everyone will spit on you. People who don't habitually spit will expectorate up to thirty feet, like zoo camels, in order to bespittle you if you even suggest the possibility of using a Lisp or Scheme dialect at your company."
- budu3 19y agoI'm impressed with javascript. I think it's a good bridge between the LISP/SCHEME crowd and the C/JAVA curly bracket crowd. I'm really rooting for it.
- michaelneale 19y agoMe too. the new ECMAscript looks like it is prescribing some sort of class structure (of course you are free to do the prototype thing if you need to). I guess its a balancing act, I like havign the power, and I am happy to discipline myself. Sure, it may have trouble scaling for large teams and codebases, but I don't wnat to work with large teams or codebases.
- budu3 19y agoYeah, I think the new proposed spec is trying to addressing that, with namespaces and the like.
- ecuzzillo 19y agoWhy do you put the names of languages that are clearly and obviously not acronyms in all-caps?
- mdemare 19y agoWhy are you discussing capitalization preferences with complete strangers?
- mynameishere 19y agoHeck, I've never managed to get Eclipse to pull in and index even my 500,000-line code base, and I've spent weeks trying. It just falls over, paralyzed. It literally hangs forever He probably just needs to disable automatic builds. There are other automatic features that can be disabled as well. Eclipse can be stripped down like anything else. nothing that would permit the removal of the copy-and-paste duplication patterns that Java programmers think of as "inevitable boilerplate", but which are in fact easily factored out in dynamic languages. You know, I've never heard the phrase "inevitable boilerplate" from a Java programmer, though his quotation marks suggest that he has. There are some things that can really be shrunk down in non-Java languages, but a lot of the examples that people point out are harmless: System.out.println("output here"); or for (Object obj : list) { } These sorts of things don't really add to complexity. Too bad he didn't provide any specific examples of his own. Typically, when attacking Java (the most common sport in the software world today) people will pretend it has disabilities it doesn't have. like non-broken closures, that the Java community is resisting tooth and nail Another phenomenon I haven't seen too much of, I guess. Most resistence probably comes from people who know what will happen, rather than people who dislike the feature in and of itself... I'll say this about Java, since I get the impression that a lot of ynews people are in college or just out of college: I've had gigantic mountains of Java code thrown at me that I could make useful modifications to in minutes. It is hard to obfuscate. By contrast, I have dealt with Javascript codebases that were a nightmare to work with simply because the previous guy thought it useful to graft functions onto objects (or is it "prototypes") at runtime. Nice feature, if you're not inheriting it...
- michaelneale 19y agoI work on about 400K lines every other day in eclipse, no issues. Of course things are broken down into modules, maybe that helps a bit. I don't like eclipse at all, but I don't understand their complaints. Maybe back in 2003 that was a problem.
- fauigerzigerk 19y agoI've heard Java people defend boilerplate code countless times. Just take getters and setters. People will tell you "the IDE generates them anyway". What you can't do within the bounds of the language is to loop over all accessors and replace them with something else that might call the original versions. A technique that's used frequently in Rails for instance. To do that in Java you need code generators (probably built into IDEs), frameworks that supplant the entire object creation mechanism to hook in proxies, or byte code manipulation. All of these techniques are orders of magnitude more complex and error prone than dynamic metaprogramming or lisp macros. And despite all the complexity some things just can't be done. There is no way to call a Java method (using regular method call syntax) that the compiler doesn't see. So even if you know the method will be there because some other code will have created it by the time it is invoked, you still need to put a useless method stub somewhere in the source code.
- bayareaguy 19y agoSo "JavaScript", which once had nothing at all to do with Java proper, may now be the best language to target the JVM. Oh the irony...
- michaelneale 19y agoNot only that, but its in a useful form in the most common client platforms today (browser, and flash ! - of a fashion). In many cases javascript is fullfilling the promises of lisp. Complete with REPL on the client platform itself (firebug, for instance). May not be what you expect, but its there, its its not too shabby.
- staticshock 19y agoin the browser, javascript's REPL is essentially the address bar. you can type in javascript:alert(2+2) to output 4, or javascript:void(code) just to run an expression and swallow the output. to evaluate expressions more complex than a one liner you can inline a function, javascript:alert((function(){var x = 2; return x+x;})()). that's how bookmarklets work.
- michaelneale 19y agoFor a more psychadelic version, try this: javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(Rx1+ix2+x3)x4+x5; DIS.top=Math.cos(Ry1+iy2+y3)y4+y5}R++}setInterval('A()',5); void(0); (in address bar)
- deleted 19y ago[deleted]
- staticshock 19y agothe auto-formatting swallowed the multiplication symbols. the actual code should be this, with "TIMES" replaced by the multiplication symbol. is there any way to escape them? javascript: R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R TIMES x1+i TIMES x2+x3) TIMES x4+x5; DIS.top=Math.cos(R TIMES y1+i TIMES y2+y3) TIMES y4+y5}R++};setInterval('A()',5); void(0);
- lkozma 19y agoOne of the best writings from Yegge and it makes perfect sense. One of the reasons I always admired SQLite for example is that it has a self-imposed limit on size and thus complexity, and the author keeps adding new features, but still manages to stay within that (strict) bound.
- brlewis 19y agoMaybe people won't spit at Scheme on the JVM after they see another web site using it successfully. http://news.ycombinator.com/item?id=91206 http://news.ycombinator.com/item?id=91206
- michaelneale 19y agoI would love to use scheme, especially on the JVM. But its a bit like going nude on a beach. Don't really want to be the first one in the crowd to do it. Hmmm.... did I just type that or think it ?
- brlewis 19y agoI'm willing to be the trailblazer on this one. Help me succeed. Find some people who have a lot of photos that they can never find time to organize for sharing. Point them to my site. When a popular site is using Scheme on the JVM, you using it isn't such a far-out proposal any more.
- pchristensen 19y agoI'm working on a directory of Lisp companies (that I started today), and I put you at #2 right after ITA Software. Caveats: 1) There are only 2 on the list so far - but I'm adding more 2) I haven't published it yet - but I will soon and solicit feedback 3) Nobody reads my blog - but I've just started in earnest and need to beef up publicity in order to get exposure for my startup I'm planning on Common Lisp and Weblocks for my startup (just because), but I must admit that both Kawa and PLT Scheme intrigue me.
- MuddyMo 19y agoI second that "cool". Hey, nobody reads my blog: muddymo.blogspot.com (well, a few do) but I will link you on my blogroll. Send me an email when you are ready.
- michaelneale 19y agocool - good luck, I will have a go.
- crucini 19y agoSomething doesn't add up. Steve is hoping for a 50% - 75% reduction in LOC. In other words, he hopes to compress by 3 or 4. In other words, a mere linear reduction. Is that worth a complete rewrite? Remember the lesson of the Mozilla rewrite? http://www.joelonsoftware.com/articles/fog0000000069.html http://www.joelonsoftware.com/articles/fog0000000069.html Rewriting does nothing for users. I'd like to know what the 500k lines are doing. It's a game. Are there numerous classes representing physical object types and character types? Could these be expressed as data, or in a domain-specific language, or using an embedded scripting language like Lua? I'd prefer any of those three solutions to rewriting the whole app in a scripting language. If the codebase does contain a degree of data-as-code, it's better to factor that out.
- Darmani 19y agoI'm one of those quarter-million people who have an account on Wyvern, Yegge's game. All maps, game objects, and NPCs/monsters are in XML, though ones with odd, specific behavior also have a corresponding code file. I'm not sure about races, but it doesn't make much difference, considering there are around twenty races and thousands of maps, objects, and monsters. Wyvern is wrought with fair-size bugs (e.g.: hydras and other monsters with multiple attacks can kill players multiple times at once) that have been around for years, despite multiple attempts at fixing them. He had complained frequently enough about the difficulty adding major features with the codebase's design. It certainly would do something for the users. If you want to see what those 500k lines are doing, check out the API docs at http://web.archive.org/web/20060820070049/www.cabochon.com/api/index.html http://web.archive.org/web/20060820070049/www.cabochon.com/a...
- henryw 19y agoLOL "Java is like a variant of the game of Tetris in which none of the pieces can fill gaps created by the other pieces, so all you can do is pile them up endlessly."
- soundsop 19y agoHis writing needs compaction too.
- pchristensen 19y agoYes, he should write short and succinct articles like Paul Graham or Joel Spolsky :) With written or spoken communication (as opposed to visual), you have to say things a lot of times, in a lot of ways, to get people to listen. Which is more memorable - this or a Valleywag post?
- davidw 19y agoMost of pg's articles feel like they have less fluff to me. They may be long, but most of the writing feels like it has a point. A bit less so with Steve Yegge, or perhaps it's more hit and miss...
- Goladus 19y agoThere's a lot of humor in pg's essays but overall Yegge is more consistently funny and often downright hilarious. He'll often have a valid point, but equally important is the goal of presenting that point in an entertaining way. I think of it less as fluff and more of a tasty cream filling. Yegge has an exceptional sense of comic timing in writing, and sometimes it takes a bit of buildup. Imagine a kingdom of nouns and verbs, where nouns have lots of rights and verbs are oppressed. Imagine replacing all the verbs with just one verb, 'execute!' Get it? Verb/execute/oppression?? I guess not, not when I try to cram all the ideas into 2 sentences. Sure it takes Yegge a page or so to get there, but the payoff is a hearty laugh.
- edw519 19y agoIn my case, there seems to be an invisible "limit" as to how much I'll read. For a book, it seems to be about 300 pages. For an on-line essay, x words (I really don't know how many), but about 5 to 10 minutes. When I'm working (always), I don't want to take a break for much longer. I realize that this may not be the best belief system - still haven't read "War and Peace", but that's just the way it is. This essay looks to be about 5 times as long as I could easily handle during the work day. You lost me at "continued".