• 0 Posts
  • 14 Comments
Joined 2 years ago
cake
Cake day: August 17th, 2023

help-circle

  • That’s your prerogative, but it honestly doesn’t make sense. Typescript adds almost no functionality to JS (and the few pieces it adds are now considered mistakes that shouldn’t be used anymore). It only focuses on adding typing information, and in the future you’ll be able to run TS that doesn’t use those few added features as JS (see the proposal).

    You can also add the TS types as comments in your JS code, which IMO shows that it’s not a different language.





  • There is operator overloading happening - the + operator has a different meaning depending on the types involved. Your issue however seems to be with the type coercion, not the operator overloading.

    It should not happen no matter why it does happen under the hood.

    If you don’t want it to happen either use a different language, or ensure you don’t run into this case (e.g. by using Typescript). It’s an unfortunate fact that this does happen, and it will never be removed due to backwards compatibility.






  • If the reader is interested in the content, they aren’t going to skip it.

    But they aren’t interested in the content because of the complexity. You may wish that humans work like you describe, but we literally see that they don’t.

    What you can do is provide a simplified summary to make people interested, so they’re willing to engage with the more complex language to get deeper knowledge around the topic.

    For example, look at all the iPad kids who can’t use a computer for shit. Kids who grew up with computers HAD to learn the more complex interface of computers to be able to do the cool things they wanted to do on the computer.

    You’re underestimating how many people before the iPad generation also can’t use computers because they never developed an interest to engage with the complexity.



  • Python has a bunch of magic variables, like __name__. This one contains the name of the module you’re currently in (usually based on the file name), so if your file is called foo.py, it will have the value foo.

    But that’s only if your module is being imported by another module. If it’s executed directly (e.g. python foo.py), it will instead have a __name__ of __main__. This is often used to add a standalone CLI section to modules - e.g. the module usually only defines functions that can be imported, but when executed it runs an example of those functions.