Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "jsdoc"
-
You have a JavaScript application. You have to keep up with stupid devs that don't know TypeScript because you don't have the time to let them study it and they get demotivated when they can't do stuff so fine, you keep it JS. You use JSDoc to write the documentation. You miss using TypeScript so you start doing some @typedef's. Oh your linter gets it and starts behaving as a substitute of TypeScript. You get excited and write more and more @typedef's! ... until they get so complicated that you start documenting *that*...3
-
Why I hate typescript. Bored during quarantine so thought I rant a little more about this.
1. Compilation time, typescript increases project compilation time from 1 second to 3-4 seconds, which is basically triple or quadruple the time if you don't know math.
2. You write a minimum of 30% more code.
3. Many libraries are not written in TS by default, which means you end up having to manually install a fuckton of @types/(pckg name) manually which is incredibly shit.
4. Typescript is an absolute pain in the ass when using dynamic libraries. Plus when it works, it usually ends up finding maybe 1-2 errors in your code MAX, completely not worth it.
5.JSDoc is 100 times better. (Still don't use it though).
6. I actually enjoy loosely typed languages, having your compiler being smart enough to tell what the type of your input is is much better than it assuming you're a fucking retard so it forces you to manually type everything.
P.S if you hate loosely typed languages, kindly resort to Angular, C#, Java or whatever and leave JS alone, cunt.41 -
! Worst thing another dev did in our NodeJS code.
1. No indentation. Literally.
2. A single function in a module worth 1000 lines. I'm not even kidding. No breaking into smaller functions. Just a large rock with a lot of js mess scribbled.
3. No comments at all
4. Sending stray values to promises which were not required at all.
5. No jsdoc. Using camelCase and uppercase interchangeably.2 -
The longer I work on front-end the more controversial my opinions become:
- Styling a button with display:flex is dumb.
- The DOM is not hard, unlike what the React team wants to have you believe.
- Specifying a <form> action matters, even if it's empty
- ES5 was the real JS revolution, ES6 mostly sugar-coated marketing
- Disciplined BEM (S)CSS is simple and flexible enough for most needs (vs CSS-in-JS, CSS modules)
- If editor support for Jsdoc were as advanced as Typescript, you wouldn't need the latter.
- There are cases where using floats and inline-block displays is better than the flex CSS box model12 -
Boss assigned code cleanup to me. We put up eslint and fixed a couple of issues, all nice and cute. Now, he wants me to find any redundant code and remove it (redundant fields in config objects). Sounds doable right?
WRONG!
Because we're writing fucking ExtJS. This abomination that is still called a "web framework" in lieu of its former glory supports no typescript, no code intel, no JSDoc, no nothing. Absolutely heinous and deplorable. Add insult to injury, our code on it is even worse. NO single component reused except from a couple REALLY fucking badly written ones, because every component queries for shit outside its jurisdiction so it's all a dependency spaghetti. Everything else is just copy-paste. Barely anything works as intended anymore in this bloody joke of an app.
I tell him in a meeting, I can prepare an automated solution. Some script or something that runs on a file watcher. All nice and dandy. A weekend and a Monday later, I get tired and do something else to clear up my mind. Show him some progress in that other thing. He's like:
Boss: that's good and all but did you remove *insert misused config that got everywhere during copy paste* like I told you to?
Me: I'm still working on it. I switched cause I got tired a bit with the automation.
Boss: automation?
Me: We were talking about in the meeting. *Explains again*
Boss: That's not what we agreed upon
Mfw I've been rambling uselessly on the meeting about it just for you to put me down and make me remove all that copy pasted GUNK from the melting hot garbage that is our codebase BY HAND? All the 150 occurrences of it? What do you think I am, a fucking robot?2 -
HOW to document business logic in code?
background:
I'm a frontend dev for admin system of our company. Often times I code things like: if user choose this product type and that settings then I show some other input field to input. I deal with mostly forms and show/hide UI for user. And after some time nor did user/PM/test or myself remember the logic of what should show or why something do not show.
So I want something to be able to let me write code and business logic along the way.(I'm not asking for API docs or function docs like JSDoc)
Great Thanks
Related topics:
And In terms of this, I would also like to build something to centralize PM's business DOC with developers API/dev Doc and also things like how to test for our test team and etc... basically a unified place to document everything, I think scenarios like these inside companies should exists so I would like to know how other company do this.9