+ 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

2nd Jan 2018, 4:34 AM
Logomonic Learning
Logomonic Learning - avatar
5 Respuestas
+ 8
Flowcharts? Pseudocodes? Sometimes they do come in handy.
2nd Jan 2018, 4:43 AM
Hatsy Rei
Hatsy Rei - avatar
+ 2
For things I actually care about I make a list of I/O the program is gonna perform. That's about it.
2nd Jan 2018, 4:54 AM
LunarCoffee
LunarCoffee - avatar
+ 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.
25th Jan 2018, 12:44 AM
Logomonic Learning
Logomonic Learning - avatar
+ 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.
17th Apr 2019, 9:43 AM
Logomonic Learning
Logomonic Learning - avatar
+ 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.
24th Jan 2018, 10:07 PM
Purpll
Purpll - avatar