- Code Editor
Code Editors are text editors with optimized and powerful built-in features, specialized functionalities and integrated tools to simplify and accelerate the code editing process and experience.
There are a ton of code editors in the ecosystem, but for the sake of this course, we'll be using Visual Studio Code, by clicking on the link, you'll be able to download the software and installation is pretty straight forward.
Of course, you should have a browser, however, we'll be using google chrome in the course of the class.
- Create your project folder in any location on your computer
- Open up Visual studio code
- Navigate to the File menu and click on the open folder menu
- A file explorer pops open, locate the new folder you just created and click the open button
alert("Hello World, it's my first Js Code");
- Navigate to your project folder, and open up the HTML file, you should see a prompt if all setup was done successfully
If you've any issue with this setup, leave a comment down below, I'll be happy to help, but if you've made it to completion, I'm proud of you 😉
What is an Identifier
Rules in naming identifiers
There are only two hard things in Computer Science: cache invalidation and naming things. by Phil Karlton, a famous Netscape developer.
Identifiers should start with A-Z, a-z, _ or $ only
Naming should start with characters within A-Z or a-z. No special character should be used to start an identifier except underscore (_) or a dollar sign ($). They can contain digits as well.
Give meaningful names
Your codebase should flow like a poem when read. by Tajudeen (Adeleke) Adenekan
The reason why legacy software (old software) in many companies are usually very difficult to take on new features, scale or maintain is that 85% of the time allotted is spent trying to make sense of its codebase rather than building the new feature or optimizing the software.
One of the major reasons why this is the case is because the early inscrutable genius, who wrote the software from scratch gave a lot of bad names that do not correlate with functionality.
The key takeaway here is this, make sure the name you're assigning to a variable, object, function e.t.c reflect its essence or functionality, technically speaking. This way anyone can jump on the code base and easily make sense of it all.
Do not use reserved words
An example includes
if, else, return, public and a lot more.
You do not need to know them ahead of time, the more you understand the language better, you'll naturally know them.
No space or hyphen
This convention is named after the sloppy back of a camel. The rule is whenever you join two or more words together, the first word is all lower case while the first character of all subsequent words should be written in upper case. For instance, if we want to use
upload files to google cloud, we simply say
another instance is
add two numbers, we say
Use of Underscore
Multiple words can also be joined together with the use of underscore. Taking from our examples above, we can simply say:
The question I always get goes like this, "Dami, which convention should I stick to 🤔?", Don't overthink it, you'll naturally find yourself comfortably using one than the other, consistency in using that singular pattern becomes the object of necessity. Also, if you find yourself working among teams, simply follow whichever convention their coding standards depicts and you'll do just fine.
That's it for this series friends 🙂
Leave comments for any questions and nice reactions if you've learnt a lot.
Upcoming series: Variables & Data Types
See you in the next series 😉