If you think decomposition is from CSI, stop writing code!
I like coaching developers to write better code, but sometimes it is too much. So here it goes:
Want to improve? Attend a computer science 101 class at a good university and some programming lessons. This is the 21st century, it won't cost you (other than your time):
If you think decomposition is from CSI, STOP writing code!
So, it is off my chest. Simples rule of thumb:- if a function doesn't fit on a printed page, it is too long
- A function does one thing. If you loop through a document (or record) collection call a function with the individual document as parameter
- Use objects and inheritance with a factory class instead of monster case structures with copy/paste code duplication
- Refuctoring was meant as a joke
- The functions that declare a variable clean it up, not the called functions
- Global variables are evil unless you have 7 good reasons to have them
Want to improve? Attend a computer science 101 class at a good university and some programming lessons. This is the 21st century, it won't cost you (other than your time):
- Stanford Engineering Everywhere offers:
- Coursera offers classes from different universities. Check these out:
- Introduction to Python (Rice)
- Computer Science 101 (Stanford)
- Algorithms: Design and Analysis, Part 1 (Stanford)
- Algorithms: Design and Analysis, Part 2 (Stanford)
- Algorithms, Part I (Princeton)
- Algorithms, Part II (Princeton)
- Learn to Program: The Fundamentals (Toronto)
- edx offers education from MIT, Harvard, the universities of Texas and Berkeley
- CodeAcademy has JavaScript, HTML/CSS, Python and many more
Update: Lydia advised me on broken links with CodeAcademy asking to link to her Phython courses article in return. Thank you Lydia
Posted by Stephan H Wissel on 15 October 2012 | Comments (3) | categories: Software