42 ms·
I'm a Lisper and am usually firmly in the Java-hater camp, but I downvoted you because of your last line, and because of your claim that C will have closures be
by spacemanaki 15y ago
I'm a Lisper and am usually firmly in the Java-hater camp, but I downvoted you because of your last line, and because of your claim that C will have closures before Java. That's simply too much of a stretch.
Java already has inner classes (and anonymous inner classes) which are much closer to closures than anything in C. They are syntactically clunky and using them like first-class functions is only kind of idiomatic so not many libraries leverage them for their full effect (although see the Google Guava libraries for examples of interesting usage). But if you squint they are pretty close to closures. I find the whole closures-in-Java debate very tired because of this.
Also, writing Java for Android isn't that bad, although I'm not qualified to compare it to Objective-C for iOS. I would like to become qualified though, because I love my Mac and I love my iPod Touch. My point being that I'm a bit biased but not a fanboy.
- fleitz 15y agoC already does have closures on the compilers I use.
- spacemanaki 15y agoIt occurred to me that Apple might have added extensions to C and C++ along with whatever is in Objective-C, and went off to look it up. So today I learned something new: http://en.wikipedia.org/wiki/Blocks_(C_language_extension)#Examples http://en.wikipedia.org/wiki/Blocks_(C_language_extension)#E... But it's almost as ugly as the equivalent Java, and I'm pretty sure the equivalent existed in Java 1.0^, while this apparently is new as of OS X 10.6 and iOS 4. I still think it's disingenuous to say that "C will have closures before Java" when this is a nonstandard extension. If you think it's easier to work with, that's totally fine. But then we're just arguing over syntactic noise and frankly I don't like either syntaxes. And I still don't think it's constructive to talk about a programming language as a ghetto. ^ Nope, I think I was wrong. Nested and inner classes were added in 1.1
- fleitz 15y agoI'm not thrilled about the block syntax either, I do prefer it to java. I'd much rather a C#, F# or ruby style syntax. It's not that you CAN'T accomplish a bunch of things in Java it's just that it's a pain to do so. When one looks at java they see a language spec and virtual machine dominated by a bunch of people who are resistant to any improvement that might break compatibility with code written in 1994. Those people or their employers also use various capricious tactics to stall anyone else from improving it. It's essentially been left to rot while the owners of the language strip mine the value. When a situation such as that exists I think the word ghetto is the perfect way to describe the ecosystem. Java is an ecosystem designed to cater to the task masters who oversee the pair programmer chain gangs in the cube farms. If they are happy with that lifestyle then so be it. Who am I to say they can't live that way. But it doesn't make it not a ghetto.