RE: getting stuck 09-23-2014, 08:59 AM
#11
This is normal, blackeagle. Even if you are experienced you will get stuck, although it won't be the simple stuff anymore.
Every programmer needs persistence and confidence that he or she will eventually find the problem and solve it. Debugging stuff for hours or even days is normal. I was once stuck for two weeks. It is probably the most frustrating experience in programming, but you can learn to avoid it as best as possible by inhabiting good programming practices and gaining experience and knowledge in software design, architecture and testing.
This is the stuff especially beginners like to discard as pointless work. But it is actually worthwhile to do:
Every programmer needs persistence and confidence that he or she will eventually find the problem and solve it. Debugging stuff for hours or even days is normal. I was once stuck for two weeks. It is probably the most frustrating experience in programming, but you can learn to avoid it as best as possible by inhabiting good programming practices and gaining experience and knowledge in software design, architecture and testing.
This is the stuff especially beginners like to discard as pointless work. But it is actually worthwhile to do:
- document all of your code (e.g. comments, javadocs, specify: preconditions, invariants, postconditions; specify the semantics, specify measurement units, e.g. for a method long getTime(): Do you get seconds? milliseconds?)
- design your code for readability, not performance (performance is in most cases something to react to when you encounter problems, not to tackle in the first place---there are exceptions though, but that comes with experience) Just follow this rule: Do not sacrifice readability for performance unless there is a real performance problem
- write unit tests, a lot (look at JUnit or TestNG once you feel confident to write bigger programs; yes, unit tests are boring and seem pointless in the beginning, but they are actually one of the most helpful tools to avoid problems in the future)
- refactor your code often, do not proceed with bad code once you know there are better alternatives (prerequisite: good unit tests, so you don't fuck up parts of your code that already work)
- get familiar with OOP design patterns and code smells, gain experience in applying the first if appropriate and avoiding the latter
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.
Expressed feelings are just an attempt to simulate humans.
![[Image: 2YpkRjy.png]](http://i.imgur.com/2YpkRjy.png)
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)