Jump to content

Advice when/for writing


Don E
 Share

Recommended Posts

Hello everyone,This past weekend I wrote a small, simple voting system with php, mysql, javascript, ajax. I looked into ajax some time ago and this weekend I figured I would take a stab at it. I got inspired by some sites that have instant showings of votes without having the page getting reloaded. My question though is, and especially to those who are very experienced programmers, and of course beginners as well.. is what do you guys do when you get into a "block", "frustrated", "confused" or just overwhelmed by many lines of code and just not sure where you're at, at the moment with your code because of the reasons listed?I'm sure for many of you very experienced programmers, you probably experience none of the above really anymore but what do you guys recommend to do when people get into those moments? I've noticed with myself that I have to step away from the computer for a bit to let my mind relax and whenever I do that, everything comes back usually. Of course my objective is always at mind or else I wouldn't be attempting to do what I'm doing but because of the reasons listed above, sometimes a person can lose momentum.So any advice/suggestions would be great! Thanks! :)

  • Like 5
Link to comment
Share on other sites

The idea is that you should make your code modular, by separating related processes into different functions, files, or classes. This way you can work on the current part of the program without being distracted or overwhelmed by all the rest. You can also construct unit tests, that verify that each function, method, or other "unit" in your program is working correctly in isolation, so that you can always tell where a problem is actually at.

Link to comment
Share on other sites

Thanks Synook for your response. Definitely take your advice into consideration. I wrote a website in object-oriented style in PHP not too long ago and I have to say that it did make the writing process more easier BUT what I noticed and realized is that, if the site is going to be pretty big and complex, OO is probably the way to go. If it's not going to be too big or complex, procedural is most likely the way to go. I guess it depends on the site and programmer.One thing though about OO, is that you can end up with a lot of files, because of writing classes, extending a class, etc, and keeping track of it all can sometimes be a task.

The idea is that you should make your code modular, by separating related processes into different functions, files, or classes. This way you can work on the current part of the program without being distracted or overwhelmed by all the rest. You can also construct unit tests, that verify that each function, method, or other "unit" in your program is working correctly in isolation, so that you can always tell where a problem is actually at.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...