T
T
Taras TTM2015-07-06 09:39:32
Java
Taras TTM, 2015-07-06 09:39:32

How to develop programmer thinking?

Hello. About two months ago, I started learning the Java programming language from Schildt (Beginner's Guide). I started programming from scratch. And everything is going well, interestingly, I understand the theory, but when I have to solve practical tasks I often cannot find a solution, although if you look at the answer, it turns out to be quite simple. How to fix this situation? I don't want to be just a theorist. Maybe there are some special resources that would "train" your brain in this matter? Thanks for any help.

Answer the question

In order to leave comments, you need to log in

14 answer(s)
A
Alexey Yakhnenko, 2015-07-06
@ayahnenko

Oddly enough, you need to program. And think about it.

V
Vitaly Pukhov, 2015-07-06
@Neuroware

I agree with Spetros , the ability to google is a vital skill in programming) 99% of any tasks in one form or another have already been solved before you, 70% already have a well-explained description, 50% there are also instructions, so if you can’t find a solution, this either poorly searched, or the task was set incorrectly.
As for the second part in programming, you need to be able to break the task into parts (subtasks). That is, let's say the task is to find a substring in all the files of a folder, it's not immediately clear how you can search in all files at once, obviously you need to search in each one in turn, if the files are small, then everything is fine, you can read them in their entirety and then calmly search them, but if they weigh under 24GB, then you need to read the files line by line and search for a substring in each individual line, etc.
If "in the head" it is not possible to build a complete solution to a specific subtask, you need to break it into functional parts and solve each of them as a separate subtask. In general, any even incredibly complex product with a million lines of code is just a collection of small fragments, each of which can be understood.

J
jackroll, 2015-07-06
@jackroll

Do not listen to idiots who write what to google - the most important skill of a programmer. Such people have a poor idea of ​​what the Google search engine is and how it works. I don’t understand how such people can call themselves programmers, they are worse than coders.
A real programmer should try to solve problems himself. A programmer should create something new, and not look for ready-made bikes of other programmers.
On a subject - I advise any to find the book on algorithms and data structures. If I'm not mistaken, Laforet wrote a book of this type, where code examples are written in Java.

S
Spetros, 2015-07-06
@Spetros

Unfortunately, you can't develop it.
The ability to use the search is one of the important features, if it is not there, then everything is sad.
https://toster.ru/search?q=%D0%BC%D1%8B%D1%88%D0%B...

E
Eugene, 2015-07-06
@e-antonov

try interactive tutorials with practice without interrupting theory.
for java look here javarush.ru

P
Pavel, 2015-07-17
@zhukpavel

I’m willing to bet that after reading the problem you immediately sit down to write code, which is absolutely not the right approach, since there is no formed solution in your head yet and you have to come up with it on the go. The ill-conceived structure of the program leads to many errors, and in the absence of experience, as you have, it generally leads to a dead end.
I would advise you this method, tested on yourself:
1. Come up with and write down on paper an algorithm for solving the problem. In human language, broken down by points. Moreover, an item is understood as some simpler subtask, which at this stage does not matter how it is solved.
2. Repeat point 1 for each subtask until the solution of the next subtask becomes obvious.
3. Write each subtask separately on a piece of paper in terms of the programming language. Starting from the smallest and gradually coming to the original.
4. (the first three points are done on a piece of paper with a pencil) And only now, with a full understanding of what is happening, you can start writing code.
If the tasks are quite simple, then you may not have to break them into subtasks, and then you can start right away from point 3.
About googling. In general, this is a useful skill for a programmer, but obviously not at the "started from scratch" stage. Now the main thing is to learn how to decompose tasks and build algorithms. The only reason why now you can (and even need to!) Climb into Google is the official Java documentation.

O
Oleg Gamega, 2015-07-06
@gadfi

find first-year labs ─ something simple where there is a lot of work with strings and arrays, logical operators ... so do them.

G
Gluck Virtualen, 2015-07-06
@gluck59

Algorithmize everything :)
Learn to break any tasks (not necessarily in programming) into stages and think through the implementation of these stages.

A
Artem Zinkin, 2015-07-16
@zinkinru

Start with algorithms without being tied to a language. What is important is not what language it is written in, but what kind of logic (read the meaning) is embedded in it.
Any simplest algorithm can be reduced to three actions: “do”, “condition”, “loop”.
"Do" means to do something.
"Condition" - either so, or so (or else so).
"Cycle" - do, do, do...
As has been repeatedly said, try to imagine tasks as if they were performed by a machine: in the form of separate steps. And already you need to google the implementation of these steps directly. And remember, for any algorithm (code) there is a better solution :)

M
Marina, 2015-07-06
@MJee

Here is a good book.
www.ozon.ru/context/detail/id/29561974
Despite the name, there are a lot of good tasks in it. There are answers with detailed explanation. Try to decide on your own first, if it’s completely dead, then read the explanation and then, without looking at the code examples, implement the algorithm.

X
Xee, 2015-07-19
@Xee

Harold Abelson, Gerald Jay Sussman, with contributions by Julie Sussman "Computer Program Structure and Interpretation" and Steve McConnell "Perfect Code".

A
Andrey Shchetinin, 2015-07-08
@draedful

You analyze the task, divide it into parts, in turn, each part into another part, and so recursively up to atomic operations, after which you describe atomic operations in a programming language. This is a very hardcore method, but the most useful one on the start.

@
@coodan, 2015-07-28
_

Forget about other people's decisions and don't worry. Write your decision. Remodel it. Until you like it for its beauty. And then look at someone else's code. As a connoisseur, not a blind copyist.
See what is better and more beautiful with them. Adopt. You can understand this only by comparing it with your beautiful solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question