+ 3
What is your method for writing code
I’m currently proficient at analysing and studying code that’s already been written. At some point though I’ve got to be able to write code from my own knowledge and skill. What method, strategy or technique do you use to write code? Do you just start writing or is there some planning involved? All answers will be appreciated
5 ответов
+ 8
Flowcharts? Pseudocodes? Sometimes they do come in handy.
+ 2
For things I actually care about I make a list of I/O the program is gonna perform. That's about it.
+ 2
@Stay_frosty true, but not all styles are equal. An expert will plan and implement code differently from a novice. And two experts may probably have their own styles. But at the end of the day the one whose methods are efficient and effective will produced the better script, and quicker.
+ 2
A year on I can answer my own question with confidence.
1) plan your code with storyboards, flowcharts and psudocode
2) List all the functions and choose which design patterns to use. bearing in mind design principles such as DRY and KISS.
3) prototype your scripts with online IDE's like jsbin
4) Familiarise yourself with your text editor and know all the keyboard shortcuts and features, then use it to refactor your code.
+ 1
I start off already knowing what program I want to code, and I have an idea, of how it's gonna be structured. If you start coding yourself a lot, then you are also going to develop your own coding methods.