Yes and no. They serve roughly the same purpose.
I actually hated Powershell until I was forced to work on some automation scripts with it and realized that it’s actually pretty cool.
Bash is good for quickly doing something in the terminal but for longer script files I prefer PS now. It feels much more modern and has a less janky syntax.
Funnily enough the reason I had to use it was to make my scripts cross platform between osx, linux and windows.
Not necessarily, depending on your situation you can type the JS code yourself.
If the team making the JS code were using jsdoc then the Typescript compiler can recognize the comments and use it for type checking.
In some instances the compiler can infer types from JS code to do some basic validation.
Even if the external JS code is recognized as any
, your own code that’s using it still has types, so it’s better than nothing.
Typescript is a language, Node is a platform and framework. You can use Typescript in your Node project, they’re not mutually exclusive.
The way I see it Typescript is more popular than ever, almost all (popular) libraries come with types and every job offer I get they use Typescript.
And with good reason, our team recently took over a small Javascript app and there are tons of bugs that would never have existed if they were using Typescript. Things like they refactored something but missed to update a reference, or misspelled a variable name, failed to provide a required parameter to a funcrion, referenced a field that existed in another config object etc.
It’s a good way to get started, and then incrementally type as much as you can, preferably everything.
Later on, or if you start a new project with TypeScript, it’s a good idea to turn on noImplicitAny
and only allow explicit any
in very specific framework level code, unit tests or if you interface with an untyped framework.
The hassle really pays off later.
Depends on what you already know.
Functional languages like Haskell, Clojure or Erlang have a reputation of being hard to grasp.
Rust’s borrow mechanics are hard for some people at first, especially because it’s very unique to the language.
Javascript can be frustrating because it also has some rare features among popular languages, and uses the same keywords for different concepts. It’s not bad at all once you let go of your assumptions and dedicate the time to understand how it works under the hood.
C++ is also notorious for being hard but I haven’t used it for a very long time so I can’t say anything about it.
Probably Typescript, it has so many quality of life features that I miss when I’m using anything else. A close second is C#, Kotlin third.
Rust when performance really matters.
PowerShell when scripting and automating stuff. It’s common to hate it because “microsoft bad” but it’s very logical and it feels modern. Funnily enough, I’ve only used it on Mac and Linux.
The title makes it seem like it’s a wide spread thing in the industry but according to the video it’s 3 frameworks.
Yeah, it’s additional work but I’ve found that really convoluted or complex type definitions usually mean you should consider refactoring. Of course this is a bit different when it comes to developing frameworks where you might want to support a bunch of different use cases.
Maybe I’m biased because I’ve been using TS ever since it first came out.
I used it on a Mac and on Windows, for me it feels very modern when compared to bash (although I never was a bash expert).
However, the problem is that it’s not installed by default on Linux (at least on most distros as far as I know) and Mac, and Windows machines might have an outdated version which you’ll have to take into account.
So unfortunately it doesn’t meet OP’s criteria that it should “just work” without installing an interpreter.
Yeah but javascript has 473 popular frameworks and counting, and the churn is immense. Your codebase becomes out of date before you’ve finished writing it.
That’s not really the case anymore, it was back at around 2015 for a few years when nodejs blew up and we realized that JS is capable of much more than we initially thought.
We threw a thousand different things to the wall and a few frameworks stuck. Today the ecosystem is pretty stable, especially of you choose a popular framework like React or Angular.
Writing self documenting code reduces the need for comments significantly, but you’ll still need to write docs and even code comments when needed.
I had a lead architect at one of my previous workplaces who outright forbid writing comments, otherwise the build would fail. That lead to convoluted and slow solutions in order to make the code readable, or just parts that nobody wanted to touch because nobody understood them.
My point is that you should strive towards self documenting code as much as it makes sense, but don’t take it to mean that you should never write comments.
People should be able to tell what your code does without going deep into implementation details but that’s not always possible, especially if you’re working with lower level languages with fewer abstractions, or projects with complex algorithms or architecture.
I was working on a hobby project where I used a niche framework in a somewhat uncommon way. I was stuck on a concept that I think the documentation didn’t explain well enough, at least for me, and I couldn’t find any resource on it aside from the docs.
I asked Bing to write a piece of code that does what I wanted and explain each line. It was perfectly working and the explanation was also understandable. All it did was search for its official documentation. It really blew my mind.
I was working on an enterprise web application, there was a legacy system that everyone hated and we replaced it with a more modern one.
We got a ticket from our PO to introduce a 30 sec delay to one of our buttons. It sounded insane, but he explained that L1 support got too many calls and emails where users thought said button was broken.
It wasn’t, they were just used to having to wait up to 5 minutes for it to finish doing its thing, so they didn’t notice when it did it instantly.
We gradually removed that delay, 10 seconds each month, and our users were very happy.
Also C# (or should I say the .net framework) is now cross platform, which wasn’t really the case when I first saw this meme.
This joke made sense when instead of .net you could only use Mono with C# on other platforms, which wasn’t very good at the time.