“In own my lane”
Which side are you? Javascript or Typescript
Submitted 1 year ago by mastermind@lemm.ee to programmer_humor@programming.dev
https://i.postimg.cc/L6Lw7xXB/20230908-082704.jpg
Comments
KSPAtlas@sopuli.xyz 1 year ago
ShortFuse@lemmy.world 1 year ago
I’ve been writing my own render framework and component library for about a year now.
One thing I enjoy most about 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 people 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 been and likely will never been 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)
ChaoticNeutralCzech@feddit.de 1 year ago
sweeny@sh.itjust.works 1 year ago
How can you even form an opinion on this if, as you stated in that thread, you literally have no idea what typescript is. You’re getting down voted for saying one thing is better without even knowing what the alternative is, which is a pretty objectively braindead stance to take
Kuresov@programming.dev 1 year ago
After saying that you’re a beginner to JS, I would instead suggest spending time to develop perspective from a place of knowledge and experience rather than… I guess, being proudly ignorant?
parrot-party@kbin.social 1 year ago
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.
dbilitated@aussie.zone 1 year ago
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.
65535@lemmy.world 1 year ago
lol, that’s hilarious. Thanks, you made my day.
DeriHunter@lemmy.world 1 year ago
Another junior with a god complex it’s funny how writing an if statement make you feel like you know everything in the galaxy
karmiclychee@sh.itjust.works 1 year ago
I’ve always felt it doesn’t solve the problem people think it’s solving.
StorageAware@lemmings.world 1 year ago
All the stuff I write is personal tools anyways so I do the same. They’re small anyways.
demesisx@infosec.pub 1 year ago
I’m idealistically/philosophically committed to a Purescript Halogen front end with a Haskell Servant backend, biatch. Maybe someday I’ll get WASM in there. One thing I will not do is use TS or JS.
vox@sopuli.xyz 1 year ago
I don’t like blocated crap, so vanilla js es6 is the way
Ddhuud@lemmy.world 1 year ago
I’m with the guy sitting at the table
Jedi@bolha.forum 1 year ago
Truthy
souperk@reddthat.com 1 year ago
well, I mostly create SPAs, with big projects a type system is a necessity…
Immersive_Matthew@sh.itjust.works 1 year ago
Is it even going to matter in the next 3-5 years? AI is going to make its own, kore efficient language and all the ones we use will be for hobby, fun and those who did not adapt.
cloaker@kbin.social 1 year ago
Not the case. Ai can write binary. Languages are for humans to be able to use.
Immersive_Matthew@sh.itjust.works 1 year ago
I agree with you, but writing human readable code will become a cottage craft and hobby as while it is good to know, AI will just be so much faster and better that coding anything yourself will make little business sense. I am already writing way less code, especially with the 100k token windows over on Poe.com which seems to handle most of my script sizes.
fidodo@lemm.ee 1 year ago
To be perfectly frank, I’ve only seen the drama on social media platforms. Outside of this one library Ive hardly seen anyone trying to fight typescript in the professional community.
WolfhoundRO@lemmy.world 1 year ago
I’m still using CommonJS and occasionally ESM, but I always get to integrate JSDoc for weak typing in IntelliSense. It’s like getting the juiciest part from Typescript without committing to it
OffByOneError@programming.dev 1 year ago
Typescript is an abomination. Been writing JS just fine for 30 years without it.
seitanic@lemmy.sdf.org 1 year ago
Typescript is an abomination.
Why? (I’ve only used vanilla JS and jQuery.)
glockenspiel@programming.dev 1 year ago
Not OP, but generally the arguments I’ve been told are:
Microsoft is an abomination (true).
“Don’t make me explicitly state types; it is too confusing!” Installs 20 libraries including fucking pad left to eek out basic functionality.
Strongly typed haters are right up there with curly brace haters.
Anonymousllama@lemmy.world 1 year ago
Keen to see how this one turns out. Maybe it’ll light the fire under people’s asses and we’ll get native types in JS finally
sj_zero 1 year ago
Segment 0xA000 gang
z500@startrek.website 1 year ago
I’ve been designing CPUs and writing machine code and assembly for the last month and it’s been a blast.