Linked by Thom Holwerda on Tue 28th Aug 2012 19:20 UTC, submitted by MOS6510
General Development "Coming from a background in higher-level languages like Ruby, Scheme, or Haskell, learning C can be challenging. In addition to having to wrestle with C's lower-level features like manual memory management and pointers, you have to make do without a REPL. Once you get used to exploratory programming in a REPL, having to deal with the write-compile-run loop is a bit of a bummer. It occurred to me recently that I could use gdb as a pseudo-REPL for C. I've been experimenting with using gdb as a tool for learning C, rather than merely debugging C, and it's a lot of fun. My goal in this post is to show you that gdb is a great tool for learning C. I'll introduce you to a few of my favorite gdb commands, and then I'll demonstrate how you can use gdb to understand a notoriously tricky part of C: the difference between arrays and pointers."
Thread beginning with comment 532761
To read all comments associated with this story, please click here.
REPL - a key to success
by 108adams on Tue 28th Aug 2012 20:14 UTC
108adams
Member since:
2012-08-28

As a casual programmer in Python I cannot praise enough the REPL idea: the fact I can experiment, build and check quite complicated procedures and just check the syntax when dubious (will IF work this way in this context...)

In fact I have moved TWICE this way: first, learning Python and moving from early stages of C++ and compilation to REPL, and the other time leaving LaTeX for InDesign. Ohhhh, the moment of a sweet freedom, when I just could click and have a widow killed instead of (change a parameter, recompile, check pdf, change it a bit more, recompile, check pdf, curse, find another parameter in a TeXbook, da capo x 20)...

A.

Reply Score: 2

REPL - a key to success
by wigry on Tue 28th Aug 2012 20:21 in reply to "REPL - a key to success"
wigry Member since:
2008-10-09

Yep thats called experience. At some point you discover that you have a fancy algorithm or idea in your head, you sit down., write a program, compile, run , and discover that it works perfectly the first time. Thats great feeling!

Reply Parent Score: 5

REPL - a key to success
by dnebdal on Wed 29th Aug 2012 09:20 in reply to "REPL - a key to success"
dnebdal Member since:
2008-08-27

Yep thats called experience. At some point you discover that you have a fancy algorithm or idea in your head, you sit down., write a program, compile, run , and discover that it works perfectly the first time. Thats great feeling!



And even after some years of working with this, having a program work on the first try is still rare enough that it feels like a victory every time it happens. ;)

Reply Parent Score: 2

REPL - a key to success
by Soulbender on Tue 28th Aug 2012 23:32 in reply to "REPL - a key to success"
Soulbender Member since:
2005-08-18

Ohhhh, the moment of a sweet freedom, when I just could click and have a widow killed


Might not want to let everyone in on that.

Reply Parent Score: 3