Slashdot Mirror


Conceptual Models of a Program?

retsofaj queries: "Almost all of the introductory programming books I've looked at focus on syntax, with possible digressions into a bit of semantics. What I haven't found are any great discussions that go beyond syntax and semantics and make it all the way to conceptual models. My goal is to develop a set of resources that can be used in an introductory course that teaches students programming starting with conceptual models, as opposed to starting with syntax."

"What I mean by conceptual models are how you think about what a program is (if a program can be anything!). Examples would be (all prefaced by "a program is made up of..."):

  • flowcharts (structured programming)
  • arrangements of opaque things sending messages to each other (OO)
  • transformations of data structures (Wirth's view)
  • state machines
  • a knowledgebase (Prolog, etc.)
  • algebraic operations on sets (Functional languages)
Of course this is just the list I've come up with off the top of me head. My questions for the community are therefore:
  1. Who/Where/How are the different models of a program being taught?
  2. What conceptual models do you use when programming (and where would I go to find out about them)?
I acknowledge that some of these are covered by UML, but UML seems biased towards the object model of a program, which seems to exclude things like knowledgebases and functional approaches."

16 of 399 comments (clear)

  1. Design Patterns by abroadst · · Score: 4, Informative

    I think a good text for a course on conceptual models for software is Design Patterns by Gamma, Helm, Johnson, and Vlissides. When I first came upon this book it really opened my eyes. Now I can hardly imagine trying to be a software developer without the perspective offered in these pages.

  2. A Famous One Is... by the+eric+conspiracy · · Score: 5, Informative

    Structure and Interpretation of Computer Programs
    by Harold Abelson, Gerald Jay Sussman, Julie Sussman.

    1. Re:A Famous One Is... by hatter3bdev · · Score: 2, Informative

      I found this book online here if anyone is looking for it.

  3. How To Design Programs by jrstewart · · Score: 5, Informative

    You may be looking for the book How To Design Programs. I haven't read (all) of this book but I've learned a lot from the guys who wrote it. The complete text is online so take a look.

  4. Design Patterns, The Book by Bouncings · · Score: 3, Informative
    What you are talking about is software design patterns. I suggest Eddison Wesley's book on the topic of object orientation. There's less information on structured programming out there becuase structured programming isn't very trendy right now. New materials on cutting edge (yes, cutting edge) structured programming methodology is really only available on usenet and in people's code. For that, you are on your own.

    I also would advocate you not to follow the dogma that object orientation is the holy grail of software. Be open minded to structured programming too! :)

    --
    -- Ken Kinder ken@_nospam_kenkinder.com http://kenkinder.com/
    1. Re:Design Patterns, The Book by alext · · Score: 3, Informative

      Nonsense. This book has nothing to do with IT fundamentals, OO or otherwise. As many people have pointed out, at best it can be regarded as a roll-your-own appendage to cover the flaws of current mainstream languages. This situation does not apply in academia - they can use any language they like.

  5. Structure And Interpretation of Computer Languages by William+Tanksley · · Score: 5, Informative

    The granddaddy of this type has to be MIT Press' SICP. It's a programming intro, but it teaches you lambda calculus as well as the problems with lambda calculus.

    Lambda isn't everything, and a good teacher should also cover some languages which use it lightly (J and K) as well as a language which doesn't use it at all (Forth, Postscript, Joy) -- but it's good to have as a starter. SICP doesn't teach 'conceptual models', though; I don't think that the authors even realised there were other conceptual models out there. Most people don't, since most people don't even know that lambda calculus has almost nothing to do with how computers work, but is rather just the way most programming languages have been designed, in imitation of Fortran.

    But I can't slam SICP. It may not cover other conceptual models, but it does a BANG-up job of covering the one it acknowledges, and even points out the weaknesses.

    -Billy

  6. Structure and Interpretation of Computer Programs by The+Pim · · Score: 3, Informative
    It's a beautiful book, and takes basically the approach you outline. I don't have it in front of me, but I believe it treats most of the models you mention, and always focuses on the insights they give you into programs.

    It's the standard MIT intro text. Philip Greenspun called it the "one great book on the subject of computer programming". It's even online!

    The only caveat is that students reportedly find it hard to absorb on the first pass--even at MIT. (This is second hand information--I didn't read SICP in a class, nor did I go to MIT. I read it after programming professionally for a few years, and loved it.)

    --

    The evaluation of an action as 'practical' . . . depends on what it is that one wishes to practice.
  7. How to Think Like a Computer Scientist by bcrowell · · Score: 4, Informative
    Check out How to Think Like a Computer Scientist. It's an excellent introductory book, and the digital version is also free. It does at least some of the kind of stuff you're talking about.

    However, I think it would be a mistake not to teach any syntax at the beginning. Students need concrete examples, and the only thing that makes it fun to learn how to program is that you get to build actual programs that really do things.

  8. Re:Structure And Interpretation of Computer Langua by ariels · · Score: 2, Informative
    SICP is it. It's more than just "a book about Scheme"! It talks about:
    • Scheme
    • Programming:
      • Recursion and iteration
      • Continuation
      • Debugging!
      • Types and type hierarchies
      • Infinite data types!
      • ...
    • Time complexity
    • Abstract models of computing
    • Functional programming
    • Object-oriented programming
    • Logic programming
    • Memoization
    • Interpreters
    • Compilers
    • Language design
    • ...

    Just the "Table of Contents" should be enough to set any red-blooded programmer on "DROOL".

    Scheme has trivial syntax. This lets the authors explore semantics in amazing detail. Scheme's semantics are explained using progressively finer (and more accurate) "models". Eventually these models are implemented, in the form of interpreters and compilers for interesting subsets of Scheme. Meanwhile, various data types are presented. Unlike the vast majority of programming textbooks, arrays and array-based types are given little space. Meanwhile, lists, trees and various (potentially) "infinite" data structures are examined.

    Models are also given for other types of programming, including a machine code, a logic programming language, and the pure functional style. Functional programming is used extensively (assignments are deliberately rare) but not fanatically.

    An amazing introduction to the subject (even if you already know it).

    --
    2 dashes and a space, or just 2 dashes?
  9. Another option by jabbo · · Score: 5, Informative

    I feel like Paul Graham's "ANSI Common Lisp" is more fun to work through (and makes my brain hurt somewhat less) than SICP. SICP is a really stiff book -- using that text for a class is a sure way to weed most people out. Graham's book, while very very intelligent and deep, is also a lot easier to grasp in many respects. Not a bad choice for 'SICP Lite' although that doesn't give it enough credit for what it teaches you about programming in the real world (vs. the computer-linguistics and mental gymnastics that SICP teaches you).

    (Read the articles on Graham's site. They're friggin' amazing distillations of experience. If you've been programming (successfully) for long enough, you'll not only be pleasantly surprised, but will find yourself nodding in agreement whilst learning about new topics. Anyways, the book is an implementation of much of what he writes about, into his 'Mother Tongue' of Common Lisp. Hell, this is one of the few good writers who can correctly answer the question:

    "If you're so damn smart, why aren't you rich?"

    The answer, for anyone whose opinions you'd want to trust, is "I am", and it's BECAUSE of his opinions. :-))

    --
    Remember that what's inside of you doesn't matter because nobody can see it.
  10. Best book I've read.... and the one I started with by achiel · · Score: 2, Informative

    An Introduction to Programming, and Object Orientated Design
    Nino & Hosch

    That's the book I started with 7 months ago (had never programmed before, HTML doesn't count :P), and I'm very happy I did. It's a fairly theoretical book, emphasizing greatly on the fundamentals of Object Orientated design, placing Java syntax a definite second. Chapters don't teach you how to program, they teach you the development of Object Orientated design, beginning with simple classes, building test classes for those, GUIs etc.

    While this approach to programming is _very_ frustrating (I was very itchy, wanting to get ahead and start coding real programs which could actually 'do' something), it gives you a very good base from which to go on and learn more about programming. GUI's, for instance, are discussed in chapter 20 (one of the last chapters), and only AFTER completely digesting the whole Model-View-Controller pattern.

    Enough of the propaganda for this book, I'm simply a student who is very happy to have been able get such a good introduction to programming from this book. I've tried other java books in the past, only to have been irritated with the lengthy examples which they START OFF with, even before teaching you exactly what a class is.

    Problem with this book is that it doesn't really stand alone. You'll be able to grasp the concepts of OOP completely, but you'll have almost no hands-on experience, unless you pay _very_ close attention. I recommend using a second book as reference (we used a book by Kalin which I do NOT recommend, maybe an O'Reilly in a Nutshell book would be good)

  11. OS-X IDE comes with Conceptual Tutorials by Anonymous Coward · · Score: 1, Informative


    Apple ships the OS-X developer tools (free download) with a nice set of Tutorials that start with Conceptual presentation of: Object Oriented design, Frameworks, Sockets and Classes.

    Apple Developer Tools

  12. mod parent up (link to full text of SICP online)! by jabbo · · Score: 4, Informative

    Or use this one, if you must

    SICP online (my god that background is ugly)

    Not to be confused with the Society for Invasive Cardiovascular Professionals, mind you.

    --
    Remember that what's inside of you doesn't matter because nobody can see it.
  13. Referenes by Anonymous Coward · · Score: 1, Informative

    Of course, The Art of Computer Programming by Don Knuth can not be beaten. But Design Patters by the fearsome four (Gamma et al.) is absolutely essential reading for the type of ideas that you refer to.

  14. Re:Design by lo_fye · · Score: 2, Informative

    I teach web design, and one thing i find is that a LOT of my students are not programmers. They just want to make pretty web pages. They might not even know that it requires programming. Some don't even know how to use computers very well.

    So, I have to start very basic. I get them to look at the source of a webpage (like google or soemthing). Then I point out that it's all just text. Then I get them to open up Notepad.exe, where we'll stay for the first 8 weeks before graduating to Homesite.

    Then I describe what H,T,M, and L in HTML stand for, and what (exactly) mark-up is. I compare it to an english essay that you hand in, and when you get it back, the teacher has "marked it up" saying "new paragraph here" or "italic" or "bold" here.... she's not telling you to change the content, just how it appears.

    Then I teach them 1 tag at a time and the well-formedness rules. After they type it in, they look at it in the browser. They understand it that way.

    After completing all of the basic xHTML tags we move on to CSS and start emphasizing the separation of data and presentation.

    Then we do css layers/positioning and @media types, even further separating data & presentation.

    Finally we do javascript and dHTML. This is full-on scripting. Data and presentation layers are separated (for the most part), and I can now introduct the idea of variables (which I relate back to grade 10 algebra x=1, y=2, therefore x+y=3), looping, conditional structures, and functions.

    For 16 3 hour classes, this gets them from point zero to understanding the basics of scripting, as well as all of the details required to make a site with css-p that will validate under the strict xhtml dtd. For beginners I have no doubt that "doing" is much more powerful than "talking/thinking about".

    --
    geeks are cats who dig a certain kind of cool