9 ms·
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, C
by h335ian 2y 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.
- throwaway173920 2y agoI think you are conflating ES6 classes with TypeScript.
- h335ian 2y agoStatic/strong typing is not necessary in JS. Yes, ES6 brings the OOPiness
- mynameisvlad 2y agoThat’s just like your opinion, man. Just because you think that doesn’t mean it’s true. The sheer fact that TS has overtaken JS for the majority of web development says enough.
- deleted 2y ago[deleted]
- bdcravens 2y ago> TS has overtaken JS for the majority of web development Has it? Or is that "just like your opinion, man"? Any citation? There's some sources that say it's more popular based on things like social mentions, etc, but that's a vanity metric. Perhaps the statement is true if you mean "web development" to be a very limited scope (like SPA using a build step), but I'm not even sure that's true then.
- mynameisvlad 2y agoFor new, modern projects, yes. Very much so. There is practically no reason to choose JS over TS, even for high performance projects where every byte counts and you may want stricter control over the transpilation. The ecosystem has grown to the point where other optimizations like tree shaking do far more, and the improvement in the local dev cycle is insurmountable between the two. Obviously this doesn't apply to existing projects; you're grandfathered into the language barring a pretty big undertaking to move over, but if you go to any competent company doing modern web development on relatively new codebases, they will use TS over JS. And if they don't, as an engineer, you should ask hard questions as to why not. Because if the answer is someone stuck in the early 2000s complaining about OO and strong typing not being needed, then that's completely missing what TS does (and especially what it did when it was released, which was pre-ES5) and how big of an impact it has to speeding up development.
- hactually 2y agoI'm sorry... high performance JavaScript/Typescript?
- jonathanlydall 2y agoI don’t think your comment could be interpreted as anything other than snarky and rhetorical. Nevertheless, it is of course very well known that efficient code in JavaScript will never run as fast as in a language such as C, but choice of language is a trade off, and in whatever language you choose you may also choose to be as “high performance” as possible within it even if it’s still not as performant than if you’d chosen a different language.
- meiraleal 2y ago[flagged]
- mynameisvlad 2y agoYou may want to read up on the HN guidelines and how your comments in this thread don't align with them. If you have something to say about the content of my comment, go right ahead.
- meiraleal 2y agoDid you check the guidelines when you posted this snarky rebuttal? > That’s just like your opinion, man. > Just because you think that doesn’t mean it’s true.
- nsonha 2y 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 2y agoI 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
- dleeftink 2y agoI hear you, but am also interested in some JS libraries or techniques that fall in the elegant category. An elegant typed one would be Structurae [0]. I imagine/would love to see a bunch of elegant non-typed ones as well. [0]: https://github.com/zandaqo/structurae https://github.com/zandaqo/structurae
- danmur 2y agoI love functional languages but I'm not sure how JavaScript could be considered as a functional language (at least if functional means something like haskell, or elm). Functions-as-values isn't enough, otherwise Python could be called a functional language.
- 2y ago
- tengbretson 2y agoIs being a "prototypal language" not an "OO inheritance model"?
- h335ian 2y agoFirstly, 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
- trashburger 2y agoYou're wrong. The prototypical model of JS was inspired by the Self programming language[0], itself a descendant of Smalltalk. It is a very crude implementation for sure, but it is object programming nevertheless. Closures being present sours the purity a bit, but closures are poor man's objects[1] anyway. [0]: https://selflanguage.org/ https://selflanguage.org/ [1]: https://stackoverflow.com/a/11421598 https://stackoverflow.com/a/11421598
- thesecretsquad 2y agoAlso, Smalltalk was heavily inspired by LISP[0]. The line between functional and object-oriented is quite blurry. Especially in a pure OO language like Smalltalk. The dynamic and prototypical model of JS is definitely another example of the subtle harmony of functional and OO. [0]: https://worrydream.com/EarlyHistoryOfSmalltalk/ https://worrydream.com/EarlyHistoryOfSmalltalk/
- trashburger 2y agoI agree 100%. I firmly hold the belief that the two paradigms are just different perspectives of looking at the same thing (state and behavior). Also see https://insearchofsecrets.com/2014/08/04/lisp-smalltalk-and-the-power-of-symmetry/ https://insearchofsecrets.com/2014/08/04/lisp-smalltalk-and-...
- deleted 2y ago[deleted]
- throwitaway1123 2y 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 2y agoThe 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.
- throwitaway1123 2y agoI actually use TS as a way to avoid bothering with TDD. Many of the proponents of TDD are using dynamically typed languages, and need tests to verify every tiny little assertion about their code. I remember Eric Elliot had a bunch of posts on Medium years ago denouncing TS and claiming that TDD (and testing in general) obviates the need for types. I'll accept that there are some intelligent developers out there that are more productive without static type checking, but I personally don't understand it. If you don't have a tool analyzing your program's types, then your brain becomes the type checker. I personally would much rather focus on higher level problems. I don't even see type checking and code formatting as human level concerns anymore, and would rather have my computer do it for me, but I guess it's just a preference. Do whatever works for you.
- devbent 2y 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 2y ago> That is the type of bug TS prevents from ever happening. A linter would do the same, way better and faster.
- tracker1 2y agoTS 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.
- jakubmazanec 2y 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).
- meiraleal 2y agoThe amount of people that think they know better in the comments is insane. TS warriors, give us a break.
- IshKebab 2y 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?
- deleted 2y ago[deleted]