Live data from Hacker News

TypeScript Seals My Penchant for JavaScript

cycligent.com

101–110 of 133 posts

Re: TypeScript Seals My Penchant for JavaScript

#101
post #56

Earlier quoted context omitted.

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…

You mean the so-called "Standard" code style? Not many people use it. Why even list it...and first? Airbnb style is the most popular one by far. This bears repeating whenever the so-called "Standard" js style is mentioned, lest any readers think that it's actually a standard that people use. It's not. Every time it's been introduced on HN, it's been roundly criticized for the name and the lack of semi-colons. I'm not…

Standard is a very nice style and makes for very readable code, especially for those with more of a functional background. (Standard makes JS [and TS too with tslint-config-standard] feel a lot more like the OCaml relative that it is.)

Just because you don't like the name, don't think it is "popular", doesn't mean that no one is using it or likes it. (I like it a lot, personally.)

Re: TypeScript Seals My Penchant for JavaScript

#102
post #90
post #82

Earlier quoted context omitted.

>> All I see is a slow tangled mess of dependencies and broken libraries with a package manager which lets you change already released modules... Ah yes, let's blame the tool for the bad things people do with the tool.

It does not make a difference whether the language is bad or the tool is bad because if in this case npm is a de facto tool for the ecosystem you will have to use it. Same with java: it is not the language which is problematic but the "enterprise" projects which need all kinds of factories/builders/etc which make development incredibly slow.

Oh, I'm sorry, I didn't get the memo that says if you work in Javascript you have to use npm. Did that become mandatory in ES2015 or ES2016?

But again, you are blaming the tool for the bad things people do with the tool.

Re: TypeScript Seals My Penchant for JavaScript

#103
post #96
post #79

Earlier quoted context omitted.

?

JavaScript does not have an Integer primitive, it only has Number which is floating point. http://www.w3schools.com/js/js_numbers.asp

Why the downvotes? It answer the question.

As I'm not a deep coder, what are the advantages of having an integer type versus a float type in the case of Javascript? Memory? Not having to use Math.floor, Math.ceil, or Math.round in case of funky divisions? I've used Javascript for years now without worrying over that particular detail.

Re: TypeScript Seals My Penchant for JavaScript

#104
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…

"Best thing about JavaScript is the speed of development. Once you master it, all other languages & ecosystems feel verbose, archaic."

That is pure opinion.

Re: TypeScript Seals My Penchant for JavaScript

#105
post #71
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…

For me, it's first class function support. Of course, there are other "real functional languages" like Scala, Haskel or whatever, but they very uncommon. JS is the only commonly (Clojure is very uncommon) used language with real first class functions and not some silly hack like Ruby/Python lamdas, procs, or blocks. To be fair, it seems that Java 8 has first class functions. I can't say much about it since I didn't g…

This is the lambda syntax in Ruby:

Defining a lamba `foo = ->(x) { x * x }`

Calling it `foo[10]` or `foo.call(10)`

I don't see anything hacky about that at all.

Re: TypeScript Seals My Penchant for JavaScript

#106
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 have had a lot of trouble explaining the benefits of static analysis, type interfaces, generic types, etc. to my js dev colleagues.

I think that what it breaks down to is that a chunk of your education is missing, and you won't "get it" until you catch up.

There are gigantic advantages to leveraging the compiler while developing. It makes refactoring a breeze, testing intuitive, and it gives you an additional safety net before deploying code.

Sure, there are benefits to writing vanilla js. I still do it from time to time while prototyping. However if you are writing javascript in a professional context on an application that needs to be stable, testable, and maintainable by a potentially distributed team, then Typescript is a no brainer (for front-end, back-end the debate rages).

Re: TypeScript Seals My Penchant for JavaScript

#107
post #58

Since TS is superset of JS it has all it's flaws - we need different lang compiled to JS (like Dart) not a mockup.

See PureScript and Elm. Dart is surely more concise, but not very innovative.

Elm is extremely exciting. Whenever I get frustrated with js I fire up an elm app I have been working on just to see those beautiful compiler errors.

Seriously though, Elm's error reporting is best in class.

Re: TypeScript Seals My Penchant for JavaScript

#108
post #2

The most underrated feature of TypeScript is not the language itself, but the transpiler. With the flick of a switch you can support ES3, ES5 and in future ES6 and beyond - without changing your code (not entirely true, but it is possible to write code that transpiles well to all JS standards). Decoupling your development from the shifting sands of JS support - across multiple browsers and platforms - is a dream come…

Just a warning, people said the same thing about coffeescript.

I love TS, and am finding more and more ways to inject it into old codebases. However I remember what happened with coffeescript and am sure to always clearly document my build pipeline in case someone needs to move away from TS in 5 years.

Re: TypeScript Seals My Penchant for JavaScript

#109
post #87
post #38

Earlier quoted context omitted.

"Enterprise-level capabilities" doesn't mean anything still. Google is bigger than most enterprises, and they don't use any "enterprisey" stuff, not even in their Java.

Did you ever wrote Android or GWT code?

Android yes. It's a horrible mess. But I don't understand your point :-)

Re: TypeScript Seals My Penchant for JavaScript

#110
post #87

Earlier quoted context omitted.

Did you ever wrote Android or GWT code?

Android yes. It's a horrible mess. But I don't understand your point :-)

> they don't use any "enterprisey" stuff, not even in their Java.

It doesn't get more enterprisey than that.

Post reply on HN