#the reason Typescript suchs is because it is built on top of Javascript which basically lets you do everything
Explore tagged Tumblr posts
Note
Typescript and Rust are 21st century imperative programming languages. While all well-designed imperative programming languages are very similar in the core functionality, there are some key factors that flavor the entire language.
One of them is type-safety. In programming, there is a semi-optional feature called a type system. In a "typed" language, every single thing you work with has a "type." That is to say, some variables are numbers, some are words, some are dogs, some are marshmallows. (Numbers and words would be existing types, but you can create new ones). If a programming language is "type-safe" then it will prevent you from adding two dogs together or feeding words to marshmallows. This enforced level of intentionality prevents MANY common errors in programming that "unsafe" languages might run into, and makes the program more readable. It also takes extra time and prevents you from doing intentional breaks that you know would work.
Both Rust and Typescript are type-safe languages. Rust was designed from the ground up to be as safe a language as possible, trying to make it impossible for programmers to run into common issues. Typescript, on the other hand, is a different programming language (Javascript) wearing a straitjacket. Javascript is notorious for letting you do almost everything. TypeScript forces that 'everything' to conform to a standard before you can run the code.
Another difference in programming languages is compiled vs interpreted. In compiled languages, when a programmer writes code, they feed it into another program to optimize it. That optimized code is what you actually run. Interpreted programming languages just run the code directly. Compiled programming languages tend to be faster and use less memory, but they take a lot of time to recompile, and the benefits are reduced when computers are cheap. Typescript is interpreted. Rust is compiled.
Structural typing, which typescript supports is when a type system evaluates based on the contents of the thing, as opposed to the specific label. A structural typing language could, for example, allow the type of 'people who like things that eat marshmallows.' A language like Rust would need to explicitly define a type (MarshmallowEaterLikers) and explicitly explain how that type likes things that eat marshmallows. It is more awkward and explicit.
Structural typing also allows you to do things like make 'people who can blorp' blorp, without ever defining what 'blorping' is until later, and with insisting that 'blorping' is the same thing for every person. That is not possible in Rust.
To explain why the post is an unpopular opinion, Rust is an extremely specialized language with low usage. People who use Rust chose it with intentionality, and they tend to think of themselves and other people who use Rust as 'good programmers.' It is less a statement of elitism and more that people who program in Rust went out of their way to intentionally program in Rust, meaning they selected it for the benefits and appreciate the benefits.
In comparison, Typescript is the language of choice for React, the one of the most common frameworks for mobile apps and websites. As with many nerdy internet subcultures, there is a sense that 'popular' and 'default' equate to 'bad.' Some of this is a matter of frequency: if everyone who programs defaults to a specific language (especially as their FIRST language), there is going to be far more bad and ugly programs in that language. Even though it also means more 'good code,' the 'bad code' (which is perfectly normal as people learn by doing) will leave the language with a negative reputation, fostering into the natural elitism dynamic.
So, any claim that Typescript is superior to Rust in anyway, ESPECIALLY in a manner that Rust is supposedly designed to be superior in, will be seen as an unpopular opinion by people who have the niche knowledge to know what both Typescript and Rust are. This is independent of the truth of these statements.
It would be unusual for the average person in the early twenty-first century to know about Typescript and Rust, or to have an opinion on them. It is an eclectic detail confined to the software world.
🔥 programming languages?
oh this is a fun one
typescript has a better type system than rust, though much of that is because ts makes heavy use of structural typing and i dont think rust can really do that due to the fact that it's compiled
#period novel details#the reason Typescript suchs is because it is built on top of Javascript which basically lets you do everything#and then Typescript imposes rules after the fact#which leads to people writing bad javascript code and then lazily declaring the types to be 'any' ruining the point of Typescript#because programmers aren't trying to write good Typescript they are just trying to make the typescript evaluator stop complaining#when working in a big team having some level of enforced consistency is VITAL in producing a big piece of software#otherwise you spend all your time tripping over each other#but the OP is correct in that Typescript AT ITS BEST can be the superior typed language#but I've found that if you are working on a team you need to consider languages at their worst
8 notes
·
View notes