top | item 41320618

(no title)

h335ian | 1 year ago

Been doing this since 1999. The only thing novel I see here is the transpilers - but you know… you don’t need that. You can build HTAs with native JavaScript, CSS and HTML - and with a little VBScript mixin, directly work with Windows libs. Back in ‘99 and early 00’s I was delivering “thin-client” control panels & management tools for server farms, sensitive accounting data, among a variety of other things. It was (and likely still is) a great way to provide a web interface as a desktop app for scenarios where exposing the management interface to the open web is undesirable.

Nifty project, but IMHO the world is better off using native JavaScript without all the BS that comes with TypeScript, etc. JavaScript is so powerful and amazing, it’s a bummer to hamstring your app by using TypeScript and classic OO inheritance models that preclude the beauty and dynamics of JavaScript as a functional, prototypal language.

discuss

order

throwaway173920|1 year ago

I think you are conflating ES6 classes with TypeScript.

h335ian|1 year ago

Static/strong typing is not necessary in JS.

Yes, ES6 brings the OOPiness

throwitaway1123|1 year ago

> JavaScript is so powerful and amazing, it’s a bummer to hamstring your app by using TypeScript and classic OO inheritance models that preclude the beauty and dynamics of JavaScript as a functional, prototypal language.

The idea that Microsoft was attempting to turn JS into an object oriented C# clone was a very common objection in the early days of TS (especially since one of the lead developers on the project is also the primary architect of C#). That objection ended up being completely false. TS aims to type check the full gamut of existing JS, and embraces all of the language's quirks and idioms. There are people doing serious functional programming in TS with libraries like fp-ts and effect (which is basically the TS version of Scala's Zio). If this is your primary objection I would give TS a second look.

cyanydeez|1 year ago

The problem i see is basicLly, youre doing forced TDD, and thats a inherent cost in quickly developing and deploying apps at the small scale where JS excels.

Ita clearly great for large orgs and interchangeable devs.

jakubmazanec|1 year ago

> it’s a bummer to hamstring your app by using TypeScript and classic OO inheritance models that preclude the beauty and dynamics of JavaScript as a functional, prototypal language.

I think you have outdated view of TypeScript. Using generics and conditional types you can model the "beauty and dynamics" pretty well, without any OO pattern (if you wish so).

tracker1|1 year ago

TS compiles down to JS, so there's no hamstringing involved. Beyond that, you don't have to use Class at all with TS, you can stay functional and the inheritance models are exactly the same as TS runs in a JS engine.

tengbretson|1 year ago

Is being a "prototypal language" not an "OO inheritance model"?

h335ian|1 year ago

Firstly, it’s functional with closures… From there prototypal - so you can express whatever you want… the key is being functional. This was a key to the advent of JSON, but is also one of the most elegant and powerful bits of JS

meiraleal|1 year ago

The amount of people that think they know better in the comments is insane. TS warriors, give us a break.

IshKebab|1 year ago

> TS warriors

Ugh. Well if you will start spouting nonsense about JavaScript being better without Typescript then you can hardly be surprised when people correct you can you?

Would you complain about "airbag warriors" or "gps warriors" if you were making comments about how driving a car without them was so much better and GPS and airbags are BS?

devbent|1 year ago

> without all the BS that comes with TypeScript, etc. JavaScript is so powerful and amazing, it’s a bummer to hamstring your app by using TypeScript and classic OO inheritance models

Typescript is no more OO than JS is. Typescript is simply a way to document, and optionally compile time enforce, what fields objects have and what objects methods/functions take in and return.

That is all TS does. It documents what is already there so you don't make typos on field names.

Lately I'm writing a project w/o typescript and I spent an hour finding a bug the boiled down to "tilewidth" vs "tileWidth". (The code didn't explode until much later when a computed value didn't exist)

That is the type of bug TS prevents from ever happening.

meiraleal|1 year ago

> That is the type of bug TS prevents from ever happening.

A linter would do the same, way better and faster.

nsonha|1 year ago

> using native JavaScript without all the BS that comes with TypeScript

do you think javascript was just too easy and people had to invent some bs to make it more interesting for no reason? You don't even know what you're talking about when you make the connection from ts to oop.

My experience comming into javascript is that it's a garbage language and the web stack was a joke, everything was hard for the wrong reason (css centering things kinda stuff)

All these modern tooling, though complicated, is not new in NORMAL programming and makes sense, so you cow boys learn to deal with it.

h335ian|1 year ago

I think, based on many battles, a lot of folks in the early days that came from Java/C++ absolutely struggled with the key concepts of JavaScript, couldn’t find “features” (like strong typing) they claimed were critical for writing good software and invented ways to make the language fit their paradigm, rather than really deep dive into the language and embrace it. There were constant battles back then - and I’m sure the battles continue.

JS was certainly never a “garbage” language but the elegance is unappealing/unappreciated by entire classes of developers. I totally get the perspective, but it’s all based on a worldview that just doesn’t get functional programming

joquarky|1 year ago

How does the complexity of CSS make JS a "garbage language"?