r/AskComputerScience • u/[deleted] • Aug 09 '20
Learning higher level programming
Hello
I've been programming for about 5 years now, and I have a decent understanding of several language (mostly C/C++, as well as some assembly and python).
While I do feel that I have a decent knowledge of the detailed, technical stuff (algorithms, data structures, languages and concepts, etc), I'm lacking in the higher level program... design. How do I design and structure larger applications?.
For example, how would I know if I should design something as an object or function? What should I run as separate threads, and how do I figure these things out on my own?
Links or references to informative litterature or articles are highly appreciated, as well as comments!
Thank you in advance.
2
u/BigTheory88 Aug 09 '20
While I agree that reading up on these "high level" things is important so you can understand why they're done etc. I think it's just as important to start writing code and actually "experience" them. You've probably heard of DRY, which is one of these concepts - if you see yourself repeating things, create a module to handle this that can be shared by multiple parts of your code that require those "things".
From my experience, if you can get code reviews on code you write then get them and learn from the comments on them, they're super helpful.
For structuring projects, it really does depend on the project so I cant give much input there but if you're building a webapp and following the MVP model for example, then you'll know how to structure your project to a certain degree.
For separate threads, think - does this piece of code need to finish execution before the next part of the code, am I going to be running this code on a CPU that supports multiple threads etc. - Take a look into when to use multithreading.
In terms of literature, there's 3 books I'd recommend
- The Pragmatic Programmer by Andy Hunt
- Clean Code by Martin Robert
- Clean Architecture by Martin Robert
Just start coding and use these to supplement what you're learning while reading or use them to help find areas of code that can be improved.