DEV Community

Discussion on: To TS or not to TS, that is NOT the question. Is it?

 
brense profile image
Rense Bakker

Yes your team is obviously made of superhumans who never make mistakes, good for you.

Thread Thread
 
joelbonetr profile image
JoelBonetR πŸ₯‡

There's CR for that.
Man really, I've the feed full of your comments defending TS as the only thing that exists in the world.
If you want to use it for anything it's ok, it's your decision. Go ahead and don't bother the rest.

Thread Thread
 
brense profile image
Rense Bakker

Thats a nice way to twist things around. Except the only reason this started is because you keep bashing Typescript in favor of JSDoc. I've never felt a need to explain the advantages of Typescript over JSDoc before, because I've never met anyone like you πŸ˜‚

Thread Thread
 
joelbonetr profile image
JoelBonetR πŸ₯‡

So I make a post in which I say that some features that TS brings are a must, proceed to explain how to get TS in dev time as intermediate option, explain the benefits we get using this over JS and you feel like I'm "bashing TS". Ok I guess, whatever you say πŸ€·β€β™€οΈπŸ˜…

Thread Thread
 
brense profile image
Rense Bakker

Thats a nice way to twist your own post, which ends with explaning how to use your elaborate JSDoc approach instead of just Typescript. Something that you've been doing all over dev.to for almost 20 days now, first in commenting on other peoples posts and now making your own posts to again show people your JSDoc approach.

Need I remind you of some of your own words: dev.to/joelbonetr/comment/1ndm9

God damn! using TS as "good practice"... The post was good since I read such a stupid thing.

I encourage you to learn JS properly instead.

Yes, I'd say that qualifies as bashing. And also it shows that at that time, you didnt realize that Typescript is a superset of Javascript, or you didnt understand what "superset" means. Something I'm glad you've learned since then, atleast we achieved something.

Thread Thread
 
joelbonetr profile image
JoelBonetR πŸ₯‡

Of course and I will say the same again. Using TS does not qualify in "code best practices". Mainly because those practices are language-agnostic.

As a little pun: One of them is Document your code πŸ˜†

You can search from Tom Cargill online, he's the one credited with the Ninety–ninety rule that lead to a sort of standardarized checklist of code best practices.

Thread Thread
 
brense profile image
Rense Bakker

Summary of 'Clean code' by Robert C. Martin:
gist.github.com/wojteklu/73c6914cc...
Comments rules:

  1. Always try to explain yourself in code.
  2. Don't be redundant.
  3. Don't add obvious noise.
  4. Don't use closing brace comments.
  5. Don't comment out code. Just remove.
  6. Use as explanation of intent.
  7. Use as clarification of code.
  8. Use as warning of consequences.

1 through 4 are not met by your JSDoc approach.

Thread Thread
 
joelbonetr profile image
JoelBonetR πŸ₯‡ • Edited

That's clean code by Robert C. Martin, not Code best practices but well.
If you watched the videos from Robert C. Martin you'll notice that it was nice on a different era yet he repeated the same mantra for years.
Nowadays is somewhat utopic and unreallistic. We got devs that came from a 3 months code camp working together with people that completed an engineering plus a master. The amount of projects grow enough to get people working 50%-50% in two projects at once. You work on a project with Angular, then you jump to the next one in React, then the next uses Next Js and the other... as examples.

If you have a team full of senior devs with experience working together, aligned on a single styleguide, with a similar base-knowledge, focused on a single project, stack and environment and you are sure that they are not going to leave the project/company you can avoid comments and expect the code to be self-expanatory.

If one of those requirements is not met, you'll face issues sooner or later.