I was working on a project today, and practicing. I feel like I am learning to code without relying on youtube tutorials and ai as much. I feel like I am learning to not ask ai for the code, but to google better questions.
I feel like my research skills is getting better with googling better questions, looking in documentation a little more, and using other resources before I go to ai and ask it for the code. Which lately I haven't really been asking ai these past few days now for the code. I will tell it don't give me code, but I will ask it how do you code a feature like this, for example, "There is a drop down menu. How do you code a drop down menu , and make sure this is how you it is coded in real world applications and projects, then I will look at the code, study it, figure out what was done step by step and how to do it step by step, sometimes I ask the ai for the html code and css code of that JS code it gave me and post it in a different vs code window and go to the live server and test it.
Which recently I opened a new VS Code window for testing code before adapting it to my project.
Then I will look at the code and figure out how to adapt and change it to my own specific project, like I will change the variables, or anything else that needs to be changes in my project, I will have different variables, and anything that needs to be adapted for my project ,but I look at the code I tested and adapt it based on my variable. i write the code, and don't just copy and paste and adapt to my specific variables and anything else.
I am learning how not to ask ai the code, but ask it how a feature is coded and adapt that feature to my own project, and also ask it if there is a concept I don't understand, but first I go to google and get the answer of how to write a specific code and then I adapt the answer or solutions on google to my specific project.
I also try to search concepts in documentation, which I don't always find what I am looking for in documentation, but I feel like I kind of in these past few days been getting better at reading searching documentation. I try to go to google, documentation, and even youtube first before going to ai. When I do go to ai which I do use is I will ask it how is a certain feature is coded in real projects and real world applications and then test the code in different vs code window, look at what steps to take based on that, and then sometimes comment out just to see what each code mean or does, and adapt that in my project where my VS Code project is at. I go to ai last when I couldn't find the answer, but I try not to ask it for code for my specific project but just a general example of how to code a certain feature.
I also use ai lately to tell it what I am coding/building and give me the instructions in order, and then I will ask after that is for each instruction, give me the concept for each of these instructions because I like to look at these concepts in the documentation sometimes to get a better understanding. I will ask it sometimes for both instructions for html and JavaScript if I don't understand or know from the start how to code something in the html.
I am trying to rely less on ai and go to other sources first like google, documentation, YouTube tutorial (Especially for a specific feature, I try to find on YouTube.)
I also want to say I felt like yesterday or a couple days ago, I got so much understanding as I was coding even though I was struggling, but I am finding and believing that a lot or majority of web development is problem solving.
I also heard from someone on YouTube or somewhere, said in their video that 80% of web development is problem solving and solving problems.
Sometimes when I get frustrated with a bug or problem, I try to change my mindset with thinking, 80% or a large part of the web development is solving problems.
I also wanted to say lately as I am coding, the idea came to me that web development is: 1. Learning the concepts of a programming language, library, framework or anything, 2. Improving your research & coding skills (Which this gets better I feel like the more you practice projects and practice and learn from mistakes), 3. Debugging Skills
I feel these 3 things is what it comes down to lately as I am practicing coding.
I feel like I my research skills and coding skills now are getting better, it seems like ever since I stopped asking ai for the code for my project and go to google and ask better questions, and go to the other resources first, and then if I can't find the answer ask ai not for the code for my project, but asking it for the code for a specific feature and seeing how a specific feature is coded, and then adapting that in my project, and only using ai for instructions and identifying the concepts of the instructions it is giving me.
I also feel like I have learned the concepts of JavaScript, but I can learn more, but I feel like number 1 and number 2 I have done for JavaScript. I feel like I just need to practice more and continue to improve my research skills and coding even though it seems to be improving. I also feel like I definitely need to learned specific debugging strategies for JavaScript and practice them. I am not saying I don't need to learn more, I feel we will always be learning JavaScript, React and all these things in React ongoing in our web development journey.
I also wanted to include some more progress I made in JavaScript and web development today and the past few days.
For a past couple of weeks I have been struggling with a bug, the setInterval bug, finally solved it. I asked ai yesterday this prompt after I tried everything else to debug (Which I am going to learn debugging strategies for JavaScript, but I was thinking of getting more practice in and improving my research and coding skills first), but I asked ai this, "There is a drop down menu. Give me a coded example. Make sure this coded example is this way in real world applications and projects." Or I wrote something similar to this, and it gave it to me , I looked at the code, tested it in a different vs code window, and thought about what is the step by step based on this coded feature and the steps I take to apply to my feature, so I gathered the step. Wrote the code in my VS Code window where my project was at, followed the steps and adapted and changed the variables and everything according to my specific project. It went to working.
The second issue I ran into last night was the empty option value was working the first time you clicked it because it would show , Please enter a city, but when I clicked on a city and then came back and clicked on the empty option value again, it would show the cities anyway, so I commented everything out one piece of code at a time. I commented out the return under the textContent statement, and I just knew and thought to myself the return statement is supposed to be there. I also tried search the documentation and google. Which there are times in coding this project that google gave me an answer and sometimes the documentation helped me understand something, but that wasn't working. I kept googling, still couldn't find what I was looking for. I eventually found out it was because the clearInterval was before the city logic was being checked.
I learned this week and today that: 1. The clearInterval needed to be before checking if a user selected a city or not. It needs to be before if (!city) .
2. The setInterval needs to be in the event listener logic of the button, but I learned I was doing even more wrong than that was the reason the city and time values was running before the user clicked the button to show. (I gathered the steps, but I am going to write or type them down eventually so when I encounter this issue with setInterval I will know what to do and how to solve it next time.)
These are the 2 lessons and other insights I feel like I got this week as I was coding this project and practicing.