Answer the question
In order to leave comments, you need to log in
How to develop thinking for programming?
I recently finished studying Python (from books) and in practice I noticed that I have a hard time creating an algorithm (sometimes I just can’t formulate it in a programming language).
I tried to read Cormen , I didn’t master it (since mathematical preparation is at the level of grade 9).
What would you recommend to read or study? Or is it worth starting to study higher mathematics for further study of algorithms?
Answer the question
In order to leave comments, you need to log in
Experience is the best teacher. Engage directly in programming from easy tasks to complex ones. I graduated from the Faculty of Physics and Technology and when I started programming I was no different from you, I got confused in algorithms and hardly built cycles. I started with the simplest, took a textbook and analyzed examples, came up with problems and bravely solved them, read manuals, found sensible video tutorials on the necessary material. Patience and hard work do their dirty work, I do Web programming and the more I study it, the more I realize how much I still don't know. I think the most important thing in programming is that you yourself are interested in doing it and you are happy to spend your free time and effort on it, everything else will come with time. I can also advise you to find a company of like-minded people or a mentor, with whom you can consult and ask for help,
In my opinion, mathematics and programming have little to do with each other.
Even at school (well, yes, physical and mathematical school), my friend's math was no worse than mine, but programming was not worse. School and college mathematics - alas - are taught to solve standard problems using standard methods.
Creating even just an algorithm is a creative process.
Well, actually - in programming there are few conceptual entities - variables, input-output, cycles, functions, C ++ as a nice bonus, coupled with RAD.
If we take a typical program - solving a quadratic equation - then even here there will be moments of creativity.
How to name variables? Are the coefficients entered by the user or are they hardcoded? After the end of the program - everything, stop or decide one more thing? And if they slipped a linear equation, and not a square one - what to do? And if the equation is given as a string like "2x^2+3x-10=0" - can we solve this?
Well, and so on.
And to program some tic-tac-toe - we need to solve even more such issues.
And mathematics as such is generally of little use - if you need to program how a satellite flies - then read books on numerical methods, since now they are a lot - from the point of view of programming - everything is hyper-simple there.
As a rule, these are programs of the form to read data, to calculate for a long time using complex formulas, to display the results.
Yes, there is a certain amount of knowledge that you need to know - such as what a pointer is and how it is stored, that it is not undesirable to compare a float type variable with zero, how arrays are stored, etc. well, this is all in programming books.
My idea is this - try to solve the same programming problem in DIFFERENT ways - well, or at least think about different approaches.
About myself - from the first year of the institute I worked in a software company. I write in C / C ++ in its various forms, I don’t know newfangled things like Python.
Learn math. Click on higher algebra, mathematical logic and the theory of algorithms.
Solve problems. Read Knuth's Concrete Mathematics.
Recently finished learning Python...
Thinking for programming cannot be developed in any way, just like the body for ballet - it either exists or it does not.
Your "hedgehog" is in another area. To be a “fox” in programming is to produce shit code or do something, but not enjoy it. Try a different area.
I think your problem is something else. What I will say is just my opinion and it may not be true, but nevertheless I recommend thinking about my words.
Is your problem in not understanding what you want to achieve?
You see, there are different goals: programming to solve problems and programming to make programs run even faster. These are completely different goals!
Ask yourself as many questions as possible and understand what you really want to achieve? What specific goal are you pursuing?
Knuth has a book "Concrete Mathematics", if he hasn't mastered Cormen, this one should be easier to go in)
There is also a video course "Discrete Mathematics" on the intuitive, everything is straight from the very beginning
For algorithms, it is worth learning algorithms, and as said above - practicing. It is necessary to understand what abstraction and decomposition are at least, and then learn how to use it.
In any technical university there are hundreds of books for a programming course, the main thing is to understand the essence, and then expand the knowledge with skill.
If you didn't pull Cormen, try another: Wirth, Skiena, Goldaev, Levitin... you can enumerate them ad infinitum, they are all about the same thing in different words, and sometimes the same ones.
Read about patterns, try to comprehend and analyze. Main traction.
upd:
Well, or over there in the next branch recommend aliev.me/runestone
To be honest, thinking for programming, in my opinion, develops in the process.
In the course of studying at school, in the modern program there is a rather extensive topic - flowcharts. They facilitate the creation of an algorithm by visualizing it.
Perhaps they will help you if you say that it is bad with algorithms.
I also advise you to practice on something simpler ... Python, as far as I can imagine, is not such an easy language.
Take the MSU program for mekhmat/VMK. Start by preparing for the entrance exams. All information is in the public domain. You can compare with MIT.
It's simple:
Try to calculate the factorial (recursive algorithm), having previously compiled a flowchart (for example, in www.draw.io ). And then - you will understand what you need.
To develop as a programmer, I recommend constantly setting yourself new, non-standard tasks. I recommend trying to solve the existing problems in the most optimal, elegant way. It is also worth paying attention to your metrics, and not only the code, but also the body. Try to bring the development process to perfection. Such a global direction will automatically force the development of thinking. And then books and mathematics will follow.
What do you need to write an algorithm? Mathematics? Unlikely. For mathematics, you just need to be able to compose algorithms. Xs, try to live in our realities. Survive on a salary, buy a car, become more independent, make your own decisions.
I can't imagine how you can develop logical thinking in a closed space.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question