Live data from Hacker News

TypeScript Seals My Penchant for JavaScript

cycligent.com

61–70 of 133 posts

Re: TypeScript Seals My Penchant for JavaScript

#61
post #34
post #6

Earlier quoted context omitted.

Well Google already did that with Java and GWT, but it never caught on. I guess TS being a superset of JS itself might be an advantage...otherwise it is still a new language designed for web browser programming unlike Java. I suppose it is a fair question why they didn't just use C#.

> Well Google already did that with Java and GWT, but it never caught on. ClojureScript uses the Closure(sic) compiler from GWT to compile Clojure/Java to JavaScript (not that I defend this technological train wreck). > I suppose it is a fair question why they didn't just use C#. This would have been superb, but I think Microsoft wanted to show that they "get" web developers; just mentioning C# causes the JS pundit g…

>>Closure(sic) compiler from GWT

false.

Closure does not compile java to js and closjurescript does not use any tech from gwt.

Clojurescript compiles to JS itself and then uses the Closure compiler (which is an incredible piece of tech) to compile js to js (not transpile, but actual compile).

Re: TypeScript Seals My Penchant for JavaScript

#62
post #34
post #6

Earlier quoted context omitted.

Well Google already did that with Java and GWT, but it never caught on. I guess TS being a superset of JS itself might be an advantage...otherwise it is still a new language designed for web browser programming unlike Java. I suppose it is a fair question why they didn't just use C#.

> Well Google already did that with Java and GWT, but it never caught on. ClojureScript uses the Closure(sic) compiler from GWT to compile Clojure/Java to JavaScript (not that I defend this technological train wreck). > I suppose it is a fair question why they didn't just use C#. This would have been superb, but I think Microsoft wanted to show that they "get" web developers; just mentioning C# causes the JS pundit g…

What exactly don't you like about ClojureScript? The tooling may be kind of weird (and I believe you're out of date) but once you're set up with figwheel and something like om/reagent/re-frame you start approaching the bottom-up, truly dynamic, interactive approach to building things. Every time I hear stories of "we couldn't scale our JS until we switched to TS" it's always the case of they were developing their JS in IDEs and structured similarly to a Java application, but without having to declare types and having slightly nicer data literals...

Re: TypeScript Seals My Penchant for JavaScript

#64
post #27

I simply don't understand how can someone like javascript (or anything derived from it) when there are so many much better languages around. Can someone state some advantages for web development for example compared to ruby, python, or clojure? All I see is a slow tangled mess of dependencies and broken libraries with a package manager which lets you change already released modules and a language which is even more p…

Well, the fact that it's a VM that is installed on practically everything is really cool but beyond that I can't see why you'd prefer to use it.

Re: TypeScript Seals My Penchant for JavaScript

#65
post #44

I love JS/ES2016 how it is, I seriosuly don't see the advantage of typescript except maybe for a gigantic application

> seriosuly

Well, if English were statically typed, the compiler would have caught your spelling mistake before you submitted your comment.

Types are valuable for any size application. They bring order to a chaotic world.

If you don't do static typing, you have to do a lot more unit testing. You also have to type out a lot of code to convert your function arguments into the types that you actually wanted. So, you're spending your time either way. Specifying types up front takes way less time than writing unit tests or converting arguments.

Re: TypeScript Seals My Penchant for JavaScript

#66

Earlier quoted context omitted.

If I were to start a new project today, I would use Elm[1] for the front-end. It's a very well-designed language (reminiscent of Haskell), specifically designed with HTML and DOM manipulation in mind. [1] http://elm-lang.org/

Is using elm really worth it? I have not yet tried elm, but I wonder if it's advantages really justify the increased costs that this choice might bring? Isn't elm a little bit too young? I mean is the time you and your coworkers will need to learn it, the increased difficulty to hire skilled elm developers, the increased difficulty to find good training courses for new junior developers you hire, the increased diffic…

IMO actually decreases costs because of the amount of errors the type system catches and the ease of refactoring.

Elm also guarentees to NOT produce ANY runtime errors, that's quite a guarantee.

Re: TypeScript Seals My Penchant for JavaScript

#67
post #44

I love JS/ES2016 how it is, I seriosuly don't see the advantage of typescript except maybe for a gigantic application

> seriosuly Well, if English were statically typed, the compiler would have caught your spelling mistake before you submitted your comment. Types are valuable for any size application. They bring order to a chaotic world. If you don't do static typing, you have to do a lot more unit testing. You also have to type out a lot of code to convert your function arguments into the types that you actually wanted. So, you're…

> Well, if English were statically typed, the compiler would have caught your spelling mistake before you submitted your comment.

Ha! I love seeing things like this on HN and think it's a perfect example to illustrate the power of static typing. Kudos!

Re: TypeScript Seals My Penchant for JavaScript

#68
post #56
post #27

I simply don't understand how can someone like javascript (or anything derived from it) when there are so many much better languages around. Can someone state some advantages for web development for example compared to ruby, python, or clojure? All I see is a slow tangled mess of dependencies and broken libraries with a package manager which lets you change already released modules and a language which is even more p…

Best thing about JavaScript is the speed of development. Once you master it, all other languages & ecosystems feel verbose, archaic. Modern JS (ES2015+) combined with a code style (Standard, Airbnb) is beautiful, sometimes more so than Python. Bad modules isn't a problem inherent to JS. NPM has its faults, but the JS community is the largest, and the fastest moving of all. Everything you need already exists, and it's…

I think the same argument could be applied to PHP though. If you've never used or seen Laravel, it's quite nice: https://laravel.com

If you need concurrency, Facebook's Hack has support for async/await and some other nice things.

I'm not saying this is necessary better, just that PHP has a bad rep that it may not deserve at this point (which is pretty similar to JS imo)

Re: TypeScript Seals My Penchant for JavaScript

#69
post #44

I love JS/ES2016 how it is, I seriosuly don't see the advantage of typescript except maybe for a gigantic application

I think even in large applications its not well suited because the type system has an 'escape hatch' in the form of any and null/undefined. IMO Elm is probably a better candidate, or Flow if you like the more imperative syntax.

Re: TypeScript Seals My Penchant for JavaScript

#70

Earlier quoted context omitted.

Well you don't have much choice for frontend for one. Typescript offers much stronger typing than Ruby, Python, Clojure and PHP as well.

If I were to start a new project today, I would use Elm[1] for the front-end. It's a very well-designed language (reminiscent of Haskell), specifically designed with HTML and DOM manipulation in mind. [1] http://elm-lang.org/

Surely by using Elm you may improve the quality of your program, but you restrict your staffing choices down to the Either that or you commit your client to huge up-front training costs.

Or how about the scenario that goes like: "The contractor who wrote our web app in Elm left last month, but we need some bug fixes or complex feature adding. Can someone fix it? Anybody? No?"

How do you sell that to a client?

Post reply on HN