D
D
dubstephere2014-12-21 00:27:18
Programming
dubstephere, 2014-12-21 00:27:18

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

15 answer(s)
A
Andryushkov Konstantin, 2014-12-21
@dubstephere

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,

D
Dum_spiro_spero, 2014-12-21
@Dum_spiro_spero

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.

A
Armenian Radio, 2014-12-21
@gbg

Learn math. Click on higher algebra, mathematical logic and the theory of algorithms.
Solve problems. Read Knuth's Concrete Mathematics.

A
Artem, 2014-12-21
@mrRontgen

Recently finished learning Python...

Knowing the syntax of a language does not mean that you know the language. Complete your sentence to the end. What do you understand about the language and what do you not understand? I know many people who have read many books on mathematics, algorithms, but they cannot apply this knowledge. Higher mathematics (as you called it) is the level of abstraction (the real problem turns into an expression, an equation). For example, how much wallpaper do you need to buy to cover a room? Measure the dimensions of the walls, find out the width of the wallpaper, write down the equation and voila!! The same is true in programming. There is a real task and you translate it into a certain language (create an abstraction, a model). And what mathematics really gives is the skill and ability to work with abstractions. And the better you learn to think in abstractions, the better you will be able to solve problems (and not necessarily in programming). What I want to convey is that you do not waste time simply studying books! Find a problem and start solving it, and in the process of solving you will have a lot of questions and you will look for answers to them in books, on thematic sites, and so on. Moreover, you will learn how to ask questions.essentially ! And since you say that you have finished learning Python, then here's the problem for you: why is there no tail recursion optimization in python?

E
Evgeny Maltsev, 2014-12-21
@hellpirat

Might help :)

G
garex, 2014-12-25
@garex

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.

D
Dmitry, 2014-12-25
@EvilsInterrupt

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?

C
Cyril, 2014-12-25
@krog

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

L
LLlAMuJIb, 2014-12-25
@LLlAMuJIb

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

U
Uno, 2014-12-25
@Noizefan

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.

E
Elizaveta Borisova, 2014-12-21
@Elizaveta

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.

X
xmoonlight, 2014-12-21
@xmoonlight

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.

P
Pavel Elizariev, 2014-12-21
@effetto

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.

V
Viktor Vsk, 2014-12-21
@viktorvsk

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.

K
kstyle, 2014-12-21
@kstyle

Grade 9 is enough for an active start. find tasks and even easier books.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question