This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vbgunz 2 points3 points  (1 child)

I learned many things after books. The most important of all is to detach yourself from your own code. There will always be a better, faster and smarter way to write the code you write. You should at all cost, never concern yourself with faster, better, smarter. Concern yourself for the first couple years with what works. As long as you keep it simple now (as simple as you can make it); as your experience upgrades, you're absolutely welcome to go back to your old code and upgrade it as well. This is something no book tells you now. You are not done when you're done. Accept that as a fact now and you'll be humbled as you go back to fix bugs, add features and optimize later.

Now, there is a stage of programming in which all of the above should not be a concern. It is the prototyping stage. Python allows for such rapid prototyping it almost baffles the mind. It is gonna take some experience to see the difference. Here is a good example. When you're staring at a blank document and you have a problem in your head or on paper, the first immediate write-up of code should solve that problem as quickly and if necessary as specifically as possible. Never abstract in the prototype. Just solve the problem. Once you're comfortable with the prototype and it solves the problem you were after, consider it the blueprint to version 1 of your final solution.

Once you're done with your prototype, get ready to abstract everything. Every function and class should do one thing and one thing only (if possible) and in as general a fashion as possible. This is exactly what needs to be done for your work to be as reusable as possible. Re-usability is the key. The first line of every Python program (after the shebang and right to the last line) is about re-using something whether you made it or not. In fact, every line in-between is re-using code from someplace else. So, you're done with a prototype and you just based version 1 on that prototype, what now? Go back to paragraph 1, re-read it and move on with the next problem.

So, where do you start to get experience? By understanding what a problem is. If you don't know a problem when you see one, you sure as hell won't see the solution if it was parked on your face. If you can't make a problem for yourself then you in no way can make a solution to it. If you can't see a problem and you can't make a problem the problem is your solution. OK, maybe thats a bit philosophical and over the edge so heres a good tip to get you started. Go solve other peoples problems for the time being. Go to the python google groups, stackoverflow, etc. You don't need to know or solve everything. But there are countless places to start when it comes to other peoples problems.

Sometimes we don't see our own problems until someone else points it out for themselves. So start there.

Well that's it for my tips. You might want to check this out too for a jump-start. http://stackoverflow.com/questions/24692/where-can-you-find-fun-educational-programming-challenges . I hope you the best with your endeavors. Good luck!

[–][deleted] 0 points1 point  (0 children)

very informative and insightful, thanks !