Le 16.10.2013 03:25, Jerry Stuckle a écrit :
Ah, but you are more than a "simple user".
I guess so. I am not even a TV user anymore in fact, but that's not the
question.
The point is that I can hardly consider a programmer to be a simple
user of a computer, because when you write a program, you will probably
have to know how to install it, and so know the system you target.
Because it's the programmer who knows what the program needs. Root
access maybe? Or will it listen on a port? Which configuration files
will it needs? Which installed lib?
Those are not the work of the admin, even if the admins can be able to
understand about what the programmer is talking, so that they can then
know when there is a problem how to fix it.
Just like I
don't program in assembler (for Intel or Motorola MPUs or IBM
mainframes), although I could do any of them still.
I do not do it either. But by being able to do so, I can understood
why
some instructions will slow down programs more than others. Of
course,
early optimization is root of evil, but I know that if I have to
divide/multiply integers by a power of 2, I can use the << and >>
operators. It also helps me when I need to debug programs, even if I
do
not have the source code.
Pointers have nothing to do with assembler.
Pointers are memory addresses, which are very important in asm. So,
yes,
knowing asm helped me a lot to understand C pointers. I understood
them
without any problem, unlike my classmates. And those guys were, as
me,
coming from electronic studies, so they were supposed to know basics
about processors.
Yes, my C/C++ students sometimes had initial problems with pointers,
but some real-world (non-programming) examples got the point across
quickly and they grew to at least accept them, if they didn't like
them. :)
I only know few people who actually likes them :)
I liked them too, at a time, but since I can now use standard smart
pointers in C++, I tend to avoid them. I had so much troubles with them,
so now I only use them for polymorphism and sometimes RTTI.
I hope that someday references will become usable in standard
containers... (I think they are not because of technical problems, but I
do not know a lot about that. C++ is easy to learn, but hard to master.)
C is not the only
language with pointers
Of course. They all need to use them if they offer dynamic stuff,
but
they try to hide them. Is it the good solution or not? I do not
know,
but if yes, I wonder why most games are written in C or C++? I think
that guys who write them knows what is memory, and how it works. I
hope
for them at least.
C was never meant to be an applications language - K&R designed it
for creating OS's (specifically Unix). But because of that design, a
good programmer can write code that is smaller and faster than with
other languages (except assembler, of course).
Yep. It is designed to be an efficient language, allowing to give
people full control on their tool, in a portable way. This is risky,
because you can shoot your feet, but taking that risk is needed to have
efficient softwares.
Plus, in an OS, there are applications. Kernels, drivers, and
applications.
Take windows, and say honestly that it does not contains applications?
explorer, mspaint, calc, msconfig, notepad, etc. Those are applications,
nothing more, nothing less, and they are part of the OS. They simply
have to manage with the OS's API, as you will with any other
applications. Of course, you can use more and more layers between your
application the the OS's API, to stay in a pure windows environment,
there are (or were) for example MFC and .NET. To be more general, Qt,
wxWidgets, gtk are other tools.
For Debian, in it's standard installation (I insist on the standard
installation, the one I never do), it will come with the gnome DE. I do
not know the tools it provides, but they are probably applications, too.
And it is part of the Debian OS.
I know, OSes have evolved since the first UNIX. But languages and the
libs available in them too. C was invented 40 years ago. I have seen
some of the codes which were valid at that time, and it really had great
enhancements (imo).
But all of this have nothing related to the need of understanding
basics of what you use when doing a program. Not understanding how a
resources you acquired works in its big lines, imply that you will not
be able to manage it correctly by yourself. It is valid for RAM memory,
but also for CPU, network sockets, etc.
A bigger advantage is
the code is machine-independent.
Which is why C and his little brother C++ are probably the reason of my
switch to linux. See, if those languages were never used to write
applications, there would not be so many portable and efficient one, and
so I would have probably stayed to windows (and not annoying people on
that list :p), instead of changing my tools one after one until I was
able to change the OS itself without changing any tool.
But I do not think that this one is the biggest advantage of C. other
ones compete a lot: efficiency, lot of good libraries and ISO standard.
I strongly doubt that C were chosen for portability to write winAPI.
But it doesn't require knowledge of underlying memory
access to use pointers.
I've taught many C and C++ classes over the
years (I used to do corporate programmer training), and never once
did
we get into how memory works.
I wonder how you taught how to use them, so. Just saying that they
are
variables which indicates where in memory are located other
variables?
And people just accept that?
Nope, real-world examples unrelated to programming.
The classic one with the street, maybe. It is a good one to explain how
memory works, too.
Those who never programmed in languages
with pointers, i.e. COBOL, had a little trouble getting used to
them,
Yes. It is what I said. General culture helps to learn new things
faster. Not needed, but helps.
Actually, in this case, new programmers pick it up faster than
experienced programmers. The same is basically true with OO
programming techniques - the longer someone has been using functional
programming, the harder it is for him/her to make the jump.
I did not noticed the same thing in the lessons I had.
Well, I can not really say that I was an experienced programmer at that
time, but when I learn C, and so pointers, I had QBasic and asm x86
knowledge, and never had any problem with pointers. To be exact, I was
already using them (but not with memory allocation at that time) in my
first language, qbasic, to access graphical memory in mode 13h.
When I came to C, I learned in the same time asm x86, and really had no
problem with pointers.
But when I reached universities-like studies (3 years after my first
steps), I have seen that those guys, with for most of them electronic
knowledge, had a lot of troubles with pointers. Except the few which
already had programming knowledge.
About OOP... well, I had real problems understanding it. And I was one
in the less bad of the entire class in programming.
The only thing which made me understanding it were real programming and
reading on the web. But I have to say that it was 2-years only studies,
so maybe it is the reason.
And I can remember what exactly allowed me to understand the basics of
OOP. If was certainly not the translated book "C++ for dummies" that I
bought (I recommend to never buy it, except maybe if you are from USA.
It is full of references to USA's stuff, and the translation is dirty)
but the tutorial I have found on the web which explained how to
implement OOP stuff in C. And I would never say that this allowed me to
fully understand OOP, since I am still learning a lot in that domain. I
doubt that I'll end learning about that.
Plus, here, we are not discussing about programming, but about
networking, so I think minimal knowledge of network stuff and some
electric basis can be useful ;)
Not really. When you're troubleshooting network problems in low
level code, it is important. Otherwise it's no more important than
knowing how everything in your TV works.
So, you are able to do right choices when you buy hardware without
knowing how it works? Interesting, but I doubt it.
By right choices, I do not mean "buying the one with the highest
perfs",
I mean "buying the one which fit your exact needs".
Buying hardware is different from programming. There are millions of
programmers in the world who never bought a bit of the hardware they
are working on.
They are not even able to choose their tools? They do not know what can
be the interest of multi-core CPU for programming?
It seems really strange to me.
If you have no understanding about what the hell is a parasite, you
will
always buy armored cables, even if you only need a small piece of
cable
far from any parasite generator. Waste of money.
Do you mean a parasite generator, or a parasitic generator?
Excuse my bad English, I meant parasitic generator I guess, if it is
the one which means a hardware generate parasites.
--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2f1ef58de508a896d87e579bae9a9...@neutralite.org