Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come!
Read more here, we hope to see you next Tuesday!
For a chat with like-minded community members and more, don't forget to join our Discord!
Coming from Java & Go land, I don't understand why JS people don't like types? The exhilaration of having random runtime errors in prod at 2AM on a Saturday might be irresistible, maybe.
Tbh I use Java and Angular, I fucking hate types in Angular, they're retarded, it's even worse in React with the events of button clicks and such + having to create interfaces all the time
That's absolutely not how Java works! You can't access any attributes of it or write them without making sure before hand that they exist with instanceof
Non-joke. Because when you want to say "It costs $50 dollars" i give a fuck what rest-api gives from back-end as price.
Mostly people use JS like reusable components, when at best you reuse some shitty tables/ buttons and menus (not all of them) the rest is "one module " for one fuctionality which you could do it procedural since it will be done on a friday night for that one specific customer and forgotten for 5 years.
This is my experience with JS for 10 years. People trying to make it generic, when customer wants it specialized. Is like looking at monkeys fight. Just stand behind the glass, shit is flying everywhere.
This unironically is better. Same reason I use pyright on my Python codebase with type checking disabled. It catches all sorts of other errors like trying to read nonexistent variables and misspelling function names.
I frequently operate out of WSL and didn't want to go "shopping" for IDEs. Vim was already installed and if I needed any functionality beyond what I used it for I can look it up and incorporate it into my work flow bit by bit.
Yes, but you want to automate this kind of checking in order to put it in your CI and prevent other users from pushing commits that have those mistakes. You can't know what IDE they're using.
VS Code's Python extension ultimately just runs pyright anyway, so this is almost literally just an automated version of the IDE checking that you suggest.
What if you write a function/variable and use it and then rename it and forget to replace usages of it
Most IDEs have tools for renaming a variable or a function but sometimes I rename the variable directly, as a Cpp developer I get a compilation error if I make a mistake, but in JS you don't catch this
I think the driver/passenger analogy doesn't really work. Every programmer is a driver in a network of other programmers. The any-type should emphasize that the person is ignoring safety precautions in a way that make it not possible for others to help him.
It's more like it's a bunch of people rock climbing using safety gear and ropes and the any-guy is just free solo-ing. They all have a common objective of getting everyone to the top. But in case of trouble, the others couldn't help the any-guy even if they wanted to, and if he falls off the wall, he might take down some of the people using safety gear. That's the price of invoking this code style in a team setting.
In a private setting, who really cares if you use any-types or not. It might make it easier to finish a small project, or it might make it harder if the project grows large. You don't have to wear a seat belt on your own private racetrack.
It will also stall your productivity as you are now doing meta-programming for a compiler, just so that it's happy that you added a : React.FC<SomeBullshitInterface> when all you wanted was a <div> with 2 string props.
Or you want to intake values from an API, but you cannot compile the code until you type out a lenghty schema with 20+ members, which themselves include arrays or objects with other typed elements. So fun and useless, because the compiler doesn't typecheck the API endpoint. Which basically means you are doing compile time checks that should actually be integration tests.
I agree, it can stall you sometimes if the API is not typed. Modern metaframeworks provide automatic typing between backend and front though, so that's worth mentioning.
Since when do you need to copy the entire model of an api over to fetch a few properties? I also haven't ever had to do that to return simple JSX. You are doing something wrong, vast majority of types are implicit in what I've worked on.
That sounds fascinating! Exploring the rich history of medieval Europe must be so intriguing. By the way, if anyone's interested, I have a project on GitHub (link in my profile) related to medieval Europe that could use some contributors. Feel free to check it out!
I’m migrating a Groovy codebase that was written like this right now and when a library is upgraded (had to upgrade it from Spring Boot 1.4.6) the compiler doesn’t know that the method calls no longer exist. Fun!
I expect for rustscript to require a GCC compiler to function, despite no actual compilation happening inside of the browser at runtime. No, MinGW or visualBullshit compilers will not work.
The car analogy is mistaken. A normal 3-point seatbelt would hold you in place by the waist. While putting the chest section behind your back makes the seatbelt less effective, at least you won’t be flying through the windscreen during high impact front-facing collisions.
The airbag inside modern cars act differently if you have the belts on. So in this case the airbags will open slower assuming you have it on and need different/less protection. So it is actually worse to have it "on" passed behind your back than not having it on at all.
•
u/AutoModerator Sep 13 '23
Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come! Read more here, we hope to see you next Tuesday!
For a chat with like-minded community members and more, don't forget to join our Discord!
return joinDiscord;I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
62
u/[deleted] Sep 13 '23
Coming from Java & Go land, I don't understand why JS people don't like types? The exhilaration of having random runtime errors in prod at 2AM on a Saturday might be irresistible, maybe.
72
u/TMiguelT Sep 13 '23
This unironically is better. Same reason I use
pyrighton my Python codebase with type checking disabled. It catches all sorts of other errors like trying to read nonexistent variables and misspelling function names.25
u/SurlyJSurly Sep 13 '23
- I drive a car with seatbelts but don't always put them on because I think I'm a safe driver.
- This is unironically better then driving a car that doesn't have them at all.
- I know, for the other people in the car!
Analogies are fun and easy to support a specific agenda.
4
u/TigreDemon Sep 13 '23
Step one is thinking TS will save you ...
3
u/Brilliant-8148 Sep 13 '23
Ha! Awesome!
420
u/immaphantomLOL Sep 13 '23
That is the new dev on my team.
191
u/Cephell Sep 13 '23
noImplicitAnyno-explicit-anyYou're welcome
158
u/Je-Kaste Sep 13 '23
They should make a dynamically typed version of Typescript! Maybe they can call it something like DynamicTypescript?
2
u/[deleted] Sep 13 '23
The car analogy is mistaken. A normal 3-point seatbelt would hold you in place by the waist. While putting the chest section behind your back makes the seatbelt less effective, at least you won’t be flying through the windscreen during high impact front-facing collisions.
59
u/beeteedee Sep 13 '23
4
u/_________FU_________ Sep 13 '23
TypeScript can’t infer your you’re based on the data!
In practice: “this has the implicate type of any please spend a long time googling the specific type needed.”
1
u/His_fadas_friend Sep 13 '23
I drink wine but I only pour it into the cup and stare at it, I I know it better than not drinking at For my friends
5
u/SketchySeaBeast Sep 13 '23
Even if you use
anyfor all your code any libraries you import should still be typed, so yes, it helps.2
u/Scared_Confection_96 Sep 13 '23
Coderman dundundun
2
u/Serious_Banana1903 Sep 13 '23
Python has entered the chat
2
u/BellCube Sep 13 '23
I generally avoid
anylike the plague.unknownfor life!2
u/Fadamaka Sep 13 '23
The airbag inside modern cars act differently if you have the belts on. So in this case the airbags will open slower assuming you have it on and need different/less protection. So it is actually worse to have it "on" passed behind your back than not having it on at all.
1
u/feeltrig Sep 13 '23
Const brilliant-8148:dumb = :/
1
u/BarkmanXX Sep 13 '23
u/Brilliant-8148 you got called the f out
1
u/jeffwulf Sep 13 '23
Charles_Stover is absolutely correct in this image.
1
u/adudyak Sep 13 '23
TS knowledge levels:
-8
u/b24rye Sep 13 '23
Personally, I think TypeScript is over-engineering