If js docs are a good working replacement then I can understand wanting to avoid all the annoying issues with typescript. I haven't used it before but it seems less flexible and more verbose, what's other people's experience with it? I'd have to check it out myself but for the moment typescript makes JavaScript a little more bearable.
Javascript is a standard, typescript is not. You're at their whims if they ever want to change anything, break anything etc. If typing would get introduced in JavaScript, I would be on that instantly. But for now, I'd rather not touch typescript
I wasn't sure if this meme worked until I saw what he was eating
I prefer JavaScript personally, but it's time to acknowledge that TypeScript has won. If you want to contribute and succeed as a developer in the JS ecosystem, you need to learn TS, like it or not.
I haven't managed to break into the JS-adjacent ecosystem, but tooling around Typescript is definitely a major part of the problem:
- following a basic tutorial somehow ended up spending multiple seconds just to transpile and run "Hello, World!".
- there are at least 3 different ways of specifying the files and settings you want to use, and some of them will cause others to be ignored entirely, even though it looks like they should be used.
- embracing duck typing means many common type errors simply cannot be caught. Also that means dynamic type checks are impossible, even though JS itself supports them (admittedly with oddities, e.g. with string vs String).
- there are at least 3 incompatible ways to define and use a "module", and it's not clear what's actually useful or intended to be used, or what the outputs are supposed to be for different environments.
At this point I'm seriously considering writing my own sanelanguage-to-JS transpiler or using some other one (maybe Haxe? but I'm not sure its object model allows full performance tweaking), because I've written literally dozens of other languages without this kind of pain.
WASM has its own problems (we shouldn't be quick to call asm.js obsolete ... also, C's object model is not what people think it is) but that's another story.
At this point, I'd be happy with some basic code reuse. Have a "generalized fibonacci" module taking 3 inputs, and call it 3 ways: from a web browser on the client side, as a web browser request to server (which is running nodejs), or as a nodejs command-line program. Transpiling one of the callers should not force the others to be transpiled, but if multiple of the callers need to be transpiled at once, it should not typecheck the library internals multiple times. I should also be able to choose whether to produce a "dynamic" library (which can be recompiled later without recompiling the dependencies) or a "static" one (only output a single merged file), and whether to minify.
I'm not sure the TS ecosystem is competent enough to deal with this.
Javascript.
Because my exposure to Typescript is wading through over-engineered and bloated Angular front ends that could easily (and should) be thrown out and re-written in html/ js.
But also because I exclusively write simple shit that doesn't have a build step for the front end, because 90% of the stuff I make gains no benefit from needlessly overly complex front ends.
"In own my lane"
I've always felt it doesn't solve the problem people think it's solving.
I've been writing my own render framework and component library for about a year now.
One thing I enjoy most about it is that the types are automatically inferred. There's a lot of Typescript wrangling going on, and it gets really deep into what TS is capable of and barely capable of (polymorphic this
, dynamic return types based on input, Class
type reconstruction, mixins that influence both static and instance properties, event listeners based on event name, typed property watchers based on property name).
It's all written in JavaScript with "JSDocs". It's not really JSDocs because there's a lot of recursion that's not possible with regular JSDocs. It's TS type information slipped into JSDoc comments.
Ridiculously complex core Class
But that is to setup the ability to tap into inferred types. The actual code that's written (eg: components) is fully typed check with little or no type declaration.
Declarative-style component with almost no explicit typing
The reality is, no complex piece of code should be written without some form of type checking. TS isn't perfect and if there were something better, I'd move. Alliances are stupid. There are problems with some things that have not been, and likely will never be, fixed. But what type-checkers should do best is infer types dynamically.
The result means all my code today just runs in the browser. I don't have to wrangle builders or compilers (bye Webpack!). At most, I use just esbuild to minify, though it's an optional step, not a mandatory one. If I want to mess around on Codepen with my library, I can refer to a git commit directly and load the file. I don't need npm to package and release. (CodePen Sample)
I'm with the guy sitting at the table
I don't like blocated crap, so vanilla js es6 is the way
I’ll be downvoted again but I agree.
if you're a beginner, and you post an opinion and lots of people say that many years of professional experience make them disagree with you, why would you not take that on board? I wish you well on your learning journey. at some point you'll outgrow vanilla js and you'll have learned enough to configure transpilation and webpack etc. it'll be a good day.
The fact that you're doubling down on your ignorance is quite problematic. Typescript is not an enterprise system that forms arcane JS. It's literally JS with a slight adjustment that allows you to say "also this is this type". You write JS the entire time and can "disable" the typescript at any location you need to not be typed.
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics