r/ElectricalEngineering • u/bhalo_manush • 17d ago
Education How do I improve at coding (c/c++)
This semester I took my first class , they're teaching us C ,this is also my first time ever learning how to code ,and not gonna lie ,I'm dreading every single day , almost every single code I write has an error, not matter how much I practice, I can't seem to improve, get get in the flow state where I finally cracked it ,this has never happened to me before, , even in my first year ,when I took my last physics course (I really struggled with ) I somehow raw dogged practice problems until I finally got better, but this time I'm going no where ,every code in wrong or has an error, what also weird is some peeps in my class with no experience in coding, are catching up immediately, here I am looking like a monkey with a hammer in his hand banging the keyboard, going no where . If there's anyone who's been in my place , please guide me , I want to get good at it ,and understand, I don't want to be like the people that vibe coded their way through everything, I also want to go into control systems as a major ,so I know this is something that I have to excel att
3
u/imseakin 16d ago
Look at University of Waterloo CEMC Canadian Computing competition problem sets from past contests. The easier level problems will help you build competency and they provide solutions. Then move on to more complex problems.
It can be tough going. But practice builds proficiency.
Use your college’s tutor engagement time to get extra in person help.
(Retired high school COMPsci Teacher here)
2
u/Juanybutnotjuany 17d ago
I’d follow an independent course that you can move through fast. Just searching up learn c, you’ll find plenty of free resources. Most programmers also tell you to work towards a project, so find something you’re interested. When you run into a road block, look through the documentation and Reddit. Most people argue that route memorizing knowledge is not what makes a good engineer, but the ability to quickly and throughly research, make sense of it and apply it.
2
u/Past_Awareness2079 14d ago
Look up Tsoding on YouTube, most of his videos are on C. He has older videos where he builds a hash table with C. Also, look up pointers in c by freecodecamp, on YouTube as well.
2
u/bobd60067 13d ago
no matter how experienced you are, it's rare to write a new piece of (non trivial) code and have it compile and run perfectly the first time. it's just too complex. so don't worry about that part.
focus instead on creating a good architecture & design, and work on your debugging skills too.
1
u/Usernametaken427 17d ago
One thing that really helped me was building text based games or something like a tic tac toe board to help understand arrays, iterating loops, pass by references etc depending on how in depth you go.
Or get an arduino to practice the hardware side of it
Edit: cpluscplus.com is a great resource too
1
1
u/RevolutionGlad4540 17d ago
I suck at coding, so idk if you want advice from me, lol. When I took my Data Structures and Algorithms class a while back, the professor made us write code by hand a lot. I thought it was fucking stupid at first, but it actually helped me understand the flow of the code a bit better.
I'd suggest using a whiteboard and manually working through different iterations of your code. It helped me visualize what was happening at each step and better understand how everything worked.
idk, I just thought it was interesting.
1
u/NewSchoolBoxer 17d ago
C and C++ aren't the same thing. Coding skills in one language transfer to another. You lack CS fundamentals. I guarantee you 90-95% of that C class came in with significant high school coding experience. The pace is too fast for true beginners.
Yeah you just need to practice more and make up for being behind. I've taught Java to over 50 employees from the ground up to beginner level and the main thing was always putting enough time into it. There's no shortcut. Don't watch 10 hours of videos and think you've learned anything.
I also want to go into control systems as a major
It's very math-intensive in a classroom setting. I didn't have to code anything.
1
u/Truestorydreams 17d ago
Its as others say. Practice. One thing i really like about programming is you can literally see your growth the moment you look back.
If you kept your labs from week 1.... Without looking at how you solved them, redue them. Then compare the difference. It will be night and day.
1
1
1
u/ThaumKeeper 14d ago
If your code has errors, it's either a compilation/syntax problem or a logic problem. Take some time to plan a solution agnostic to the language. Then try to translate that solution into C, syntax is something you will pick up with enough practice.
1
u/Zealousideal_Tie_426 11d ago
Write by hand first, but a book or series you're comfortable with and stick to it. Also at weekends do small builds end to end and document them. What I was taught: expect to fail and learn to fail fast. Also know how to ask for help, this will make you infinitely better. LLMs do help but in chunks don't mentally offload or you'll be a lot worse off.
Or drop out and marry rich. Follow me for more.
0
u/Jaygo41 17d ago
Practice? Ask AI to help you understand things? Try to make your own exercises?
-1
u/bhalo_manush 17d ago
Already doing it , but as soon as I hit exam level algorithm heavy problem, I land on my face
11
u/FearTheMoment_ 17d ago
Practice more