Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Delving Deeper into the World of Programming

by nysus (Parson)
on May 22, 2001 at 18:41 UTC ( [id://82236]=perlmeditation: print w/replies, xml ) Need Help??

Fellow Monks,

Now that I'm pretty familiar with basic Perl syntax, I started reading "Advanced Perl Programming" (the Black Panther book). The preface of the book has whetted my appetite for learning some fundamentals of programming theory.

I suppose I could continue to learn programming theories by doing and seeing like I am with Perl. But I'm guessing it might be more efficient (but perhaps less fun?) to go to the guts of the matter and pick up texts that explore programming fundamentals more directly.

For those of you without computer science degrees, how did you become experts at programming? Was it through the applied use of a programming language or through the study of more abstract programming theory, or a little bit of both?

Also, can anyone recommend some good texts that cover programming fundamentals?

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar";
$nysus = $PM . $MCF;

  • Comment on Delving Deeper into the World of Programming

Replies are listed 'Best First'.
One Monk's Reading List
by footpad (Abbot) on May 22, 2001 at 20:19 UTC

    While I don't consider myself an expert at programming by any means, here's a brief list of books on my current reading list. I've managed to get through some and am slowly working my way through others.

    Note that some are rather expensive. Some time back, I started setting aside a portion of my paychecks for the reading list. Usually by the time I'm ready for the next one, I can afford it.

    Please note that a) the books are listed in the order that I thought of them and b) the links take you to the most recent listing on FatBrain using the Monastery's [isbn://] link.

    That said, here's one monk's (incomplete) reading list:

    By the way, I second merlyn's suggestion for reading source, though wish to add an adjective: read good source. Look for stuff by people whose coding skills you (hopefully) respect. For example, I've been reading the source of CPAN modules by Lincoln Stein, Gisle Aas, <a href=http://search.cpan.org/search?mode=author&query=tilly">tilly, dominus, and others that've been mentioned before.

    While it's possible to learn from bad code, there's a danger that you'll pick up bad habits in the process. Save yourself the effort and start with the good stuff

    Also, it helps to locate some good periodical sites and go through their archives. TPJ, for example, has published some really useful stuff. Personally, I'm looking forward to the re-opening of their archives.

    --f

      To footpad's excellent list, I would add Bentley's books are fun reads. They're written in short chapters, each illustrating a particular aspect of the craft. His optimization case studies are particulary fascinating. He takes real, (poorly) working code, and improves it step by step, measuring as he goes.

      I still wonder why nobody ever cites :

      MUSASHI (Eiji YOSHIKAWA)
      (The Sword and the Stone, in some editions)

      It's describing the way of the coder through the pleasant metaphor of a samurai...


      "Only Bad Coders Badly Code In Perl" (OBC2IP)
      If you're going to pick just one book, pick Code Complete. I love any book that lets me say "This book is our departmental coding standard."

      xoxo,
      Andy

      %_=split/;/,".;;n;u;e;ot;t;her;c; ".   #   Andy Lester
      'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'.  #   http://petdance.com
      "hack";print map delete$_{$_},split//,q<   andy@petdance.com   >
      
Re: Delving Deeper into the World of Programming
by merlyn (Sage) on May 22, 2001 at 18:52 UTC
    For those of you without computer science degrees, how did you become experts at programming? Was it through the applied use of a programming language or through the study of more abstract programming theory, or a little bit of both?
    Same way you get to Carnegie Hall. "Practice, Practice, Practice."

    But yes, to answer your question, "yes". I spent most of my time faced with a programming problem in front of me, and a stack of manuals to my side. Nothing like a paycheck to motivate you to solve problems in your programming.

    But in the "off hours", I also spent hours and hours just reading code. I can't emphasize this point enough. Get all the code you can already written in the language you wish to learn. And in languages you don't know yet.

    What happens over time is that the "rhythm" of the language starts pounding inside your head. And then you start noticing that "rhythms" from one language can be reused in another, as long as they're from common families.

    If the reference manual is like the dictionary, existing code is where you learn the "idioms". How do people typically write a subroutine call? Where does argument parsing get placed? How do you handle errors? What are hashes commonly called, and why? This is makes someone fluent in the language.

    For example, the Schwartzian Transform was nothing more than an idiom I had learned in LISP, recoded to Perl. That's why I was able to hack it up in a few minutes in response to a question in CLPM, and nearly without even thinking about it, because I already had thought about it when I was first playing with list processing.

    And then comes along a tool like YACC, where I'm puzzled about what the term "LALR(1) Grammar" means. So I do grab theory books from time to time, and learn just enough to be dangerous. {grin} But what I learned there applied a lot to Parse::RecDescent, and I end up already writing columns using it within a short time of being exposed. Because I'm reusing the patterns in my head. The idioms of the languages.

    -- Randal L. Schwartz, Perl hacker

      Your words reinforce my thoughts on how closely programming and language (spoken and written) are related. I'm sure that's a topic quite a few books have been written on already.

      I will definitely take your advice to read other people's code. It's something I haven't been doing much of. Thanks.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar";
      $nysus = $PM . $MCF;

Re: Delving Deeper into the World of Programming
by mikfire (Deacon) on May 22, 2001 at 19:30 UTC
    Experts at programming? What kind of expert? There are those who excell at the theory of programming, those that excell simply at getting the job done and then there are those really disgusting individuals that seem to have both talents.

    The theory is nice because it gives a person a framework within which they can think about programming languages in general. The most enlightening course I took in college was a comparative OS course, but only because I had been working in a real-time system and the course finally gave me the correct language to think about what was happening.

    For the most part, I have come by my knowledge the hard way. Write enough code that you then have to maintain 6 months later and you quickly figure out the value of comments and documentation. Spend enough time trying to remember what command line options are available and you learn the value of -h options and Getopt::Long. Re-invent certain wheels enough times and you learn to either make a module or to search CPAN first and steal^wuse somebody else's wheel.

    I would recommend, for what terribly little my opinion is worth, picking up the book on programming theory and language design. I would recommend learning several different programming languages. Both will allow you to approach a problem, determine the best tool and use it effectively. Which, in my mind, is what really defines an expert programmer.

    mikfire

Re: Delving Deeper into the World of Programming
by chromatic (Archbishop) on May 23, 2001 at 09:16 UTC
    There are plenty of ways to become a better programmer:
    • Learn a new language. Rewrite some of your old code in the new language.
    • Explore a new technology. Read a book about something not specifically related. Ask yourself how they designed it and why they made the decisions they made.
    • Solve a new problem. Read a question on clpm or a golf challenge or a SoPW question, attack it yourself, and then compare it to the other answers.
    • Ask a new question, like "What happens if I bless a typeglob? Can I access a scalar and an array even if I pass just a scalar reference as $self?" Then write code to try it.
    • Rewrite an old program, but do something differently. (Perl makes this easy.) Some solutions are better than others, but knowing more about the language helps you solve other problems.
    • Read a module's interface, then see if you can recreate it without reading the code.
    • Look at a problem and write an interface to attack it. Then compare it to a module that solves the same program.
    Mostly, just keep learning and looking for patterns. If you can make connections in your mind between nominally different things, you'll do okay.
(dws)Re: Delving Deeper into the World of Programming
by dws (Chancellor) on May 23, 2001 at 10:10 UTC
    There are many ways up the mountain. Not all of them require that you go solo.

    Seek out people who are more skilled or experienced than you, and ask them to review your code, or to let you look over their shoulder while they code. I've picked up a lot of my technique from watching others.

    Convene a "coding" group, to review and critique each others' code. The challenge of knowing that your code will be subject to peer review is marvelous for quickening the mind and reenforcing good habits.

An inspirational book
by John M. Dlugosz (Monsignor) on May 23, 2001 at 01:05 UTC
    I was in high school when I first read The Art of Computer Programming and I've returned to it many times since.

    This is not a book that assumes certain principles as built into some programming language—rather this book teaches the fundimental ideas that later got put into those languages. In fact, I found more than one compiler implemented malloc() directly out of Knuth's answer section!

    —John

Re: Delving Deeper into the World of Programming
by Anonymous Monk on May 23, 2001 at 00:59 UTC
    There is an old saying: "Those that can do, those that can't teach" No amount of book knowledge will ever substitute for practical experience. The practice practice practice advice is impossible to fault. This being said, in the texts you will find 'perls' of wisdom to help you avoid the age old pitfalls. While you may need to reinvent a wheel or two to learn your stuff there is no need to get run over by a bus in the name of experience. For out and out syntax practice deconstructing obfuscated code will teach you a lot and provides an endpoint, reading code comes a somewhat poor second. JAPHs make for 10 minutes of intense thought to understand them - all in all a nice bite sized syntax problem. Summary Do code Do make mistakes Do not repeat your mistakes, make new ones! Do ask if you need help Do read at least one book cover to cover Do not take it too seriously Do enjoy Tip:If you have been coding for 36 hours straight take a break. tachyon my $answer=[q;7566626f206f7420756f7920656d6f636c65772049;]; print join''=>reverse split''=>pack H42=>$answer->[0]=>eval;
Re: Delving Deeper into the World of Programming
by Anonymous Monk on May 23, 2001 at 16:23 UTC

    Several responses have mentioned some excellent texts for reference. I have not yet seen anyone recommend Mastering Algorithms with Perl by Jon Orwant, Jarkko Hietaniemi & John Macdonald which is an excellent introduction to theory using perl.

    Sriram Srinivasan's book on Advanced Perl is now quite dated and needs an update (as do the perlxs and perlxstut pod pages).

    Unfortunately (or fortunately :-) Perl's weak typing means that a lot of what goes into computer theory: data structures, algorithms, etc. is altogether too easy. Most of the other formal monographs on theory spend tens, or hundreds of lines of code just dealing with strong typing allocation, a subject that is only rarely broached with perl. Knuth's texts on TAOCP for example are written in MMIX, an assembler for the imaginary MIX hardware.

Re: Delving Deeper into the World of Programming
by adamsj (Hermit) on May 23, 2001 at 16:56 UTC
    I'll second any recommendation for The Art of Computer Programming, and I'll add this as a good entry-level, mathematically-oriented book on algorithms: Introduction to Algorithms, Cormen, Rivest, and Leiserson, MIT Press. It runs around $75, but used copies are fairly easy to find, as it's an often-used textbook.

    Of course, the very best thing you can do is go to college, ignore the CS department, and study math and English. That's only partly tongue-in-cheek advice.

    adamsj

    They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen

Re: Delving Deeper into the World of Programming
by krujos (Curate) on Jan 26, 2002 at 16:19 UTC
    While I am far from expert. and only 9/10 of the way to the CS degree two things have helped me a lot. Old guys with beards (I dont know why but all of the really good programmers around me have full beards) and my internships. what i have learned from the classroom and books about programming / languages has been very valuable nothing can replace the expereinces I have had with professors and bosses / guys I work with taking the time to actually talk with me about how to program. Conversations I have had with professors espically have been valuable (small school professors easily accessable, education++). Look to your elders, they know there stuff. yes yes.... just how did they make the form buttons look so cool in windows xp.... its almost like im living in a cartoon..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://82236]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found