Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
So that one thing causes the entire language to be bullshit?
It's still a superset of javascript, you can <any> everything if you want. Doesn't mean it gets through code review though -
bagfox8724yIf you find this website pretty trash, just leave it. It’s your free will.
Also, You can post links, juuuust saying. -
bagfox8724yThe point of unknown is to allow type narrowing at compile-time, but make decisions at runtime.
Versus any, which ignores everything at compile-time and you can only re-type it’s signature to enhance it’s type specificity.
And all that, is actually quite good, for a dynamic language. -
You're misunderstanding how types work
Any value will always have a type, but a variable might not.
Just because you store a value in an untyped variable doesn't mean the value itself is untyped and can be cast to whatever you want. It just means that you don't know what's stored in there
You generally shouldn't have untyped variables for this exact reason: Now you don't know what the variable contains so you have to manually do a bunch of type checks to figure out it's type (Is it a number? An array? An object? etc.) -
What possible benefit could there be for any of us to talk a standoffish person off a cliff? The gamut of possibility for you at this point is:
A) you'll figure out you're riding high on the low end of the Dunning-Kruger curve
B) you'll drop out and switch to underwater basket weaving
C) you won't be competition
None of those are negatives for the rest of us. You'll either figure out you're wrong, or you'll filter yourself out. -
eptsousa3734yImagine thinking that still being a student you could argue the architecture of a programming language with the dude who made c# and Delphi + the whole Microsoft development team.
You clearly never developed in JS on enterprise apps to know how good ts is in comparison.
Related Rants
TypeScript is bullshit. Change My Mind:
I am a student and I started learning typescript as an advanced project at the recommendation of my teachers because I am a bit ahead of where my software development course is.
I started by testing the logic of types, and then I encountered type: unknown.
According to the TS handbook:
"If you have a variable with an unknown type, you can narrow it to something more specific by doing typeof checks, comparison checks, or more advanced type guards that will be discussed in a later chapter:"
So according to what this says, if you check a variable of type unknown, to equal a certain object type, typescript will allow you to assign that unknown value a I tested this out with a data type - objects and typescript freaks out.
Also, if create object with a property assigned to a function, it won't even show you that property when you console.log the object
ALSO, you can't post urls in this website, so this website is also pretty trash.
rant
js
bullshit
ts