Live data from Hacker News

Dart language

dartlang.org

271–280 of 504 posts

Re: Dart language

#271
post #144
post #135

Earlier quoted context omitted.

Awesome, your comment is a perfect epitome of the point I was making :) Convention/syntax is completely orthogonal to that point - that point being that experienced programmers don't notice the semicolons, or braces vs 'End If' (OK I realize I'm threading on thin ice with that one...) - once one reaches a certain fluency in programming and reading code, one transcends minute details like that. It's like learning how…

Bullshit elitist crap. No one can argue with you because you just claim knowledge superiority that can't be confirmed or denied. People care about this stuff, I don't care if you don't, if other people do, then it's an issue.

i prefer semi colons too. i know its annoying when you write a piece of code, then you go test it. then an error occurs, then you go look for it, and finds out that theres missing an ;

besides that, its really easier to read the code with semi colon, when you get used to it.

also.. flash got optional ;

Re: Dart language

#272
post #219
post #197

Earlier quoted context omitted.

>int bool String Object Why do some types start with lowercase and some with uppercase letter. Why not use a sensible naming convention? Primitives and objects, it kind of makes sense but I do see your point.

But the thing is, they are not primitives: > Although you might expect int and double to be primitive types, they're actually interfaces that extend the num interface. This means that int and double variables are also nums.

That's actually kind of like Haskell.

Re: Dart language

#273
post #226

Earlier quoted context omitted.

> leaky and half-featured classes. This is a common willful misconception. CoffeeScript classes are isomorphic to JavaScript prototypes -- the do precisely the same thing. In addition, there is a shorthand syntax for prototyping objects, if that's more your style: Dog = -> ... Dog::bark = -> ... Dog::run = -> ... Note that the above will produce the same result as: class Dog bark: -> ... run: -> ...

I didn't mean that CoffeeScript classes don't cover prototypes —but the other way around: prototypes can't implement the whole typical class abstraction (encapsulation, etc.). So I think CoffeeScript would do better implementing a completely new syntactic abstraction over prototyping that fix all the JavaScript awkward ambiguities than adapting classes to prototypes. But it's still OK, I like and use CS classes.

there are performance reasons for that choice, the prototypal inheritance + constructors are way faster than anything else at the moment

Re: Dart language

#274

Earlier quoted context omitted.

I have little knowledge of the latest trends in programming languages, but if your example of a good PL theorist is someone who designed LINQ, then I am going to have to take your opinion with a grain.OfType(Salt).Where(m => m.Value.Contains(nothing)).ToList ().OrderBy(m => m.irrelevance).FirstOrDefault ();

I'm not familiar with LINQ, but is that roughly equivalent to grains.select{|g| g.is_a?(Salt) && g.value.blank? }.sort{|a,b| a.irrelevance b.irrelevance }.first

Ruby tip: Instead of .sort you can use .sort_by.

    grains.select{|g|
      g.is_a?(Salt) && g.value.nil?
    }.sort_by(&:irrelevance).first
Edit: Changed from blank? to nil? since that is probably closer to nothing in C#.

Re: Dart language

#275

A question to ask yourself: If this had been Microsoft creating an IE10-only language to replace JavaScript, instead of Google, would you feel any differently about Dart?

There's probably still a few managers left at Microsoft that can recall VBScript vs. Javascript.

Re: Dart language

#276

Probably the biggest difference between JS and whatever revision to it you like, and Dart, is that dart is early-bound. That means, you can't change the list of methods or fields present on an object at runtime. It doesn't really make sense to ask "Why should I switch from a language I already love?" If you're already productive and love what you're using, then you should probably keep using it. There are people who…

I was liking Dart's syntax but the early static binding is a deal breaker for me. Javascript would've been stuck in neutral if it didn't support mutable objects.

Re: Dart language

#277
post #156

Earlier quoted context omitted.

Agree with parent comment. My opinion, so far: Overall: uninspired. Below what I was expecting. Probably good for Google goals (tooling, migrating developers, etc) The language is somewhat interesting, but unfortunately saddened by an incredibly boring syntax. At this point, I am thinking that they would have been better off just going with the Go language for this. Looks like something good to migrate fleets of java…

What does "boring Java-like syntax" mean? Can anyone show some quick examples of a boring and a not boring syntax?

    Circle my_circle = new Circle();
I have to type the word circle 3 times to define a circle. It gets boring. This gets worse if you are trying to do any kind of user input.

    BufferedReader my_reader = new BufferedReader(new InputStreamReader(System.in));
Had to type reader 4 times. :(

Re: Dart language

#278
Has programming language creation maniacs took over Google or what? What happened to Go. Why Google thinks that they can steal our precious time with these stuff. Why don't they eat their own dog food first and benefit from the nutrition and then develop sense of urgency to share it with world! I even regret to take time to write this comment.

Re: Dart language

#279
I am also disappointed, but in a different way that most commenters. I don't mind java syntax, and I prefer strongly-typed languages. My concern is that Dart seems to give up a lot vs. gwt, and not add much.

That is, with gwt you get

- strongly typed java syntax

- it abstracts away browser differences, and supports many browsers

- it lets you run mostly the same code on client and server, and gives you access to lots of java libraries on the server

With dart, it seems you get a weaker java syntax, and you lose access to all the existing java libraries on the server. You also seem to get a new interpreted server side environment. Maybe that will be better/faster than the JVM, but that is not obvious to me.

Overall, I agree with a commenter above who said that they should have defined a general VM for web browsers, similar to the JVM, but simpler/faster/more appropriate. Then, all kinds of languages could be cross compiled into it, while you could use the language natively on the server.

I think their original memo got many of the problems right - javascript has become a limiting factor in advancing web development - but I think the solution lies in a more general VM approach.

Re: Dart language

#280
post #274

Earlier quoted context omitted.

I'm not familiar with LINQ, but is that roughly equivalent to grains.select{|g| g.is_a?(Salt) && g.value.blank? }.sort{|a,b| a.irrelevance b.irrelevance }.first

Ruby tip: Instead of .sort you can use .sort_by. grains.select{|g| g.is_a?(Salt) && g.value.nil? }.sort_by(&:irrelevance).first Edit: Changed from blank? to nil? since that is probably closer to nothing in C#.

thanks. I've been writing Ruby for a few years now and I never knew about sort_by. Looks like is works in 1.8 too, but without the &: syntax

    sort_by{|g|g.irrelevance}
source: http://www.ruby-doc.org/core-1.9.2/Enumerable.html#method-i-...
Post reply on HN