P
P
pastaf2017-02-11 22:53:28
C++ / C#
pastaf, 2017-02-11 22:53:28

Is it worth learning to program the old fashioned way?

I study at school in the 10th grade, in the physics and mathematics direction with profile computer science they teach us the C language. So I have a question: if I want to connect my life with programming, do I need this experience, just our teachers teach us the way they taught them and that was oh so long ago. Well, for example, why is it bad that the for loop counter variable is declared inside it, and not at the beginning of main ()? And is C still relevant as a programming language in the 21st century, or is OS even written in something higher? Of course, I understand that sex with pointers develops the brain, and an understanding of basic data structures is simply necessary, but will I develop bad habits associated with constant monitoring of memory, will it bother me that I often use constructions like "pointer to pointer" (for example, when working with linked lists),
PS I started to study the pros in order to delve into the OOP. they seem to me the most natural consequence of C with objects. Am I mistaken in my undertaking, do I need to learn something like java right away?
PSS Actually, this kind of programming seems quite interesting to me, does the C/C++ market even require specialists?

Answer the question

In order to leave comments, you need to log in

15 answer(s)
A
Alexey Nikolaev, 2017-02-11
@Heian

but will I not develop bad habits associated with constant monitoring of memory

Hmm. "If your program only consumes 50% more memory than it needs, that's not so bad."
"It disgusts me how often the curriculum is based on the premise that Java is a good language to start programming, because it's so "simple" and you don't have to get distracted by those boring details about strings and memory allocation, and you can immediately learn cool OOP stuff that will help make your big programs so delightfully modular.This is a pedagogical failure.Generations of graduates condescend to us, throwing Shlemiel's painter algorithms left and right, without even realizing it, because they have no idea that the lines are at the bottom level complex, even if their pearl script doesn't show it. If you want to teach someone well, you have to start with the basics." (c) Joel Spolsky

P
Pavel, 2017-02-12
@mrusklon

when I was at school, they taught me ms office in computer science ... how I envy you

E
evgeniy_lm, 2017-02-12
@evgeniy_lm

1. In programming, the language does not matter.
2. The C language was developed to port UNIX OS code to various hardware platforms. In short, as long as programming exists, the C language and its descendant C++ will exist.
3. The only way to learn programming is by reading books.
4. First learn to write programs, and then you will be surprised to find that you know all programming languages

S
Sergey, 2017-02-18
@red-barbarian

There is an old wisdom "the better a person knows c, the more difficult it will be for him to switch to c++")))
Let me explain, if we consider c++ improved c, then there are no problems.
The difficulty comes from the fact that there are two (+) programming paradigms "procedural" and oop. It's more of a way of thinking. Think of a model that you describe as a kind of algorithm and data, or as a relationship and interaction of objects. So the more you get used to one way of thinking, the more difficult it is to learn another.
C itself aims to describe the system as data and procedures (functions) on them. It now has its own scope. Controllers, drivers, etc. Also, procedural programming is useful in the development of algorithms.
But now the market is taken over by OOP. Those. ordinary programmer is an oop programmer.
I think you need to understand this. Understand how language affects thinking.
And you will be happy)))

R
Rou1997, 2017-02-11
@Rou1997

it's bad that the for loop counter variable is declared inside it

Brad, for a long time almost everywhere they announce inside.
Both.
Develops only one of the characteristics of the brain.
Do not worry, the activities of teachers are usually simply useless, they are insignificant and do not influence you in any way, either positively or negatively.
Will it bother me
because it greatly reduces the comprehensibility of the code.
don't I need to learn something like java right away?

The answer to these aspects depends on your tasks, if they don’t have them yet, like most, and you look at programming as a whole, “I want to connect my life with programming” and no specifics, then only Vanga knows what will bother you and that - no, your activity is not meaningful.
This question needs to be dealt with much more seriously, and it is not possible to answer so primitively.

N
Neznayka xD, 2017-02-12
@Neznayka1979

Robotization of production, trading floors, auto / air ... is and will be in full swing.
And specialists will be needed to write programs, information security specialists, etc.
Yap C (C) is one of the main Yap, which is used and will be used for a very long time for the functioning of all of the above and not only that ...
As for the fact that you are tormented by doubts "they teach the old fashioned way", then the way out is simple buy a book for example :
"The C programming language. Lectures and exercises ” Stephen Prata
Master C in this book and at the same time master English. lang. + algorithms + databases +...

A
abcd0x00, 2017-02-12
@abcd0x00

And is C still relevant as a programming language in the 21st century, or is OS even written in something higher?

A project is being written in several languages ​​at the same time. If you write something, then you need to serve the project files themselves.
For example:
Yes, there are a lot of things to do. Basic principle: if you did something a second time, write a script that will do it next time. So, C is not suitable for such actions, because it is not sharpened for this, a special language is needed. As a result, you have a project in C, pieces of code for the project are generated by a shell script, testing of the project is performed by a python script. And then, for example, you need to generate a set of similar scripts for any new project - and you write a shell script that creates shell scripts, python scripts, and a basic C source. Write a C program that creates C sources to write another program is a nice thing, and maybe write several programs.
In general, you should not bother with one language, because it will be inefficient in any case, whatever it is, somewhere you will need to link programs made in different languages ​​​​into a single system.
In general, my first programs were in QBasic, and they did their job - they got me text data from binaries that I took from one program. But that was a long time ago, but I still remember how much data I got from them. That's what programs are for. Nobody will buy them from you, you make them so that they work and give a result that you cannot get manually, because it is long or impossible at all (100 hours are needed).

I
index0h, 2017-02-11
@index0h

C / C ++ is relevant, this family has a huge ecosystem.
As for habits: not always, but often it is worth writing slower and easier to read code than fast but unreadable.
On account of the correctness, we start with crosses: each language has its own implementation of the same OOP, and having learned one language, you will consider the OOP of this particular language to be the most correct, but in fact you will only work with the implementation of the same OOP, and not generalized principles. The same golang lacks inheritance, but there is aggregation and embedding, there is also prototypal oop as in js...

D
devalone, 2017-02-11
@devalone

C/C++ gives a good understanding of the basics, but in any case, if you are going to connect life with programming, then you will try to learn more than one language and choose what you like / what you will be paid for

M
McBernar, 2017-02-12
@McBernar

And we had BASIC at school.
And I could not understand from your question - what does school and C have to do with it?
In general, you are very lucky.

K
Konstantin Nagibovich, 2017-02-12
@nki

Of course, I understand that sex with pointers develops the brain

Take care of 1C and you will see that you can live without all this.

S
Sh0ttky, 2017-02-17
@Sh0ttky

1) OOP is an ABSTRACTION, and it is incorrect to say that C ++ has OOP, but not C. It's like saying that C++ has buttons and C doesn't. Look at the code of any good project and you will see a huge amount of OOP.
2) is si relevant today? Definitely yes. But you also need to know C++. In the same way, a C++ learner needs to know C. These are the vacancies today.

D
Dmitry, 2017-07-13
@Dit81

Then look in the direction of multiplatform QT ​​or the prospect of the Python language ... I think C may not come in handy later ...

M
Mikhail Potanin, 2018-03-01
@potan

Well, for example, why is it bad that the for loop counter variable is declared inside it, and not at the beginning of main ()?

Is that how they teach, and not vice versa? It is good to make the lifetime of variables as small as possible - this makes the program more understandable to a person, and simplifies optimization for the compiler. That is, it is better to declare a variable in a cycle.
On the subject itself: C is a bad first-learning language and outdated for the industry (there is some demand, mainly for embedded software development, but salaries in this area are low).
But there are old technologies that would be quite appropriate to use in education - for example Scheme (the old SICP is still the best textbook) or the Fort language for low-level programming.
But in general, now it is worth studying functional programming, languages ​​\u200b\u200bwith advanced type systems, and mathematics.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question