Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I am new in programming world and I'm still learning the basics and I have this question that I didn't find a specific answer for it..

So, if you are a professional programmer and you're using any language you want, while coding, do you memorize the codes you write or you just pick it from any place and you write it.

Hope you understand what I want to mean.

Thank you

What I have tried:

I just searched quick in google but didn't find something specific
Posted
Updated 29-Jun-20 9:15am

Quote:
do you memorize the codes you write or you just pick it from any place and you write it.

Your question is not very clear, but I think I understand what you want.
A programming language purpose is to translate an algorithm to plain text in a way that will allow a computer to execute that algorithm once compiled.
Thus a programming language have only very little number of structures, just enough to translate an algorithm.
So what is important is the starting point, the algorithm.
The part of writing the code is deduced from the algorithm, the algorithm tells you when you need a loop or an alternative, and how you need them.

So the key of writing code is your understanding of algorithm.

- Learn one or more analyze methods, E.W. Djikstra/N. Wirth Stepwize Refinement/top-Down method is a good start.
Structured Programming.pdf[^]
https://en.wikipedia.org/wiki/Top-down_and_bottom-up_design[^]
https://en.wikipedia.org/wiki/Structured_programming[^]
https://en.wikipedia.org/wiki/Edsger_W._Dijkstra[^]
https://www.cs.utexas.edu/users/EWD/ewd03xx/EWD316.PDF[^]
- Learn Algorithms and Data-Structures (many books exist).
 
Share this answer
 
Neither.
I look at the requirements, and convert them into a specification which provides a testable "end point" for the project. That needs to be agreed with the project sponsor to ensure we all know what is being delivered.
I then work out what I need to provide to meet the specification, and design a system based on that.
Then I can write software based in the design.
Then I can test it.

At any point, I may need to go back to an earlier stage and make changes, which can have drastic effects on already written sections.

So no, I don't just reassemble used code (though I do put together useful libraries for general use in many projects) nor do I expect to find software which fits the problkem exactly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900