A
A
ale-le2016-04-28 12:25:28
Android
ale-le, 2016-04-28 12:25:28

Is this approach to learning programming correct?

Hello. I'm learning the basics of android development. I decided to start with a calculator. Before that, I wrote only labs in C and simple tasks in java, i.e. except for the bubble, spinning rows and matrices in the console, I did nothing.
The calculator is almost ready, but it just depresses me that I did not write it myself.
Yes, I completely made up the UI myself, but I almost completely copied the logic, of course, having thoroughly understood it.
I doubt that this approach is productive, because. I just understand someone else's code, on occasion, optimizing it a little for my task, and I don't write the code completely "out of my head".
Is the vector directed correctly? In the future, will quantity turn into quality with this approach?

Answer the question

In order to leave comments, you need to log in

10 answer(s)
D
D', 2016-04-28
@Denormalization

In the modern world, 80% of tasks are solved by copy-pasting someone else's code and a little editing. (British scientists have proven).
For typical tasks, there are ready-made solutions for a long time. There is no need to reinvent the wheel, and even more complex because of this.
You should not just copy someone else's code and understand it, but also try to reproduce it.
That is, something like this:
- Copy-paste
- Understand why and how it works
- Delete everything, create a new project and write everything from scratch without prompts (with pens).
This approach will be more efficient.
But all people are different, and everyone learns in the way that is convenient for him. If you think that you are good at assimilating the material in this way, then there is nothing wrong with that. Just try to reproduce the result from scratch, and if you succeed - you really learned how to do it.

V
Vladimir Kuts, 2016-04-28
@fox_12

Well, actually 99.9% of programmers take such a vector of development. The remaining percentage is apparently those who do not have the Internet :)
The main thing is not to do it thoughtlessly, but to try to figure out "what and why" in the code that you take. Over time, you will copy-paste less and make more use of your own brains.

S
Saboteur, 2016-04-28
@saboteur_kiev

Write from the head is a unique code. Copy-pasting someone else's code, especially if you understand it thoroughly, is a great idea. Having understood a lot of someone else's code, you see the difference, you see different approaches, you do not spin in your own sandbox.
In addition, you have an extremely correct approach in that you brought the matter to the end and released the product, and this is not only learning programming in some language, but also learning the technology stack - how not only to write a piece of code, but also to compile, and download it to your phone, and run it directly on the end device. Plus UI.

V
VZVZ, 2016-04-28
@VZVZ

Programming, first and foremost, should always be task -oriented .
If within the framework of your task it is enough to take someone else's code and you do not need to study it, then everything is fine.
If it is desirable to dig it out (there are suspicions that there will be problems, or just enough money and time), or if it is necessary, then you need to dig.
For the approach should be intellectual, and not categorical "yes / no."
If "yes" - that is, set a goal within the framework of any task to unearth everything in the world to the last bit, then you will have to dig all the standard libraries, platforms, IDEs, OS (what? suddenly come in handy? happens) - then you yourself understand, there is no time enough, and the real customer will not pay for such a pastime.
And if "no" - that is, always and everywhere to swim on the surface - then you will not be unique and will not master much.
Those. we start from the tasks, but where do we get the tasks themselves?
And we take them from more global goals: freelancing, work in an office, such and such areas ...
Much depends on personal characteristics, someone is a born reverse engineer, and someone is more of an inventor than a researcher, and for them the answer to your question will be different.

E
evgeniy_lm, 2016-04-28
@evgeniy_lm

Well, first of all, you always have to read something. Secondly, why reinvent the wheel. If there is a ready-made code, then why not use it. On the other hand, you should not abuse copy-paste either. Often there are a lot of questions like "Where to find the component ...", "Who has the code ...". A simple rule: "If you know where to copy - copy, if you don't know - write it yourself (don't forget to let others copy it)"

M
Mikhail Potanin, 2016-04-28
@potan

Reading someone else's code is just as useful as writing your own. Especially if it's good someone else's code.

A
abcd0x00, 2016-04-30
@abcd0x00

The calculator is almost ready, but it just depresses me that I did not write it myself.

This is an important question. As long as you don't write anything yourself, copying someone else's stuff can seem easy. But one day you want to write your own program and you think "Will it be mine? Will there be other people's pieces under some other people's rights?". Well, if there is nothing special (free licenses and all that). But it may also be that you will start making money on your program (quite unexpectedly for yourself). And then the author of some piece that has never been seen will immediately wake up and ask you, "Where is my share of the labor?" You want to remove it (part of it) and then you will face the second question, which lies in the same plane: “How to remove it? I don’t know how, because I’m used to only copying.”
This is an important question. Yes, everyone copies the code as much as possible, there is even such a directive: you can copy or write - copy. But this applies to those who already know how to write it all. This is a very important difference - a fool who copies, and a professional who copies. If you don’t know how, then sooner or later you will have to do something on your own (write from scratch or greatly alter someone else’s) and you won’t be able to, because you never developed yourself in this. And the brain is arranged very simply: if you have activated some centers in it, then they remember everything and use it later; if you have not activated the necessary centers, then the brain simply has nothing to remember. Copying the code does not involve the synthesizing parts of the brain.

L
lomikman, 2016-12-16
@lomikman

The calculator is almost ready, but I'm just depressed that I didn't write it myself

You didn’t write your DNA either, but it doesn’t depress you, does it? And she copied herself for billions of years without a twinge of conscience. Take a cue from DNA
The main engine of progress in your maturation as a programmer is how quickly you learn to copy-paste, understand the possibilities and limitations of your tools
Programming is primarily about solving problems. How quickly you will understand how bad code differs from another determines your progress
. Try to find flaws in your code yourself. Then ask experienced comrades. Then rewrite. Then repeat again N times. Set more difficult goals each time, don't be afraid to read someone else's code more than write it yourself (most professional programmers read more than they write). And may the force be with you!

D
Daniil Demidko, 2016-04-29
@Daniro_San

Copypasta is evil.
So it’s not far to become a designer - know yourself copy-paste and mold molds.
The best thing, as already said, is to understand someone else's code and write your own.

R
Roman, 2016-04-29
@Exotic33

There are people who, in order to learn, it is enough to see how others do it. Seeing the implementation of something, for example, I try to reproduce it, I rewrite some pieces of code manually. And you should not be complex because of this. As they say, "A psychologist is not one who knows the answers to questions, but one who knows how to look for them."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question