Tag Info

Hot answers tagged

60

Thanks for your question! Full disclaimer, I work on the Dart team. Probably the best advantage Dart has today is that it's familiar to C#, Java, C++, and most JavaScript developers. Many developers have a set of expectations around their language (class-based OO, lexical scope, familiar syntax) and their tools (code completion, refactoring, code ...


46

While the question was "Are the purposes of the languages the same?", the real question is: "How can we make web programming better from where we are?". Both projects try to do this considering programming language (TypeScript makes a small but very clean step, Dart makes the more revolutionary move that is still moving) interoperability with existing js ...


42

Quoting Bob Nystrom: TypeScript seems nice if you like JS semantics or have a large JS codebase that you're invested in but you're having maintenance problems at scale. It's path for success is much smoother since it's (mostly?) backwards compatible with JS. Dart is taking a riskier bet. It's farther from JS in a lot of ways which is, I ...


27

The short answer to "What's the state of Dart?" is: it's in Technology Preview. That's a special way of saying, "we launched early so we can open source everything and work in the open." "Technology preview" also means "we're not even in Alpha yet, we have a lot of work to do, but there's enough there for you to play with and give feedback." Internet time ...


26

1) All Javascript numbers are specified to behave as per the IEE-754 double precision floating point specification. This means that You can't opt to use normal integers (for conciseness or speed). Your best bet here is having your compiler optimize this behind the scenes (but at the cost of perhaps having to add runtime checks and other annoying things) ...


20

The short version: CoffeeScript if you much prefer Python or Ruby-style syntax and you're uncomfortable with JS's uncomplicated approach to OOP TypeScript if you actually like JavaScript and find the idea of using Microsoft's kludge for the problem their own browser versioning approach created appealing and maybe it's really only not having the word ...


15

Quoting Scott Hanselman: People have compared TypeScript to Dart. That's comparing apples to carburetors. TypeScript builds on JavaScript so there's no JS interop issues. Dart is a native virtual machine written from scratch. Dart interops with JavaScript...but it's not JS. It doesn't even use the JavaScript number type for example. From Why ...


15

Fluent interfaces are easily supported in C# by using return this. In Linq, extension methods are used to accomplish the same thing. Extension methods over IQueryable or IEnumerable are easily chained together. Cascades, as described by the page at the link you provided, seem to be merely a subtle refinement of an ordinary Fluent Interface where return ...


11

Writing quite a lot of C# at work, the language feels very much like what I'm used to That's one point about Dart. Javascript is considered an awkward language with few general idioms. In a language like Java there is often a natural way to approach a problem. For instance if you keep an inventory of table, in Java or C# you will create a class ...


8

Some known problems with javascript are: Many don't understand some core JS concepts, like the prototype concept …those people usually claim they miss: some clean cut class syntax some clean cut inheritance and interfaces static typing They want the whole OO package, just as college taught them over Java, and they ain't gonna bend much. Note: ...


8

You can't measure programming language age in "internet years". In fact, you can't measure any actual technology in internet years. All you can really measure in internet years are hypes, but hypes don't reflect reality. Dart is public since 3 months now. Compare that to the "fresh" and "hot" techs in the field, like CoffeeScript or Node.js, which are ...


8

Yes, if the code is under the GPL and you deliver the outputted JavaScript, you must also provide the original Dart code. This would typically be done with a link to download the source code from your site but you could also embed it in a comment or something like that. I think the easiest way to comply with the GPL in this case is to use option d for ...


6

Actually you can use $ as a a prefix to variable names. I tried it for you: http://try.dartlang.org/s/lKco Please note what happens to the great string interpolation feature. Basically you can access vars in a string with ${yourvar}. If you name a variable with $, then it looks ugly: ${$yourvar}. Therefore I do not recommend the $prefix style. I have ...


5

Dart doesn't threaten the open web. There isn't one browser dominating the market right now so web developers can't afford having their site work well in one browser only. Even if Chrome has an optimized Dart VM it wouldn't make sense for a website to depend on it given the current browser landscape. I don't see Dart being adopted outright by other browser ...


5

Dart is still in technical preview. At the moment the language specification has the version 0.0.6, a 0.0.7 is expected somewhere this week. It is far from "complete". There are several example in the repository: http://www.dartlang.org/samples/index.html Here is one view on what is better in syntax terms than in JavaScript: ...


5

For me, it gives me the chance to structure my code better than JavaScript with scope and classes. It's similar to Java and JavaScript and with Dart editor, I had close to zero adaptation. I started coding straight away. var ws = new [Moz]WebSocket having to cater for different browsers is annoying. Dart compiles to JavaScript code compatible with ...


3

Had to chime into this discussion with my own finding lately. 1st: TypeScript MS has taken a nice approach in the fact that you can easily jump in and out of TS and JS. We mainly use AngularJS for our development and have found while not much documentation exist for converting Angular to TypeScript. It has been a nice addition to incorporate TypeScript ...


3

JS got plenty of things right, but IMO there are also plenty of things wrong: The lack of a import / module system How easy is to make a variable global without noticing The very awkward syntax for defining a prototype chain (having to define a function and then add stuff to the prototype of the function). There is a _ proto _ object that is extremely ...


3

There is nothing wrong with Javascript at all. I write in javascript for last 3 years and I that is my primary language cause I use an ExtJS framework. At one moment I was convinced to use JSLint - saves me from most of stupid errors. Also I had to realize what is prototype, function, constructor, THIS (that was really hard at first but one moment I started ...


2

The reason why most language designers don't like constructs like starting variables with special chars is that most language designers want to minimize the amount of repetitive "stuff" that is required of the programmer, so long as the compiler / interpreter can figure it out. So, to many language designers, the code: var x = new Something() has less ...


2

First of all we are talking about GPL, not AGPL. If you do not distribute a GPL'd the application, if you run it on a server, you don't have to provide the source code. There is AGPL for that. GPL is all about distribution. From Drupal FAQ: Do I have to give the code for my web site to anyone who visits it? No. The GPL does not consider viewing a ...


2

A huge part of a JaveScript program has to do with the DOM (the objects that JavaScript works on, e.g. typically all of the stuff that shows up on your screen), and that is not actually part of JavaScript but ties a given JavaScript code to it's DOM. So for example, the JavaScript on FireFox and IE might be similar or even identical, but differences in ...


1

This sounds like the exact kind of job people used PERL for back in the day. Most of it was very simple to set up. We would create a HTML form or two. The information was submitted to a Perl (later Python) script that easily pull info out and merged it into templates. The regular expressions and string processing features will help with requirements like ...


1

No more than any other language. There are plenty of inconsistencies between JavaScript engines - in fact, that's why most JavaScript frameworks, including jQuery, get started - trying to smooth those differences over. And that's before you get into platform-specific aspects. For example, Palm OS phones used JavaScript as their primary app language. But ...


1

When I think of Java I tend to think in packages, not "modules", but I guess I'm too back-end/API oriented. Modules are front-end/use-case oriented and should be mostly in the view/controles layer. In the business logic/model layer you should not worry about "module" size, since classes, interfaces etc, would be in packages. In the ...


1

Constructors are where you should construct things. That's why they are so named :) The alternative to constructing everything in the constructor is that you will have a half-constructed object that you then rely on the rest of the program to handle well until its had its properties initialised. This makes things more complicated than they should be - ...


1

In general, it really depends on the license. In your case, Dart is a bad example since it's BSD, and it seems GNU 3.0 covers the case you are talking about. As a non-lawyer I would interpret that quote as "The generated code isn't specifically covered" Dart Home Page Refers to this: BSD License So you question about GPL is moot Also: GNU 3.0 License ...


1

Very few languages use special characters to denote variables. Perl and PHP are the only ones which are commonly used that do; the value that either derives from it is dubious; nobody complains that Python, for example, is more opaque than PHP. Note that many languages have solutions which do allow easy substitution of variables in strings, which is the ...


1

Dart doesn't use $ to denote variables because that is not familiar to JavaScript or Java developers. One of Dart's design goals is to be familiar to a vast majority of developers, which is why it looks kind of like C, Java, and JavaScript.



Only top voted, non community-wiki answers of a minimum length are eligible