What are some coding tips I might not learn if you don’t tell me?
Here are some coding tips you might not learn if I don’t tell you:
When it comes to coding, there are several best practices and techniques that can make a huge difference in the quality and maintainability of your code. One important tip is to write code that you can read. This means using proper indentation, line breaks, and syntax highlighting to make your code easy to understand. For example, consider the following two code snippets:
1// Bad code
2const Carinfo = {Model:"Pagani_Huayra",Brand:"Pagani",Price:"$ 14,869,999"}function Show_Pagani_Advertisement(carinfo_object){let Pagani_model_1 = "Pagani_Huayra";if(carinfo_object.Model == Pagani_model_1){return console.log(`This is model: ${carinfo_object.Model}, brand: ${carinfo_object.Brand}, Price: ${carinfo_object.Price}.`);}else{return console.log(`Welcome to this Car Showroom`);}} Show_Pagani_Advertisement(Carinfo);
3
4// Good code
5const Carinfo = {
6 Model: "Pagani_Huayra",
7 Brand: "Pagani",
8 Price: "$ 14,869,999"
9}
10
11function Show_Pagani_Advertisement(carinfo_object) {
12 let Pagani_model_1 = "Pagani_Huayra";
13 if (carinfo_object.Model == Pagani_model_1) {
14 return console.log(`This is model: ${carinfo_object.Model}, brand: ${carinfo_object.Brand}, Price: ${carinfo_object.Price}.`);
15 } else {
16 return console.log(`Welcome to this Car Showroom`);
17 }
18}
19
20Show_Pagani_Advertisement(Carinfo);
Another important tip is to don’t give up. Programming can be challenging, especially for beginners. It’s normal to get stuck or feel frustrated, but don’t give up. Keep practicing, and you’ll eventually get the hang of it.
Additionally, don’t try to memorize everything. There’s no way you can remember all the syntax and concepts without reviewing old documents or googling and browsing documents online. Instead, focus on understanding the basics and building a strong foundation.
It’s also important to use code snippets to write code faster. Thanks to code snippets tools from IDE like VS Code, you can write code quicker by injecting a bunch of code that you customized before into your project.
Finally, don’t focus too much on syntax. Programming is becoming more high-level day by day, and there are many IDEs that provide help and correction on syntax. Focus more on semantics and understanding the logic behind your code.
By following these tips, you can improve your coding skills and become a more efficient and effective programmer.
Check out more details on BLACKBOX.AI 👇
https://www.blackbox.ai/share/a009d028-86b5-4533-b563-7f18eeb516ce
Like, Comment and Follow me for more daily tips.