3 ms·
Creating an object: Greeter greeter = new Greeter() or var greeter = new Greeter() Defining a constant: static final myConst = 1 Plus there ar
by vegai 15y ago
Creating an object:
Greeter greeter = new Greeter()
or
var greeter = new Greeter()
Defining a constant:
static final myConst = 1
Plus there are classes, interfaces... It's just Java?
- haasted 15y agoLooks a lot more like James Gosling, actually ....
- vegai 15y agoI had a comment above saying something to the effect of "not everyone can be Ken Thompsons" and then edited it out, sorry.
- munificent 15y ago> var greeter = new Greeter() Well, it's hard to get that much better than that. > Plus there are classes, interfaces... It's just Java? Java didn't invent classes. It certainly looks a lot like Java, but it's more Smalltalk under the hood.
- masklinn 15y ago> Well, it's hard to get that much better than that. var greeter = Greeter() there, no need for `new`. Alternatively, var greeter = Greeter.new() or var greeter = greeter new if it's not acceptable to have arbitrary callable objects. > it's more Smalltalk under the hood. The speed and wide-spread use of Smalltalk with the regularity, flexibility and terseness of Java's syntax? That sounds like a recipe for success.
- munificent 15y ago> there, no need for `new`. Agreed. I didn't say you couldn't get better at all, just not much better. I'd personally be in favor of ditching new (or conversely making it a method on the class). > The speed and wide-spread use of Smalltalk with the regularity, flexibility and terseness of Java's syntax? Oh, you. You may be right. Making a new language is crazy, especially if you're aiming for widespread adoption. Still, you have to try, right? Dart is definitely more terse and more flexible than Java. Maybe not perfect, but it's heading in the right direction. Dart is no DSL-friendly beauty like Ruby, but I think: var odds = [1, 2, 3, 4, 5].filter((i) => i % 2 == 1); is pretty tolerable without being novel enough to scare people that have never programmed outside of a curly brace language.
- masklinn 15y ago> Agreed. I didn't say you couldn't get better at all, just not much better. I strongly disagree, it makes away with a keyword and magical syntax, that is much better. > Making a new language is crazy, especially if you're aiming for widespread adoption. That's not what I'm saying, I like new languages, and I like interesting new languages, but it pains me to see you defend (or even work on?) Dart, which so far looks even worse on the programming-language-progress continuum than Go does. It barely makes any progress on the very language it's supposed to replace.
- cromwellian 15y agoWell to be fair, the language it is replacing for the most part works, it's mostly just patching up problems: ability to optimize for startup performance, ability to program in the large, and ability to write tools easily (IDEs, etc) Most new programming languages are really just variations on those that came before them. You've got you're LISP derived, your Forth/Stack derived, your APL derived, your ML derived, etc. IMHO, it's hard to consider a programming language in isolation. As far as 'feel' or 'productivity', it really comes down to the ecosystem, the runtime and tools available. Here I think is where Dart hopes to excel -- make a JS-like replacement that supports a better runtime and tools story.
- masklinn 15y ago> Well to be fair, the language it is replacing for the most part works They clearly disagree, since instead of taking part of cleanup/improvement efforts (e.g. Harmony) they decided to build a brand new language from scratch. > Here I think is where Dart hopes to excel -- make a JS-like replacement that supports a better runtime and tools story. I fail to see why that would happen, from what I've seen so far there's little in Dart which is a significant improvement for runtimes. And as far as tooling goes... well Google's history means they're unlikely to be those handling that, who's going to build tooling for Dart, and why would they have any reason to make that investment instead of improving their JS support further, or adding CoffeeScript support?
- icebraining 15y agogreeter := Greeter()
- vegai 15y ago> Well, it's hard to get that much better than that. Ok, fine, but why have both forms?
- munificent 15y agoSometimes you care about the types, sometimes you don't.
- pajju 15y agoIt is. Google is betting heavy on android. Expect more Java style languages.