Use Left and Right arrow keys to move through the sides
Ryan Stille
Servers, disk space, bandwidth, etc. are cheap
Job satisfaction is more likely when you aren't wasting time trying to understand code
What a function does should be clear based on it's name
Getting rid of repetitive code, abstracting details
Lining up code for readability
Easier to understand
Helpful comments
i and j are not descriptive
Choose a shorter name over a longer one if it conveys as much meaning as the longer one
If customer has a property called firstName, user should not have a property called fName
Ambiguous | Better |
text length authenticated date size limit |
searchTerm runwayLengthFeet isAuthenticated createDate fileSizeBytes maxDownloadsPerDay |
Long | Better |
runwayLengthFeet number_of_search_engines transaction_typeID_sapWork_create_material |
runwayFeet numEngines ??? |
A function whose purpose is to provide a service to one or more other functions nearby. Helper functions are often implemented as local functions. - Programming in Scala, Martin Odersky.
Move logical chunks of code to separate methods
Move common code into reusable function
Don't forget to mark helper functions as private
Comment why you did something. Comment what the next programmer will need to know to understand your code.
Break your code into pieces that do one thing and do it well
Wait to write code until you actually need it. Remove code that isn't being used.
Write for a human, not the computer
It will take some extra effort in the beginning put will pay off later
/
#