Re: Learning C
- From: "Nick Keighley" <nick_keighley_nospam@xxxxxxxxxxx>
- Date: 11 Mar 2006 01:02:53 -0800
Richard G. Riley wrote:
"Chris"posted the following on 2006-03-10:
Richard G. Riley wrote:
"Nick"posted the following on 2006-03-10:
I thought you were implying Linux was better because the *debugger* was
There is no "the debugger" : although gdb is prevalent in Linux -
albeit with several front ends.
"debugger" / "debuggers" whatever. I've used ddd.
better. I've never stepped through an existing application (that wasn't
broken)
with a debugger. If you say it's a good way to learn C, who am I to
argue.
I stress that I talking about "stepping through an application". I have
*no*
objection to examining existing code. One way to learn is to look at
good
examples (and sometimes at bad).
I said its one way to get used to the structure and flow of
applications which is what he wants. Also, I do think a debugger can
give real insight into how C works in the real world : results of
operators there for you to see with no overhead of printfs which some
favor.
The printf's are portable. The printf's work without manual
intervention.
No they dont : you have to insert them in the code.
yes, but you don't have to keep on inserting them. Debuggers are
generally manual.
But thats being petty.
I beg to differ.
Its rare that I find someone wanting their printfs to be
portable in a system process or a an X gui or a Win 32 winproc : they
dont work. Home grown or system supplied logging libraries possibly :
but can you really analyse them at run time? I cant : I like to step
through and see the flow of the app to get a feel for how the systems
heart is beating.
ok I'm not saying you are wrong. I'm just pointing out that not
everyone
works and learns the way you do. I don't single step debuggers to
examine other people's applications
The printfs work without having to understand an additional tool.
But it *still* sounds bizzare to me
What does?
using a debugger to examine existing applications
Are we talking about the same thing? Do you doubt that
watching other, well written apps work is beneficial to a newbie?
*examining* existing applications and other examples, yes.
*stepping* existing applications and other examples, no.
It
seems fairly clear to me that it can only help. Its how the entire
Open SW system works : people learning by doing and picking up on
other peoples work.
right. BUT NOT IN A DEBUGGER
You've conflated "learning by doing and picking up on> other peoples work"
with "watching ... apps work" and that with stepping through an application
using a debugger. I think that's misleading.
Really? Seems pretty straightforward to me and also how close on 100% of
Universities teach coding at some stage or other :
really? *all* universities encourage the use of stepping?
Do you have statistics?
Could you go back and *read* what I and other posters have actually
been saying?
adding modules to existing systems.
yes! absoloutly!
Maybe I'm a bit slow today but I'm not seeing the
subtleties of the point you are making here :
well you don't "add to an existing module" by using a debugger.
the user is looking for
a way to learn how to structure applications and build them himself.
yes yes
I fail to see how analysing existing, successful apps can be anything
other than beneficial. It doesnt take away the donkey work of learning
the lanugage basics, but it can make text book "science" much more
accessible and "real". I cant imagine becoming a programmer without
such practice, guidance and "practical training". Its the same in all
walks of life.
I think I'll give up here. My point wasn't that important. Just trying
to
make the point that different people do thinks in different ways. Linux
is not the only platform. Not everyone uses debuggers the way you do
(some people only use them when they suspect a compiler error). A
newbie should be aware there are different ways to do things and not
lock themselves into a particular approach too early.
Maybe I'll even get my debugger out and step through a program
sometime to see if it brings me any insights. Maybe you should try
a "debugger free day" and try and see what you have to do to manage
without. Try reasoning about the program. Consider invariants and
post/pre conditions. Try adding asserts etc.
no way is the One True Way
"A desk is a dangerous place from which to view the world" - LeCarre.
"there is nothing as practical as a good theory" Lewin
--
Nick Keighley
.
- References:
- Learning C
- From: mfasoccer@xxxxxxxxx
- Re: Learning C
- From: Micah Cowan
- Re: Learning C
- From: mfasoccer@xxxxxxxxx
- Re: Learning C
- From: Nick Keighley
- Re: Learning C
- From: Nick Keighley
- Re: Learning C
- From: Chris Dollin
- Learning C
- Prev by Date: Re: Help! serial communications programming in c
- Next by Date: Re: Help with void's
- Previous by thread: Re: Learning C
- Next by thread: Re: Learning C
- Index(es):
Relevant Pages
|