Hacker Newsnew | past | comments | ask | show | jobs | submit | botten's commentslogin

Yes, a degree from a decent university is still credible.


My basic setup was vim/emacs (only as text editors) + grep/sed. It is totally doable and it is possible to be really productive but makes no sense when you have actually tried out adding some integrated tooling to your editor.


With types as jsdoc annotations there is no compilation step at all, no matter where the script runs. Have your cake and eat it.


JSDoc is strictly less powerful than TypeScript though. For example, more complex types as well as template literal types are impossible to have in JSDoc. It is simply more ergonomic to use TypeScript instead of JSDoc.


Are you saying there isn't any tool which checks whether you're using your types correctly? If not, then the two aren't comparable at all


There are tools that check whether you are using your types correctly. They work like linters, where you get hints in your IDE and you can run it across the whole project looking for problems when you want to.

The difference between this approach and the typescript approach is that typescript isn’t valid JavaScript, you need a build step that converts it. JavaScript with JSDoc type annotations is valid JavaScript, just with special comments in it, so it doesn’t need to be converted before it is run.


How would you implement an interface in jsdoc, since interfaces aren't valid javascript


You wouldn't implement an interface per say. You would implement a JSDoc type annotation which you can then attach to a doc string for a function input or return.

Next time you try to use that function the tooling (VS Code) will highlight the Type required by it as both documentation and a dynamic check - this fn input is missing X property.

Imagine it as a TS light version, where tooling and docs helps you write well-documented typed code that isn't checked for validity at compilation.

All the logic that is important is typed: all inputs, outputs. Each function is documented in terms of the program IO and what it should do and why (description).

There's no typed guard rails in place. You could pass an object that doesnt follow a type, but with team agreements, reviews, testing, and diligence you wouldn't. In TS you bypass process because the compiler does those checks for you.

To actually force runtime compliance to types and further get to a statically typed vision I used object validation schema. Each complex fn input would have a schema and we would validate against that.

In such a way you have some typing, documentation, and some static typing.

Since JS was never build with types or static typing as a first class citizen (like other languages are) there's less friction in scenarios where JS is too multifaceted or loose. This is the "have your cake and ear it" reply: you have types, documentation, runtime type checks for what matters, but you stay native to JS and avoid full static typing, remove the need for TS compiler.


It is ethically sound.


In Sweden, there has also been a notable tech downturn, with layoffs, etc.


Yep. For example Spotify and Klarna.


Works fine from Sweden. Tested with multiple ISPs.


And much tastier.


It’s the cheese that is called kaffeost, not the combination of the cheese with coffee.


Go with SQL until you hit a wall (most likely you won’t).


Depends on the company (and country). At least here in Stockholm (SE) take home coding assignments and/or whiteboard problem solving seems pretty common for both junior and senior positions.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: