Why is used in c

Why is anyone still using C?

cooky451 wrote:

dinosaur wrote:

I can’t believe it. You would have to do without all containers / algorithms of the STL (maybe except for std :: vector).

This is nonsense because a large part of a program is often completely non-performance-critical.

That's exactly what I wanted to get out of. For the majority of a program, C ++ is completely overkill - from the point of view of performance and syntax overhead. If nobody gets performance problems with the standard library, then performance is obviously no reason for most of them to choose C ++.

dinosaur wrote:

I've never had a problem with it. It is easy to see. Overall, the time saved by not having to do verbose typing all the time is greater than the disadvantage.

So that bothered me enormously, especially if you want to change something quickly for a test, sometimes errors occur in marginal situations at runtime that the compiler would otherwise have reported immediately. (I don't mean there is static_assert for nothing.)

Fortunately, you can correct the error on the fly and don't have to wait hours for the compiler.

Besides, there are good tools, pyflakes catches you some errors during the code.

Apart from the fact that it bothers me enormously that some errors are unnecessarily only noticed in special cases during runtime.

The type system doesn't catch special cases either.

Why should saving time while typing be important? That is completely irrelevant. It is much more important to see what you have and what it is later in the program. With every major program, I find that completely unmaintainable. If I see a function somewhere that gets a parameter x, how should I know what x is and what it can do?

Take this as an example: https://docs.python.org/3/library/argparse.html vs http://www.boost.org/doc/libs/1_55_0/doc/html/program_options/tutorial.html# idp163291912
Which code is more readable:

(Unfortunately no suitable syntax highlighting here)

It's much better if you know the type right away, then you can look at the type and you can't go wrong with anything else because the compiler supports you.

You see named arguments when you call it up, you have to find out the type every time.