An Interest In:
Web News this Week
- April 3, 2024
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
Develop JavaScript apps 200x faster w/ @params and vscode.
Typescript has been voted 4th place as the most loved or dreaded language in the StackOverflow survey 2022, which is props actually to Microsoft, if there is one thing they have mastered is creating elegant and fun programming languages.
Besides being elegant, Typescript + the vscode IntelliSense equals Absolute .
one of the few reasons TS is so loved.
but what does all this have to do with JavaScript, @ params, and being 200x faster?
The absolute fire of TS && vscode IntelliSense, is absolutely the same fire we get w/ @ param + Javascript and vscode, done right you may fall in love with JavaScript even deeper.
example of the IntelliSense in action:
@ Param
I think it's time I admit @ param is kinda clickbaity, it's part of a larger concept of JSdocs, @ params is well-known and recognizable I had to use it.
JSDoc
defined as a quick start to documenting JavaScript.
besides documenting your code, JSDoc provides a way for vscode to understand your JavaScript, that's where the magic happens, the beautiful IntelliSense.
@ type example
JSDoc has these @ annotations that describe your code, @param being one of them, @type defines the type of a variable. for example, annotating a string.
w/o JSDoc
with JSDoc
Becoming 200x faster
JSDoc and HTML elements
you can document any element and get free code completion.
gif example: code completion
JSDoc and Primitive types
/** * @type {String} */let str; /** * @type {Array} */let arr;/** * @type {Object} */let obj; /** * @type {Number} */let num;/** * @type {Boolean} */let bool;
JSDoc and complex Arrays or Objects
more of the documenting side than code completion.
/** * @type {Array<String>} */let arr = []/** * @type {{a: String, b: Number}} * */let obj;
JSDoc and functions
You can go deeper or wide as you want, and get free code completion. JSDoc was designed for documentation, allowing developers to communicate the functionality of their JS code and their types, vscode just leveraged it for IntelliSense.
Outro
JSDoc is a neat trick to know, to learn more you can visit their site for in-depth documentation and more cool features.
enjoyed the article? and wondering if you can support me, which I will truly appreciate and goes a long way, you can buy me a coffee.
I also have a practical tutorial dropping soon, building a mobile app in React from scratch to production, with monetization, remote DB, auth, and all that good stuff more info here.
with that, have a good day or night. Thanks for reading!
Original Link: https://dev.to/sfundomhlungu/develop-javascript-apps-200x-faster-w-params-and-vscode-43pn
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To