Yaya Mamoudou’s Post

💭 𝐌𝐨𝐬𝐭 𝐝𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫𝐬 𝐥𝐞𝐚𝐫𝐧 𝐭𝐡𝐞 “𝐡𝐨𝐰.” 𝘉𝘶𝘵 𝘵𝘩𝘦 𝘳𝘦𝘢𝘭 𝘨𝘳𝘰𝘸𝘵𝘩 𝘩𝘢𝘱𝘱𝘦𝘯𝘴 𝘸𝘩𝘦𝘯 𝘺𝘰𝘶 𝘴𝘵𝘢𝘳𝘵 𝘢𝘴𝘬𝘪𝘯𝘨 𝘸𝘩𝘺. A few years back, when I worked as a 𝐑𝐞𝐚𝐜𝐭 trainer, I noticed something: Many learners focused on 𝐰𝐡𝐚𝐭 𝐭𝐨 𝐭𝐲𝐩𝐞 but rarely paused to ask 𝐰𝐡𝐲 𝐭𝐡𝐚𝐭 𝐬𝐲𝐧𝐭𝐚𝐱 𝐞𝐱𝐢𝐬𝐭𝐞𝐝. So I made it part of my 𝐭𝐞𝐚𝐜𝐡𝐢𝐧𝐠 𝐬𝐭𝐲𝐥𝐞. If you were in my class, you probably heard me say: | “𝐃𝐨𝐧’𝐭 𝐣𝐮𝐬𝐭 𝐜𝐨𝐩𝐲 𝐭𝐡𝐞 𝐜𝐨𝐝𝐞, 𝐮𝐧𝐝𝐞𝐫𝐬𝐭𝐚𝐧𝐝 𝐰𝐡𝐚𝐭 𝐦𝐚𝐤𝐞𝐬 𝐢𝐭 𝐰𝐨𝐫𝐤.” Take React’s 𝐮𝐬𝐞𝐒𝐭𝐚𝐭𝐞 for example. Most people know 𝐡𝐨𝐰 to use it, but few know 𝐰𝐡𝐲 we write it that way. Here’s the “why”: 𝐮𝐬𝐞𝐒𝐭𝐚𝐭𝐞 is just a 𝐟𝐮𝐧𝐜𝐭𝐢𝐨𝐧 that 𝐫𝐞𝐭𝐮𝐫𝐧𝐬 𝐚𝐧 𝐚𝐫𝐫𝐚𝐲, the 𝐟𝐢𝐫𝐬𝐭 item in the 𝐚𝐫𝐫𝐚𝐲 is the 𝐜𝐮𝐫𝐫𝐞𝐧𝐭 𝐯𝐚𝐥𝐮𝐞, and the 𝐬𝐞𝐜𝐨𝐧𝐝 is a 𝐟𝐮𝐧𝐜𝐭𝐢𝐨𝐧 𝐭𝐨 𝐮𝐩𝐝𝐚𝐭𝐞 𝐭𝐡𝐚𝐭 𝐯𝐚𝐥𝐮𝐞. Because it returns an array, we can use 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭’𝐬 𝐚𝐫𝐫𝐚𝐲 𝐝𝐞𝐬𝐭𝐫𝐮𝐜𝐭𝐮𝐫𝐢𝐧𝐠 to 𝐮𝐧𝐩𝐚𝐜𝐤 both in one line. That’s why we write it as  𝐜𝐨𝐧𝐬𝐭 [𝐯𝐚𝐥𝐮𝐞, 𝐬𝐞𝐭𝐕𝐚𝐥𝐮𝐞] = 𝐮𝐬𝐞𝐒𝐭𝐚𝐭𝐞(0)   Instead of accessing each item separately like in the example I shared on the image It’s not 𝐦𝐚𝐠𝐢𝐜, it’s just 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭. Once learners understood that, everything clicked. The “𝐦𝐲𝐬𝐭𝐞𝐫𝐲” disappeared, and 𝐜𝐨𝐧𝐟𝐢𝐝𝐞𝐧𝐜𝐞 took its place. That’s what 𝐥𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐭𝐡𝐞 𝐛𝐚𝐬𝐢𝐜𝐬 deeply does, It 𝐭𝐫𝐚𝐧𝐬𝐟𝐨𝐫𝐦𝐬 you from a coder into a 𝐜𝐫𝐞𝐚𝐭𝐨𝐫. Because when you understand the why, you 𝚗̶𝚘̶ ̶𝚕̶𝚘̶𝚗̶𝚐̶𝚎̶𝚛̶ ̶𝚗̶𝚎̶𝚎̶𝚍̶ ̶𝚝̶𝚘̶ ̶𝚋̶𝚎̶ ̶𝚝̶𝚘̶𝚕̶𝚍̶ ̶𝚑̶𝚘̶𝚠̶. 💡 #ReactJS #JavaScript #FrontendDevelopment #WebDevelopment #CodingJourney #LearnToCode #TechEducation #Teaching #DataGirl #ReactHooks #useState #Developers #SoftwareEngineering #CodeNewbie #LearnTheWhy #CodeWisdom

  • text

That's a great point, Yaya! I used to get stuck just memorizing the syntax, but shifting my focus to truly understanding the underlying concepts has made all the difference. Now, deep learning feels completely natural.

To view or add a comment, sign in

Explore content categories