R
Rui Maciel
August said:To me this is the typical macho programmer attitude. We all know that
every programmer makes mistakes every now and then. What sets a safe
programming language apart from an unsafe language is that a program
written in the former is not allowed to proceed executing once it enters
an ill-defined state. This prevents data corruption and makes the error
much easier to find.
This has absolutely nothing to do with "macho programmer attitude", whatever
that is. If a person is employed as a technician, or at least intends to do
work in that field, then the least that person is expected to do is to have
a rudimentary understanding of how the tools of the trade work and what are
the proper ways of using them. If the would-be technician fails to have a
basic understanding how his tools of the trade work then he simply cannot
shift the blame of writing broken code anywhere else beyond his failure of
attaining a basic understanding on how his tools of the trade work, which
includes accusing the tool of being unsafe.
In this case, you tried to claim that C is unsafe by presenting code which
was broken by violating a very basic aspect of how C works, one which is
taught at the very beginning of any introductory course. Yet, even though
the problem with your example lies precisely in an inability to write valid
code, you tried to pass it off as a fundamental problem affecting the entire
programming language. This isn't a sensible thing to do.
If you actually cared for that problem then you would had invested time to
try to understand what were it's causes. This would quickly lead you to the
way an object's lifetime is defined in the C programming language, which
would be enough to understand that the problem resided in the code and not
the language. You could also come to the conclusion that failing to throw a
warning when a local variable is referenced beyond it's life time, or
running similar diagnostics, is a compiler issue, not a language issue.
This is something which has been done before[1]. Yet, you failed to
consider any of this options and instead you opted to accuse the language
of, in a way, being fundamentally broken. This is a problem caused by
nothing more than a willingness to shift blame and responsibilities, not by
"typical macho programmer attitude", and throwing baseless accusations
around does nothing to fix whatever problem there may exist.
Rui Maciel
[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14156