+ 1014
[NOTQUESTION] A Helpful Coding Tip
A lot of people know that it is a good practice to comment your code.But there is something else that is more helpful.In Zed Shaw's 'Learn python the hard way' book he advised to comment each line of a code you don't understand.By that I mean is if you don't understand a code, go through each line and explain what that line does.That way you would easily know where the problem lies.I've tried it and it really helped.Just to let you people know something useful.
479 Réponses
+ 152
it's nice to comment a code but there are some drawbacks as well. Like if developer updates logic and forget to update comments. or some times logic is not explainable in comments, so we should keep this in mind while putting comments in code.
+ 96
@ASIF
Thank you, for sharing the tip!
+ 94
Learn Python theHard Way was one of the first books I read about programming, many years ago. That is definitelyy one practice I've taken the heart and you're right that it helps.
I'm generally the kind of person who spends a lot of time on organization, taking notes, creating documentation and commenting my code. Some people place more focus on getting as much coding done as possible, and of while that is also vital, I think a solid foundation for learning and working that you can apply to anything is what will eventually help out rise above the the rest.
Whether I'm learning a new language, a library or a framework, using new tech or simply reading about better practices to improve myself, I always work in a similarly obsessive fashion. I try to pay attention to how every little line of code works and a
write extensively. Some of it ends up on my blog, but most of it is just for my own use and will likely never see the light of day.
As an example, I'm learning to use Mongoose (MongoDB for NodeJS) right now. Also, as a more general goal, I'm trying to make use of ES6 and functional programming wherever possible, while avoiding only doing some things out of habit (like using jQuery and SQL databases). The basics of Mongoose are easy to get a hang of and it's possible to get started fast if you know Node.JS. But I've still rather been writing a long Markdown document detailing its usage, API and how ES6/functional programming can be used with. I've saved related Gists (I LOVE using Gist for learning and random snippets) and bookmarked several dozen bookmarks, with tags and all. I don't want to to just know ABOUT NoSQL databases - I want to be able to say with confidence that I'm skilled in their usage.
A lot of time, all these tutorials and and the possibilities the languages, their hundreds of libraries and all the other technology offer, can feel overwhelming. But when you get down to individual lines of code, the big picture gets a lot clearer.
+ 58
Good tip. I usually say it out loud as I talk to myselves a lot.
+ 56
Search for 'rubber duck debugging'.
+ 50
Great tip 👍
+ 46
Another great tip for debugging is adding sensible print statements inside function/method's body where the issue is or inside many functions/methods to find the problematic function/method printing values of variables etc. But be sure to print clear statements, e.g: "Now in destructor", etc.
this way u can watch variables and program flow and know when and why values changed.
This can be also be done in IDEs using their "Watch" window.
+ 44
Don't forget to eat.
+ 41
pay attention to capitalization, also instead of coding, write out your programs on paper then plug them in and see if they work, doing this will force you to be more aware and notice little details better without having to go back and figure out why there is an error as often
+ 37
IMHO, it is just like verbalize what you doing when you doing something complicated. It is very useful for tracking your menthal point and moving to the aimed result.
+ 31
thanku for your useful tip for coding.
A true coder wants to know than he can achieve anything in programming world and he can automatically mind thinks no one can try the coding for getting likes or comments .any one want to try the coding for useful in any part of life than that coding wants to used in any part of everyone life. in that aspect every programmer must think about the coding. from that automatically the likes and comments are get across u.all the best to all
+ 29
That actually is a good tip
+ 28
really very helpful tip
+ 28
thnx..nice tip!
+ 27
That's very true, the comment helps a lot
+ 26
great thank you
+ 26
tq
+ 23
It's a good practice, but in your work this practice can mess up you or delaying you in your tasks.
+ 23
id like to note that this tip is always useful for any new language whether it be you are learning html (a mark up language) or programming, anything that is technical and allows comments i advise this.
never be afraid to break your code its the best possible way to understanding what exactly is happening and add it to your comments if you feel the need to do your research first for yourself! if you truly are lost ask for help to understand what something is. programming is about self learning just as much as it is team building.
+ 22
here's a few tips: ... find something to focus on focus on one thing at a time; ... one task at a time; ... as you're learning something talk to yourself as you are learning it try to talk yourself through it after that then try to say it as if you were teaching someone else; ... as if you were teaching a class; ... imagine what some of your teachers sounded like while they were teaching class try to say it like that out loud that auditory sense will reinforce your memory; ... write things down it'll reinforce your memories as well, that's a visual and a touch; ... any chance you get to teach somebody once you learn something do that, ... answer that question because you figuring out how to say it will reinforce your ability to do that too!!! ... and now main thing, ... imagine yourself as doing what it is that you are learning imagine yourself going through each step... because anything that you imagine yourself to be doing will be reinforcing your memory