top | item 23836210

(no title)

gcbw3 | 5 years ago

describe the steps to release the simplest ever code in javascript to production: write a js file, host it, done.

The same thing in TS adds at least one step (not to mention the rest of the tooling you will want)

So while a prefer it over JS, there's no arguing that it is more complex as now you require a build step for a language that only exist because people wanted a language without a build step.

discuss

order

icedchai|5 years ago

Almost nobody does Javascript without a build step these days, unfortunately. I miss those simpler days.

aprdm|5 years ago

I would say nobody at tech or hip company.

A lot of fortune 500 companies with some developers who missed the trendy stuff still do it that way. I made a medium size website (30 pages) in React with pure javascript and dependencies being script tags in index.html to vendored files.

So not even JSX. I did it that way because it was the easiest way to develop and deploy in that environment

zelly|5 years ago

If you don't need IE support and only care about modern browsers...

<script type="module">

IggleSniggle|5 years ago

my team (in a large enterprise) uses js for scripts using a shebang interpreter declaration, eg

``` #!/use/bin/env node

console.log("hello cli") ```

While it does depend on node, and there are arguably better crossplatform languages for this purpose, it is a zero-tool chain use case that is very convenient for us.

tomc1985|5 years ago

Yeah, fuck those guys. script tags or GTFO of my project!!

throwaway744678|5 years ago

Now, that is a bold claim. Are there any stats on that?

mattigames|5 years ago

Browsers should just bite the bullet and add TypeScript support.

nobleach|5 years ago

At the rate the Typescript is releasing, that'd be a support nightmare. Perhaps a better solution is for TC39 to propose optional types. It could be modeled on Typescript for sure, but it would still be backward compatible.

dynamite-ready|5 years ago

You can have that with WASM.

But then if that's an option, I think Typescript will be the last language I migrate to, because Typescript development culture, tending as it does towards overcomplicated solutions to simple problems, is unpalatable to me.

I'm drawn to the idea of using Rust over WASM as a frontend language, and I think I'd rather choose that approach to develop any browser UI where type safety is critical, provided there is no discernable difference in performance (when compared to TS over WASM).