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."

399 comments

  1. Domain theory by Anonymous Coward · · Score: 0

    http://www.cs.nott.ac.uk/~gmh/domains.html

  2. Experience!!! by LinuxCumShot · · Score: 2, Redundant

    Experience is the only way to learn... write a program and its shitty, rewrite it and its less shitty... rewrite it again. Learn from your mistakes. You can't learn to program without practice. bling bling!!!

    --
    -- OMFG = Oh My Floatse Goatse
    1. Re:Experience!!! by DrSkwid · · Score: 3, Insightful

      sorry but experience alone will not teach one the breadth of the subject. How, for instance, will one deduce that the re-written program would be better suited to a different programming paradigm if one has not studied the known paradigms?

      Without reading about say, Functional Programming, how will one make the intuitive leap mearly by exercising the iterative.

      Like *all* disciplines it is the combination of study and practice that will lead the way.

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    2. Re:Experience!!! by Anonymous Coward · · Score: 0

      I can't believe someone with the username
      LinuxCumShot has been modded up to +4 informative.
      Congratulations sir. I salute you.

    3. Re:Experience!!! by retsofaj · · Score: 1

      For fun try dealing with counter-intuitive, non-experiential things (eg. complex, adaptive systems). Experience works for many things, but not for everything. Look at the current debate about the limits of specturm for an example. Experience tells us that bandwidth and usage are in opposition; a different conceptualization tells us that usage and bandwith can be complementary.

      Another really great example is quantum mechanics. Ask people who work with the deep magic, and you'll find out that they have to unlearn much of their experience.

      I don't mean to completely dismiss experience, which would be foolish. However there must be a middle ground between experience and theory/conceptualizations/etc.

    4. Re:Experience!!! by wassy121 · · Score: 1

      I don't mean to degrade anyone's form of education, but that just doesn't work for me. It seems as though rewriting a program over and over takes _way_ too much time compared with designing and redesigning it until you realize that one way obviously wins with in all aspects including structure, complexity, coupling, and cohesion. Maturity of a program does not come from complete rewrites, but from minor design changes made as better ways are thought of.

      --
      --If I said something interesting it probably wasn't correct
    5. Re:Experience!!! by Anonymous Coward · · Score: 0

      Programming is easy. Software design is hard.

    6. Re:Experience!!! by saden1 · · Score: 1

      Know a little bit of everything but make sure you specialize in two or three things. I spent/spend many evenings at Boarders just reading...understanding everything right away isn't important as long as you familiarize yourself with concepts, principles, and their usefulness.

      --

      -----
      One is born into aristocracy, but mediocrity can only be achieved through hard work.
    7. Re:Experience!!! by saden1 · · Score: 1

      Only if you haven't done it before. It gets easier with experience.

      Of course there are times when technical difficulties present themselves. That's when you realize they don't pay you 100+ grand for nothing!

      --

      -----
      One is born into aristocracy, but mediocrity can only be achieved through hard work.
    8. Re:Experience!!! by saden1 · · Score: 1

      Rubbish! One never unlearns. That world shouldn't be in the English dictionary! You always build on experience. If a new paradigm presents itself you ditch the old one but you never throw it away completely. You used it to support the newfound paradigm and legitimize it.

      Late in his life Sir Isaac Newton was asked how he was able to accomplish such great things. He replied: "I stood on the shoulders of giants."

      --

      -----
      One is born into aristocracy, but mediocrity can only be achieved through hard work.
    9. Re:Experience!!! by spongman · · Score: 2

      The grand-parent has a point, experience is the most valuable asset in any project. Regardless of choice of language, understading of the problem domain, or design paradigm, the knowlegde that certain approaches just wont work well is invaliable. Of course, finding the one that works the best, is a different question, but there again, experience will often lead to the more correct answer.

    10. Re:Experience!!! by Anonymous Coward · · Score: 0

      you obviously do that, it goes without mentioning, but it will still take complete rewrites, and a lot of them when you first start coding..

    11. Re:Experience!!! by colvin_t · · Score: 2, Insightful

      Experience helps a great deal. One should not have to "rewrite" the program each time it doesnt work. Remember, preparation is everything. If you truly understand the problem and are familiar with programming concepts, you will be able to build a program that will do some, if not all of what you need. Granted, experience does play a part, but being a good programmer is, in my view, being able to understand concepts and use previous experience to write a good, solid, robust program.

    12. Re:Experience!!! by ironape · · Score: 1

      You're right in experience being the best teacher, but a little preparation for the lesson wouldn't go amiss. If you have a rough idea of where you're going, then the program won't be so shitty and won't need as many rewrites. In the long run you'll save yourself sooooo much time by starting off on the right foot

      --
      Quantum Mechanics - The dreams stuff is made of
    13. Re:Experience!!! by pizza_milkshake · · Score: 1

      I spent/spend many evenings at Boarders just reading

      Well, then you should know it's Borders :P

      Nitpicking aside, i did the same thing... just read as much as you can, practice and write shitty programs, download and check out other people's source and repeat.

    14. Re:Experience!!! by Anonymous Coward · · Score: 0

      In reply to: Experience is the only way to learn... write a program and its shitty, rewrite it and its less shitty... rewrite it again. Posts like this are entertaining because of their stupidity. Sure, writing and re-writing a program may work for the "look Mom, I wrote a program that can add two numbers, AND subtract them!" but it certainly isn't how software is developed. Software development goes through a lifecycle. The lifecycle can be reduced to this: Requirements Design Coding Testing Requirements gathering is the most important part of the sofware development lifecycle. A top sofware engineering researcher at our university stated that he would spend 40% of his budget getting the requirements right. There are many requirements gathering techniques from meetings with the customer to rapid prototyping. In any case, if the requirements aren't correct then there is no point building the product. Design is the conceptual layout of program. Multiple levels of design include high level, (object models, sequence diagrams, etc.) to detailed design (pseudo code, etc). Coding is simply typing the code in the computer. This may be the least critical phase of the life cycle. Testing is NOT debugging nor the proecess of uncovering bugs. Testing ensures that the software project meets the requirements. Usually an extensive acceptance test plan is developed and the product must pass the plan before it is released. This lifecycle is not a linear model. Often the requirments get updated in the design phase, and the design is changed in the code phase, etc. This is how software is built. This is the only way (that we know of now) to build large complex systems. Anyone who says write and re-rewrite has never written a progam that is more than a few pages of code.

    15. Re:Experience!!! by michael_cain · · Score: 2, Insightful

      I agree with the basic sentiment-- like any other language, you learn to write code by writing. The missing piece in your loop, particularly for beginners, is the editor who marks up their attempts, who tells them "this part is good" and "that part sucks". I was a self-taught programmer over 30 years ago and in that first six unsupervised months, I picked up bad habits that took me years to break. If you're just starting, get someone (hopefully someone who knows what they're doing) to edit some of your code.

      Once you reach a certain level of proficiency, you can also progress by reading other people's code. Almost every language has some standard "idioms" for expressing common ideas well, and you can learn a lot of that from other people's code.

    16. Re:Experience!!! by Anonymous Coward · · Score: 0

      While I agree with you that iterations alone can not force you to leap to Functional Programming. Reading can not be the only way, because if it were true we could not learn anything that has not been written.

      It is my believe that innovation combined with iteration brings about new ideas.

  3. Analysis/Design? by Xtifr · · Score: 4, Insightful

    Perhaps you're looking in the wrong places? Introductory books on analysis and design would seem to me a better place to find an introduction to analysis and design than books on programming.

    Programming (coding) is how you implement a design. By the time you get around to coding, I would hope that you already have the design worked out.

    Or am I missing something here?

    1. Re:Analysis/Design? by burnitall · · Score: 2, Insightful

      you're not missing anything, it's just that by and large design is done very quickly, usually on a white board, and almost always fails in some substantial way to fulfill the requirements.

    2. Re:Analysis/Design? by Xtifr · · Score: 4, Interesting

      Heh, well, yes, far too many real-world projects are started without enough analysis or design. No arguments there. :)

      But it sounds like this question was posed by someone who has recently discovered that analysis and design are important, and doesn't understand why programming books don't cover analysis and design in greater detail. Which is, to some extent, a bit like asking why books on carpentry don't teach architectural design.

    3. Re:Analysis/Design? by TweeKinDaBahx · · Score: 1

      I was taught there are three steps to design:

      1. Determining your resource constraints.
      2. Creating an Abstract implementation.
      3. Implementation using code, machines, and people.

      This should be taught in everyone's first programming class. What should NOT be taught is efficiency analysis and stucture. All that intro class should do is teach you how to make things compile. If you take a class to teach each different aspect of coding, a person should have applied experience in each area.

    4. Re:Analysis/Design? by MMMMMMMMMMMMMMMMMMMM · · Score: 0

      You forgot to two steps:

      4. ???
      5. Get rich.

    5. Re:Analysis/Design? by Anonymous Coward · · Score: 0
      Programming (coding) is how you implement a design


      For learning programs, a programming language is really abstract enough. You don't need a flow chart once you can see code flow.

    6. Re:Analysis/Design? by Anonymous Coward · · Score: 0

      You are totally right...

      The books I've used with my analysis and design courses include:
      Software engineering by Ian Sommerville from Addison Welsey
      Object Oriented modelling and design by James Rumbaugh et. al. from Prentice Hall.
      UML Distilled by Martin Fowler from Addison Wesley.

      I can recommend them (even though I got very sleepy while reading them, reading them wheren't exactly the most exiting thing I've ever done... but I'm more of a coder/hacker person then a designer. ;)

      I liked the UML book the most... It was short and had good examples... The only problem with it was that the price was a bit high for a thin book like that... but I can honestly say it was worth the money...

      //Andreas Henriksson

    7. Re:Analysis/Design? by TeaDaemon · · Score: 1

      As somebody who wants to learn to code, but is having many of the problems mentioned here, I think that's probably a very good point.

      However, could you, or indeed anybody else who has already learned the basics of analysis/design recommend some good introductory material for somebody who would like to learn it. If not, then it seems like the original poster has found a niche in the market.

    8. Re:Analysis/Design? by angel'o'sphere · · Score: 2


      Perhaps you're looking in the wrong places? Introductory books on analysis and design would seem to me a better place to find an introduction to analysis and design than books on programming.

      Programming (coding) is how you implement a design. By the time you get around to coding, I would hope that you already have the design worked out.

      Or am I missing something here?


      you're not missing anything, it's just that by and large design is done very quickly, usually on a white board, and almost always fails in some substantial way to fulfill the requirements.


      What do you want to say by that?
      That the designs you where somehow involved with where made like this? If so, its sad.
      Or do you even like to argue: design is easy as you do it quick on the whiteboard? That would be realy depressing if that was your opinion.
      Or do you even like to say that design allways fails? Then I dissagree!

      Anyway, I did not whant to mock you!
      When I started programming I learned to use flow charts and such to "design" my software. When I felt that I was a good programmer I started to omit flow charts and I never regreted it.
      I asume "easy designing" is something everybody learned sometimes, likely found it even interesting but the more experiance one had he dropped it.
      The false conclusion I made was: design is not worth it. It consumes time and does not give something back to the final product. I see this false conclusion repeated regulary, especially here on /. when "artists" claim UML and OOAD are useless. (Because the market leader in CASE tools has an overprised solution with questionable user interface and features :-) )

      However since about 13 years I'm programming in OO. About 10 years I work with so called object oriented analysis and design. Since 5 years I teach it.
      My overall programming skills are far better now, of course, as they were at the time when "I dropped designing". A typical one month one person project I indeed can do without design and without the risk of failure.
      However, using a CASE tool and using the minimum A70% implementation. So at the moment where the new taught oo programmer likes to give up as he has spend 3 weeks mainly with A&D and only one week in coding and nearly nothing is visible of the end result the false conclusion "it does not pay off" comes up. If he sticks to the "right way" the last third of programming cycles will bumb out new features every day!

      The bottom line is: 2/3 of software development activities should be THINKING! At first WHAT to implement - analysing - and then THINKING HOW to implement it - designing -. Only one third should actually be the implementing. If you use a CASE system, the implementation can indeed be that fast as you can generate the skelleton of the application out of the CASE system. If the CASE system is: paper and pencil ... well, then you are not THAT fast in implementing but you still should save a lot of time!

      My picture above omits the key question: what about architecture? You need to have a reference architecture in mind or as experiance or as exiting framework. Without an existing reference architecture the crafting of a new software is 3 or 4 tmes more expensive then with it.

      What is a reference architecture? Well, a LAMP(Linux, Apache, MYSQL, PHP) software is a typical architecture. A kernel is/has a typical architecture. A MVC based oo framework is a typical architecture. A knowledge base backed expert system like architecture is a typical sample. A scanner/parser/anylyser/generator/optimizer .... yeah, a compiler, is a typical reference architecture(more general: pipes and filters). A Tomcat/JSP/Servlet - JBoss/EJB - PostgreSQL solution is a typical architecture. (read Buschmann et al. Architecture Patterns, Addison Wesley). And so on. Well, the Tomcat/JBoss example is close to only resemble the technical infrastructure or technical architecture. You can and should distinguish between technical architecture and domain architecture. A&D should be constraint by the technical architecture and guided by a reference architecture and elaborate mainly the domain architecture ... hu?

      Of course you can make a high level conceptual design before going deeper into the domain analysis. You need to do that if you have no reference architecture or experiance at hand.

      Sorry :-) for the buzzwords, but I'm not an artist so far. After only 20 years programming experiance I consider my self to have just done the leap from craftmansship to engineering.

      Regards,
      angel'o'sphere

      P.S.: you can book me in europe as mentor for oo technologies ... I speak better than I write :-) especialy german, LOL

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  4. It's simple, really by cscx · · Score: 2

    Teach them flowcharting and logic structures, i.e., sequential, conditional, looping, etc... They will be able to program in any language then... it's really easy to transition.

    1. Re:It's simple, really by Anonymous Coward · · Score: 0

      Teach design patterns. Look up the phrase at google if you're unfamiliar with them.

    2. Re:It's simple, really by Anonymous Coward · · Score: 0

      This naive view is really the problem. You could do some real good and teach them OO design. Or as Parnas says, in Brooks' "No Silver Bullet Refired":

      Instead of teaching people that O-O is a type of design, and giving them design principles, people have taught that O-O is the use of a particular tool. We can write good or bad programs with any tool. Unless we teach people how to design, the languages matter very little. The result is that people do bad design with these languages and get very little value from them.

    3. Re:It's simple, really by Flossymike · · Score: 1

      I'm only occasionally touching on doing some programming, a bit of bash shell, but I would love to learn programming.

      Here's my question, how do you layout your program outline in terms of flow charts? By this I mean do you use pencil and paper to easily draw diagrams and scribble on, or do you do it though commenting of code, or both, or though use of a graphics package, or ... whatever?

      If someone would answer here, I'd be most grateful :-)

      ----
      Flossy

    4. Re:It's simple, really by Anonymous Coward · · Score: 0
      That depends on your programming language, and your coding style. An object orientated program could be drawn as a series of objects with interfaces - that interact with other objects. Object oriented programming isn't for everyone, or every task - but there will often be generic groupings of functionality.

      In general I plan software by considering (or sketching) the user interface (or if I'm writing a library, the API is the interface). This isn't popular, but I hate other people's methods of beginning by naming their functions. If you thought of the URL as an interface then you might design your software differently too.

      From here I see the general structure of - say - a Scripting/Database/FlatFileTemplates. I define each's role, and make some tables in the database, and some functions or objects in the scripting language.

      When explaining my models, rather than complex flowcharts, I go through typical use of the software - ignoring the side-tracks. On other sheets I explain how there were paths in the program and how they join back up to the main flow (if at all).

    5. Re:It's simple, really by Bush+Pig · · Score: 0

      I don't believe flowcharting (flowcharts!! who uses flowcharts these days?) and logic structures is even close to sufficient. They certainly _won't_ help anyone understand functional or logical languages, or LISP for that matter.

      To reply to the original question, we used a rather fine book called, iirc, 'The Anatomy of Programming Languages' (can't remember who wrote it) to give us an insight into programming in languages other than C when I was at university. It covered imperative and declarative languages without getting too wrapped around the axles about the fine details of language syntax. There was a section on the object oriented model, and also on functional and logic-programming languages.

      I recommend this book.

      --
      What a long, strange trip it's been.
    6. Re:It's simple, really by crucini · · Score: 2

      I haven't found flowcharts to be useful recently - they take a lot of space to cover simple things, and they implicitly describe "spaghetti" code - code which uses jumps or gotos for flow control. For small programs, I generally write the main() function first, keeping it short and clear and invoking a bunch of unwritten functions. At this point I effectively have the interface to those lower functions defined. If the program has to parse a source or config file, I may fill in dummy functions for some of the lower level and test the parser.

      Then I flesh in the lower level functions, creating even lower ones where needed. I try to keep each function fairly short - going over 40 lines, let's say, could indicate that an unexpressed function is "swallowed" in your function. Longer functions are sometimes OK, and sometimes it's possible to factor out very short functions that have a clearcut, reusable purpose.

      When I code in C, I often start by defining the data structures, but in Perl I haven't felt a need to do this since Perl's data structures are dynamic.

      I hope this helps.

    7. Re:It's simple, really by SEWilco · · Score: 1
      "I haven't found flowcharts to be useful recently - they take a lot of space to cover simple things, and they implicitly describe "spaghetti" code - code which uses jumps or gotos for flow control."

      Then change your flowchart technique to use structured designs. There are four structured flowchart elements: Sequence (one process follows another), If-Then-Else (one branch can be empty), Do-While (loop with If at top), Do-Until (loop with If at bottom).

      While you can make any program with structured flowcharts, look to see if your "flowchart" is actually a "state machine graph". You might find that what you actually have is several modules where program flow depends upon the processed data If that is the case then you can decide between a structured flow between the modules or use a state machine to control what sequence of actions is used.

    8. Re:It's simple, really by Flossymike · · Score: 1

      Cheers very much for that, it sounds like you keep the concept of the program in your head, backed up with code that will help direct you.

      As I'm not getting any formal teaching, I find I need some level of reasurrance that I'm doing computer tasks right ;-)

      ---
      Flossy

    9. Re:It's simple, really by Flossymike · · Score: 1

      That very much reminds me of how I have been thinking about applications, starting from the outside appearance and working in to the nitty gritty, using comments to remind me why I wrote certain pieces ;-)

      Thanks for your time

      ---
      Flossy

    10. Re:It's simple, really by ahde · · Score: 2

      simple flowchart design:
      steps are squares. decisions are diamonds. Use arrows for flow.

      write objects as two lists:
      methods/interfaces/functions/etc.
      variables

      start general and move to specifics.

    11. Re:It's simple, really by Tablizer · · Score: 2

      (* We can write good or bad programs with any tool. Unless we teach people how to design, the languages matter very little. *)

      The problem is that "good design" is rather subjective. 20 different experts will give you 20 different designs, especially in the OO world.

      The procedural/relational world appears a bit more consistent IMO:

      http://www.geocities.com/tablizer/bizmod.htm

      I cannot find a similar way to describe OO biz app design philosophy that OO fans will generally agree with. If you can find one, let me know and I will recant.

      (Note that I am not (yet) claiming this p/r approach is *better*, just that it appears more consistent from "expert" to expert. Then again, consistency is perhaps a part of "better".)

  5. Simple, LOGO by Anonymous Coward · · Score: 2, Funny

    Make then learn LOGO.

    If a turtle walking around the screen can't teach the fundamentals of programming, nothing can.

  6. sure there are by psychopenguin · · Score: 1

    There are plenty of books about things like structured programming (iirc there is even one with that exact title), Just about any book with the work "algorithms" in the title, or things like "The Tao of Objects". Those are all good resources that focus on methodology rather than language.

  7. UML tailored for OOP... by bcarlson · · Score: 1

    I am fairly new to UML, and I agree it is very tailored toward OOP. That's not a bad thing, but it seems like you would need a firm grasp on OOP before touching UML, thus reducing your desire to a moot point, or a vicious circle depending on your viewpoint.

    I think one of the best things for students to understand (from a students perspective) is that simple code is the best code. Also, Data layout is god... IMHO if you get the data layout right, you can't help but write simple logical code.

    --

    "...I'll need guns" --Chow Yun-Fat in 'Replacement Killers'
    1. Re:UML tailored for OOP... by Anonymous Coward · · Score: 0, Insightful

      UML is a great tool for programming, and then for maintaining the code after it is written too. If you want to make a really reliable system take a look at Z, it is a tool for program specification, except it uses a type of propositional logic to "prove" the correctness of a program. Any mission critical application (OS kernel, NASA spacecraft software etc etc) is done in Z type languages.

      If your writing a site I think you should also include places where software has failed because the software engineering side was badly done. I can't remember the names off hand, but certainly a spaceship blew up on lauch because of an integer conversion, and there is another example where a program gave a patient the wrong X-Ray dose to treat his cancer. ALso, the 70's software crisis is quite interesting (read "The Mythical Man Month") which is basically when people started to realise that the more people you throw at a software project the slower it goes!! Its the time when UNIX became popular because it was one of the few small operating systems and so was reliable.

    2. Re:UML tailored for OOP... by JamieF · · Score: 2

      >Any mission critical application (OS kernel, NASA spacecraft software
      > etc etc) is done in Z type languages.

      Really? Can you back that up? Specifically, can you prove that any of Windows NT / VMS / Solaris / FreeBSD / Linux / MacOS X have a kernel that was written in a "Z type language" as opposed to just coded directly in C/C++/whatever and tested the hard way?

  8. 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.

    1. Re:Design Patterns by Shamanin · · Score: 2, Insightful

      This is way beyond what an introductory course should takle. Design Patterns must first be recognized through sweat & tears before they can be truly understood and appreciated. Design Patterns offer the experienced software designer a common language to communicate their ideas to their peers.

      --
      come on fhqwhgads
    2. Re:Design Patterns by retsofaj · · Score: 1

      I agree with you that Gamma et. al. is a good great book, *assuming that you have already conceived of your program as objects*. While there could conceivably be design patterns for other conceptual models, I have yet to see such patterns collected into a similar work.

    3. Re:Design Patterns by Anonymous Coward · · Score: 0

      Although the Gang of Four book is great, and the concepts of a Design pattern well applies to other programming paradigm, it is mainly about problems that occur mostly in _Object Oriented_ design. I doubt the book would be very usual for someone implementing an expert system in a declarative logic programming language such as Prolog.

      Also is it not really about 'thinking in objects', but more to do with specific problems that come up when you are doing OO design. A better introduction to the Object oriented way of viewing programming would be in one of Grady Booch's books or a book on Object oriented analysis/design using UML or (better for beginners) CRC cards.

    4. Re:Design Patterns by shoppa · · Score: 2
      assuming that you have already conceived of your program as objects

      While Gamma et al talk about these patterns from an object-oriented point of view, most of them predate the "OO language". We've been doing publish-subscribe, decorator, etc. for a long time, we just didn't use a OO language to talk about them.

    5. Re:Design Patterns by Anonymous Coward · · Score: 0

      this is a good idea, but i think the key is teaching people how to think about programming conceptually themselves, not giving them a list of predefined concepts to try to apply. 'design patterns' might be a good resource in a class like this, but dangerous as it's kindof a crutch. the patterns in 'design patterns' are by no means exhaustive, and should be able to be conceived of independently. teaching people how to think of their programs conceptually, how to determine abstraction points, break down into pieces, figure out invariants, etc., might best be done without a limited reference of templates. just like in an algorithms class, it's nice to expose the students to algorithms to common problems, but the real focus needs to be on how to conceive of and analyze your own algorithms.

      i think it's a great idea to teach conceptual thinking as an introduction to cs. i think this is part of the motivation for having introductory classes use 'impractical' languages like Scheme, but imho that particular approach is more flawed than valuable (unless the plan is to use it as a 'weed out' class).

    6. Re:Design Patterns by Tablizer · · Score: 2

      (* While there could conceivably be design patterns for other conceptual models, I have yet to see such patterns collected into a similar work. *)

      I have started documenting procedural/relational versions of GOF-influenced patterns at:

      http://www.geocities.com/tablizer/prpats.htm

      Personally, I find p/r versions of them simpler, and more flexible. In table-oriented thinking, a "pattern" is often merely a relational formula adapted to solve a need for a particular task. GOF tends to view them as global.

      In GOF OO thinking, one tends to make the *code* resemble the pattern. However, in p/r one tries to factor potential relationships into formulas on tables instead of code shape. Changes are then less disruptive, because it is easier to change a formula than a physical code structure. And, you can have as many different such view-providing formulas as you need without trampling on one another.

      Perhaps it is subjective. Developers tend to model their own mind more than anything external I have come to conclude after many heated debates. I just like p/r modeling better. I find it cleaner, more flexible, and less intrusive.

      Relational modeling is as close as anything I have seen to reducing GOF-like patterns into a compact, virtual "pattern language". IOW, "pattern math".

    7. Re:Design Patterns by MillionthMonkey · · Score: 5, Funny

      Of course those GoF patterns can make life hell for the maintenance developer or app framework user, when people turn it into a contest to see how many design patterns they can fit into a single project. The overall "Design Patterns" philosophy is really "how can I defer as many decisions as possible from compile time to run time?" This makes the code very flexible, but the flexibility is wasted when a consultant writes code using lots of patterns to puff up his ego and then leaves without leaving adequate comments or documentation. Without insight into how the system works, the configurability and flexibility that these patterns offer is lost. The system hardens into an opaque black box.
      Deferring decisions to runtime makes code hard to read. Inheritance trees can get fairly deep, work is delegated off in clever but unintuitive ways to weird generic objects, and finding the code you're looking for is impossible, because when you're looking for the place where stuff actually happens, you eventually come across a polymorphic wonder like

      object.work();

      and the trail ends there. Simply reading the code doesn't tell you what it does; the subtype of object isn't determined until runtime. You basically need a debugger.

      You can take a really simple program and screw it up with aggressive elegance like this. Here is Hello World in Java:

      public class HelloWorld {
      public static void main(String[] args) {
      System.out.println("Hello, world!");
      }
      }


      But this isn't elegant enough. What if we want to print some other string? Or what if we want to do something else with the string, like draw "Hello World" on a canvas in Times Roman? We'd have to recompile. By fanatically applying patterns, we can defer to runtime all the decisions that we don't want to make at runtime, and impress later consultants with all the patterns we managed to cram into our code:


      public interface MessageStrategy {
      public void sendMessage();
      }

      public abstract class AbstractStrategyFactory {
      public abstract MessageStrategy createStrategy(MessageBody mb);
      }

      public class MessageBody {
      Object payload;
      public Object getPayload() {
      return payload;
      }
      public void configure(Object obj) {
      payload = obj;
      }
      public void send(MessageStrategy ms) {
      ms.sendMessage();
      }
      }

      public class DefaultFactory extends AbstractStrategyFactory {
      private DefaultFactory() {;}
      static DefaultFactory instance;
      public static AbstractStrategyFactory getInstance() {
      if (instance==null) instance = new DefaultFactory();
      return instance;
      }

      public MessageStrategy createStrategy(final MessageBody mb) {
      return new MessageStrategy() {
      MessageBody body = mb;
      public void sendMessage() {
      Object obj = body.getPayload();
      System.out.println((String)obj);
      }
      };
      }
      }

      public class HelloWorld {
      public static void main(String[] args) {
      MessageBody mb = new MessageBody();
      mb.configure("Hello World!");
      AbstractStrategyFactory asf = DefaultFactory.getInstance();
      MessageStrategy strategy = asf.createStrategy(mb);
      mb.send(strategy);
      }
      }


      Look at the clean separation of data and logic. By overapplying patterns, I can build my reputation as a fiendishly clever coder, and force clients to hire me back since nobody else knows what all this elegant crap does. Of course, if the specifications were to change, the HelloWorld class itself would require recompilation. But not if we are even more clever and use XML to get our data and to encode the actual implementation of what is to be done with it. XML may not always be a good idea for every project, but everyone agrees that it's definitely cool and and should be used wherever possible to create elegant configuration nightmares.

    8. Re:Design Patterns by JamieF · · Score: 3, Interesting

      Bravo! Fad coding is a very real problem, and in the OO world, over-abstracting and over-design-pattern-ing is a real problem, even though those aren't real words. :)

      There are requirements that can make abstracted designs a good idea - things like i18n, which suggests that all the text in your UI should be ripped out of constants and put in config files. So in that case Hello World would need a way to read the config file in order to easily morph into Bonjour Monde or Hola Mundo or whatever.

      I can't tell you how many times I've seen an object model in a project that starts with EVERYTHING being based on some GenericItem object that all the others inherit from, and GenericItem has no real value. The designer just wanted to use inheritance a lot. Oy.

      I like OO and all, I just don't like OO developers who read 10 books on OO and try and apply 100% of what they've read in their first project... and spend all their time building more and more goofy infrastructure instead of actually implementing any functionality.

    9. Re:Design Patterns by quantaman · · Score: 2

      The second HelloWorld program looks like a tracing question off of one of my CompSci exams :)

      --
      I stole this Sig
    10. Re:Design Patterns by pkaminsk · · Score: 1

      In my experience, even 3rd-year students are confused by the Gang of Four Design Patterns book. In my Object-Oriented Software Engineering course I prefer to use Craig Larman's "Applying UML and Patterns: an Introduction to Object-Oriented Analysis and Design", 2nd ed. It introduces some of the more useful patterns more gently, along with the other essential analysis and design principles. It has a good mix of concepts which makes it a fine all-in-one choice for teaching.

    11. Re:Design Patterns by spongman · · Score: 4, Insightful
      yeah, you have a point - don't try to write a class library when all you mean to do is write a program.

      but on the other hand most tasks aren't as simple or well defined as 'Hello World'. remember the last time your boss/client said "hey can we change it to do [this]" and you groaned because [this] wasn't anywhere near the original spec and you knew how much work it would need to hack it in? at that point you're wishing you'd abstracted just a little bit more at the outset.

      My corollary: the boss is always going to ask for something that you didn't expect. twice.

    12. Re:Design Patterns by angel'o'sphere · · Score: 2

      Exactly what you find to be an advantage in your proposals is generaly found a disadvantage by OO programmers.

      Your patterns are wrong applied, your strategy is exactly NOT a strategy, because you can't add a new variant of a step without modifying the original program code.

      Design patters ín OO are mainly about: "NOT TO APPLY MANUAL CHANGES ON OLD CODE"
      But by ADDING new code and making the new code able to interact with the old code.

      Your other papers about comparision between OO and procedural are wrong as well.

      You bring up a shape example and argue that the procedural approaches would be easyer to maintaine. Thats wrong.

      If you invent a new shape you have not to modify one single point(in fact you create a complete new file and modify nothing in C++/Java etc.) but you have to change every single procedure to cover the new shape. The more "methods" or procedures a class/table(why don't you call it what it is? a record! its only a table in the DB and not in the programming language, there it is a record) have the more you have to change when a new shape gets added.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    13. Re:Design Patterns by p3d0 · · Score: 2

      I disagree. Most of those design patterns are useful structures that can be employed in a variety of programs to solve recurring problems. Some are workarounds for C++ warts. But none of them are conceptual models for software.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    14. Re:Design Patterns by Anonymous Coward · · Score: 0

      And that is why agressive refactoring is the way to go. Requirement 1: Write canonical 'Hello World'. OK, just write the Hellow World illustrated in the example above.

      Requirement 2: OK, fine, but we need a way of internationalizing. OK. Refactor to provide a mechanism for determining the string to print by a run-time based decision from, say, a config file. A class to do this would probably be the neatest way.

      Requirement 3: Allow us to select between several different output devices for the message, again chosen by the end-user at runtime. OK. Refactor again to provide a choice of methods to use for implementing the print method.

      Requirement 4: Allow other developers in the group to provide and deploy new output devices as they are needed. OK again, refactor to support a plug-in mechanism for the print method. Some sort of reflection support, a well-defined interface and the abstract factory stuff would be a good way to go here.

      So, we started out with the original example, and ended up with something closer to the final example. But each time we did enough to meet the current reqauirements, and refactored aggressively to ensure that there was still a clear, simple design expressed to meet the needs of the new features demanded. With sensible choice of method names, it needs to be no harder to follow the 'complex' design than the 'simple' one. For example, can anyone *not* tell from reading the 'main' function in the compelx example what it is supposed to do?

    15. Re:Design Patterns by Arrgh · · Score: 2

      Too much of a good thing might not end up also being a good thing?! Huh, I've never thought of it that way before. +1, Insightful!

      Cute reductio ad absurdum anyway.

    16. Re:Design Patterns by angel'o'sphere · · Score: 2

      Well Done!

      But may I point out ... hu hom, you missed to use a Composite somewhere, or was it a Decorator? Yes, the decorator for the message in case you need a CR/LF or similar ending is missing.

      You should have anticipated that, shouldn'd you?

      He he, why did you get rated funny, I do not know, INSIGHTFULL would have been the right thing. And indeed it is, and it is funny, sarcastic and ironic as well.

      I would bet you even compiled it, as I can not see a single syntax error :-)

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    17. Re:Design Patterns by Pseudonym · · Score: 2

      Design patterns are nothing more and nothing less than a certain kind of engineering experience. If you're only writing trivial or small programs, you don't need them. If you're developing flexible medium- to large-sized applications or systems, the rules are different.

      There are a number of differences between programming and software engineering. This has been one of them.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    18. Re:Design Patterns by Tablizer · · Score: 2

      (* Your patterns are wrong applied, your strategy is exactly NOT a strategy, because you can't add a new variant of a step without modifying the original program code *)

      What is an example? It is easier to add a table record than to add a class.

      (* If you invent a new shape you have not to modify one single point *)

      You did not read it very carefully. For one, most real-world things don't fit the shape change pattern. The rules of geometry don't change very often. However, in custom biz apps, PHB's don't care about math nor hierarchies. They will break a tree if they want to.

      Second, the reverse is true if you add a *new operation* to each shape. You would have to visit and alter each sub-class in OOP. That is very intrusive. (And don't bring up inheritence, I covered that.)

      I have been in many "change scenario" battles. OOP does not win unless you are delusional about forcing the world into mutually exclusive subtypes in a very artificial way.

      OOP is a solution still looking for a problem that fits it.

    19. Re:Design Patterns by angel'o'sphere · · Score: 2

      (* Your patterns are wrong applied, your strategy is exactly NOT a strategy, because you can't add a new variant of a step without modifying the original program code *)

      What is an example? It is easier to add a table record than to add a class.


      Example for what? If you add a nother case, (is that a table record for you?) you change the original program code. PERIOD. Design patters are about "how to avoid to need to change old code".

      I have nothing against the point that you like Procedural approaches and prefere them over OOP.

      But your samples regarding patterns, ALL OF THEM, are simply wrong.

      You can program procedural for the rest of the universe time span and I do not care about that, nor does anybopdy else, its just your business to do so.


      (* If you invent a new shape you have not to modify one single point *)

      Its FAR more often that a further shape is added to your sample of shapes than that a new method is added. I unfortunatly once wrote a CAD system and later I wrote a CASE system. The number of shapes are not known offhand as the silly customer allways wants one more. The number of methods did not change often and if so it was easy to iterate over the files, as each class is in one file, and add the new method.

      Adding a new method is absolutely no problem as you ADD something compleete new, its NOT intrusive as you do not affect your old test cases. Intrusion means by definition that all changed points need to be retested with ALL old test cases AND with new test cases for the change.
      You do not add a new case label in a switch. You add a complete new method/procedure. If I use inheritance and have an abstract base class my compiler tells me if I ommit it at a single point to include the method or even the IDE does.
      If I add a new method, I only write new test cases for that method I do not even need to retest the rest of the class. If I write a new class I only write tests for the new class I have no need to retest any old code.

      If you forget in one of ten procedures to add a case statement, only your test will find it. A missing method is a compiler error, no test needed.

      Your designs are so invasive to change that you can not even plan offhand how big a change will be and how big the impact might be and how many new tests you might need.

      OOP is a solution still looking for a problem that fits it.

      This is a silly statement. You where not even able to transfer the design patterns on your web site correctly from an oo language to a procedural language(which is possible, easy even!). How can you judge about OOP then?

      I have been in many "change scenario" battles
      If it was a battle for you, you better had used OOP and made a walk in the sunshine while refactoring your code.

      I programmed nearly 10 years in procedural languages and I now do in OO languages since over 13 years. I have no problem that other people prefere other styles. But in their arguments they should stick to the trueth. You try to tell me that black is in fact white. But I can see, so I see you are either mad or a liar, white IS white and balck IS black. I do not care if you prefere white over black but be honest in talking about your preferences. The topic is indeed to interesting to bull around with it.

      There are only 3 or 4 examples I found so far where a pure procedural solution was indeed favourable over a pure oo soluition. To bad that you did not even find those and cover them on your web site.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    20. Re:Design Patterns by Tablizer · · Score: 2

      (* Its FAR more often that a further shape is added to your sample of shapes than that a new method is added. *)

      I wouldn't know, I don't program shapes for a living. In my domain, dividing things into "subtypes" is a disaster anyhow because it is a one-dimensional, mutually-exclusive division. Maybe "natural laws" can rely on such, but NOT man-made rules.

      BTW, there are a lot of different ways to represent and classify shapes in practice. Sub-typing is only one of many. I showed how an oval can be a rectangle with 100% smoothing on it. IOW, manipulate an attribute to have all kinds of interesting in-between shapes. IS-A kills that.

      (* You do not add a new case label in a switch. You add a complete new method/procedure. *)

      Blocks is blocks. This is a name-game here. Methods are blocks nested within larger blocks (classes), and case statements are smaller blocks (case instance) nested within a subroutine.

      You have a double standard going here.

      Plus, you have more work if the options grow to no longer be mutually exclusive, which often happens in real applications.

      (* This is a silly statement. You where not even able to transfer the design patterns on your web site correctly from an oo language to a procedural language *)

      The pattern definitions are either vague or written with OO bias. If you can produce clearer definitions and show a concensus, I will reconsider.

      (* There are only 3 or 4 examples I found so far where a pure procedural solution was indeed favourable over a pure oo soluition. To bad that you did not even find those and cover them on your web site. *)

      How do you know that OO could not do them better? Did you run them by peers? If your OO is as bad as your procecural designs probably are, then you may be comparing bad OO to bad p/r.

      (* If I use inheritance and have an abstract base class my compiler tells me if I ommit it at a single point to include the method or even the IDE does. *)

      I addressed this already in the webpage. It is very language-dependent and potentially harms inheritance since the compiler does not know whether you meant to inherit or not.

    21. Re:Design Patterns by angel'o'sphere · · Score: 2


      Blocks is blocks. This is a name-game here. Methods are blocks nested within larger blocks (classes), and case statements are smaller blocks (case instance) nested within a subroutine.

      You have a double standard going here.


      So: how do you call a specific case label inside a specific procedure?

      How do you guarantee that all other old case labels do not get broken by a change?

      Its hard to discuss if you use your own invented terminology :-)

      I have no double standards. Each language provides some kind of "first class citizen". In procedural languages this are procedures and IMHO you can add records. In OO languages this are classes and IMHO methods.

      From both you can take adresses, from the objects and the variables declared from a record type, as well as from procedures and methods.

      Everything wich is smaller is on a different level. So your argument: "everything is a block" is rather weak. How to put the statement behind a case label into a variable and call/execute it stand alone?


      How do you know that OO could not do them better? Did you run them by peers? If your OO is as bad as your procecural designs probably are, then you may be comparing bad OO to bad p/r.
      Hey! you should appologize now. This is a personal assault. Why did you do that? Went out of arguments? *I* did not *make* the procedural desigs. I *found* them, they where made by others. I'm a known expert for OO design ... so its silly to asume I make *bad* OO designs.

      As far as I can follow your argumentations you are not even an procedural programmer but a data base centric programmer, probably a relational programmer? Probably that is the cause for your dislike of OO?

      At least it would be an explanation why you mix/switch terminology.


      The pattern definitions are either vague or written with OO bias. If you can produce clearer definitions and show a concensus, I will reconsider.
      Sure, if 'C' is a suitable language and you pay me, no problem.

      Anyway, your main thesis is: OO is bad and procedural is better. This is not prooven on your site because for nearly every sample weak points spring in mind as they generaly are samples where a oo purist would say: no no, exactly what you bring up as good is BAD. The goal in oo is to craft a program which knows nothing about the data it manipulates.
      No if "field of record" == xyz, no switch(var.field) case a: ....
      In a perfect program you had no such if and no such case.
      Another prime goal of OO is to write libraries which become OLD code and are able to call the NEW code of an application program. Not as in procedural code where NEW code is calling OLD code. In OO the goal is OLD code calls NEW code.
      This is not doable with procedural programming (well, you can use a procedural language to implement an oo design, but then you are programming oo in a procedural language and no longer procedural)
      As far as I understood you, not the language but the paradigme is what you dislike, right?

      BTW: oo also fits business applications :-) So far no problem domain is known which is not suiteable or which would not benefit from oo approaches.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    22. Re:Design Patterns by Tablizer · · Score: 2

      (* So: how do you call a specific case label inside a specific procedure? *)

      routineWithCase(theCaseArgument)

      Besides, you are comparing apples to oranges here. You are asking how to make one paradigm resemble another, which is not the goal. Does OO do OO better? Well of course!

      (* How do you guarantee that all other old case labels do not get broken by a change? *)

      How do you guarentee that you won't break *nearby* methods? How are nearby methods less fragile than nearby case blocks? I don't know what kind of finger movements you are envisioning, but I see no difference. Blocks surrounded by blocks in both cases.

      (* Hey! you should appologize now. This is a personal assault. *)

      Okay, you are right. It was uncalled for. I apologize.

      But, the point I am trying to make is that I don't know that quality of what you are comparing. You may have seen bad procedural all your life. Perhaps one of the few benefits of OO is that it made some people *care* about software engineering. However, just because it raised awarness does not mean it solved it. OO hype has distracted attention away from procedural engineering study and training. IOW, a self-fullfilling prophecy.

      (* As far as I can follow your argumentations you are not even an procedural programmer but a data base centric programmer, probably a relational programmer? *)

      IMO, procedural and relational fit well together. OO and databases tend to fight over territory and get tangled up in paradigm translation, the seperation of data and algorithm issues, and/or sharing issues. (I agree that there are flaws with some existing relational standards, vendors, and habits, but that is what we have to live with right now. Most these flaws are not paradigm-intrinsic.)

      (* your main thesis is: OO is bad and procedural is better. *)

      Wrongo! I believe it is *subjective*. OO better maps to the way *some* people think IMO. Just not my head. More on this below.

      The point is that the industry *assumes* that OO is "better" and tosses procedural without first providing evidence. The lemming/bandwagon/hype factor.

      (* This is not prooven on your site because for nearly every sample weak points spring in mind as they generaly are samples where a oo purist would say: no no, exactly what you bring up as good is BAD. *)

      Perhaps, but the OO proposed by such "high level" gurus is often a tangled, overengineered mess. (Engineered for the wrong or unrealistic change patterns, IMO.)

      IOW, it is the cliche simplicity of OOP which sells it, but to actually make it work in practice, you have to make pretzel code that is worse than what came before it. OO-Visitor has been called the "whipping boy of patterns" and rightly deserves it.

      (* The goal in oo is to craft a program which knows nothing about the data it manipulates. No if "field of record" == xyz, no switch(var.field) case a: .... *)

      Then assign it to a local variable first. Binding to a class can also be change-unfriendly (a mini Demeter sin). My technique of programming tends to "translate to indepedence" at the task level instead of at the entity level (OO's approach). I often talk about the "liaison layer". This provides "local translation" instead of the *global translation* of OOP. A one-size-fits-all hiding is not good. Make it local, and you have simpler interfaces and more flexible interfaces to deal with.

      This allows information to "jump entities" with little or no impact on the application code. In OOP, if you move a peice of info from one class to another, it has a bigger rippling affect. (I called this the "noun shuffle" on my webpage.) See Also:

      geocities.com/tablizer/bizmod.htm

      (* Another prime goal of OO is to write libraries which become OLD code and are able to call the NEW code of an application program. Not as in procedural code where NEW code is calling OLD code. In OO the goal is OLD code calls NEW code. This is not doable with procedural programming *)

      Could you privide something more specific? A routine call does not care if the routine is old or new.

      (* BTW: oo also fits business applications :-) So far no problem domain is known which is not suiteable or which would not benefit from oo approaches. *)

      Ed Yourdon did surveys and it was reported that OO offered no detectable advantages. (Actually it started out with advantages, but this faded, possibly because as OO went mainstream, the programmers were less likely to have an OO-mind-fit. IOW, it backs my subjective claim. It also suggests that if you want better designs, then let or find programmers use tools or techniques that best fit their head as long as they can justify the change-impact dicisions/tradeoffs they are making.)

    23. Re:Design Patterns by Tablizer · · Score: 2

      (* For example, can anyone *not* tell from reading the 'main' function in the compelx example what it is supposed to do? *)

      Only because the class name gave it away. If the class was named poorly, then one would be hosed.

      BTW, it's sometimes best to save the translation for other output devices as a later step IMO. IOW, don't try to integrate it into the thing that generates it. Put it first in some cononical or meta form, such as in a table record. If you later need to send it to a different device, then read it from the table.

      The mechanism that writes it to the table then does not have to care about how to send it.

      In some ways this is similar to UNIX piping philosophy.

  9. Practicum first, then theory by rleisti · · Score: 1

    In my experience, it seems best to introduce some sort of usefull example first, and then show how it fits into an overal paradigm of computing.

    ie. Introduce C/PASCAL/BASIC then talk about the von Neumann model (which seems to be the most popular model, but possible not the easiest to understand)

    In fact, since the von Neumann model is so popular, perhaps you should start of with a functional or declarative language first, like prolog just to open their minds before they get stuck into one way of thinking.

    1. Re:Practicum first, then theory by cscx · · Score: 2

      Introducing C as your first example is probably a bad idea.

      For i = 1 to 10
      Print i
      Next


      is a whole lot easier to understand than

      for(i=0;i<=10;i++)
      {
      printf("%d", i);
      }


      for newcomers to programming.

    2. Re:Practicum first, then theory by rleisti · · Score: 1

      It's actually not that bad. In my experience as TA for first year programming, the students who have difficulties seem to have more problems grasping the concept of what a loop or function is, rather than with the crazy symbols they're required to type in order to get one.

      Although, putting ';' at the end of each line, and dealing with printf format strings can be a source of headaches.

    3. Re:Practicum first, then theory by Anonymous Coward · · Score: 0

      C, Pascal and Basic have nothing to do with the "von Neumann Model". They are procedural languages.

      I wouldn't introduce people to functional languages (non procedural) languages unless they particularly want to learn one. Typically people wouldn't get on with the languages so well, and would tend to need a strong background in mathematics and/or logic.

      The von Neuman model is about computer architecture. It is the conceptural model of a computer as memory, processor, contol and input and output components.
      Lots of people associate von Neumann with the stored program, but a lot of constroversy surrounds this, and it certainly isn't fair to attribute him with the idea. But still, I don't know what you were trying to say above!

    4. Re:Practicum first, then theory by rleisti · · Score: 1

      Ironically enough, I'm pulling this out of a book oriented around computer architectures ("Advanced Computer Architectures - A Design Space Approach", Dezso Sima, Terence Fountain , Peter Kacsuk), but what I mean by the von Meumann model is that:
      "A programming language corresponding to this model should allow variables to be declared and their values to be manipulated (altered) by means of a proper set of instructions as many times as required during computation (according to the state transition semantics ...). Furthermore the language should provide control structures to allow explicit control of the execution sequence." (pg. 11)

      So C/BASIC/PASCAL all fit this model. It's probably the same idea you had in mind with the procedural model, but I think it grows out of the basic von Neumann model (of which a computer architecture is a specific facilitating implementation).

    5. Re:Practicum first, then theory by Anonymous Coward · · Score: 0
      Ahem ....

      printf("%d\n", i);

    6. Re:Practicum first, then theory by Tijn · · Score: 1

      I especially agree on your last remark, maybe because that's exactly how programming classes were set up at my university. In the first year, we start with functional programming, to give the guys who have been coding in C/Pascal/ a bit of a shock.

      This way they find out that there are more ways to program (and therefore more ways to look at a problem) than the imperative or object-oriented approach they've always been using. Add a class in programming techniques to that (using both imperative and functional languages, and implementing some functional algorithms in imperative languages), and you're set.

      Besides, I've never officially learned any programming language in all those years at the university (as a Comp.Sci. major!); the teachers expected you to teach yourself a new language if it was needed for an assignment. Worked out fine when I got a job, because right now it means I'm switching programming languages every couple months, and picking them up pretty fast.

    7. Re:Practicum first, then theory by spongman · · Score: 2
      yeah? try writing that in VDM.

      ugh.

  10. conceptual models? by Anonymous Coward · · Score: 0

    good coders think in code, not with models to understand the code, you should be able to look at a block of asm or c or c++ or vb and understand it as is. if you need to use conceptual models try a different carreer, maybee in the fast food industry..

    1. Re:conceptual models? by Anonymous Coward · · Score: 0

      good coders think in code, not with models to understand the code, you should be able to look at a block of asm or c or c++ or vb and understand it as is. if you need to use conceptual models try a different carreer, maybee in the fast food industry..

      -1 Flamebait

    2. Re:conceptual models? by Hellkitten · · Score: 1

      you should be able to look at a block of asm or c or c++ or vb and understand it

      Yes you should be able to, but you shouldn't have to unless that is the block you're going to modify.

      It seems obvious to me that you have never worked on something that is part of a bigger system. You try spending a few hours 'reverse engineering' a flowchart from the code to find the place to make your addition so that the impact (read: work) will be smaller. Then you can tell me how to do that without any form of conceptual model

      try a different carreer, maybee in the fast food industry

      Been there, done that, ain't going back. But whith your attitude that using conceptual models is wrong, just because you never needed it to write 'Hello World', maybe you should?

      --
      - We are the slashdot. Resistance is futile. Prepare to be moderated -
    3. Re:conceptual models? by Simon+Kongshoj · · Score: 1

      Billshit. Analysis of the problem to be solved as well as designing the system to solve it are as important as writing the system's code. If you think systems like the X Window System, the Linux kernel, Mozilla or any other successful large system was created without paying attention to analysis and design, you are mistaken. A good design is as instrumental to a good program as good coding practice is -- unless you're just writing throw-away code for personal use, it really pays off to think through what you're going to create, and how you're going to go about it. This is where conceptual models can be very useful, especially if you remember that conceptual models do not HAVE to be flowcharts and rich pictures, but a vision of the basic concept you are going to implement in your program. Are you going to write your program as a traditional main program/subroutine architecture, an event-driven architecture, an object-oriented one, a pipes and filters network, or perhaps a repository style? Without knowing which architecture you're trying to implement, you are most likely to produce poor, inefficient and hard to maintain code -- if you can even get properly started. What constitutes a good program? Brian Kernighan and Rob Pike, in their book "The Practice of Programming", state that the three principles of simplicity, clarity and generality are fundamental to creating good programs. I agree with them, because a program which satisfies these three criteria is easy to reuse code from, easy to adapt to other circumstances, usually easy to optimize, easy to maintain, and easy to understand. If you are a coder, you certainly know the value of these properties. However, a poorly selected design style (architecture) or a flawed analysis of the problem will be just as great barriers towards achieving the goal of a good program as bad programming practice can be. Coding is just the implementation of the problem solution, design is figuring out HOW this implementation should work. Good coders may think in code, and good system designers may think in terms of models. The best coders, however, also happen to be good system designers, and the best system designers also happen to be good coders.

      --
      Six sick .sigs, the Number of the Beast!
  11. One problem is that... by Steveftoth · · Score: 2

    most people who can program already, did it the hard way by just simply diving in and doing it until it works. So it's very hard for people like that to go back and say what would to have worked better since they had to figure it out by themselves.

    Programming is a process and modern US school don't teach processes at all. They teach you what 2+2 is, not how to add numbers. If someone figures out how to add on their own it's not cause they were taught it in school. How many people can add up all the numbers from 1 to a hundred quickly?

    but not to make this a pessimistic post, I would say that teaching others how to program is probably best started with a flowchart type modeling, since that is easy to understand and can be represented graphically and then easily turned into code.
    State diagrams are harder to understand at first, but once you get them they are very good tools for writing programs.

    1. Re:One problem is that... by domninus.DDR · · Score: 1

      I agree, especially with that math example. In my highschool calc class the teacher introduced series with that exact problem of adding all the numbers from 1 to 100. It is amazing how few understood something like 1 + 99 = 100, 2 + 98 = 100... 50 of those pairs. On another note I just finished my second year of highschool CS and I think I would rather have had the approach he is looking for here, instead of focusing on syntax. One thing to consider (depending on age probably) is amount of hands-on experience they can get early trying to learn programming like this.

    2. Re:One problem is that... by Anonymous Coward · · Score: 0

      1+99 = 100
      2+98 = 100
      ...
      49+51 = 100
      thus: 1+2+...+100 = (49 * 100) + 100 + 50 = 5050

      duh!

    3. Re:One problem is that... by Anonymous Coward · · Score: 0

      How many people can add up all the numbers from 1 to a hundred quickly? Well, everyone at my school, they taught us that quite early. absfldf lkja woefij ajslwifj lefijlwiajef ljwleifjlid jfjdsliajeowifj osijf leijwoaijeflij slfijweoijf aowi jdliewijafslfj ewoafj

    4. Re:One problem is that... by jabbo · · Score: 2

      > How many people can add up all the numbers from 1 to a hundred quickly?

      I can...

      $ perl -e 'foreach $i (1..100) { $sum += $i; }; print $sum . "\n";'
      5050

      Probably should have done this recursively for brain calisthenics, though ;-)

      --
      Remember that what's inside of you doesn't matter because nobody can see it.
    5. Re:One problem is that... by Anonymous Coward · · Score: 0

      Don't forget not to add 50 twice.

      (PS. The answer is 5050.)

    6. Re:One problem is that... by hgh · · Score: 1
      $ perl -e 'foreach $i (1..100) { $sum += $i; }; print $sum . "\n";'

      Why waste all the CPU cycles:

      $ perl -e 'print (100+101)/2;'

      hgh
    7. Re:One problem is that... by jabbo · · Score: 2


      $ perl -e 'foreach $i (1..100) { $sum += $i; }; print $sum . "\n";'


      Why waste all the CPU cycles:

      $ perl -e 'print (100+101)/2;'


      mmm,

      $ perl -e 'print (100+101)/2;'
      201$

      Probably not the result you wanted, definitely not a useful result, and points out why you need to understand syntax (operator precedence) as well as structure...

      --
      Remember that what's inside of you doesn't matter because nobody can see it.
    8. Re:One problem is that... by anderman · · Score: 1

      Also points out why people need to understand logic as well since his problem wasn't syntax or structure related ;)

    9. Re:One problem is that... by Idimmu+Xul · · Score: 1

      The correct algorithm is

      y = ((x+1)*x)/2

      iir

      --
      The problem with slashdot is that most of its users were bullied and stuffed into lockers as kids!
    10. Re:One problem is that... by Anonymous Coward · · Score: 0

      Actually, its not (N+(N+1))/2 its N(N+1)/2.

      so you get 100(101)/2 = (100+0)(100+1) / 2 = 10100/2 = 5050

      That can be done in your head in a max of 5sec.

    11. Re:One problem is that... by Morphine007 · · Score: 1

      $ perl -e 'print (100+101)/2;'

      it should be

      perl -e 'print(100*101)/2;'

      since

      n
      sum i = i(i+1)/2
      i=1

    12. Re:One problem is that... by Lozzer · · Score: 1

      Of course for pointless optimisation you'd just do perl -e 'print "5050\n"'

      --
      Special Relativity: The person in the other queue thinks yours is moving faster.
    13. Re:One problem is that... by Anonymous Coward · · Score: 0

      The number 50 is not involved at all. 100 + 1, 99 + 2, ... 51 + 50 = 101 * 50 = 5050. All sequences that have an even number as the high end will wind up with no outlier. E.g. 4 + 3 + 2 + 1 = (4 + 1) + (3 + 2) = 5 + 5 = 10.

      Ones with an odd number at the high end will wind up with a leftover number at the midpoint.

      e is exactly equal to mc2

    14. Re:One problem is that... by JamieF · · Score: 3, Insightful

      echo 5050

    15. Re:One problem is that... by shuane · · Score: 1

      Well, if you don't add the numbers it's pretty easy.
      The sum of 1..N = N(N+1)/2

      So Sum(1..100) = (100*101)/2 = 5050.

      --
      This signature intentionally has just seven words.
    16. Re:One problem is that... by spongman · · Score: 2

      shows my perl is fucked up, basically.

    17. Re:One problem is that... by maxume · · Score: 2

      or come up with a superior algorithm...

      0...100 is comprised of 50.5 sets of numbers that add up to 100, so do 50.5 * 100 = 5050.

      That seems a little simpler, I guess, but who cares...

      --
      Nerd rage is the funniest rage.
    18. Re:One problem is that... by rhkramer · · Score: 1

      Just for the record:

      1 + 99 = 100
      2 + 98 = 100
      ...
      50 + 0 = 50

      sum (1..100, step=1) { x } = 4950, not 5050

      On the other hand:

      1 + 100 = 101
      2 + 99 = 101
      ...
      50 + 51 = 101

      50 * 101 = 5050

      Be careful building fences!

  12. It's called Structure programming by Anonymous Coward · · Score: 1, Interesting

    It's nothing new, a friend of mine took a class using textbook : "Tools for structured design , In introduction to programming logic"
    by Marilyn Bohl and Maria Rynn

    lots of flowcharts and pesudo codes..

  13. Karel The Robot by critter_hunter · · Score: 2, Insightful

    Sortof like a modern, complex Karel in other words ;)

    --
    Karma: Could be worse (could be raining)
  14. Worm's eye view by Inthewire · · Score: 2, Insightful

    I started programming because I had a problem to solve. I focused on what I wanted to accomplish, not syntax or method or anything else. That isn't to say I didn't think about things like modularity, clarity, documentation, testing, etc - I did. I read a lot of the common texts - Brooks' _Mythical Man Month_, McConnell's _Code Complete_, Raskin's _The Humane Interface_, Spolsky's website, and a host of articles. I didn't start out with a language in mind. I started out with a result in mind. All of those things helped me to understand that my program existed to solve a problem. It wasn't there to keep me busy. I wasn't writing it because I wanted to use every neat trick I'd ever heard of. I was trying to make my life, and the lives of those around me, easier. I don't know how well I accomplished that, but I did build a program that did what it was supposed to do.

    --


    Writers imply. Readers infer.
    1. Re:Worm's eye view by einer · · Score: 2

      I did build a program that did what it was supposed to do.

      Well, you're one up on Redmond.

      Andrew

  15. Visualisation Research Group by Andrew+Coles · · Score: 1
    The University of Durham (UK) have a research group concentrating on the area of conceptual modelling through visualisation. There's some papers and so on here:

    Durham VRG

    HTH

  16. 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 CMonk · · Score: 3, Interesting

      I'll second this one. Stop looking at programming books, if you want to learn Computer Science read Computer Science books. SICP is where I learned it all (in school).

    2. Re:A Famous One Is... by William+Tanksley · · Score: 4, Insightful

      Agreed. This one's _essential_. In fact, I would go so far as to say I've seen no other choice; if you want to learn both how to program and how to think about programming, this is the only book which combines both.

      The only problem, as I point out in another message, is that they almost totally ignore other conceptual models of programming; lambda calculus is thoroughly explored, but combinatorial logic and similar models, as demonstrated impurely by APL/J/K and purely by Forth/Postscript/Joy, are almost ignored. A good teacher would, IMO, base a class on SICP, but augment with two of the above languages and a discussion of their paradigms.

      -Billy

    3. Re:A Famous One Is... by Anonymous Coward · · Score: 0

      Mmmmm, fond freshman memories of the Purple Wizard Book...

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

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

    5. Re:A Famous One Is... by FreakOfTheWeek · · Score: 1

      Curious about it, I googalized "Structure and Interpretation of Computer Programs". Guess what came up as the first hit?: http://mitpress.mit.edu/sicp/full-text/book/book.h tml It appears to be the full text online!

    6. Re:A Famous One Is... by Anonymous Coward · · Score: 0

      Yeah. SICP was somewhat designed to weed people
      out as I recall from my 6.001 days, though
      not as much as 18.100B was supposed to stop
      people from studying math.

      SICP teaches some important ideas, but it tends
      to overemphasize abstraction at the expense of
      efficiency.

      As good a book as it is, it points up why some
      claim that when it comes to the real world MIT CS has lost out to Bell-Labs engineering.

      I mean building a clean interface to something
      with growth O(nlogn) has merit, but if you know that n will never be more than 100 there's something to be said for the O(n^2) algorithm
      that doesn't copy-in, copy-out, and garbage collect before finishing ten times slower.

      Even if SICP did really address all the ways to control complexity (it doesn't, witness the success of Perl over Scheme), efficiency does matter.

    7. Re:A Famous One Is... by Peter+Van+Roy · · Score: 1
      There is a book in progress that is in the spirit of SICP and addresses these concerns. You can check out the latest draft at Concepts, Techniques, and Models of Computer Programming.

      I'm one of the authors, so don't take my word for it. We've been working on it for two years and we've taught from it. It distills ten years experience building the Mozart system.

    8. Re:A Famous One Is... by Peter+Van+Roy · · Score: 1
      There is a book in progress that is in the spirit of SICP and addresses these concerns. You can check out the latest draft at Concepts, Techniques, and Models of Computer Programming.

      I'm one of the authors and of course I'm enthusiastic about the book, so don't take my word for it. My coauthor and I have been working on it for two years and we've taught courses from it. It distills ten years experience building the Mozart system.

      Peter

    9. Re:A Famous One Is... by William+Tanksley · · Score: 2

      Well, I'm impressed! That is indeed almost exactly what I was hoping for.

      I'm going to be spending some time reading the draft. The intro slideshow lacked something I was hoping for, though: it's based almost entirely on the lambda (variable passing) model. Are all your concepts built around that, or do you have some dataflow programming (as in APL/J/K) or concatenative programming (as in Forth/Postscript/Joy)? If so, your book would be of immense use to me, since I'm attempting to research the properties of concatenative languages (a shamefully neglected area of computer science).

      Thanks for the book! I hope I can afford the hardcopy when it comes out... That looks like it'll be an INCREDIBLY massive tome. I'm not even going to be able to print it out, it's so massive.

      -Billy

    10. Re:A Famous One Is... by Peter+Van+Roy · · Score: 1
      The book has a lot on dataflow programming (both data-driven and demand-driven). In our view, dataflow is a basic concept that deserves to be there from the beginning. Dataflow concurrency has all the good properties of functional programming and yet is concurrent. This seems not to be widely known, but it deserves to be since it is a much easier form of concurrency than the usual stateful concurrency (as used in all mainstream languages).

      I have programmed in both Forth and PostScript; they are incrementally compiled languages with a postfix syntax and no static typing. I never heard of the term "concatenative languages", can you give a good reference?

      Peter

    11. Re:A Famous One Is... by William+Tanksley · · Score: 2

      I never heard of the term "concatenative languages", can you give a good reference?

      Sure thing. Check out the main Joy page. The mailing list linked to from that page is also a very good resource.

      I have programmed in both Forth and PostScript; they are incrementally compiled languages with a postfix syntax and no static typing.

      Non-incremental Forth compilers are not uncommon; most people never use Postscript incrementally. A strongly statically typed variant of Forth exists (strongForth). And finally, although both do use RPN, they do not have a true postfix syntax; they lack syntax of any kind. Postfix syntax _requires_ that operators appear after their operands; RPN doesn't require operators and operands to have any static relationship.

      The important distinction that the two languages share is that

      1. any concatenation of valid programs produces another valid program
      and
      2. any dissection of a valid program produces two valid programs.

      (Condition #2 is the equivalent of "referential transparancy" in lambda-based languages: it's nice to have for reasoning, but there are some handy things to have which make it impossible sometimes.)

      Concatenativity implies a whole different set of rewriting rules, some of which are quite powerful compared to the applicative/lambda rewriting rules. It turns out to be a whole different way of thinking.

      And as a bonus, the implementation is very simple, fast, and highly optimizable. Because data is managed by the programmer on a stack, the compiler doesn't have to guess what datum is more important than which other one; the stack provides a total ordering, and if the compiler can simply provide faster access to the top of the stack things speed up a lot.

      -Billy

    12. Re:A Famous One Is... by Peter+Van+Roy · · Score: 1
      Ok, I looked at the Joy page. Joy seems to be
      'Forth done right', with nice semantics. But,
      other than being implementable in just a few
      kilobytes, what's the advantage of the Joy
      approach? It seems to be a rather tortuous way
      to write functional programs.


      Don't get me wrong. I enjoyed immensely writing
      Forth programs, especially since my machine only
      had 4 kilobytes of memory
      (it was an Elf II from 1976).
      But if you have the
      memory, why program in Forth (or Joy) nowadays
      (except to have a little fun)?

    13. Re:A Famous One Is... by Lupin+Variant · · Score: 1
      In the process of designing our introduction to computer science (see our curriculum), I've put a fair bit of thought into the question of how to instill good conceptual models of programs and program execution into folks with no programming or design experience. A number of posters have remarked on the distinction between design and programming, and one problem is that you really need to learn both, hand in hand, right from the start -- learning design without programming can be way too vague and abstract, but learning programming without design just instills bad habits.

      In our first semester, we focus on (small-scale) algorithm design techniques and discuss two models of programs. The first is basically functional, using functions, immutable variables, and conditional statements -- in this case, we describe execution in terms of "substitution" of values (or expressions) for variables. We then move on to discuss mutable objects, reference parameters, and loops, and the model of execution as the update of the state of the set of variable values. We've been doing this in C++ recently, though of course you could use scheme or Lisp, and we may move to Java soon. For those who are saying "No, no! Describing the execution of C++ programs in terms of substitution is wrong ", I note that the interpretation of a C++ program occurs in two phases -- first the optimizer does local modifications that really are like substitutions, and then at run time the state update model is more accurate -- so knowing how the two go together is really the only accurate model.

      In our second semester, we get into data abstraction, and then later introduce inheritance and parametric types -- these also serve to add subtle flavors to the models of execution as we get closer and closer to the object-oriented "paradigm". We also discuss the issues of scaling up our simple "single-algorithm" design techniques to full software projects, though we don't have an explicit "software engineering" course.

      We find it very hard to find textbooks that support our approach, and generally focus on trying to find things that do a good job on part of what we're teaching without doing too much damage in other areas. Thanks to all who posted recommendations for books (I tried to borrow heavily from SICP in the original design of our course).

    14. Re:A Famous One Is... by William+Tanksley · · Score: 2

      Joy is just another language; I'm not convinced it's done right any more than Forth is. The interesting thing on that page isn't Joy itself; it's the conceptual background which the author builds up to describe a set of languages which lack application of functions to parameters.

      But, other than being implementable in just a few kilobytes, what's the advantage of the Joy approach? It seems to be a rather tortuous way to write functional programs.

      An excellent question. I could answer it by giving a list of advantages, but I think that would be beside the point.

      I do not wish to imply that there are no disadvantages, nor that concatenative language are 'better' than (traditional) applicative ones. I simply wish to demonstrate that the differences between the two camps are real and useful, not mere obfuscation for its own sake. Concatenative languages should be an object of study, and more languages should at least include a concatenative subset, just as many languages now include a purely applicative subset.

      Note your own saying -- Forth is fun. Why shouldn't we use languages which are fun? Why is Forth fun, and would it be possible to separate its fun from some of the admittedly inconvenient features?

      My goal has been to try to answer those questions.

      I'm not going to try to do that in this short space; but I will note a few convenient features of concatenative languages.

      All of their typographical rewriting rules apply regardless of the semantics of the words making up the program(s). It doesn't matter whether the words modify state, do I/O, or anything else. So, concatenative languages can ALWAYS be typographically analysed. This is a HUGE improvement versus applicative languages, which contain a number of rewriting rules that only apply in special semantic cases (for example, the famous "referential transparency", which only applies in a very narrow context). This reduces many refactorings to a simple case of cut'n'paste. It also helps explain why Forth engages the mind in a way other low-level languages cannot: in spite of its native low level, it's easy to reason about its programs.

      The textual nature of the rewriting rules makes metaprogramming in concatenative languages very easy (as I mentioned elsewhere, it's no accident that reliable Postscript can be generated easily by even C programs; imagine how much more powerful programs can be generated by a language aware of its own rewriting rules.

      The data structure required to represent code is very simple. In Lisp it's a tree; the forks represent parameters of a function call. In concatenative languages it's merely a list: one action, then another, then another.

      The only known means to make a language concatenative is to use a stack. This happens to not only make implementing the language trivial; it also makes a number of very useful results trivial.

      Compiling requires no parsing, only lexing.

      Strong polymorphic static typechecking can be done in the compiling pass, with no lookahead or behind.

      Dataflow analysis is already done by the programmer, so the compiler can use the intelligence of the programmer to help it do its job of resource allocation. Urgently needed items are at the top of the stack; less urgently needed ones are at the bottom. Cache the top of stack in registers; page the bottom out; put the items between in varying speeds of memory, depending on depth in the stack. The only task for the compiler is to know the resources of the computer it'll be running on, so it can allocate the caches properly.

      If you'd like a better answer, please ask the question on the concatenative language mailing list. It's a very good question, and will get an answer from many, including myself.

      Slashdot just isn't really appropriate :-).

      -Billy

  17. Well ... by Anonymous Coward · · Score: 2, Interesting

    ... maybe I'm just a bitter old bastard (ah, you kids, with your IDEs and source-code control! You don't *know* how good you have it!), but it seems that too many comp-sci programs, to say nothing of the autodiadacts who start out on the "24 hours to a six-figure-salary developing Unix device drivers" books, ignore the fundamental abstractions that underlie all computing.

    That having been said, it's not too hard to find good texts that cover these issues. Knuth's opus is only one example; there are several good books on algorithm design and analysis that are recent enough not to suffer from the "provably correct" disease of the '70s and '80s, and there's probably dozens of books by now that are part of the Booch series on OO design. Plus the hundreds of excellent texts on linear algebra and other basics.

    Is it necessary to *start* with these? Well, I'm a fan of a two-track system where students are given both theory and praxis, allowing them to apply the former by way of the latter. You can learn theory without application, but chances are you'll end up with something like Python (/me ducks and covers); you can also learn application without theory, but then you get ... well, most Microsoft products, for example.

    Just US$0.02 from The Watchful Babbler.

    1. Re:Well ... by Anonymous Coward · · Score: 0

      Right on! I got an engineering degree in the '60's, and a CompSci degree in the '70's, and then watched in agony while the C/C++ crowd bastardized CompSci. Anybody can write programs - its like draftmanship. To design programs requires sophistication and discipline, something in short supply. Would-be programmers should start out with Knuth before they ever write a line of code.

    2. Re:Well ... by drew · · Score: 1

      you can also learn application without theory, but then you get ... well, most Microsoft products, for example.


      ...or maybe something like Perl.

      --
      If I don't put anything here, will anyone recognize me anymore?
  18. Java Design Patterns by peterdaly · · Score: 2

    In the Java "community", design patters are very popular as building blocks to build functional programs. There are many books available the the subject. One good one is EJB Design Patterns: Advanced Patterns,..., written by one of the guys who runs The ServerSide.com which also has a less formal discussion forum centering around design patterns.

    While many design patterns are specific to good J2EE design, and may not be relevant for all types of application, many are general enough to be used in any object oriented language. May be part of what you are looking for.

    -Pete
    (yes, the book link has my amazon id in it...click and buy the book. It's worth having.)

    1. Re:Java Design Patterns by Javaman59 · · Score: 1

      Thanks Pete. I just had a look at Serverside, and found that they are offering a free pdf download of the book. I'll get into it.

      --
      I'm a software visionary. I don't code.
  19. 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.

  20. To Code Well - Write Code by stoolpigeon · · Score: 4, Interesting

    The best way to learn programming is to do it. The more the better. And see what works and what doesn't.

    You have to know syntax and semantics to practice.

    To take the high road right off the bat is good conceptually but the problem is implementation is often where it gets difficult. I know a lot of people will disagree but I can tell you that the concepts behind something do not have a lot of value until the user has a level of experience that brings out that value.

    I believe this is true across a wide range of disciplines - not just programming. If you tell someone that breaking in boots is important to hiking (w/out getting into a lot of messy details) they may listen they may not. If they sit at the end of a trail w/blisters all over their feet (or see a companion in that shape) they will value the information much, much more.

    I've never found a conceptual approach to be nearly as useful before I've tried something compared to after those attempts.

    .

    --
    It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
    1. Re:To Code Well - Write Code by deanj · · Score: 1

      Amen to this. Experience is what makes a good programmer. Not a bunch of funny pictures with lines going between them. I'm not saying not to use those when you need to...just don't think it'll be a substitute for experience.

    2. Re:To Code Well - Write Code by Darth_Burrito · · Score: 1

      Agreed.

      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. (flowcharts, oo, Wirth's view, state machines, a knowledgebase, Functional languages, etc.


      I sincerely hope this is not a true introductory to programming. Sounds like you are trying to teach someone to do a Triple Lutz who doesn't know how to ice skate. Most kids in intro programming classes are utterly befuddled by strange and bizzare things like pointers, procedures, and functions, and the difference between passing by reference and passing by value. Some people/programmers may go through life without ever making a flow chart or writing a single line of Scheme. If you try to teach all that stuff in an introductory course, your students heads will explode and chances are 80% of them won't understand what you were talking about for another two years, 10% never will.

    3. Re:To Code Well - Write Code by the_verb · · Score: 1

      But that's the whole point -- it sounds like he's not TALKING about that fine of detail in his overviews. The difference between 'stateful and stateless' for example, is a philosophical one that affects implementation. It has nothing to do with pointers, by reference versus by value, and so on.

      --the verb

    4. Re:To Code Well - Write Code by Darth_Burrito · · Score: 1

      More to the point... there are usually courses where these subjects are supposed to be covered in depth. As an intro programming teacher, your job is to get the students to the level where they can absorb the information in those upper level courses.

      Too much time in my upper division courses was wasted because some lower division classes/students didn't learn everything they were supposed to in the pre-reqs. Honestly, nothing pissed me off more than spending a week going over Discrete Math operations in course after course after course. It feels like you are paying $X thousand dollars a year to listen to a broken record.

    5. Re:To Code Well - Write Code by benw01 · · Score: 1

      ...and maintain (someone else's) code.

      i've had the misfortune of having to maintain a self-taught programmer's code in my current job - it's a nightmare. zero comments (that's not an exaggeration), no indentation[1], bad variable names (myInt1, myInt2).

      i've learnt more about how to structure code to be readable and maintainable by having to do it to this guy's code than i ever did from people saying "indent properly, comment but not too much, meaningful vars".

      even going back over old code you wrote can be benefical - seeing the things you used to do before you knew better, if you can actually follow your own logic, if your var names make sense. i agree with the "read code" comment - but reading *and maintaining* is more important, i think.


      [1] which is particularly funny because the editor he used indents automatically - so he would have had to manually defeat the indentation

    6. Re:To Code Well - Write Code by Blackjax · · Score: 2, Insightful

      I find it frustrating to see people like the original submitter trying to do something like this. It is a fine example of someone with lofty ideals and noble intentions who is determined to not let reality get in the way of how things *should* be. Because if we can just teach them the wisdom *first* we can save them the time and effort of having to achieve it themselves! As the parent of this post points out, it doesn't really work like that. It would be really nice if you could teach most people the abstract theory and concept behind good design and development practices, but the truth is that you really appreciate why something is right by having done, or seen it done, wrong yourself.

      If you have never developed before, the conceptual underpinnings will be largely meaningless. Sure, students can and will learn what you're teaching by wrote, but the information is not *real* to them yet because they can't make the connection to anything within their experience. Further, they won't retain it long enough for it to be of value later when their development skills catch up enough to appreciate it. So it is all well and good to say 'teach the abstract stuff first' but you're just going to frustrate them and yourself. It's like trying to give the benefit of your life experience to a teen by lecturing them. It's just words to them until they come into that wisdom on their own someday and finally 'get' what you were trying to tell them.

    7. Re:To Code Well - Write Code by Twylite · · Score: 2

      You are discussing the difference between maths, engineering and social science. Programming can unfortunately only be described as a social science subject.

      In maths you are presented with the result (the theory), and then with the proof. You don't need to satisfy yourself that it is correct emperically or "in the real world" or that its better to do it that way. Its proven.

      In engineering you are presented with the result. You don't care about the proof, because you know that there is research and proof underlying the result, and you use the result in the recommended way to achieve those ends.

      In social science everyone has their own theory. Some people rise to the top of the pile, and get continually picked on. Occasionally someone provides sufficient emperical evidence to justify the result being called a fact within the subject's domain.

      This is the case with subjects like psychology and computer science. There is always more than one way to do or interpret something, and ego dictates that you must contest "accepted facts", and either derive or disprove the result for yourself.

      Programming SHOULD be taught as an engineering subject. There is a body of knowledge for programming according to the conceptual model in use, and it is based on hard evidence from decades of development.

      Unfortunately, software engineers prefer to make their own cement rather than ask the expert cement maker for the properties of the cement that is readily available.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    8. Re:To Code Well - Write Code by Twylite · · Score: 2

      I'm hardly surprised. How can you understand functions and procedures without understanding the conceptual model of a functional program? How can you understand pointers, references and pass-by-value without understanding the execution model behind the program?

      To teach, you have to start at the beginning. Programming is the means, which comes in just before the end. The approach of teaching students how to hack their way along in a visual language is a primary cause of the number of inept developers, and gives our profession a bad name. Bookkeeping is a well-established profession: if you get a useless bookkeeper, you blame the person or the institution. A useless developer is assumed to be par for the course.

      Programming courses need to start with the most basic topic: what IS a program. Then the theory of how programs run (jumping around to repeat bits of processing, and varying the processing with parameters). Followed by how we achieve that using source code and a compiler.

      Only then can a student appreciate and understand what they are going to be doing when they "program".

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    9. Re:To Code Well - Write Code by PythonOrRuby · · Score: 1

      My bias is towards object-oriented programming. It's a method(no pun intended) of approaching programming that seems to lend itself incredibly well to analogy. There's a certain animism to it that lets top-down teaching work, because the way object interact is the way everything interacts. Things in day to day life are self-contained, opaque packages, yet they send and receive messages from other objects, have certain properties, and do certain things. That I can relate programming to just about anything makes OO an absolutely wonderful thing.

      Of course, more important than this is listening to your students. If you try to teach purely by lecturing, their heads will explode. Let them reinvent the wheel. They'll figure out in time that there are good reasons not to do that(I know I did), but in the meantime, they'll approach a wider variety of problems. Let the better students take over a bit. Hold discussions in a lab with a whiteboard and lots of markers.

      As a teacher, you can only provide some basic knowledge, and guidance based on your experience. You can transfer the knowledge to them, but not the experience. They have to gain that on their own.

    10. Re:To Code Well - Write Code by p3d0 · · Score: 2

      5, Interesting?? This is off-topic. The question was not how best to teach programming.

      Everyone knows you can only get good at programming (or anything, for that matter) through practice. That is not insightful, nor interesting. It's patently obvious.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    11. Re:To Code Well - Write Code by p3d0 · · Score: 2
      I find it frustrating to see people like the original submitter trying to do something like this. It is a fine example of someone with lofty ideals and noble intentions who is determined to not let reality get in the way of how things *should* be.
      I would say the exact same thing regarding your attitude. Don't let the fact that students might not even know what a program is get in the way of your lofty notion that all you need to learn to program is to practice.

      Would you tell a potential pianist not to study music theory?

      I think a programmer's competence is a product of three factors:

      • How much code you have written
      • How much code you have read
      • How much theory you know
      Set any of these factors to zero, and your competence will also be zero.
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    12. Re:To Code Well - Write Code by Anonymous Coward · · Score: 0

      I agree... In general, people (including programmers) don't appreciate (or know how to apply) a solution until they've understood the problem.

      In theory, it ought to be possible to talk them through the problem, but in practice, it generally sticks better if they've actually experienced the problem. In the world of programming, this unfortunately means writing (and perhaps maintaining) a shitty program. Only then can you truly understand the advantages of an given improvement in technique.

    13. Re:To Code Well - Write Code by stoolpigeon · · Score: 1

      Here's what I was responding to.

      . 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.

      Since this is in his original post I consider it to be part of the question and worthy of comment. So I would'nt go as far as off topic.

      A 5? Well that's a good question and it did catch me off gaurd a bit that it was modded up so high - but the other day I got stomped on for what was a pretty good post (I thought). So you just can't get too worked up about moderation.

      --
      It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
    14. Re:To Code Well - Write Code by Blackjax · · Score: 1

      If you re-read what I wrote, you'll note that nowhere do I advocate only teaching coding. There is a school of thought which advocates that hands on, down and dirty, get it done (what do I need a CS degree for?), coding skills are all you need; I don't subscribe to this viewpoint and this is not what my post was about.

      On the contrary, I feel that theory and exposure to others code is crucial to advancing beyond the most basic levels of development. What I was arguing against was that abstract theory be the first thing taught and that coding skills be taught as an afterthought.

      Teach the students how to use a tool (language syntax), then once they are comfortable enough with it that it is not a source of confusion for them, teach them how to apply that tool wisely.

      As for pianos, it is the same. There is a time for basics and a time for higher level abstract theory. Basics first, theory later (when it can be usefully applied). See here for more:

      http://www.suzuki-piano.com/

    15. Re:To Code Well - Write Code by p3d0 · · Score: 1
      So you just can't get too worked up about moderation.
      Yeah, you're right there. Thanks for the cool-headed response to a pretty obnoxious reply. :-)
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    16. Re:To Code Well - Write Code by p3d0 · · Score: 2
      Teach the students how to use a tool (language syntax), then once they are comfortable enough with it that it is not a source of confusion for them, teach them how to apply that tool wisely. As for pianos, it is the same. There is a time for basics and a time for higher level abstract theory. Basics first, theory later (when it can be usefully applied).
      Ok, I think we're pretty close to agreement here. We just differ on what we think of as "abstract theory". I bet people learn what a "note" is on their first piano lesson. (Mine was too long ago--I don't remember. :-) Likewise, people should know what the heck it is that they are building with all this syntax.

      What is the point of saying "a function body is enclosed in curly braces" if they don't know what a function is, or why they would want one to have a body?

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    17. Re:To Code Well - Write Code by stoolpigeon · · Score: 1

      No biggie. For what it's worth. After I replied to you about it this morning someone came along and modded it down as over rated. So you aren't alone in your opinion. (or maybe it was what I said)

      There is a real strong tendency for people who take a real different view on certain issues to get modded down. Same w/if they are real critical about certain /. issues.

      No big deal to me but interesting to watch.

      .

      --
      It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
  21. Models by Guitarzan · · Score: 3, Funny

    Make sure they're not those terribly thin, Kate Moss-like models. Give them at least a little bit of figure, please!

  22. You have to learn arithmetic ... by Daniel+Dvorkin · · Score: 3, Insightful

    ... before you can tackle algebra.

    Students need to learn syntax before they learn (much) in the way of structure. It doesn't matter what language they first learn in, though I think something in the C family (i.e., C, C++, Java, etc.) is a good place to start, since a) most real-worl programming is done in one of these languages and b) if you can really, truly learn C, you can learn anything. ;)

    But hell, teach 'em in Perl or LISP or Pascal if it makes you happy. The point is that programming courses have traditionally started out with "Hello World" or some such thing for a reason: beginning computer scientists need to learn that they can type in, compile, and run a program before they start worrying about higher-level structures. Any attempt to teach theory before practice will fail as surely as the "New Math" -- which basically did try to teach algebra before arithmetic -- did a couple of decades ago.

    --
    The correlation between ignorance of statistics and using "correlation is not causation" as an argument is close to 1.
    1. Re:You have to learn arithmetic ... by happyclam · · Score: 2

      While that's true, a lot can be done with beginners in a pseudocode type of "language" that does not actually get run. I recall my first "programming" exposure was BASIC in 7th grade math. We had no computers, and this was shortly before the Apple ][ came out. We wrote very short programs on paper which were then essentially traced by hand by the teacher.

      Still, as a beginner with zero exposure to programming at the time, I learned a lot: linear processing of commands, simple loops, printing, and yes, even some syntax such as line numbers and labels.

      (back to my point) Pseudocode can help teach the logic and flow and structure aspects of programming without the burden of having to follow syntactical rules at the same time. So, the first step should be to write out the "program" in a lightly structured pseudocode; the second step would be to "compile" that by hand into actual code when syntax had been covered. At that point, the fundamentals of the logic are out of the way and the students can focus on getting the syntax right.

      When I think about how my projects have been completed in the real world recently, this is essentially the same process I go through: map out the general logic (either in prose or with a type of pseudocode shorthand) and then program the thing after I've got that worked out.

      --
      He looked at me and said, "Kid, we don't like your kind, and we're gonna send your fingerprints off to Washington."
    2. Re:You have to learn arithmetic ... by retsofaj · · Score: 1

      I agree with you that some people need to learn the details (syntax) before they learn the structure (abstractions and conceptualizations). However there are a number of theories of intelligence (that I happen to agree with) that discuss other people who need structure before they can understand syntax.

      I'm concerned that the current crop of programming resources focus on the first kind of people while ignoring the second. I'm looking for balance, not to replace the current approach.

    3. Re:You have to learn arithmetic ... by GigsVT · · Score: 2

      Learning C is very easy, it's a simple language. Learning to do something useful in C is the difficult part. :)

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    4. Re:You have to learn arithmetic ... by binaryDigit · · Score: 2

      To me it's kinda like woodworking/carpentry. You could either teach the students all about the tools, how to use them, etc, etc and then start teaching them about "concepts" such as joints, styles, etc. Or you could show them various pieces of furniture and how/why they were built that way, and the various features, then you could get into how to build it. Both ways have the pluses and minuses. What I like, is a mixture, just like woodworking class. Show me how to use the tools, but show me how with "concepts" in mind. e.g. show me how to use the table saw by letting me cut pieces/create rabbits and making a simple drawer. In this way, you show them the syntax (which for similar reasons to those who have already mentioned this), but also start to slowly feed them concepts and algorithms. What I _don't_ like are things that start off with syntax, but use lame/non useful examples to practice the syntax on. Have them create "real" stuff right off the bat (like the drawer, don't just have'em cut wood).

      What I've seen of the "current crop of programmers" is that they are not very good with fundamental concepts and they are especially bad a breaking problems down and then applying the tool (whatever language/programming "style" that happens to be). So I know guys who know Java like the back of their hand, but when it comes to solving problems, they don't know _how_ to think about solving it. I also know some masters grads who can talk algorithms and concepts till their blue in the face, but they couldn't actually implement it if you wrote half the code for them.

    5. Re:You have to learn arithmetic ... by Eil · · Score: 2


      Mwahaha, couldn't agree more. I'm still a rather inexperienced programmer and while I've dabbled in various languages, C is definitely the one that makes me shudder. They present it to you easily enough... at first. Ya know: These are variables, this is an array, these are for loops. And then all of the sudden its "Oh my god, how do I use pointers! How to define a structure?! HOLY SHIT, IF THIS 5-LINE FUNCTION SEGFAULTS ONE MORE TIME I'M GOING TO MURDER THE ENTIRE PLANET!!"

      I'm sure we've all been there.

    6. Re:You have to learn arithmetic ... by pnatural · · Score: 2

      Your comments about pseudo code are spot-on.

      However, that pseudo code can actually be run if it's done in Python. Python is often described as "executable pseudo code". The syntax is very clear and very simple, but it is also amazingly powerful. Check it.

    7. Re:You have to learn arithmetic ... by Charm · · Score: 1
      "Oh my god, how do I use pointers! How to define a structure?! HOLY SHIT, IF THIS 5-LINE FUNCTION SEGFAULTS ONE MORE TIME I'M GOING TO MURDER THE ENTIRE PLANET!!"

      LOL

      C is easy if you have learned assembler first. When you know at least 5 languages things really start to fall into place. You can understand not just why languages do different things but also how you could implement it in different languages. Of course thats a bit hard for an introductory course. First structure then logic then analysis is what I say. It's hard to work out a solution if you have no idea how the logic works. It's like asking someone to write it down in English if they don't know English.

      --
      -- RTFM:Slackware::Beer:Saturday
    8. Re:You have to learn arithmetic ... by cbowland · · Score: 1
      This is so true. I am java programmer, but wanted to learn a scripting language (and perl looks like line noise to me - my fault as I am weak on regular expressions) so I started in on Python. I have noticed that the same program implemented in Python is about 20% shorter than its java equivalent. Plus I seem to get a working program faster since I am not chasing ()'s and {}'s and semicolons. I am now using python to prototype apps (Jython if a gui is needed) and the implementing the same app in java once the design is stable. (I do the same thing with PHP/JSP, but that is a different story).


      Java Example

      for (int i =0; i < 10; i++) {
      System.out.print(i);
      }
      System.out.print("Done");

      Python Example

      num = range(10)
      for i in num:
      print i
      print ("Done")


      Trivial example, but I think it illustrates the relative simplicity of the syntax ( and not the shorter amount of code). For those not familiar with python, the whitespace is significant and indicates the logical groupings just a pseudocode would do. Using python, the students could focus on concepts, but still have code that worked (and does some damn powerful stuff to boot!).

      --

      Give a man a fish and he will eat for a day.
      Teach him to eat and he will fish forever.

    9. Re:You have to learn arithmetic ... by Anonymous Coward · · Score: 0

      I'd vote for LOGO because:

      1. it's not C, thus forcing them to learn more than one language, which will make learning additional languages easier

      2. it is *VERY* not C. In fact it's almost LISP without the parenthesis. As such, it's quite different from anything out there. (again, forcing two perspectives)

      3. it has a fairly simple syntax. Heck, if I could learn it when I was 5, it can't be that hard.

      4. it's fun. Easy graphics even.

      5. it's what I learned first. I *must* have been right. ;)

      I think having experience with a more diverse range of languages will give students more options when faced with difficult problems.

  23. start lower than you'd think by Pauly · · Score: 2

    If this is a truly introductory class, please do what my first programming teacher didn't do: take a few classes to explain what the hell "programming" is. I went through a lot of confusion making the connection between words written into a file and behavior later when executing that file. Granted, this was a long time ago, and I had never sat behind a computer until my first lab in that class, but I imagine this is still a problem for most first timers.

    In my case, I was able to fall back on my considerable experience with logic concepts and advanced mathematics. Fortunately for me, Fortran behaved(s) itself in this regard and allowed me to apply these concepts. I learned that this text needed to be processed before running it, but I had no idea until I started studying C what the hell those steps really meant.

    Students today already have a bunch of assumptions of what computers are/do, so I imagine you'll have to help them unlearn some of that limited perspective. They also probably haven't learned a great deal of formal logic, so they might need some instruction there as well.

  24. Hrm... can you teach people to think? by vkg · · Score: 3, Insightful

    Although there are a lot of useful models like the ones you outlined, I'm not sure that there is any way to teach problem solving, and it's most important step, problem conceptualization.

    I think you could take people through graded series of exercises soluble in different approaches, but there's no "one size fits all" way to develop intuition.

    One approach used widely in architecture, a sibling profession if we ever had one, is "masterworks" - taking students through the works of other great architects, examining each decision made in some detail with reference to notebooks and discussions.

    I think that this approach may make a lot more sense than teaching theory because it gives some access to an experienced mind, rather than just a methodology created by such a mind.

    I know that I learned more from working with great programmers and absorbing their tricks than from any book I ever read or course I took.

    1. Re:Hrm... can you teach people to think? by retsofaj · · Score: 1

      I have as an (unproven) article of faith that you can help people learn to think differently. In my own experience I know (believe?) that certain people did help me learn to think differently. What I'm wondering now is whether there are certain approaches that work particularly well with certain individuals.

      I totally agree that there is no "one size fits all" approach to developing intuition, or problem solving for that matter. On the other hand I don't want to go to the other extreme and say that there are no common approaches. Hopefully there is a middle ground of techniques that would work better than others for a particular sub-group.

      I like the idea of "masterworks" a lot. All we need now are those notebooks :) Again, speaking only from my experience I know that it was talking with people that let me get into their minds (to some degree) and change my way of thinking about things.

      Your final point is bang on, but the problem is that there is a finite (and it seems small) population of these great programmers and a much larger population of people trying to learn programming.

    2. Re:Hrm... can you teach people to think? by vkg · · Score: 2

      Let me suggest an example: RMS's config utility for Fetchmail. It's in Python, is relatively simple, and he's well on top of his game.

      Plenty of changelogs available, and he'd probably talk you through a big chunk of the design process if asked nicely.

      I do think that people can change the way you think about things, but I think 90% of the time it's done by "call-and-response" - you ask a question which reflects your current state, then they emit a response which changes your current state into some new state, and you fall on your ass wondering how you could have lived not knowing the world could be seen like that: code gurus.

      Our models of education, alas, assume this is to happen by chance during lectures based on rough ideas of the makeup of a class.

      I think the best programming education of all is apprenticeship and the open source community provides an excellent pool of masters from which to learn.

      Email somebody: I bet within the first couple of dozen, you'll find somebody who's willing to mail you their source code to comment or standardize.

    3. Re:Hrm... can you teach people to think? by Anonymous Coward · · Score: 0

      Don't you mean ESR?

    4. Re:Hrm... can you teach people to think? by vkg · · Score: 2

      Yeah, sorry, I'm a moron!

    5. Re:Hrm... can you teach people to think? by WGR · · Score: 1
      There is a wonderful book on problem solving called "How to Solve It" by the famous mathematician, George Polya. It was written about 50 years ago, but it is really one of the best introductions to the skills for programming there is.

      It is about techniques of problem solving, such as analogy, embedding, input-output analysis, decompostions etc.

      Perhaps because it was written before widespread use of computers, it does not try to impose a machine oriented view on a solution, although it does develop algorithms in a step by step breakdown of solutions.
      A number of years ago, somebody wrote a book called "How to Solve it with Computers" whcih goes more into implementation by computers of these solutions but the general concepts are similar.

  25. Duh by bitsformoney · · Score: 1
    These are the deepest secrets of software development that you are asking for there. They can only be learned on the job through years of experience and implemented by someone who has risen to software architect.


    These can and will never be tought in university.

    --
    This comment is printed on 100% recycled electrons.
    1. Re:Duh by Anonymous Coward · · Score: 0

      Well, actually it _used_ to be taught that way at the University of Michigan (Ann Arbor) back a few years ago. The Comp Sci degrees were part of the LS&A school, but not part of Math or Engineering. The focus was on the concepts, priciples and 'philosophy' of CompSci and it was expected the How-To would be something the student would pick up in non-core courses. Any CompSci core track that starts with an interesting version of the Scientific Method (as applied to computers) is well worth considering.

      Sadly, I hear that CompSci is now under Engineering and the nutz-n-boltz approach has replaced the scientific/semantic approach.

  26. flowcharts by deanj · · Score: 2, Interesting

    Uh...I'd toss the flowcharts...we tossed those back when I started programming more than 20 years ago.

    1. Re:flowcharts by Anonymous Coward · · Score: 0

      What do you think that the UML came from?

      Do you want to use the state diagram instead?

      By the way the state diagram is even older and even less ysed for programs :-).

  27. You are VERY correct by stoolpigeon · · Score: 2

    I said the same but not as well.

    I would add that this approach of theory w/out specifics of implemenatation is not as workable on a practical level.

    People learning to code want to get in their and 'do' something. They want to see some results and I don't think there is anything wrong w/that. You need to give them that opportunity to keep enthusiasm.

    The 2 track idea is excellent.

    .

    --
    It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
  28. wanabe's? uh oh by eRhino · · Score: 1

    hey man im an english and Poli Sci Major...Programming has nothing on me! I just come here to check out whats going on in the world of IT....if your a wanabe, thats ure thing....

    1. Re:wanabe's? uh oh by Anonymous Coward · · Score: 0

      A thousand dead authors just rolled over in their graves.

  29. for the love of something.... by TweeKinDaBahx · · Score: 1

    I've been over this so many times it makes me want to kick someone in the teeth...

    It always seems like programmers say that you have to know data structures and algorithms first to write good programs. Unfortunatly, these people have forgotten they had to LEARN TO CODE first. I dissapprove of any program that teaches theory first and syntax second because once the theory is there, people have the bad habit of trying to do things word for word. If these people had thier way, the towers of hanoi problem would only be taught iteratively!

    Ok, i'm going home. Today sucked.

    1. Re:for the love of something.... by Anonymous Coward · · Score: 0

      Premature abstraction is the curse of the software weenie. "Software professionals" are the only people I've ever heard say "totally abstract" like it meant something. No wait psycobabblers do it too.

      Abstraction is realizing TWO or more things are the same when viewed from some higher viewpoint. Abstraction is relative, layered like an onion. You can get more abstract or less abstract but not totally abstract.

      And you abstract at all until you've grasped the individual instances.

  30. TCL way by WetCat · · Score: 1

    A program is a set of a commands, that perform operations under strings.

  31. 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.

    2. Re:Design Patterns, The Book by psaltes · · Score: 2

      > 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.

      I just went and looked at both of those sites and I don't think that either are portraying design patterns nearly as harshly as you say they are.

      Here is a quote from the second link: "Some of the patterns disappear -- that is, they are supported directly by language features, some patterns are simpler or have a different focus, and some are essentially unchanged."

      From the first, "16 out of 23 patterns have qualitatively simpler implementations in lisp or Dylan than C++ for at least some uses of these patterns".

      Both of these are quite balanced evenhanded statements, neither condemning design patterns or equating them with language flaws. Both links are oriented towards only one difference between language kinds, dynamic rather than static. There are quite satisfactory reasons to choose static languages over dynamic ones regardless of whether the design patterns are more complex, and it is somewhat closeminded to call either approach flawed.

    3. Re:Design Patterns, The Book by alext · · Score: 2

      The quotes were just accessible examples of why this book is inappropriate as an introduction to conceptual computing fundamentals. There are other papers highlighting problems with the GoF book in its own terms, if that's what you're interested in. LISP and Dylan aren't perfect models either, and I certainly wouldn't base a course entirely on them.

      I'm sure you are aware of established books on computing fundamentals, such as How to Design Programs, so it must be fairly obvious that the GoF is not remotely comparable to these.

  32. 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

  33. Flowcharts!!! by a3d0a3m · · Score: 1

    Pseudo-code and flowcharts were my enemies in AP Computer Science. Nobody should have to flowchart a program with one For loop. I found all of that theoretical stuff to be useless for me, and I'm sure your students will too. I was able to get a 5 on the AP Computer Science test without ever turning in a flowchart. Really, I think programming should theoretically be taught from a theoretical standpoint, but really, modelling something in a flowchart manner went out in the 70's. Your best bet is to keep on upping the complexeties of the programs until you get to something that 50% of the kids are floundering on, then you should introduce flowcharts... instead of making kids flowchart everything so that they get bored of it before it ever becomes useful.

    adam

    1. Re:Flowcharts!!! by DevNull+Ogre · · Score: 1
      Nobody should have to flowchart a program with one For loop.

      Exactly. And flowcharts become worse than code for modeling anything more complicated. That is, except for a big-picture look at program flow. As Brooks (in The Mythical Man Month) points out, flowcharts rapidly lose any sort of value if they don't fit on just one page. One-page flowcharts don't describe meaningful programs unless they do so at a very high level.

      It is important to teach good design. Just don't use useless tools. The classic flowchart is a pointless burden, not a design (or documentation) aid.

    2. Re:Flowcharts!!! by Anonymous Coward · · Score: 0

      Nice theory, but of course it's complete nonsense. Most of these people who are blathering about "code first, theory later" haven't actually tried teaching both.

      The hard things to teach in programming are:

      1) Problem Decomposition (How do you take a problem and break it down into successively smaller pieces that you CAN do?)

      2) Discipline (How do you teach a student to have an idea of what they want before they start writing code, to work smarter instead of harder, to build little pieces and make sure they work before tackling the hard problems, etc.)

      3) Clarity (How do you impress upon students the need to think about the problem and their solution clearly? To document their thought processes so that someone else -- the grader, or themselves in two years -- can understand their solution?)

      Everyone seems to starts off skipping flowcharts, because it's time-consuming and a waste of time for trivial programs. But they're a tool to help teach problem decomposition ("Here, kid, wax the car: wax on, wax off..."). If you do it for the trivial and boring tasks, you foster a mode of thinking that makes it much easier to see *where* to break down a larger problem.

      Plus, you get enough practice with deriving flowcharts that you can distinguish between a valid flowchart and one created by a cretin. Presented with an invalid flowchart, you'll be able to *see* the spaghetti, draw a box around it, and say "THIS BIT IS A PROBLEM".

      Waiting until you get complicated problems to start flowcharting means that you've skipped the largest benefit: the training aspect. I have never seen a huge and complicated algorithm derived with traditional flowcharting techniques -- it takes way too much paper. But you can flowchart a complicated algorithm easily if you've practiced on the trivial cases.

      That is, of course, if you're even willing to try. By the time most students are writing complicated programs, they feel as if they've progressed beyond flowcharts anyway, even if they never learned the lessons.

      Teaching discipline is even more of a hit-and-miss thing. Many students seem to program in a sort of inefficient tweak-and-see-if-it-works-else-repeat sort of way: the most widespread form of genetic programming out there. Alas, they "evolve" solutions with no understanding. They generate monstrosities for conceptually simple problems. They code all night working a problem that five minutes contemplation would have solved.

      (It is depressing how many people are unable to find the compilation errors in their programs, even when the compiler helpfully points out where and what the problem is. "Omigod!" they cry, "It didn't compile! CHANGE SOMETHING!")

      The last problem -- which is frequently never learned, even when there is time to attempt to teach it -- persists even into industry. "REAL PROGRAMMERS DON'T WRITE DOCUMENTATION", with the implicit subtext that they'll be doing something else by the time someone else looks at their code.

      A useful test is to ask a student -- some weeks after they've turned in a program -- to _explain_, in detail, their program. If they can't, they don't understand it, and should therefore not receive credit. What isn't often taught is that you should write your programs as if someone else will have to understand your program after you've left (frequently, this person will be a slightly older version of yourself).

      In fact, for _school_ programs, where the goal is to see if the student comprehends the program, versus being able to get something working, something like Knuth's _Literate Programming_ would be ideal.

  34. You might like Design Patterns by brad.hill · · Score: 2
    It's not really a conceptual model of software, such as you seem to be seeking (pehaps barking up the wrong tree) but the Design Patterns book and community around these ideas are excellent.


    Perhaps more similar to ideas from systems theory than from ontology, design patterns are sets of abstractions and ideas that are repeatedly useful in many different contexts for solving complex problems in an elegant manner.


    As a developer, patterns are the most powerful part of my design repertoire. Conceptual models are invariably domain specific, but uses for patterns come up again and again.


    Try Design Patterns, by Gamma, Helm, Johnson and Vlissides. There are many other books in that genere, though. Analysis Patterns by Martin Fowler may be more of what you want if you're looking for domain-specific analytical abstractions.


    The book Cognitive Patterns by Karen Gardner describes a different kind of conceptual model for programming. An interesting read, but I've rarely used anything from it.


    If you really want to get into a detailed ontological perspective on programming and the world, read On the Origin of Objects by Brian Cantwell Smith. Absolutely fascinating philosophical study. Absolutely useless to a working programmer. (unless you work at PARC or Watson labs) :)

  35. Structure and Interpretation of Computer Programs by alacqua · · Score: 3, Redundant
    Its been quite a while and a new edition since I read this book for a computer science class, but as I reacall the main thrust of Structure and Interpretation of Computer Programs was to focus on computer science concepts in a somewhat introductory class with a minimum of syntax. It uses the Scheme dialect of Lisp which, although it was quite alien to most of the students, does not force the programmer to get bogged down in lots of syntax rules and is quite powerful. I think the author(s) explicitly stated as a goal to get right into concepts and let the student absorb the syntax along the way. And you can read it online in addition to purchasing it at the bookstore.

    I'm sure many people here are already familiar with it, but if you're not it's worth a look.

    --

    Move on. There's nothing to see here.
  36. Re:I hate niggers by eRhino · · Score: 0, Offtopic

    wow. this is the first time in my life ive ever seen bigotry in the IT world...i thought that the level of intellect required to work on computers would be high enough to pass that by, but i guess i was wrong....damn....keep in my not everyone who reads slashdot it white...

  37. Sequence Diagrams by Anonymous Coward · · Score: 0

    > UML seems biased towards the object model of a
    > program

    You can use sequence diagrams like a kind of flowchart...the things passing messages around don't have to be objects, they can be functions, or objects, or white elephants.

  38. Best advice: Keep It Simple by rufusdufus · · Score: 3, Insightful

    Getting too caught up in programming models early in as students training will almost certainly inspire them to build complex systems with huge over-generalized models. Programming models should come later, after basic syntactical and functional issues are addressed. The only model fledgling students should learn is to keep it simple. Teach them to solve problems with the least lines of codes possible, and the simplest data structures.

  39. 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.
  40. I have a book... by Anonymous Coward · · Score: 0

    Fortran 77 for Engineers and Scientists 3rd Edition by Nyhoff and Leestma is an introductory programming text that goes into high-level design for a couple of chapters, as well as the history of computing, programming tips, etc. A very good book, IMO.

    Matt

  41. pragmatic programmer by relay_mod · · Score: 1

    Maybe this isn't exactly what you're asking for, but for me, the first book that comes to mind when you start talking about "programming" from a more conceptual standpoint, is "The Pragmatic Programmer" by Andrew Hunt and David Thomas (Addison-Wesley). Lots of good examples in that book of how to go about programming and how not to go about programming (not just writing code), and lots of great advice on how to improve your craft. Maybe not too much about "conceptial models" as in functional versus imperative or procedural versus object-oriented, but it certainly is worth a look.

  42. Concrete to Abstract by austinBlues · · Score: 1

    Most people learn concrete first, then they can move to abstract. Without some programming language(s) to think in or weigh alternatives in, it gets difficult to consider abstract notions.

    It sounds like you are trying to do what I tried, teaching black belt lessons to white belts. This does not work, even if the black belt lessons are on topics the white belts already have covered.

  43. Patterns by OhYeah! · · Score: 1

    However, The problem with starting out with the conceptual, is that students may miss an understanding of what a computer can actually do. Truly understanding things conceptually (rather than just repeating concepts for a test) usually requires quite a bit of experience.

    The best programming class I ever took was actually an electronics class, where the final project was to build a working computer (which would even record and play back sound) out of a Motorola 68000 chip. That taught me most of the assembly I ever need to use, but also gave me a deep understanding of how computers actually work which is useful for everything from writing algorithms to basic Systems administration.

  44. 50 pairs + one lone number by jabbo · · Score: 2

    You conveniently omitted the one outlier that the pattern converges upon. Anyone who understands quicksort could tell you that ;-)

    1 + 99 = 100
    2 + 98 = 100
    ...
    50 + 0 = 50

    sum (1..100, step=1) { x } = 5050 because of that.

    Come to think of it, patterns like this (eg. all the multiples of 9 x a single digit N have the first digit as N-1 and the second as the difference 9-(N-1)) are probably why I hated calculus and used Taylor series in place of integrals every chance I got in college.

    Integration still seems like voodoo to me. Sequences, now there's something *REAL*.

    (even in job choices -- computational chemistry, database work, etc. -- I ended up with discrete rather than continuous bases for solving most problems... odd)

    --
    Remember that what's inside of you doesn't matter because nobody can see it.
    1. Re:50 pairs + one lone number by Anonymous Coward · · Score: 0

      Opps... I think you got it wrong. The original poster said "from 1 to 100"

      thout would be:

      1 + 100 = 101
      2 + 99 = 101
      .
      .
      50+ 51 = 101

      101 * 50 = 5050

      You had the right answer, but your setup was wrong

      1 + 99 = 100
      2 + 98 = 100

      50 + 0 = 50

      so far so good, but there's only 49 pairs plus the outlier. That would come out to 4950.

    2. Re:50 pairs + one lone number by spongman · · Score: 2

      apparently Gauss' teacher gave his class this puzzle (add up all the numbers from 1-100) to keep them occupied while he marked papers thinking it would take them a while. Gauss, of course, worked out the above solution within minutes. he was 8.

    3. Re:50 pairs + one lone number by Anonymous Coward · · Score: 0

      You can rewrite it, so that there is no outlier.
      The original poster was simply off by 1.
      It should be 1+100=101, 2+99=101, ...
      There are 50 such pairs, and 101*50=5050.
      That's the way my math teacher explained it. :)

  45. 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.

    1. Re:How to Think Like a Computer Scientist by Anonymous Coward · · Score: 0
      A clean language with a simple minmal syntax like Eiffel is ideal. If I were to teach a course, I'd like to teach the syntax in two days. Then teach the language libraries. Mastery of the libraries buys you just about everything.

      As an example, I know C++ syntax pretty well, along with a lot of the pitfalls. But when I learned C++, there was no standard library. I pretty much leanded on the stdc library. Now I have to break a whole lot of engrained habits and start relearning how to think in C++. It is mastery of the libraries which aids that endeavor.

  46. I always start with the concept of transformation by IBitOBear · · Score: 2, Insightful

    It seems obvious when you say it aloud, but the purpose of any program is to "do something". That is where I start. With what exactly it "can mean to do something".

    The fact that this is vauge is, frankly, exactly the point. I also take the student through the real-world words excersize. Particularly "what is a file? Now try again but completely forget that htere has ever been a thing called a computer; what is a file?" wearing them down to "An arbitrary collection of arbitrary things."

    Once you have done this decomposition of practical thought (typically about ten minutes of easy banter and cheap jokes) you can "really start" with the idea that there is a thing called "a state", that that thing is "only as defined as it needs to be for the task" and that any task is a transformation on that state.

    The whole lecture really involves working a crowd (of students) like you were the warm-up act for a TV sit-com live-taping audience. But done correctly you are seeding your students with the tiniest grains of everything you will be requireing them to think from there on out. Most importantly you are doing it in a non-threatening way AND showing them that what they already know is vitally important. (That's the heart of the all important act of validating your students.)

    Then you start bouncing back and forth between the practical and the theoretical.

    Basically, what you should *REALLY* do is spend a few weeks with an "english as a second language" teacher or just a plain english teacher and learn how to *TEACH* before you even think about teaching a particular subject like "programming".

    The fundimental problem with computer science is that the students are learning from the people who learned from the people who made it up in the first place, and not one of those people ever learned to "teach" any subject to anybody. -- me

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  47. If I could teach one thing... by rob-fu · · Score: 0

    it would be to stop needless overcommenting of code. Not trying to stray offtopic but if you're in an introductory CS class, I believe syntax should be taught first. OO/structured programming ideas should be brought up later after the student has a firm grasp on the language that he/she is going to be applying these constructs thru coding.

    But back to the overcommenting issue, something like this:

    /* This is the variable which is used for a
    counter. It is incremented by one each time
    the program goes through the loop. */
    int i=0;

    ...Is absolutely overkill. Commenting is good, but this kind of commenting is awful -- trivial elements of the program are magnified 100x. Just my $0.02.

  48. Re:I hate niggers by MMMMMMMMMMMMMMMMMMMM · · Score: 0

    All koons must die because they smells like mal odorous feet.

  49. Algorithms by gorf · · Score: 1
    When writing anything you'll probably find that a similar problem has already been solved; everything ultimately boils down to an algorithm and most things have already been done.

    The programmer's bible for this is The Art of Computer Programming by Don Knuth. It isn't the easiest book in the world to read, however, and consists of three volumes and an additional one Knuth wrote recently.

    An interesting example of this I found out about recently are coroutines. I struggled with writing part of a program for weeks on end trying to do something similar to this. Had I known about this kind of technique then, I would've done it in a day.

  50. They used to call it "Systems Analysis" by mangu · · Score: 2

    About 40 years ago, IBM found that they could charge more from their customers if they called their programmers "Systems Analysts". The catch was that they had to find some way to differentiate the systems analysts work from that of mere "programmers". It was from that context that the basic idea of what you are asking came from.

    OK, I'm being cynical, but my point is that, in the last 40 years or so, everybody in the industry has agreed that one should have *something* that precedes programming, but there has never been a really good agreement on what should that be. Methods go in and out of fashion, just like names, Yourdon, Chris Gaine, etc.

    My tiny piece of advice, based solely on my decades of working with computers is: hire really _good_ programmers (they may be expensive, but they are worth every cent) and let them do what they like. Nothing hampers a good programmer as much as imposing a "methodology".

    1. Re:They used to call it "Systems Analysis" by Anonymous Coward · · Score: 0

      When I worked at a help desk we all had the title "System Analyst." Yeah, right. Another good one is "Account Executive" (Salesman). And then there's the one... I think it is "Executive Assistant" or something like that, which means Secretary.

  51. What books are you looking at? by Jason1729 · · Score: 1

    Every programming textbook I used at university was strong on concepts and theory and considered syntax an irritation that got in the way.

    For an introduction to programming from a conceptual viewpoint, try the books in the "Data Abstration and Problem Solving with [language]: Walls and Mirrors". That's what we used in first year, and it's a good introduction to programming from a conceptual point of view.

    Jason

  52. The Wizard Book by Chris-S · · Score: 1

    The best introductory computer science textbook is "Structure and Interpretation of Computer Programs", also known as the wizard book because of the wizard on the cover. I've also heard good things about "How to Design Programs." Both of these books avoid the pitfall of focusing on syntax by using Scheme, which has very little syntax. I haven't read HTDP, but SICP is the best introductory computer science textbook I've read, and many computer science educators agree.

  53. That's a really clear book by jabbo · · Score: 3, Interesting

    kind of like 'SICP for nonprogrammers' (\me ducks).

    I liked the chapter differentiating generative recursion from structural recursion. That's a really insightful distinction in terms of the mechanics of grasping a problem and a good solution for the problem.

    Definitely worth a read, although I think SICP is the cleverest (most intellectually satisfying) exposition of these little gems ever written.

    I am reading (and doing) Paul Graham's 'ANSI Common Lisp' book for amusement and it's really sharpened my thinking. Macros are a great example of meta-generative-recursion, if you can call it that. Whatever you call it, it's raw power.

    --
    Remember that what's inside of you doesn't matter because nobody can see it.
    1. Re:That's a really clear book by xenocide2 · · Score: 1

      "I liked the chapter differentiating generative recursion from structural recursion. That's a really insightful distinction in terms of the mechanics of grasping a problem and a good solution for the problem."

      What a curious term for that stuff. It makes sense but I thought for a second I had missed something really cool. Instead its just iterative versus recursive code. I suppose it could be useful for first time learners but then again you could use the term inductive algorithm as well, since generative recursion is just like inductive logic.

      --
      I Browse at +4 Flamebait

      Open Source Sysadmin

    2. Re:That's a really clear book by Furry+Ice · · Score: 1

      You should read his book "On Lisp" next. "ANSI Common Lisp" doesn't cover macros in much detail. "On Lisp" spends the majority of its time on them. Unfortunately, it has gone out of print, but Graham has made it downloadable from his site.

    3. Re:That's a really clear book by Anonymous Coward · · Score: 0

      No, it's not "just iterative versus recursive code". Structural recursion has nothing to do with iteration. You can structurally induct over non-linear structures, such as trees. Generative recursion isn't about what you induct over -- it's *how* you induct over it.

      Read it again, carefully.

  54. Another Idea to Include by linuxtuba · · Score: 0

    I am fairly experienced with some types of programming, mainly small perl utilities to manage servers, server deployment, website testing, etc. Also a fair amount of C++ for my computer science classes I am taking at a local community college (BCC). A problem I am running into right now is how to structure a fairly large program. I have had one-liners grow into month-long, mulit-perl-module scripts. Now, I know advance planning would have been better, but are there books/websites/tutorials that can guide you on how to stucture a scalable program? I know, experience has helped me, but some other medium would provide a good reference. What's out there?

    ~Stephen

  55. Concept Programming by descubes · · Score: 2

    Take a look at the Mozart web page for a discussion of what this is. The basic idea: Your code should use the very same concepts that you have in your mind when you think about the application. A concept programming language can be extended to incorporate arbitrary forms of abstraction, not just the built-in ones (i.e. "integer", "addition", "objects" are all library things, not built-in)

    I'm currently hard at work on the first concept-programming language, called XL.

    --
    -- Did you try Tao3D? http://tao3d.sourceforge.net
    1. Re:Concept Programming by Anonymous Coward · · Score: 0

      Concepts, Techniques, and Models of Computer Programming - with Practical Applications in Distributed Computing and Intelligent Agents does a fantastic job of presenting a unified view of programming. In this case, it's based on Mozart, but anyone inspired to learn should benefit by reading it. Enjoy.

  56. Syntax first by Kphrak · · Score: 1

    Before object oriented things, structures, etc, the fundamental thing a student needs to know about programming is that it's a list of instructions to the computer.

    I know BASIC teaches bad habits, but hell...teach them some rudimentary BASIC if you have to for a few classes (Pascal might be still better since I've heard it gives less bad habits, but I have no experience w/ Pascal). Once they know what code does, then it's time to teach higher levels of abstraction, with structured programming (C), OOP (C++/Java), or even something outside the declarative type of language (Prolog, which most people who aren't pure, theoretical CS will hate).

    At the risk of sounding old, I'd say that most colleges today don't teach that long enough before they jump to C++/Java. You get one "Hello world", using C++-style cin and cout, and then it's off to classes, overloading, etc...without even giving more than a passing mention of pointers or even arrays (these concepts are pretty tough for a first-time student).

    Abstractions are a programmer's tool. They're OK, but one must remember that they're only a human interface to what is essentially a list of commands to the computer. Teaching abstractions in a language without teaching how to write a simple program in it is confusing and demoralizing...and the sad thing is that I suspect most universities probably just teach C++ or Java to first-years because it's the Next Big Thing (TM).

    --

    There's no sig like this sig anywhere near this sig, so this must be the sig.
    1. Re:Syntax first by Anonymous Coward · · Score: 0

      Seriously,

      My first class was Intro to OO w/ JAVA, the teacher just threw us in. That class was hard as hell (my first programming class). I wish they had us take some class that taught concepts with pseudocode...

  57. "Cardboarding" and Literate Programing. by os2fan · · Score: 2
    Computer languages, like real languages, give you the power to say things. Learning a foreign language or C++ isn't going to get you to say intelligent things.

    Because computers are so literal, you need to think out the fine details of the process as well. This is where the cardboard comes in. In essence, you assume the program works, and manually work through the data.

    You need to be conversant with your target enough to deal with all of the possibilities. To get an idea of this, read some of the bug-lists and history files of shareware.

    The other thing to do is to design the thing so that the user knows what to expect. Spreadsheets were there before computers [Stationers carry books of x or y columns].

    Once you do this, sit down with your material, and start with this program:

    /* rexx */
    call startup
    call looping
    call closure
    exit

    You break the program down into parts, and then address each part. Each part should do a clearly defined activity. This may not be just "one thing". Each routine must leave the global variables in a clearly defined state,

    More importantly, each of the controls (be they buttons or command switches) must do logical things. You can draw on your user's expectations. Putting a function at menu|F|X will draw the ire of people who use this sequence to shut the program down.

    There are of course excellent books out there. The one by Hackel [I forget the name .... will post it tonigth :)] is good, as is Knuth's "Literate Programming". Jon Bentley's comment in there is worth considering as well.

    --
    OS/2 - because choice is a terrible thing to waste.
    1. Re:"Cardboarding" and Literate Programing. by os2fan · · Score: 2

      The book by Heckel is "The elements of friendly software design".

      --
      OS/2 - because choice is a terrible thing to waste.
  58. IT is about information, not technology by alext · · Score: 2

    Lucky you. Some poor recommendations so far IMHO, with the honourable exception of SICP.

    The key thing is to keep a sense of proportion - anyone referring to UML or the GoF design patterns book has failed to understand what the fundamentals of IT are, and is certainly overestimating the relevance of their own preferred language or paradigm.

    Scheme/LISP, logic and some database theory is a good way to approach the fundamentals, as it was 15 years ago when I went through it. They won't thank you to begin with, but its what college is for! I'm not totally sold on SICP, students might think it's a bit pedantic, you might like to look at How to Design Programs as an alternative. I don't have a good reference for database and logic texts - I use Joe Celko's Data and Databases book, but this isn't suitable as an introduction.

  59. 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?
  60. Re:Structure and Interpretation of Computer Progra by Anonymous Coward · · Score: 0
    From the preface:

    ...we believe that the essential material to be addressed by a subject at this level is not the syntax of particular programming-language constructs, nor clever algorithms for computing particular functions efficiently, nor even the mathematical analysis of algorithms and the foundations of computing, but rather the techniques used to control the intellectual complexity of large software systems.

    ...In teaching our material we use a dialect of the programming language Lisp. We never formally teach the language, because we don't have to. We just use it, and students pick it up in a few days. This is one great advantage of Lisp-like languages: They have very few ways of forming compound expressions, and almost no syntactic structure. All of the formal properties can be covered in an hour, like the rules of chess. After a short time we forget about syntactic details of the language (because there are none) and get on with the real issues -- figuring out what we want to compute, how we will decompose problems into manageable parts, and how we will work on the parts. Another advantage of Lisp is that it supports (but does not enforce) more of the large-scale strategies for modular decomposition of programs than any other language we know.

    I may just have to crack open this book again after all these years!

  61. Brain and Box by LowneWulf · · Score: 2

    Our professor would always (almost compulsively) draw a picture of a brain, and a picture of a box.

    The box was your state machine, and the brain was the operator/programmer/user whatever looking at some aspect of it.

    The whole concept of programming languages was explained using a sequence of grunts and sidetracks, and lots of pictures of the brain and the box with different relevant sizes :)

  62. 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.
    1. Re:Another option by Sir+Robin · · Score: 1

      Link to SICP at Amazon, with a review by Paul Graham.

      --
      My /. ID is only 5,210 away from Bruce Perens's.
  63. Man, that was cool... by Anonymous Coward · · Score: 0

    I cut and pasted all of it as funny/nigger.txt

  64. ...and read code! by AT · · Score: 3, Insightful

    I agree, but also read code. There are lots of large projects with source available out there; grab it and find out how their authors did it, and note whether the approach is understandable, consistent, scaled well, etc. You can only write so much code for the sake of learning; also some designs lend themselves to larger projects, beyond the scope of a learning exercise.

    Case studies are widely used in other disciplines like engineering, and they can be useful in programming too.

    1. Re:...and read code! by stoolpigeon · · Score: 1

      You are right. It is good to read any kind of code - good or bad.

      Good code gives you ideas and lets you see better ways to do things. Bad code shows you what a nightmare someone can leave behind and (at least I feel this way) motivates you to leave behind maintainable code.

      .

      --
      It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
  65. Re:I always start with the concept of transformati by IBitOBear · · Score: 2, Insightful

    Not to reply to my own post but...

    The most important "conceptual model" is "you already know how to solve problems, you do it every day."

    This is generally followed by:

    "This is not hard, just new/strange to you"
    and/or
    "Everything anybody can do in here, at the atomic level, is exactly analogous to something you have already done in the real world."

    The first and hardest thing to do is demystify the experience. Computer mystics program by rote formula, always recreating the same program with nearly identical structures in a cookbook-like format. Computer scientists take knowledge and use it to manufacture a good solution for each unique problem.

    Most of the freshly-minted graduates in Computer Science are Computer Mystics. If you can break down this formula approach to the subject you will get much further much faster and produce a better graduate.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  66. Re:Design Patterns - Overrated by Anonymous Coward · · Score: 0

    Employ the Contractor Pattern to lengthen the schedule and line your wallet with extra moola.

  67. Applying UML and Patterns by draed · · Score: 1

    The best book i've ran across that teachs analysis, design, as well as UML syntax, and design patterns is:

    Applying UML and Patterns : An Introduction to Object-Oriented Analysis and Design

    Great book that teachs by going through an example of building a very simple Post/Cash register system.

    Covers Requirements, use cases, functional specs, conceptual models, system sequence, collab, design class diagrams, and finally patterns and how to map your finished design to code.

    Very easy to read and understand. highly recommended!

  68. Design by bytesmythe · · Score: 1

    I would say that you actually could teach design without teaching syntax first.

    First, I would teach what memory is, and how instructions are followed in memory and the concept of algorithms. The next thing would be variables, followed by pointers. Then subroutines and parameter passing. Finally, data structures and "meta" structures like linked lists, stacks, etc.

    You can actually explain every bit of this without a programming language, and without actually writing a single program on a computer. Along the way, you can have students write out basic programs in pseudocode on paper. This allows them to learn some code structure without relying on the compiler to and run-time environment to test everything.

    After this, you can start from the beginning and go over the pseudocode programs and teach them how to phrase the same things in a particular language like C or Perl.

    One thing I've noticed about people with poor backgrounds in software design and problem solving is that they may be able to write basic code in one language, but if they have to switch languages, they're totally lost.

    To other readers, please note: I'm not necessarily advocating this approach. I'm merely suggesting it as a possibility.

    --
    bytesmythe
    Hypocrisy is the resin that holds the plywood of society together.
    -- Scott Meyer
    1. 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
    2. Re:Design by C+Joe+V · · Score: 1
      First, I would teach what memory is, and how instructions are followed in memory and the concept of algorithms. The next thing would be variables, followed by pointers.

      Wait, you think this is design? This is not design. This is "how a computer works", which is *not* what people should be thinking about when they design programs. I'm not even convinced this is what people should be thinking about as they write programs. If, for example, you are programming in a functional language, then thinking too much about how the computer will execute your code will hurt you more than it helps -- making your head hurt and your code suck.

      I agree, though, that it is useful to teach "programming" as opposed to "coding". What I mean by that is that students should be instructed in the intellectual process of designing solutions to problems, or working out ways to accomplish tasks, rather than just showing them how a CPU works, how a compiler works, and a few "Patterns" and then telling them to figure out the rest for themselves.

      Also, rather than post again in a different thread, I'd just like to get off my chest the fact that it is impossible by definition to teach programming by just teaching syntax. Even if you think you're just teaching syntax, you're probably also conveying to students at least a vague sense of what the different syntactic constructs "do", or "mean" -- i.e., semantics.

      JV
    3. Re:Design by bytesmythe · · Score: 1
      >>First, I would teach what memory is, and how instructions are followed in memory and the concept of algorithms. The next thing would be variables, followed by pointers.

      >Wait, you think this is design? This is not design. This is "how a computer works", which is *not* what people should be thinking about when they design programs.

      The only "how a computer works" things I mentioned were memory (which is an important concept for moving on to pointers if you're going to teach C/C++/ASM), and the vague "following instructions" (which gives you a basis for explaining procedural algorithms).

      I will readily admit, however, that my example was highly biased towards procedural or possibly OO programming. I've never used anything like LISP or Prolog, and honestly wouldn't know how to begin explaining their programming paradigms.

      >What I mean by that is that students should be instructed in the intellectual process of designing solutions to problems, or working out ways to accomplish tasks, rather than just showing them how a CPU works, how a compiler works, and a few "Patterns" and then telling them to figure out the rest for themselves.

      I agree. That's why I didn't go into detail about how CPUs and compilers work. That wouldn't be my goal at all. I would definitely teach a few patterns, but then I'd teach them how to translate them into a real programming language. After that, you'd have to use everything you've taught and go over "real world" type examples, teaching them how to break down each problem into workable chunks and solve them.

      >I'd just like to get off my chest the fact that it is impossible by definition to teach programming by just teaching syntax.

      Amen to that. :)

      -- bytesmythe

      --
      bytesmythe
      Hypocrisy is the resin that holds the plywood of society together.
      -- Scott Meyer
    4. Re:Design by C+Joe+V · · Score: 1
      OK, perhaps I overreacted a little.

      >>What I mean by that is that students should be instructed in the intellectual process of designing solutions to problems, or working out ways to accomplish tasks, rather than just showing them how a CPU works, how a compiler works, and a few "Patterns" and then telling them to figure out the rest for themselves.

      >I agree. That's why I didn't go into detail about how CPUs and compilers work. That wouldn't be my goal at all.

      When I took AP CS in high school many years ago, the teacher began the course by showing us a diagram of a computer that consisted of a "control unit", an ALU, some memory, and "input" and "output" devices. She then showed us some simple code in pseudo-assembler and traced through it in front of us. Finally she told us that we would be learning a high-level language that was easier to write but would be reduced by the compiler to instructions like we had just seen.

      This may be what is necessary in order to teach Pascal (or now C++) to high school kids, but it is not too helpful in developing "programming" (as in problem solving) skills. (She also taught us "top-down design" and flowcharting, but I'm not sure how helpful these were either.) I think it's important that after an introductory programming course, if I ask students "Ok, so how could you put these numbers into ascending order?" they don't automatically begin with "Well, first I'd need to allocate these local variables..." or some other programming language driven response.

      I agree with you (although it may have seemed I didn't) that having students write programs in a real language is crucial, mostly because it gives them a sense of how infuriatingly precisely they have to say what they mean in order to get the behavior they want. It will also allow them to automatically get feedback from the computer as to whether their programs are right -- but it's important not to confuse "learning through interaction with the computer" with "learning that the way to program is by interacting with the computer", i.e. learning a trial-and-error-can-solve-anything design methodology.

      JV

  69. in the beginning... by msulis · · Score: 1, Interesting

    you could start by teaching them about Babbage's Difference Engine, the Universal Turing Machine, etc.

    (but it would take a long time and probably be a digression into anecdotal history more than a useful starting point)

    if you want to arm people with a useful conceptual and visual toolkit, UML would get my vote. I wish someone would have started me out that way instead of letting me stumble my way into it.

  70. Think in Parts by napoleonin · · Score: 1

    Break a bigger problem into a bunch of small pieces. Stay focused on what the program should be doing - don't lose sight of the bigger picture.

    1. Re:Think in Parts by Tablizer · · Score: 2

      (* Break a bigger problem into a bunch of small pieces. Stay focused on what the program should be doing - don't lose sight of the bigger picture. *)

      Good general advice. However, the problem is that there are often competing, orthogonal ways to divide something up. For example, traditional procedural programming tends to divide by tasks or verbs (at least the code part), while OOP tends to divide up by nouns. (I see no evidence that noun-centric code division is superior to task-centric, BTW.)

      Every experienced programmer will probably agree that "parts is good", but the hard part (pun) is how to partition things to reflect the multi-faceted world we live in. Dealing with multiple, interweaving facets is the hardest part of designing complex systems IMO. (And please don't say that AOP has "solved" this. It is only a lab toy at this point.)

  71. 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)

  72. Potential Computer Science Student....(opinion) by neonemo · · Score: 1

    As a potential student of programming I think that it is more important to get the conceptual ideas of programming first. I think that to demonstrate logical programming is much more important than learning syntax. Many books that I have looked at try a 24 hour format. They also claim that little knowledge of programming is necassary. Even after completing a book I am left with little skills in implementation of even the most basic nature.
    I think that a what your are attempting could be very useful.

  73. the Zed Specification Language by jimdesu · · Score: 1

    Zed lets you fully specify your program regardless of how it's implemented. It is specifically designed to let you work out the conceptual nuts & bolts and make sure they're consistent before you implement.

    The most grievous bugs are logic errors(imho).

    // James

    --
    --- The reclining dragon deeply fears the blue pool's clarity.
    1. Re:the Zed Specification Language by WetCat · · Score: 1

      URL?

    2. Re:the Zed Specification Language by jimdesu · · Score: 1

      Here's a good indexing page. It's not terribly informative on its own, but it has lotsa links.

      http://www.afm.sbu.ac.uk/z/

      // James

      --
      --- The reclining dragon deeply fears the blue pool's clarity.
  74. Re:Structure and Interpretation of Computer Progra by Anonymous Coward · · Score: 0

    This book is great for learning how to program.

  75. What do you mean by "introductory"? by LoveMe2Times · · Score: 1

    You say that this is for an introductory course. Does this mean people with zero programming experience or little experience? Are you talking about high school, college, vocational, or corporate training type courses? I'm not very close to the teaching scene, and so I don't have any good pedagogical sources. Anyways, a few cautions along with my thoughts: our conceptual models probably vary widely, having mostly developed ad-hoc. Methodology, and the coincedant models, of any kind are not exactly common amoung professional programmers. Articulating the ad-hoc models that we do use, often unconsciously, is not easy. Interesting study? Very. Useful for an introductory course? I don't know your purposes, but I doubt it.

    So, now for my thoughts. I would couch the discussion in terms of problem solving, rather than "programming" per se. Hopefully your students are used to solving math, physics, and/or chemistry etc problems. In this context, "problem solving methodology" should hopefully be sufficiently tangible to get them thinking about it. Discuss using algebraic methods versus geometric arguments versus intuitive methods for problem solving. This is mostly just to get them thinking about the fact that there are entirely different conceptual approaches, all of them workable, but with different applicability. It should be less controversial in this context to say that there is no "best" approach, only ones that you are more or less comfortable with. Now it should be easier to present different programming paradigms as different approaches to the same problem.

    Ok, now, how math inclined are these students? If you want to go after conceptual, well, you're going to hit a mathematical barrier eventually. If you can spend some time on basic set theory, and the idea of functions as mappings or projections, I would recommend it. Then, some basic algebra to get across the idea that we define the meaning of operators, but we try and do it in such a way that the emergent properties are interesting to us. And of course, I would (re)introduce them to Newton's method as a segway into algorithms. Finally, I would go over just enough logic and binary arithmetic that you can lay out a simple adding circuit in terms of AND, OR, XOR, etc. Now the stage is set without unduly biasing them towards one method. They may be severely disappointed by so much math, though :) But then again, my peers were severely disappointed by Prolog.

  76. C is for Cookie. by janda · · Score: 1

    The easiest, quickest way I can think of to start is in a cooking class. The ingredients are your inputs, the receipie is your program, the oven is your computer, and the cookies are your output.

    From there it's all all powdered sugar and souffles.

    --
    Karma: Food Fight (Mostly affected by Date Plate).
  77. Re:Structure And Interpretation of Computer Langua by cpeterso · · Score: 1


    Having read SICP, I know that functional programming is for quiche eaters. If you are into this sort of thing, then you will love the Lambda the Ultimate blog.

  78. Old timer comment... by johnlcallaway · · Score: 5, Insightful
    I've written code (as many others have) for 25 years, starting with Fortran and assembler on punchcards, working with TRS-80 Basic, spending several years with COBOL, using perl, Java, C/C++, and such over the last 10 years, and other languages to unique or propriatary to remember. The concepts that have lasted through all the languages and methodologies, from spaghetti assembler, top-down and structured COBOL programming and now object-oriented C++ and Java, are very simple.
    • Break down what is being developed into very small components, and make them as independant of everything else as possible.
    • Develop so that relationships between components can be easily understand to lessen the impacts of any change. (One hint to a student, can he envision a cube in his head and rotate it or unfold it?? If not, maybe programming isn't for him.)
    • Write reasonably good, self documenting, maintainable code that is consistent. Teach that it might be easier to use 'i' as a variable in a short loop, but loop-idx or object_idx make more sense.
    • Which leads into the next one, LEARN TO TYPE DAMMIT. Programmers spend their career at a keyboard, they should learn to use it efficiently. That means both hands and all the fingers. Throw in the feet if you can.
    • Write self checking code that handles errors in a concise, yet informative node. I hate 'segment fault' type messages. Trap the damn things and let someone have a general idea where it occured and what dataset was being worked on if possible.
    There are probably a thousand some concepts that should be taught, but these are a few off the top of my bald head that shine through.
    --
    I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
    1. Re:Old timer comment... by InfinityEdge · · Score: 1

      Teach that it might be easier to use 'i' as a variable in a short loop, but loop-idx or object_idx make more sense.

      Y'all can thank those damn math people programming in fortran during the 60's for that holdover. Personally I think that since i,j,k have such a history as loop indicies it really doesn't matter. What bugs me is that people still use i, j, and k unmodified. Ever try searching for the next occurence of 'i'? Shit, i is one of the most used letters in English or any other Roman Script based language for that matter. For that reason, all my loops are indexed by ii, jj, kk. Only one half second slower to type and much better to search for.

      Which leads into the next one, LEARN TO TYPE DAMMIT. Programmers spend their career at a keyboard, they should learn to use it efficiently. That means both hands and all the fingers. Throw in the feet if you can.

      Here, here. I totally second that motion. During a boring summer week in High School I taught myself the Dvorak layout. It was one of the best things I did for my programming carreer. Dvorak is slightly faster, gives me less pain, but most importantly it FORCES you to type correctly. You cannot look at the keyboard when the key lables have no relation to what character is put on the screen. You should NEVER look at your keyboard. Glancing down and up kills your speed because you have to orient yourself each time you transition. A one second overhead starts to add up when you do this several times per minute while programming for ten hours straight. If you don't care for the other benifits of Dvorak then at least file off the letters on your keyboard so you have to type correctly. Best thing you can do for yourself if you spend any amount of time entering text into a computer.

    2. Re:Old timer comment... by xenocide2 · · Score: 1

      Plus, nobody ever asks to use your computer more than once. I find trackballs have the same effect.

      --
      I Browse at +4 Flamebait

      Open Source Sysadmin

    3. Re:Old timer comment... by The+Masked+Rat+Fink · · Score: 1

      1. 'i' makes a great loop variable. Yes, I know that it hearkens back to the days of Fortran, but it's become a cross-language idiom, so you'll confuse more people than you'll enlighten if you use something else for short loops.

      2. I never learned to type and I have 22 years of non-typing experience to draw upon. If I have to choose between thinking and typing, then I'll choose thinking. I get paid to produce software, not bang out words. Besides, I look at the keyboard while I'm typing and my brain fills in what the command line looks like so far including any mistakes that I make. Who needs to look at the screen? :-)

      --
      simonpeter.org | simonpeter.com | techbook.info
    4. Re:Old timer comment... by Tablizer · · Score: 2

      (* 'i' makes a great loop variable. Yes, I know that it hearkens back to the days of Fortran, but it's become a cross-language idiom, so you'll confuse more people than you'll enlighten if you use something else for short loops. *)

      I generally have to agree. As a rule of thumb, the more often something is referenced, the shorter its name should be. Long-winded code is harder to read IMO.

      If you have a long variable name, then shorten it with an abbreviation, and then comment the abreviation. Example:

      var fbtb; // foo bar transfer buffer

      or perhaps:

      var fooXfr; // foo bar transfer buffer

      IOW, factor the "documentation" into one spot.

      As a compromise, perhaps try "idx" instead of "i".

    5. Re:Old timer comment... by sconeu · · Score: 2

      Shit, i is one of the most used letters in English or any other Roman Script based language for that matter. For that reason, all my loops are indexed by ii, jj, kk

      I tend to use "j", for that reason but in vim, there's always \<i\> to look for the solo letter "i".

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    6. Re:Old timer comment... by w3woody · · Score: 3, Interesting

      While I agree with most of your comments, just one point from another ol' timer. (Though only 15 years...):

      Teach that it might be easier to use 'i' as a variable in a short loop, but loop-idx or object_idx make more sense.

      Research suggests that, for complex equations and/or complex operations, shorter variable names are more easily recognized than longer variable names. That's because most people who learned algaebra recognize patterns in the equations, and using longer variable names makes the equations harder to recognize.

      Thus, "force = gravitational_constant * object_1_mass * object_2_mass / (distance * distance)" takes a little more time for the brain to parse than "f = G*m1*m2/(r*r)", even though they represent the same thing.

      With this in mind, I would suggest that if the iterator of a loop was being used as part of a mathematical operation (such as an array index), perhaps using 'i' will make the code more readable. However, if your iterator is not being used as part of a complex equation or represents an object (such as a pointer in a linked list), perhaps using a descriptive name makes more sense.

      Personally I tend to write:

      for (i = 0; i < 10; ++i) a[i] = 0;

      yet:

      for (windowPtr = GWindowList; windowPtr != NULL; windowPtr = windowPtr->next) {
      windowPtr->Update();
      }


      You get the idea.

      Just my two cents worth.

    7. Re:Old timer comment... by Anonymous Coward · · Score: 0
      Teach that it might be easier to use 'i' as a variable in a short loop, but loop-idx or object_idx make more sense.
      I used to properly name my loop variable, but have decided to switch to using i (for loops only 1 deep anyway). Why? Because 'i' is more informative - every programmer of nearly every language instantly recognises i, knowing both its purpose and scope. Names like loop_idx, index, idx, list_index etc is a bit like coding with an accent :)

      Note also that i as a loop variable makes more sense in some languages than others, for instance the 'for' statment in Dephi (and other descendants of Pascal) is expressing something entirly different to the 'for' statement in C (and its descendants), in Delphi 'i' is always a read-only ordinal type that will increment or decrement through a precomputed range, in C because there are so many things the loop variable could be, or could be doing, you'd only want to use i when the for statement is being used as a textbook loop.

      LEARN TO TYPE DAMMIT. Programmers spend their career at a keyboard, they should learn to use it efficiently. That means both hands and all the fingers. Throw in the feet if you can.
      Uh, guilty, but so little of my day is typing it's never seemed an issue. The odd thing is the faster people can type the more they seem to abbreviate and cut corners. Case in point, I would write loop index as loopIndex and you use loop_idx - that's not a critisism (they both read fine) just a observation I've noted here because a) it's interesting, and b) it undermines the assumption you were going to make that I cut coding/commenting corners because I never bothered to learn to type ;).
    8. Re:Old timer comment... by p3d0 · · Score: 2

      I agree. Pick the notation that is most likely to help potential readers understand what the code is doing. If you honestly think that means using "i" as the induction variable of a loop (which it occasionally does), then do it.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    9. Re:Old timer comment... by vrmlguy · · Score: 3, Interesting

      I've said this before, but one of the best ideas that I ever encountered was that the length of variable names should be proportional to the size of their scope. So, one the one hand, this is OK:
      for (int i=0; i<size; ++i) { ... }
      (assuming that the "..." doesn't contain any braces), but function/method arguments should be longer, like this:
      int createWidget(string name, billOfMaterials parts) {...}
      and globally-visible items (like the class and function/method names above) get the longest names.

      --
      Nothing for 6-digit uids?
    10. Re:Old timer comment... by spiderspit · · Score: 1

      a few additions to the old timer's list -

      1. Don't assume that your users will "know"! aka "Yes, there is somebody who is that dense"

      2. Test exhaustively, preferably have someone else do it.

      3. And develop a taste for luke-warm coffee.

      --
      Forgive him, for he believes that the customs of his tribe are the laws of nature! -- G.B. Shaw
    11. Re:Old timer comment... by spiderspit · · Score: 1

      self_Idx think that self_Idx have made my point clear. self_Idx might say, abundantly so :)

      --
      Forgive him, for he believes that the customs of his tribe are the laws of nature! -- G.B. Shaw
  79. A Full Conceptual Course by sig · · Score: 1
    Here is a full course that I found on the web, coincidently earlier this morning, while I was searching for something completely different. It is designed with an eye towards scheme, because scheme has the simplest syntax there is, although its contents can be applied to any language. It has lessons and an on-line text, examples and problems. It has the multi-platform scheme interpreter DrScheme which can be used to run all the examples and problem sets.

    I'm not sure how all of this stacks up to SICP since I just found this one this morning. I can't say enough good things about SICP (It is how I really learned to think about software), but neither can a lot of other posters, so I figure I don't have to. This program is directed at a conceptual level and it looks like this course might be a worthwhile comparison.

    The link is here

  80. STOP reading books on programming. by Anonymous Coward · · Score: 0

    Take a trip to a university bookstore and read some books on Computer Science, instead.

    Not a 2-year vocational program either, please!

  81. 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

  82. LARMEN!!! - stop trolling by Shamanin · · Score: 1

    Alright Larmen, stop trolling!!!

    I thought the book to be too simplistic and nothing to do with actual code (which is necessary in an introduction to programming course).

    The author of this thread is trying to cover way too much material with novices that will be more than overwhelmed.

    Unless he wants to teach Visual Basic using its Visual Modeler (but I wouldn't call that programming).

    --
    come on fhqwhgads
  83. Re:Structure And Interpretation of Computer Langua by bentini · · Score: 3, Interesting
    I think the authors of SICP realized there were other models out there, and I think they might disagree with the statement that lambda calculus have almost nothing to do with how computers work.

    Sussman was a co-author on several papers, the titles of which approximated: "Lambda: The ultimate goto instruction." I think Sussman and Abelson know a lot more about cs than you give them credit for.

  84. It's called by Beyond+Redemption · · Score: 1

    Programming Logic...Many colleges have courses just like that where they do not get into any specific language but instead discuss the very topics you brought up.

  85. Worst way to teach, ever. by bleckywelcky · · Score: 1


    Do not ever start out an introductory course with theories only. If you spend even the first two weeks or so discussing just the ideas of programming and never get to the actual syntax, everyone will be bored out of their minds, and you will definitely hurt any of the inspirable people. Mix and match. Sure, some courses may start out with too much syntax, and not focusing enough on the ideas behind writing certain routines, but they get the people into actually working with the code. Imagine if in an introductory physics class all the professor talked about was how a force could be used to accelerate a mass, and how the forces could act with or against each other, but never got down to F=ma and the vector additon of forces, or never showed pictures of force diagrams or anything. You would lose everyone in the class. Make sure you combine application and processes with theories. Get the right balance, and the theories can/will be interesting enough to be applied anyhow.

  86. Re:Structure and Interpretation of Computer Progra by Brad+Lucier · · Score: 1

    SICP is great, but it can be quite difficult for many beginning programmers. An excellent alternative that covers many of the same "big ideas" is The Schematics of Computation, by Manis and Little; I call it "SICP for mortals".

  87. Trouble is.... by tjlsmith · · Score: 1

    We're at the same stage in software where medicine was when the guy who cut your hair was the same guy who set your bones. Truth be told, we have no clue as how to write software and our kids will pity us and our grandkids will REALLY pity us.... As for the competing schools of development - 'Where there is science there is no argument' - da Vinci

    --
    Mumia Abu-Jamal is *laughably guilty*. Check the evidence.
  88. There is no such thing as "theory" in software by Anonymous Coward · · Score: 0

    In most courses they start with "theory" (they draw lines on chalkboard and paper, sometimes using an unholy amount of Greek letters) in order to avoid letting the students "get stuck" with "bad practices"

    That is partly the result of the way the TEACHING of programming evolved. Programming was first taught by mathematicians and engineers. Mathematicians LIKE drawing lines on paper, and using Greek letters, engineers are "stuck with the bad practice" :-) of separating things into "theory" and "practice".

    The words "theory" and "practice" have a very real meaning in the fields of engineering: it is much easier to erase a line on paper, and draw it somewhere else, than it is to pull down a bridge and rebuild it again. When it comes to teaching engineers, it would be very unwise to let the young trainees litter the countryside with their little training bridges. Of course they should learn as much by scribbling on paper, as they can, before the start to do that :-)

    Programming, on the other hand, has no such limitations. Deleting a line from a program is JUST as easy (or easier) than erasing a line from a piece of paper. For those who can still remember, THAT WAS THE ORIGINAL INTENT OF SOFTWARE. I hate yell like that, but nobody seems to listen...

    Writing of software (programming) has no separate "practice" and "theory". Many other, more mature fields share this behavior. Mathematics for one: you don't write a flowchart before you try to prove something. Playing chess, writing books etc...

    Teaching of programming should use paper and pencil, when appropriate, (they are great tools, cheap, effective, they contain their own power supply) but should also use the computer as a valuable teaching tool. They major advantage of writing a program in front of the computer, and testing it immediately, is that you get instant feedback. This is what makes programming so much fun. You should not exclude fun from your course.

    I don't know how much time you have for that course, and how much the intended audience already knows, and where do you want to get them, but I would suggest that in the beginning you should skip things like UML, flow charts and block diagrams. These tools can do miracles in the hands of capable programmers, who use them to communicate with their co-workers, but they are a mere waste of time for people who do not yet even know what a program is all about. It is a bit like not permitting a year old child to speak before he learned to spell properly...

    This way you gain some time. Use that time instead to give them an understanding of the place of software. Most programmers don't know, and don't care how their programs fit in. That is a major shortcoming. Much worse than not knowing all the UML thingies. Also, try to give them some solid ground to stand on. The equipment they program, should be something they can understand. A PIC controller with LED and switches attached is a nifty thing to start with. They should FIRST learn about assemblers, and later about high level languages. A programmers should always KNOW what he is doing. He should always stand on solid ground. When they have learned to walk slowly, you can teach them to run, and fly, relying on compilers and interpreters. You can also start to teach them about operating systems, because they will have some understanding of the problems that made them necessary, and the limitations and tradeoffs they introduce. When you are done with all this, and they have at least a limited understanding of the previous topics, (the child can now speak) you can teach them the "conceptual models" (how to read, write and communicate about it).

    Peter

    1. Re:There is no such thing as "theory" in software by os2fan · · Score: 2
      No, honey, there is theory in software.

      For example, consider the sorting algorithms. There are several different methods of sorting a series. Some of them, like quicksort, are generally better than others, like bubblesort. But in Knuth, we find a system where bubble sort is the most efficient method.

      The idea that different methods "cost" different amounts, and doing these calculations can speed up programs greatly, is also not to be missed.

      There is also "design philosopy", which is about how the parts fit together, and are built. The shift from the hard-coded jumps and gotos of assembler and basic to the structured programs of c, rexx &c is the application of a theoretical discovery. The unix pipe is built around the idea of task segments.

      Like bridge design, program design is a case of learnt skills. And if you don't periodically look objectively with some theory at the design process, the design of both the bridge and the program may be sadly lacking and unnecessarily expensive.

      And yes, you CAN learn bad habits. Programs like basic teach you bad habits in the sense that all values can be called from anywhere, and the use of "GOTO"'s.

      Flow charts are generally a bad idea, since they force you into excessive codes. Better to let things wait and ride.

      --
      OS/2 - because choice is a terrible thing to waste.
    2. Re:There is no such thing as "theory" in software by cybercrap · · Score: 0

      Haha, this is funny. I'm sorry but sorting routines are pretty much just thrown in peoples faces and they are told use this routine when your doing this. Now I'm not saying there isn't any theory in programming, but I am saying there isn't any theory in programming for 99% of programmers. Sure there are those geniuses who come up with new sorting routines and better ways of doing stuff, but we ain't talking about them in intro courses. Most programming is cutting and pasting. You guys can jump around it all you want, but most coders cut and paste from shit they already know works and then try to get it to work in their own code.

    3. Re:There is no such thing as "theory" in software by Anonymous Coward · · Score: 0

      I never said you cannot THINK about programs.

      What I did say, was that there is no point in separating your thinking into different modes of DESIGN and BUILD. Software is unique, in that you can mix the two without any fear of damage. The only limiting factor should be the contract you work under.

      When you are trying to teach somebody to program, allow him to make mistakes. Like somebody very correctly put it, there is no point in pounding the answers into their heads until they don't know the question. You should not show "The Art of Programming" to people who have not yet tried to write their own sorting algorithms, and produced something they feel VERY proud of. If you do, that will only leave them in a worse position: they will see themselves solving all the world's problems from famine to the ozon layer using all the proper algorithms, when they should just type "SORT" or "ORDER BY" :-) Peter

    4. Re:There is no such thing as "theory" in software by os2fan · · Score: 2
      I never said you should not make mistakes, or that you can't learn from mistakes.

      None the same, theory is valuable, not all the time, but as often as it is in engineering. Debugging is fairly theoretical task. The more you move up the front, the less you have to debug and rewrite.

      Yes, the average programming does benefit from a fair bit of design. In essence, if you can plan for things aforehand, then you can avoid these pitfalls. A big program in an area wher you can't lock away variables, or needs a tight squeeze of space, does well with a bit of foreplanning.

      And, besides, what's the difference between "SORT" "ORDER BY", and cutting and pasting a standard sort routine. :) I may not know how to do quicksort, but the program runs faster with it than, say, bubblesort. Most of the time I use the "sort" command, and structure output to make its life easier. It's only when I need an inline sort that I dig out the code.

      I mean, I wanted some code for matrix determinate and inverses, so I took some stock code, and made my programs use the right variables. It's not that much different to doing the same in an spreadsheet.

      There's nothing wrong with a spot of idealism, and I assure you, it's not a new thing with computers.

      As far as programming goes, the first thing I show people is things like how to write filters in rexx, and shell programming. Both of these are dirt-easy, and immediately appliable.

      --
      OS/2 - because choice is a terrible thing to waste.
    5. Re:There is no such thing as "theory" in software by os2fan · · Score: 2
      To say the same thing, there is no theory in 99% of designing and building bridges as well. In both case it's pretty much applying stock formulae to each case.

      I mean, what's the difference in cut-and-paste and kit-assembled homes. The bulk of the work is done elsewhere.

      Sorting routines are pretty much thrown at people. I do not deny this. So is bridge design. But this is not the point.

      On the other hand, a careful study of where things go in a program, and considering alternate options for the program, resulted in massive speed increases (here hundred or thousand-fold type), in some of the programs I wrote and rewrote. Yet the first program I wrote was recycled to do an entirely different task, where it was much more effective.

      There's no "magic wall" between theory and practice. It's more a matter of how far you stand back and see the scheme of things.

      --
      OS/2 - because choice is a terrible thing to waste.
    6. Re:There is no such thing as "theory" in software by crucini · · Score: 2

      That was interesting, and I hope it gets modded up. I think you touched on something that makes me uneasy about "software design" - design seems to imply redundancy. It's easier to design a bridge than to make one. The drawing package for a bridge is a more compact representation of the underlying structure than the bridge itself.

      Repetitive work may be needed in the physical world, but should be automated in the computer world. If a piece of software can be "designed", isn't the design document itself a program? And shouldn't it be run through a preprocessor/compiler/whatever to generate the next stage?

      Of course a real engineered artifact might have higher-level design documents which do not contain sufficient detail to build the artifact, but containt sufficient detail that a qualified engineer could use them to develop the detailed design. Maybe within that context it is acceptable to speak of software design or engineering.

      By the way, why don't you create an account?

  89. the guy needs a little Knuth (who doesn't?) by jabbo · · Score: 2

    In the words of a programmer noted for both correctness AND efficiency,

    Premature optimization is the root of all evil

    :-)

    --
    Remember that what's inside of you doesn't matter because nobody can see it.
  90. FOEY! by mstorer3772 · · Score: 1, Insightful

    I disagree.

    I think that someone starting off with these mental tools straight out of college can avoid all the 'sweat & tears' that we had to go through.

    I haven't personally derived each and every pattern described in Design Patterns (just 1 in fact)... but that doens't mean I don't find them useful. Quite the opposite.

    Now I 'grok' the pattern I worked out for myself more than the others, but that doesn't mean I don't use them.

    I still think this would be a bit much to through at someone early on, but perhaps after they've got a language under their belt, along with some basic concepts....

    --
    Fooz Meister
  91. Use small words by Anonymous Coward · · Score: 0

    Use smaller words so guys don't get lost in technical bs. Use fewer acronyms, they're confusing when a guy doesn't know what they mean, or if they mean something different to him than to you.

    Also, as far as OOP goes, it's NOT HARD. In fact, it's easier than traditional programming, IMAO. Of course, I also have a strong mechanical background, and the idea of interchangeable parts is simple, as well as NOTHING NEW.

    Finally, "Hello World" doesn't teach anybody anything. It's just another useless chapter, or section, or subsection.

  92. Incorrect information by Anonymous Coward · · Score: 0

    Prolog is a logic paradigm, not functional. An example of a functional language is lisp.

    1. Re:Incorrect information by Bush+Pig · · Score: 0

      They're similar enough. They both use (ugh!) tail recursion.

      BTW, I have programmed in prolog for a living.

      --
      What a long, strange trip it's been.
  93. The semantics is in the sintax. by JanMark · · Score: 1

    IMHO you learn to program just like you learn to talk. First you mumble after an adult (wizzard), without comprehension, than you find meaning in the words.
    Only then you get your first glimps of semantics, as you combine the meaning of words (instructions) into the meaning of life^H^H^H^H it all (what the program does).
    It doesn't pay to hammer in "42" if they don't know the question.
    Just give them exampels, have them work with it, and then they see the light, and the can reverse the process; Going from meaning to syntax.If they want to know the answer to soon, they are not going to like it. And you need that motivation! Have them program 'life' than the 'universe' and after than you make them believe the can do 'everything.' Keep um coding! The semantics is the answer, the sintax the question.

    --
    -- (:> jms cs.vu.nl (_) --"---
  94. 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.
  95. foreign languages by Anonymous Coward · · Score: 0

    if you have every studied a romance language, i think programming should come fairly easily for someone. had i not taken 4 years of latin, i probably wouldn't be as good as a programmer now.

    every time i learn a new (computer) language, i look at it like a new (human) language ... conjugating regular verbs = object.method() ... straight-forward and gets about 80% of the verbs out of the way. conjugating irregular verbs is somewhat similar to having to learn a new component (eg, swing).

    senior year in high school, i took a course in c ... and having a 'structured' language background (latin) helped a lot, imo

  96. I agree about experience first by const+char+*+codeman · · Score: 1

    Although I understand the merits of looking at everything from a top-level, big picture point of view, I don't know if this is the best way to teach new students.

    I completely believe that the reason why I absorbed computer science in college, especially software engineering principles, is that I wrote a 30,000 line game in C when I was in high school. I learned *all* the wrong things to do by experience, and could apply all the material in college directly to my game.

    I've always wanted to teach a programming class where you would keep building on an project through-out the semester, until it totally blows up in everyone's faces because of their bad programming practices. The next phase of the class (maybe the next semester?) would be analyzing the project and how SW design principles could have been applied and how they would have helped!

  97. Warnier/Orr by Anonymous Coward · · Score: 0

    These books mostly seem to be out of print, but Jean Warnier took a systematic approach to programming fundamentals with "Logical Construction of Programs" and "Program Modification". Old stuff, definitely not OO, but does teach the basics of programming using a rigorous approach.

  98. Genu: Solid Modeling Interface for C++ by silkySlim · · Score: 1
    This guy has been working on way to graphically model C++ programs. Basic shapes represent different constructs and you graphically connect them together. The tool then generates C++ from the model. Kind of cool for visualizing code:

    http://www.gel.ulaval.ca/~dumais01/genu/

    "What is Genu?

    Genu is an interface to C++. It brings to the user:

    -Intuitive approach to programmation with the analogy of C++ and tree.

    -Interface for managing complex projects and instant recognition of important part of the program"

    1. Re:Genu: Solid Modeling Interface for C++ by Anonymous Coward · · Score: 0

      The 1.00 version is due for June 15th

      I see you to the launch site!;-)
      louis

  99. Good Conceptual book by randLews_Therin · · Score: 1

    Try getting the Data Structures book by Micheal Main from the University of Colorado he only has one so it should be easy to find it is very handy for conceputal computer science.

  100. Hello, World! of patterns by Shamanin · · Score: 1

    Not to be mean, BUT... Let me guess, the singleton pattern is the one pattern that you HAVE derived.

    --
    come on fhqwhgads
  101. Models by hackus · · Score: 1

    I do not have any tools per se, in teaching computing concepts. I usually start with diagrams of what computing hardware is, though.

    After all, basic operation of a motor vehicle and how it is maintained for example begins with maintaining its parts, and why and what happens when you don't change the oil for example on a regular basis.

    Same thing with computing machinery. What parts do what provide a thoughtful framework, a conceptual framework in how and what programming is and how to do it.

    MMU's, Registers, Stack Frames (if you are on a CISC machine), and the hardware that makes these things go.

    From there I move into the flow of information and instructions through the machine. I can then use that as a jump point to teaching programming concepts:

    1) I begin with the 5 "holy" constructs of structured design. From these 5 constructs all computing algorithms can be encompassed.

    command, if/then, while, do/while, case.

    This provides a conceptual and I think easy way to build simple programs.

    I usually ask people to design an algorithm that counts to 10 then quits, for example.

    2) After people master these concepts of control and command, I can then usually introduce the more advanced concepts of what data means to execution and implementation on the structure of code. (i.e. Data Structures)

    I try to keep the Math at a minimum unless I am talking with a bunch of PhD's who for example, want to figure out the finer points of whatever weather model they are building and its impact on the execution time on the target machine.

    Math however, is very important in structured design. God has his hands everywhere in your code you know, and he writes hints on how to improve it and how to store that data and access it, in his own handwriting...

    Mathematics.

    4) After we cover those topics, we get into the world of specialized design. We cover some of the more highly specialized fields in command and data representation such as Object Oriented Design,

    Conceptual models for OOD I use typically begin with the construction of a Structured Design template, and the I transform it into an equivalent OOD. OOD is very abstract, even more so than structured design in many ways.

    Many structured design students of the past 30 years in computer science often have a VERY hard time making the jump into this new mode of thinking.

    It takes more than just learning a new language to be a good OOD'er. Many of my students depending on the effort, usually are quite skilled in OOD about 2 years of writing code, and proper mentoring.

    That is of course, as long as you don't use Microsoft tools.

    Did you know VB of objekt oreinTA TED.

    :-)

    -hack

    --
    Got Geometrodynamics? Awe, too hard to figure out? Too bad.
  102. Design THIS by Anonymous Coward · · Score: 0

    This book is way beyond the ability of most students to appreciate.

  103. AAAAAUUUUGGGHHHHH!!!!! by pjt48108 · · Score: 1

    Ok... I am NOT a programmer. I would like to be, but most of the suggested approaches I have read here are really missing the point of the post, (Duhhhh... at least I think so...). It doesn't help me at all to continually parrot "BAWWWK! Learn code, learn code! BAWWWK!" I have read code til I was stooped over like a man thrice my age, and I still am unclear on the concept.

    Additionally, it is just as useless to me to suggest that I just write programs until I get it right. Anyone ever heard the old adage about an infinite number of monkeys with typewriters eventually producing the works of Shakespeare? Well, as in that example, simply barfing code onto a page until it lurches to life as a marginally-functional program means a long time between initial keystroke and thrilling to the sight of "Hello, world!" on your monitor.

    Personally (and bear in mind that I am a theatre major-turned-network administrator--i.e.: right-brain artsy-fartsy type learning to use his left lobe) I need something more in order to absorb the complexities associated with arcane code. What this post is getting at, I think, is more of a content-with-context approach.

    As an initial approach, I am sure many people would benefit from simple representations of complex processes as a foundation for learning. This doesn't simply mean learning to flowchart, but some sort of symbolic representation which indicates both the flow of the program and the environment within which it must run.

    For example, the first truly 'original' program I wrote, in order to self-teach myself shell scripting, was a simple script which started with a variable set to zero, and which would add one to that variable, display it onscreen as "This program has now run X times", then save the resulting variable to a separate file. On subsequent executions of the script, it would read the variable from the outside file, process it as decribed above, and spit out the result onscreen and as the new value of the outside file.

    Now, this may sound like a moronic little program, but until I figured out how the STATIC CODE interacted with the VARIABLE OUTPUT (maintained in a file outside the script) I was as stumped as John Bobbit after Lorena wigged-out on him. For me, it was just as important to understand the system of input and output and file storage and retrieval as it was to learn how to script.

    Most programming books I see take too dry an approach to lining up all the code, with very little in the way of analogy (in my moron script, it was important to learn how the script 'hands off' the output to a file where it is 'stored' until the script needs to 'pull it out' again. I know this makes me sound like an abject moron, but I have yet to find an instructional tool that brings the concept of programming as close to home as analogy.

    Ok... Time to get back to work, trying to get Slashcode working here at work... Anyone have a spare magic wand I can wave over my computer??

    --
    Mmmmmm... Bold, yet refreshing!
  104. Programming is not software engineering by Anonymous Coward · · Score: 0

    Someone's business card may say "Software Engineer", but that doesn't make them a software engineer.

    A programmer is someone who can translate someone's solution set into machine instructions.

    A software engineer is someone who can solve problems using a computer as a tool.

    A lot of programmers think they are software engineers; they arrive at solutions through trial and error. They let the compiler correct their mistakes, rather than knowing ahead of time what the compiler will do with their code.

    Here's a good test: ask them "What is a trie, and where and why would use use it instead of another algorithm?". If they can't answer, then they are not a software engineer.

  105. Here's a book by altoidsman · · Score: 1

    Practical C Programming by Steve Oulliane at O'Reilly. Covers everything you're looking for.

  106. This is the wrong way to go about teaching. by B.+Vhalros · · Score: 1

    This is like trying to teach a child about sentance structure before they know how to talk. Ie; it wouldn't make any sense to talk about predicates and subjects to a student who doesn't know any words. People need something concrete to grasp first. They need a real syntax, or things like objects, and pretty flow charts don't mean anything. Only once you have the rudiments down can you understand more complicated design issues.

  107. Move 'Jon' by Anonymous Coward · · Score: 0

    For great justice! All your base are belong to Jon Barrett.

  108. Grounding in Reality by Barryo_Stereo · · Score: 1

    You can't think about something unless you have someTHING to think ABOUT. I would think a student would be turned off really soon by philosophy without his being able to DO something. I've really enjoyed programming and now approach the abstract books with interest since I can relate to the problems that they discuss. And I DID learn programming by having an idea of a program, then looking up the code that would allow me to do it, but the two went hand-in-hand. If I could only think of what I wanted my program to do and couldn't ( for a long time ) do anything about it, I would have quit long ago. (I'm a self-taught programmer currently working in industry.)

  109. von Neumann by shpoffo · · Score: 1

    You should look into information on John von Neumann - he is generally accredited with inventing flowcharts and designing some of the first conceptual flow for machine operation. I was rather happy to have his concepts introduced in my intro CS class, but I doubt that it was so common a happening.

    .....he is also just a really cool figure to review =) good luck

    -shpoffo

  110. Workflow! by TastySiliconWafers · · Score: 1

    The single most important subject in the realm of software development is, sadly, often ignored entirely in computer science education. That subject is workflow. I've seen altogether too many well-implemented, relatively bug-free software packages that are nonetheless miserable failures because they fail to adequately consider what the end user really needs to do and how those users go about accomplishing their work.

    I'd even go so far as to say that I believe that the first "Intro to Computer Science" course ideally should involve little or no programming at all. Rather, it should focus on requirements engineering. Students should learn how to work with real end users to understand their workflows. They should learn how to write good requirements documents in prose that adequately describe the workflows they have observed so that someone could conceivably build a satisfactory software system from the requirements documentation.

    "User and Task Analysis for Interface Design" by Hackos & Redish is an excellent resource that focuses specifically on this topic. "Software Engineering" by Ian Sommerville addresses the issue to some extent while providing a broad overview of software development processes.

  111. Well, Obviously, but.... by Ian_Bailey · · Score: 1

    While actually coding may help you learn to program, it may not help if the programmer does not know about the tools available to solve the problems they encounter.

    If a coder knows about conventions, concepts, and other fundamentals, when they encounter a situation coding where they need to apply them (for a simple example, planning before you actually code), then they can think "Hey, I remember something that's applicable to this", and go and lookup the details if necessary.

    To go to your boots example: If someone gets blisters from walking, they may think it's the boots that need breaking in, but they might also think that the boots they have are not the right kind. When you say, "Look millions of people have gotten blisters, and breaking the boots in solves it with most boots", they might actualy do that, whreas without your guidance, they might not even consider that factor.

  112. Felleisen & Friedman by cthlptlk · · Score: 1

    I like Matthias Felleisen & Daniel P Friedman's books: Little Schemer, Seasoned Schemer and A Little Java, a Few Patterns. They look like they're books for kids--and they are--but anyone can learn from them, and they cover programming, rather than syntax.

  113. My opinion as a Beginner by ProfKyne · · Score: 1

    A lot of these responses describe such famous texts as Structure and Interpretation of Computer Programs, or Design Patterns, or some other famous book by Kernighan and someone else. Someday, I plan to read all of these books.

    But if you're like me you graduated with a liberal arts degree because you had too much fun in college, now you are teaching yourself programming in hopes of getting a decent job, you've learned your way around Python and Perl and you've even gotten a job as a temp, building an internal content management site in PHP (without using code from PostNuke etc, in an attempt to force yourself to figure out the answers to your own problems [even though in hindsight it might not have been a bad idea])...

    Having figured out that writing mammoth PHP scripts to handle every possible scenario is pretty unwieldy once you get the hang of that object-oriented thing, and realizing that you could have planned this thing a whole lot better than just jumping in and writing PHP code...

    I'd heard that Java is a good next step and isn't that the language they teach beginning Computer Science students? And everyone on Monster.com seems to be hiring Java programmers...

    Well in that case there's a book for you -- for me at least -- called Beginning Java Objects by Jaquie Barker. It's a Wrox book, so you can learn from it without having a CS degree or a mentor by your side (though I sure have come to appreciate the help I get on mailing lists), and it focuses on design rather than syntax. You really need to have programmed a little bit before getting into it, but it has already made me a better programmer.

    Very easy to get into and get a lot of helpful information from.

    --
    "First you gotta do the truffle shuffle."
  114. how bout this concept? by Anonymous Coward · · Score: 0

    try like anything can be an object...

  115. teaching C++ by eddeye · · Score: 1

    I can't answer the question in its full generality, but I can discuss another way to teach introductory C++.

    Accelerated C++: Practical Programming By Example
    by Koenig and Moo
    ISBN 0-201-70353-X

    I have to admit I've never actually read it, being a seasoned C++ programmer already, but it comes highly recommended from several well-respected authors. From what I gather, it introduces C++ programming by focusing on content and results rather than syntax. Using the STL and the Standard Library, you can accomplish complex tasks quickly and easily without bogging down in the details of how algorithms and data structures are implemented.

    Why is this a good thing? Certainly if you're going to have a career in programming, you need to learn the details of building a linked list or a sort algorithm. But many majors in other sciences only take one or two introductory programming courses. It's better they should learn how to write something useful than the arcane intricacies of function pointers and storage duration qualifiers.

    Even for CS majors, I would argue this approach is beneficial. It provides much greater feelings of accomplishment at the crucial introductory stage. Beginning programmers shouldn't even be messing with raw pointers or static arrays; they're highly unsafe and require a lot of attention to details which beginners don't comprehend.

    At least that's my opinion, I could be wrong.

    --
    Democracy is two wolves and a sheep voting on lunch.
  116. BlueJ by xenocide2 · · Score: 1
    While I personally hated it, BlueJ does a nice method of presenting novice programmers with a decent class diagram. This is the IDE used at Kansas State University's introductory CIS class, in combination with a book written by an excellent professor. It emphasises the "MVC" architecture made popular in part by SmallTalk. Of course our course is rough on true novices who haven't had a high enough dosage of procedural programming to take the step forward to OOP, which is why they're starting to push a class below that level. I doubt it will ever be required, simply because as it stands there's just not enough semesters in a 4 year stay.

    Personally I'm a poor programmer, for question you asked. I tend not to use flowcharts because I find it easier to express what I would write down in code anyways. If I use any conceptual model its typically just a class diagram for large projects, or maybe a memory map for smaller architectures. Rational Rose seems to be about the only real standard out there for conceptual stuff, unless you count hand waving Design Patterns.

    But I feel sorry for any intiate who takes on such advanced topics like "programs are made of..." because not all programs can be seen as a knowledge base, or a system of sending messages. I would focus more on the math behind the scenes, because thats where things are heading. Things like assertions and domains are finally being promoted in Software Engineering and it takes a solid foundation to appreciate and understand it. Computers operate on a mathematical level. The smallest component of a program is an instruction. If you want to model that using parse trees thats an interesting approach but mostly useless. Reguardless of the content, for an entry level class the best thing you can do to get more of the class to understand things is lots of bite sized homework. Its a pain on the graders and the students might complain, but doing things several times using similar solutions helps you generalize concepts better.

    --
    I Browse at +4 Flamebait

    Open Source Sysadmin

  117. For your students' sake, start with Assembly by Anonymous Coward · · Score: 0
    I spent two years teaching all kinds of programming courses to people who never really programmed before, and found out the hard way that starting with theory does not work. The students must have a very clear idea of what a computer actually does under the hood, a clear computation model. Once they get that, explaining anything else is easy, be it loops or recursion/call stack, or "object oriented" programming. Start with theory, and the students will have to put together their own computation models, except these will be very vague and most of the time just plain wrong.

    There is a way to avoid assembly: start with an interpreted language who basic structures are really easy to understand and examine. LISP or Scheme work great, because one doesn't have to go below the level of cons cells to understand what is going on with the data, it must be MIT's first language for that reason.

    On a personal level, I am still angry with my teachers who did nothing to demistify the computer for me. Nothing in the systems programming world cannot be explained to a smart high school student. Period. I was a smart high school kid, and learned some assembly and hardware, but stopped short of really interesting things for lack of available info; after that they taught me "programming" for several years, and although I did write rather long and rather complicated programs then, it was a total waste of time. Only when I had a chance to go back to basics, read real OS code, and understand how a C compiler worked by writing parts of one, only then did my CS education actually pick up.

    Understanding assembly and a few basic things about hardware make all the difference between those who can write drivers and OS level code, and those who cannot. Of course, before such a student can really do it, (s)he must see a lot of good examples and a few high level algorithms/data structures ideas which are really math. But if you start teaching them theory supported by APIs (to make any meaningful programs possible), they will have a hard time breaking this applications programmer conditioning, whereas all really good programmers are a bit of systems programmers -- they have to be in order for their stuff to scale right, react to exceptional conditions etc.

    Finally, if you are thinking of starting with an OO language, please eschew C++ (I know some students who had the misfortune of being taught that as a first langauge!). That's a language one cannot learn to program in until one understands more or less fully what one's C++ compiler does, despite all the theory that might be heaped on.

    My advice is, devise your own simulated architecture and have students write short assembly programs for it. This way when time comes for them to learn loops or recursion, they will understand exactly what's going on behind their shiny new high level language, rather than being left in the fogs and darkness of "theory".

  118. Mod up parent (it mentions K)! by Jayson · · Score: 1

    Are you some old time APLer? How did you stumble up on K. Between you, me, and my ex-roommate I think we are the only ones on Slashdot to have ever mentioned the language.

    1. Re:Mod up parent (it mentions K)! by William+Tanksley · · Score: 2

      Grin. Thanks!

      I'm not an old APLer; I was kind of a language collector, who tried and failed to learn APL because of its keyboard. J was much easier :-). K I still don't know, mainly because of its proprietariness; I'm not willing to put that much effort into any language, no matter how cool (and K is really, really cool) unless I can use it when and where I want to.

      But as you can tell, I recognise and salute useful uniqueness; K has that, in spades. It may be a derivative of APL, but it's the most creative derivative of any language I've seen. (J is a close second.)

      It makes me wish I needed kdb, to give me an excuse to learn the language even though it's proprietary. kdb is an insanely cool killer app. KILLER!!!!!! Astounding. Amazing. And utterly simple, thanks to K.

      But K also has another advantage, which would make it useful in the context of this question: it's capable of being used in a manner like Scheme and other Algol-like languages. This makes teaching it take a LOT less time than J or APL would take, but you can still get to the real useful differences and make them fun.

      -Billy

  119. the Lisp way.... by Kernel+Corndog · · Score: 1

    You might want to check out Paul Graham's site Especially his downloadable book 'On Lisp' The first chapter of that book has thoughts especially about why planning before implementation isn't really suited for building programs like it is for building dams. Instead he recommends planning as you write code. Of course having a language that is best suited for this style of programming is highly recommended :).

    I have to admit that I'm a relative Lisp newbie but the more I study it the more I see why people love it so much...And I yearn to see a Lisp Machine for they were already dead before I knew the power of Lisp.(Wouldn't you like to know why people thought Lisp as OS was superior to Unix?) Paul Graham undoubtedly has a more scholarly explanation of this technique than I can give it credit to in the meager submission..

    So when you are weighing all the suggestions on how to streamline those flowcharts give a good look to the one that says throw the flowcharts out the window and let 'code evolution' take place!

  120. You Should Start with Some Syntax by DrStrange · · Score: 2

    I may be in the minority here but I believe you should start with some syntax before you teach design. Implementing a quality design will require syntax that most courses take weeks to get to, speaking from a C++ standpoint specifically but I believe it holds true for other languages as well. What's the point in showing someone how structures should interact if they don't have the slighest idea on how to transform that into code.

    Basic rule of software: do the right things before you worry about doing the right things well. Learning the syntax is doing the right things, proper design is doing the right things well.

    /me getting off soapbox

    1. Re:You Should Start with Some Syntax by Anonymous Coward · · Score: 0

      the problem is such courses usually waste 9 weeks to teach the santax of C, something that could easily be taught in 2 weeks to the point of acceptability.

      just my 2cp

  121. red lights before gas petals by ironfroggy · · Score: 1

    I prefer learning syntax first. The whole "Hello, World!" program being your first code is nice. You could go about learning all the conceptual stuff first; but, what can you do with it if you can't actually code yet?

  122. people by 10am-bedtime · · Score: 1
    programmers are currently largely of the human variety, so whatever conceptual model you stumble upon in your quest is bound to have artifacts of that background. the usefulness of a human model for humans is natural, but did you ever think, is this model natural for non-humans? when computers try to program, what models do they use to communicate? serial protocols, mostly. imagine a drunk man on a very small planet (a la "little prince") shining a flashlight on and off to other planets, trying to control the heavens (and trying to remember why this is going on in the first place :-).

    but even that is an (obvious) anthropomorphization of the modelling problem done by a human. it may be we never know how computers dream, which is a sad thing.

    best of luck understanding things!

    thi

  123. hacking manuals vs geniune understanding by Anonymous Coward · · Score: 1, Insightful

    These are all hacking manuals! Why is everyone mentioning hacking manuals!

    The Art Of Computer Programming = hacking with elegant algorithms.

    The Pragmatic Programmer = hacking with inelegant algorithms.

    Design Patterns = hacking with no algorithms whatsoever but instead just some sort of vague metaphors.

    A New Kind Of Science = hacking with algorithms that create pretty pictures and thus concluding that you've unified quantum mechanics and general relativity.

    Knuth's book side, these have as much to do with developing a genuine understanding of computer programming as ISBN 0385194269!

  124. How I learned Design by Anonymous Coward · · Score: 0

    I learned design in High School (SIPS, now TASIS) back in 1994, when many OO theories were being developed.

    Before I ever touch a computer (we coded Pascal), I knew the entire implementation for Bubble sorts, early-terminating bbs, linear-insertion, quicksort, and many more.

    After each sort analysis (entirely pen-and-paper) and algorithm layout, as well as a thorough understnading of arrays, we actually coded some.

    After finishing the semester studying algorithm design, we then studied basic object theory by piecing our sorts (which ran each individually) with a driver program.

    So, I heavily favor design.

    I think that the current method of coding, especially in OS, of repetitiously compiling, rewriting, and guinea-pig testing is inefficient and does not lead to quality code. This method is, however, more fun than design.

    Design requires a fundamental understanding of problem-solving, so it is more important to emphasize algorithmic problem-solving than syntax.

  125. Everyone is different by f00zbll · · Score: 5, Insightful
    Perhaps the most important thing about teaching isn't having a well thought out study plan. It's relating to the students and figuring out how they learn. This is where many instructors get it all wrong. Teaching isn't about theory or code, it's about taking a subject and making it approachable.

    Some people prefer to read code. I definitely prefer reading code, because I think backwards and use non traditional techniques to learn programming principles. I prefer to deconstruct a piece of good code and work back to the theory that way. Some people prefer to understand the theory first and think about different approaches to apply it.

    A good teacher is one who is able to adapt the study plan to the strengths and weaknesses of the students. People should stop thinking of teaching as a mechanical process. Teaching is a creative, organic process that changes both the teacher and student. There are many smart and talented people working as teachers, who can't teach worth a dime. There are great teachers who are terrible programmers. Finding some one who is great at both is difficult.

    Perhaps you should be asking, "How do become a good teacher?" As Lao Tzsu taught, if a person wants to be a good teacher, first be a good student. The teacher has to be a student of the student to understand how and why a particular student fails, so that he can adapt the explanation/technique for that individual.

    1. Re:Everyone is different by Tablizer · · Score: 2

      (* Perhaps the most important thing about teaching isn't having a well thought out study plan. It's relating to the students and figuring out how they learn. *)

      I agree!

      People tend to assume that either:

      1. Others *do* think like themselves

      and/or

      2. People *should* think like themselves

      People simply process and digest and "model" information in very different ways. What works for you may not work for others. For example, social people may learn or process information better if they envision processes as a bunch of friendly little elves interacting and cooperating with each other to get a job done.

      Although I tend to be visual, I find that some people just don't relate to diagrams and prefer some sort of written description or dialog of some sorts.

      One size does *not* fit all.

  126. Genu Project: Solid modeling Interface for C++ by Anonymous Coward · · Score: 1, Interesting

    What is Genu?

    Genu is an interface to C++. It brings to the user:

    -Intuitive approach to programmation with the analogy of C++ and tree.

    -Interface for managing complex projects and instant recognition of important part of the program

    http://www.gel.ulaval.ca/~dumais01/genu/

    the 1.00 version is due for June 15th.

  127. 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.

  128. Ensure they know why... by BMazurek · · Score: 3, Insightful
    Your suggestion is clearly different than what most students will be expecting their course to be. (I think it is very interesting and holds promise.) You should be up front about what you are going to do, and why. I think many students will be very frustrated otherwise.

    Show them a couple of very simple constructs (like an if statement and a while loop), then show them the corresponding code in as many languages as you can. Build up in their mind that a computer language is just a tool to solve the problem .

    The language you use to solve problems isn't irrelevent (some languages are better at certain tasks than others), but at this point in their programming career, it largely is.

  129. No partial examples. by jag164 · · Score: 1

    Mentoring is the best bet, but personell is limited when it comes to this respect.

    Learn by example.

    * Full source code to a real problem.
    * Don't leave out any code out or anything assumed.
    * Make sure the project and source compile and work (unlike many books) so the learnee can play.
    * Try to make the reader follow what the hell you are doing.
    * Finally, present the learnee with the explanations why what was done where.

    Giving explanations during the code takes away from the readers thought process. Letting a person play with the code also helps in the learning process. Watch a toddle play and learn and you'll see what I mean. We, as adults, don't (or at least shouldn't) lose that play/learn mechanism

    A side effect, the person will become a better debugger.

  130. Re:I hate niggers by Anonymous Coward · · Score: 0

    Well, I thought that the level of intellect required to work on computers (e.g. 'that of a retarded monkey') would be high enough to avoid replying to stupid trolls. Hmm...

  131. FSA by Anonymous Coward · · Score: 0

    I believe finite state automata is a pretty good point to start. You can model variables, calls, etc... and they are easy to understand
    For a bit more power, use PetriNets and StateCharts.
    For OO, UML is just perfect
    There exist free tools to help you with all those models (xfig, dia, xpns, ...)
    A thing you need not to overlook is to teach recursion, but I don't know any good model for this (recursion trees aren't that useful) so I suggest using a naturally recursive language ala scheme/lisp or something similar with easy to understand examples (factorial, definite integrals, ...)

  132. moving to conceptual programming by Anonymous Coward · · Score: 0

    Imagine writing a simple program without even writing 1 line of code. Your program would be a visual flow diagram with nodes and bits that do work. They would do simple things like take data out of a database and format it before sticking it on a webpage etc... Nothing like making a 3D game or anything.

  133. UML?? One of us is confused by jabber · · Score: 1

    UML 'seems' biased towards OOP?? Are you serious? UML exists solely for the OOP paradigm.

    It sounds to me as though you're trying to fuse a Programming Languages course with a Software Engineering and SE Management course.

    While looking at things from a new perspective may be interesting, the IEEE and ACM people will laugh at you for standing on your head for too long.

    Functional and other non-imperative programming approaches are, for lack of a better term, academic. I'd suggest keeping them out of a mainstream curriculum course, offering them instead as an elective.

    The design process and especially its resultant artifacts are more managerial than scientific in scope, and should also be taught separately.

    The application of development processes and patterns form a relatively cohessive whole as it is. They're orthogonal to the language used and the documentation generated.

    It looks as if you're trying to go vertically through subjects that are more easily addressed linearly. What you propose is fine fodder for consecutive courses, and could even be hit in one term, but these ideas do not belong in one course.

    --

    -- What you do today will cost you a day of your life.
  134. Resolve multiple models simultaneously by firewrought · · Score: 1
    As I see it, programming is less of an attempt to harness some particular conceptual model and more of an attempt to work with multiple inter-related models simultaneously.

    Consider your basic procedural language. For a simple C program that interacts with the user through stdin/stdout, a programmer must consider at least three models or views of the program: the memory model, the textual model, and the user model. The user model is the simplest: the programmer must relate the printf/scanf's in the code with the actual output on the screen. Programmer's frequently employ the user model to observe the program execute through time (ahh, printf's... the poor man's debugger). The textual model is the code itself (e.g., what line are we on? how is this complicated nested expression executing? what does this macro expand to?). With the memory model, the programmer must consider how his/her code is altering the stack and heap.

    Modern languages and processors do a great deal of magic providing us with this nice stack concept, but you generally have to start using it awhile before you understand the value and intent of it. One idea would be to force students to solve problems without using subroutines... just lots of gotos. This would automatically reduce the number of conceptual models from 3 to 2; once the student runs into the limitations of a goto-only program, they may welcome the idea of a stack and understand it intuitively.

    Back to the point: in a single hour, you might go back and forth b/t high-level object models, quickly sketched flowcharts, cute little graphs and charts describing your problem domain, roughed-out pseudocode, a gdb window, a log file, and the code itself, all in attempt to expand, understand, and debug the program.

    None of these views completely captures what the program is doing on all levels. I contend that the programmer shifts between them while exploring the problem and its possible solutions. Now... how to teach the student to do this... hmm. Good question.

    --
    -1, Too Many Layers Of Abstraction
  135. Other conceptually oriented paradigms... by Anonymous Coward · · Score: 0
  136. Re:Pseudocode by os2fan · · Score: 2
    Pseudocode is OK. Especially if it can be made into real code.

    In fact, the concepts of bubble-programming and literate programming are based on pseudocode. All it means, is that you write the calls to the subroutines before the subroutine appears...

    So a program like:

    /*rexx */
    call begin
    call loops
    call endme
    exit

    is a perfect pseudocode, that becomes a valid rexx script when the bits are filled in. It's also a neat block-breaker.

    Often the pseudocode for something becomes with a little debugging, the alpha-code.

    --
    OS/2 - because choice is a terrible thing to waste.
  137. Nassi-Schneiderman flowcharts by Degrees · · Score: 1
    Box-like building blocks of program pieces, there are really only three fundamental pieces: loops, if statements, and other (single) operations.

    It was interesting, designing the program flowchart, and then writing the source code - and then going back and drawing the boxes around printout of the source code, re-creating the flowchart! The idea was that structure of the flowchart matched the structure of the program flow, and that the flowchart really could (with very little syntax tweaking) be the source code.

    I do not understand why we aren't writing programs by dragging and dropping Nassi-Schneiderman blocks into an IDE that then prompts for the parameters of the piece. Put a 3-D visualizer/modeler on the thing and you should have a proveably correct code generator that would make the 20th century seem truly archaic.

    Sigh - oh to be twenty again....

    --
    "The most sensible request of government we make is not, "Do something!" But "Quit it!"
  138. What are we talking about here learning or using ? by Valluvan · · Score: 1

    There are two lines of approach:- 1. learn the language , for which you learn the syntax. 2. learn how to acheive some business function using a language, for which you do analysis, design, yada yada.. Now, if we are talking about 2, you do it in a way that suits your style and inclinations (OO, Procedural. what not). If we are talking about 1, then the best I can do is to shut up and listen to programmatically enlightened souls.

    --

    Science as a way of life.
  139. Conceptual Models - via Examples by GodLived · · Score: 1
    I am intrigued by your endeavor on how to teach programming to [I assume] first year CS students. I believe the concept model is the best way to go, as you suggest, and the list you provide is a good coverage.

    My own personal experience working in various companies and settings, from large scale software house to small R&D group, has taught me that the best programmers are people who can think like the machine. Bar none, that is the best metric of success as a programmer.

    So how does one learn to think like a machine? Experience is the only way.

    I would suggest that you take your list of what you want to teach, and extend each by coming up with a real-world example that can best be represented by the technique you wish to illustrate. For instance, designing a boolean algebra reducer is a good illustration of functional programming - I forget the exact terms, but it has to do with more mathematical programming. A telephone address book is a good introduction to data structures and procedural and object-oriented programming.

    I cannot add to your list, but I can suggest that carefully-chosen examples are the best way to get the point across and your students will identify with them better and remember them long after the semester ends. Remember the first time you implemented a stack? I could quote you code from mine :-)

    Best wishes.

  140. And have someone to mentor you by glrotate · · Score: 1

    It's a tried and true methodology.

    1. Re:And have someone to mentor you by angel'o'sphere · · Score: 2

      It's a tried and true methodology
      NO, it is not!
      It is a tried and true METHOD.

      Methodology is the science of comparing methods.

      And if you do an SA/SD analysis and design you follow the SA/SAD method.

      If you do an RUP or XP process you are following the RUP method and XP method, respectively, and not any methodology.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  141. The Modern Prometheus by apsmith · · Score: 2
    The correct model for software development is obvious:


    Frankenstein, or the Modern Prometheus by Mary Wollstonecraft Shelley (first published 1818).


    Developing software means creating something new, that has never existed before. Something that is often cobbled together out of parts from both the living and the carcases of the recently or not-so-recently deceased. Something that, when we first try to bring it to life, often fails, badly at times. Something that we, acting as gods, mold and shape into an active entity worthy of respect from our peers and customers. The range to which software can be applied is vast, encompassing the entire spectrum of human endeavor. The consequences when we make mistakes can be devastating. Be careful out there, ok?
    --

    Energy: time to change the picture.

  142. get "bitter java" by calarts_nutmeg · · Score: 1

    The best book out there on what you'd call "patterns" is Bitter Java, cause it breaks down the hype around pattern based programming and shows how to use design patterns in the real world. Also there's Oreilly's "Java Patterns" and there's the original small talk based patterns book from '85. I like to program with php so I can forget about patterns, but as my own code got more and more complicated I found its still a useful resource to check out some concepts of design. Bitter Java is good because it takes patterns into the real world, and breaks down some of the myths around them that cause otherwise decent programmers to write slow, crappy code.

    --
    Check my site out for ogg vorbis music produced with linux.
  143. One word... by Anonymous Coward · · Score: 0

    ....Scheme

  144. Don't put the cart before the horse by ogren · · Score: 1

    I understand your desire to teach these conceptual models. I too think that there is too much emphasis on syntax and not enough on good CS theory.

    But if this is an introductory course, you can't just start with teaching concepts like design patterns, OOA/D, and relational theory.

    First you have to start with basic computing theory: the difference between primary and secondary storage and the difference between machine code, assembly code, byte code, and higher level language code. Then you have to teach the basic concepts of programming: iteration, conditionals, functions, objects, pointers, and references. And the best way to do that is by example, which requires you to teach the basic syntax of a language.

    Only after students have a firm mastery of the basic tools can you start to introduce the concepts of good architecture. Without the knowledge of a language to practice their skills with, it would be hard to really grasp the meaning of the theoretical knowledge.

    Frankly, if your introductory courses are like my introductory courses were, there are a lot of CS students that still need to be weeded out. There will be some students that can never really understand a pointer, and just want to survive one semester before they change majors. (There may also be some students there because intro to computers is required).

    Bottom line: as much as I agree that we need to spend more time on fundamental CS theory, we can't expect to teach the kinds of topics you are talking about to first year undergrads.

  145. Two good books by magic · · Score: 2

    How to Design Programs (Rice) and Structure and Interpretation of Computer Programs (MIT) are two classic texts that ignore syntax and dive straight for concepts.

    -m

  146. No one has done this yet. by ilmarin · · Score: 1

    Software engineering is a subset of sytems engineering. I think that one of the problems with software engineering culture is that there is not a neutral approach to modeling in general. Almost all the noise is about specific types of modeling, presented with an almost religious fervor, especially object. Most people use the term "object" without much understanding; I've had several senior chief engineers tell me there is only object or procedural.

    If you want to address modeling in general you should probably lift up a domain and look into systems engineering and cybernetics. General graph theory is the place to start; basically you can "conceptually" model any way you can graph. From graph theory you can go one way into the "Structured Modeling" discipline, and the other way into standard SW treatments: structured analysis, dataflow, CRC, UML, to see how models are used. But the real question is, how are models mis-used? That is, has does a prejudice for a specific modeling method hamper the design?

    The most important thing for an engineer is practicality. One has to blow through all of the convention and marketing to arrive at a solution with the greatest overall payback, on schedule and on budget. The only way a teacher can help develop this is by building an appreciation for essential principles over fads and heavily marketed conventions. Fads and marketing, however, are what has built careers in SW methodology. There has been no incentive to be a loud generalist, so you will not find any general materials yet.

    I think you're going to have to put it together yourself...

  147. That technique doesn't work in other topics by shess · · Score: 1

    You teach people spelling and grammar, _then_ you teach them to write stories.

    You teach people calculus, _then_ you teach them physics.

    You teach people algebra _then_ you teach them calculus.

    Well, I'm running out of examples, here. My last year of college I had a younger student ask me "But, what's the point of a tree?" There's really no point to teaching the abstract stuff _first_. Programming a computer is an unnatural act, people generally simply have no conceptual framework to slot the abstractions into!

  148. design patterns? by Anonymous Coward · · Score: 0

    have a look at this one:

    Design Patterns,
    Erich Gamma [et al.],
    Addison Wesley 1995,
    ISBN 0-201-63361-2

    I guess its one level beneath conceptual patterns - its about OO-classes and their relationships - you might want to take it as a "lower boundary" of your issue.

  149. Thinking like a Unix Programmer by marhar · · Score: 2

    You can't beat "The Unix Programming Environment" by Kernighan and Pike. It was a great book when it was released in 1984 and it's great now. Same for Software Tools by Kernighan and Plaugher, from 1976.

  150. Amen to that ... by Evil+Pete · · Score: 3, Interesting

    He he he. Yeah I've been guilty of that too after I first came across patterns. But not for long having once had to wade through layers of inheritance. I still love patterns but Pattern Paralysis is a real danger for new projects these days. It can be a real liability if a System Architect decides to go down the path of aggressive application of patterns. Trouble is , so much of the abstraction is totally unnecessary , programmers being so smart that they practically obfuscate the code with "good" design.

    --
    Bitter and proud of it.
    1. Re:Amen to that ... by ahde · · Score: 2

      Open source mostly obsoletes these methodologies. The idea behind them is to hide your code, which is fine for APIs, but especially in scripting languages (except perl) -- it's quicker and more concise to do your configuration in the code. Even with a C program, with the source (and a good makefile), its eaiser to grep (or sed!) for a string you want to replace, and then recompile, than to figure out how to set the right config to the right abstract interface.

  151. Who needs to look? by alienmole · · Score: 3, Funny
    LEARN TO TYPE DAMMIT
    Who needs to look at the screen? :-)
    Look at the keyboard, you must not, hmmm?
    Look at the screen, you must not.
    Shut your eyes, you must.
    Guide your fingers, the Force will.
    Great coder, you will be, yesss.
    1. Re:Who needs to look? by doc+modulo · · Score: 1

      Haha, this would make a great geek LAN contest.

      Who can type a hello world program the fastest. WITH A BLINDFOLD ON :)

      Or give them a really simple assignment and see who can write the program with a blindfold and have it compile and run in 1 try.

      --
      - -- Truth addict for life.
  152. A couple of good books by The_Lightman · · Score: 1

    Hrm, seems to me that you're looking forward to a "mix" of programming and software engineering. Anyway, there are a couple of books you should take a look at :

    "Software Engineering" 6th ed. - Ian Sommerville
    Addison-Wesley, 2001

    "Introduction to Automata Theory, Languages, and Computation" 2nd ed. - John Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
    Addison-Wesley, 2001

    They're both really good.
    The second one is used at Stanford for CS154 (Automata and Language Theory).
    The first one even has a web page (http://www.software-engin.com/) with source code for most of the examples, additional material, and even slides (in pdf and ppt) for each chapter that you can use as a teaching aid.

    Hope you find these interesting.

  153. My favorite references by fizzychicken · · Score: 1
    You could do a lot worse than take a look at these books:
    • Algorithms - Robert Sedgewick
    • Code Complete - Microsoft
    • Effective C++ - Scott Myers
    • Game Programming Gems - Deloura
    • Design Patterns - Gamma et al.
    • Large Scale C++ Design - Lakos
    Each of these books has served me well during my programming career. If I had to recommend two all-purpose programming must-have's from the list they would be 'Algorithms' by Sedgewick and 'Code Complete'. Algorithms shows you how to program, not how to learn APIs and syntax - it's a true gem. And Code Complete goes through a wealth of knowledge about how to get the job done effectuvely, quickly, and with few bugs - it's very good.

    --
    'Those who will not reason, are bigots, those who cannot are fools, and those who dare not, are slaves.' - George Gordon
  154. How To Design Programs (HTDP) by alienmole · · Score: 2

    SICP is fantastic, but tough going for many. Here's one that's being used even at the high school level, with some success: How To Design Programs (HTDP).

  155. Perl Version by crucini · · Score: 2
    This:
    print "$_\n" for 0..10;
    print "Done\n";

    or this:
    print join "\n", 0..10, "Done", '';

    Couldn't resist.
  156. Re:Structure and Interpretation of Computer Progra by Anonymous Coward · · Score: 0

    Having been an unsociable Apple-II, TRS-80,
    Z80, 6502 programmer from ages 11 to 17 and then
    having run off to MIT and taken 6.001,
    I will comment that:

    SICP is phenomenal. It opened my eyes to notions
    of progamming, computation, encapsulation, abstraction, and design, that made me feel silly
    for having thought that I previously knew something about software.

    I don't know if the material was precisely hard
    to absorb. I got an A, so the other 75% of the class might disagree. I will say that as much as I was able to absorb it, there was even more to
    think about afterward. That course has colored the rest of my programming life.

    That coloration wasn't 100% good. Design
    needs to be tied to functionality. SICP
    purposely and wrongly ignores real world efficiency. SICP brings up register machines
    only at the end and then from a wrong and unrealistic direction. The focus was how in
    a Turing-machine sense the register machine could
    be gotten to do everything we'd been doing so
    far. There was almost no focus on how many
    register machine steps it took to accomplish
    even the simplest thing we'd been doing.

    The advanced among us actually did compile and
    run the register machine simulator using the Scheme compiler for the register machine simulator built in Scheme, but we mostly failed to let the resulting speed inform us
    that there was more to programming than
    the holy grail of the knights of the lambda calculus.

    It took me many years to realize that the right
    design wasn't just about the right abstractions and encapsulations, but was also about letting things lie close to the machine at the right points. One needs to abstract and control complexity, but one also needs to lay things
    out in a way that the abstractions don't unnecessarily move things around to eat all CPU and make unneccesary copies to eat all memory.

    There's a sense in which functional programming
    and Scheme/Lisp encourage getting away from the machine, and in which C/Assembler encourage not getting away, and it's really hard to argue which paradigm have had more commercial success.

  157. Then there is lisp by Anonymous Coward · · Score: 0

    http://www-2.cs.cmu.edu/~dst/LispBook/

    And

    http://mitpress.mit.edu/sicp/full-text/book/book .h tml

    for starters.

  158. Software architecture patterns by KarmaCowboy · · Score: 1

    I guess at a higher level abstraction software architecture is what you refer to as 'structure' of programs. Software architecture can be worked out at different abstraction levels, from corporate wide architecture, to architecture bwteeen applications and within an application, where we sometimes call this design patterns. If you need info in this regard I canrecomment the book "design patterns" by Game, Helms, Johnson & Vlissides which is on a code level Also Martin Fowler has done some stuff on patterns in information systems check http://martinfowler.com

  159. Intro to Computer Science? FCM by Anonymous Coward · · Score: 0

    Funny, when I took introductory CS *ahem* years ago, they taught with Pascal and had time to teach actual CS concepts: design, analysis, algorithms, time complexity, data structures, etc. Much more recent courses have Java as the language in the intro courses and leave more than an inadequate skimming of design, analysis, algorithms, time complexity and data structures to other courses which may or may not treat them as main topics. Oh, but you do learn a nice modern language like Java! You may be able to bang out code, but I don't put any stock in your ability to design and oversee the implementation of a major project. Save yourself 4 years, dear readers, go to DeVry, you'll get just as much (unless you can afford an Ivy).

  160. In my CS curriculum by Kymermosst · · Score: 2

    at Lane Community College, we started off Computer Science doing UML modelling and use-case diagrams, among other things.

    When I am really programming, I write code, not use-case diagrams or class models.
    The book we base most of our OO design on is Satzinger and Orvik's "The Object Oriented Approach."

    --
    "Alcohol, Tobacco, Firearms, and Explosives" should be a convenience store, not a government agency.
    1. Re:In my CS curriculum by asincero · · Score: 1

      > When I am really programming, I write code

      This much is obvious, since "to program" means "to write code".

      > not use-case diagrams or class models

      Again, this is obvious because you don't use use-case diagrams or class models when you code. You use them when you design. Design should come before you even write one line of code.

    2. Re:In my CS curriculum by mikera · · Score: 2

      On the contrary, it sometimes makes sense to code before you design.

      I rather like the XP approach of designing only when you need to, and refactoring when you come across something you need to change. In my experience this is far more productive than lengthy design processes.

      The knowledge that you will have to refactor tends to push you towards writing very clean and modular code from the outset, so design changes are usually very simple to implement.

      Often the thorniest design decisions you will have to make only become apparent when you have a functioning prototype system and really start to understand the key implementation issues. There's nothing like a bunch of automated tests (another key XP practice) to help you here.

      Yeah, sometimes you might have to tear up a whole subsystem and start again, but even then you will have learned more than you ever could have through a paper exercise. You've also probably spent less time doing this than you would have done on a single upfront design phase.

  161. Re:mod parent up (link to full text of SICP online by cygnusx · · Score: 1

    > my god that background is ugly

    Add bookmarklets like these to your bookmarks, and relax the next time someone forces a bad background on you.

    javascript:void(document.body.background='')
    java script:void(document.bgColor='#AAAAAA')

  162. Hopcraft and Ullman by Jayson · · Score: 1

    That book is not an introductory text. It is a second of third year text and even then it can be difficult for many to understand. Sipser can probably be taught in the second of third year with more effectiveness.

  163. UML? by angel'o'sphere · · Score: 2

    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."
    The UML covers about 9 different diagrams and approaches to model with them. "Object" or "Class" diagrams are ony *1* of those *9*.
    Probably you should dig a bit into them before judging :-)

    BTW: all but the class diagrams are well known digrams used in older methods of software design/specification, like e.g. state charts, flowcharts and message interactions(sequence charts).

    The choice about using a "knowledge base" and/or "functional approaches" are beyond the conceptional phase. They have to be adressed before you start object or procedural modelling. Its an architectural descission (see e.g. Architecture Patterns, Buchmann et al., Addision Wessley) wether to use a knowledge base or a functional approach. The complete model looks absolutely different if you choose this or that architecture. And the modelling thechnices are also quite different.

    Regards,
    angel'o'sphere

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  164. Top-Down or Design wanted by SEWilco · · Score: 2
    "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."

    It sounds like you want to start with Top-Down Programming or Analysis or Design. The other things you describe are used in a programming language class. A programming class would indeed start with the abstract methods and move to more detailed methods. A programming language might be learned for the examples and homework, but the language is taught as being just one of many tools to implement the design.

  165. Old but good one by Per+Wigren · · Score: 2

    To learn about recursion you first have to learn about recursion.

    --
    My other account has a 3-digit UID.
  166. Unfolding cube by Anonymous Coward · · Score: 0

    Interestingly, I can best visualise the unfolding cube when said cube is spinning.
    I wonder if this means anything? :P

    1. Re:Unfolding cube by Anonymous Coward · · Score: 0

      > I wonder if this means anything?

      It means you're an idiot. Next question.

    2. Re:Unfolding cube by spiderspit · · Score: 1

      i find it easier to imagine a spinning and unfolding cube with me floating inside the cube. i wonder if THAT means anything... apart from the fact that i am stoned immaculate... :S

      --
      Forgive him, for he believes that the customs of his tribe are the laws of nature! -- G.B. Shaw
  167. Black and white by Anonymous+Brave+Guy · · Score: 2
    Here's a good test: ask them "What is a trie, and where and why would use use it instead of another algorithm?". If they can't answer, then they are not a software engineer.

    I've been a professional software developer for several years, and I have a formal background in CS at university level including several DS&A courses. Over the past couple of years, I've designed and implemented some fundamental modules on a big development project, and several people who've worked with them since have commented on how well the designs have worked out and how easy it is to adjust them later. I keep my knowledge current, reading several well-reviewed books on both CS theory and code hacking every year. Oh, yes, my business card does indeed say "Software Engineer" on it, and I think I've earned that title.

    But I've never heard of an algorithm called a "trie".

    These things are never black and white, and no single test like that can ever be fair.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:Black and white by Xpilot · · Score: 2

      A "trie" is not an algorithm, it's a data structure. It is a form of radix search tree that stores search keys in the external nodes of a tree. It was called "trie" because it's useful for re-trie-val :)

      --
      "Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it." -- Linus Torvalds
    2. Re:Black and white by Anonymous+Brave+Guy · · Score: 2
      A "trie" is not an algorithm, it's a data structure.

      Thanks for the reply. I've come across the term "trie" in that context, but the post to which I replied seemed to imply that there was an algorithm by that name. If that was a mistake, then my point about being wary of such simple tests is well made, I think. :-)

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  168. SICP - Abelson Sussman textbook by merigold77 · · Score: 1

    Exactly - when I read this "ask slashdot" question, I thought instantly, isn't that what I had when I took intro to programming in college? Yes, it was, hardly any textbook ever made the impression that "SICP" has made on me. Several folks have said it is hard going, maybe for some, for me it was like a light going on in my head - OH! I thought, Computer programming really is interesting and deep after all. Not something I'd thought after high school BASIC class.

    I was lucky though, in many ways. Hal Abelson came to my college (Brandeis) to teach it once a week (with our own computer science professors filling in on the other sessions of the week), so probably my experience was more on target than those who didn't have the good fortune to have one of the authors teaching the class. It was an exciting, fun, mind expanding class - the kind of thing I went to college for in the first place (cause I wasn't much of a drinker ;)

    It did cover prolog style programming, and object oriented programming, as well as lambda calculus, and stream-based programming. Admittedly, the only one it teaches deeply is the lambda calculus; the others are covered more cursorily and need their own courses to deepen them. (I "understood" object oriented programming after that course and the lunar lander program, but I didn't *understand* object oriented programming till I'd been programming in Smalltalk for several months)

    Anyway - there may well be other books that achieve this goal, because it's been years & years, but that one sure did.

    --
    Writing is the only socially acceptable form of schizophrenia. (E. L. Doctorow)
  169. Programming Linguistics by akypoon · · Score: 1

    An old book by David Gelernter and Suresh Jagannathan. I found this book is quite unique because Gelernter sees programs from a structural engineering perspective rather than mathematical view.

  170. Experience is the only way by Anonymous Coward · · Score: 0

    Think back to the first programs you ever tried to write. Now think how easy those same programs would be for you now.

    I remember looking at a (BASIC) program to create sprites on a TI99/4A when I was first starting out. The heart of the program was a routine that essentially converted a binary string into a hexadecimal string. I remember looking at that for awhile, and finally understanding how the damn thing worked. What I remember most however, was that although I could see how it worked, I could not imagine being able to have thought it up on my own.

    Now, of course, such a thing would be a trivial matter of a few minutes work, (in C anyway, I've forgotten BASIC :-)

    My point is that when you're first beginning to program, there are a thousand sort of "stock answers" to "stock questions" that you don't know anything about. Even the trivial things are not so easy, and the only way to learn these things is to practice them, in a way not so different from practicing a musical instrument, or being good at say, doing inverse La Place transforms manually. Learn to program by programming. Practice helps more than anything else.

  171. Balance between concepts and practice by wrp103 · · Score: 1

    I've been teaching a class like this for several years, and haven't found a book I really like. (Well, I did once, used it for one semester, and then it went out of print. :-( I agree with your comment that intro text books tend to deal too much with syntax, and not explain how to use the syntax they learned.

    What I have found, however, is it takes a good balance between concepts and practice. Particularly when dealing with people with no programming background, too much theory is just as bad as too much practice.

    Another interesting thing I have found is that the class is divided into two groups: those that can learn C easily and finds VB confusing, and those can learn Visual Basic, but can't get C. As a result, I let the students pick whatever language they want to learn with, and show examples in both languages.

    What I usually do is discuss some structured programming concept and discuss it abstractly (e.g., if-then-else, while-do, etc.) I then give some generic examples using pseudo-code to show how such a construct would be used. I then show example programs in both C and VB.

    Once they have learned that construct, we work on several programs to demonstrate how you can use this new concept to solve problems. I have a "getinfo" program (prompt the user for info, and then display it) that is written over the length of the semester. Each time we learn a new concept, we see how it can be used to improve the "getinfo" program. This helps them see how all these new ideas fit into the big picture.

    Early in the semester, I give them time during class to try to write simple programs. If they don't get help with their first few programs, they probably won't be able to get very far. As the semester progresses, it is up to them to practice writing programs.

    I encourage them to write one program with a group. By working together, they can usually avoid spinning their wheels because somebody in the group comes up with an answer.

    In lieu of a text book, I have lots of sample programs that they can download from my web site.

  172. Re:It's not so simple, after all by rpg25 · · Score: 1

    I don't agree --- sequential, conditional and looping are the easy things. Teach them the hard stuff first, like recursion. The easy stuff can wait.

    That's also the stuff that most of the foundation of computer science is built on, and which you need to know to be a good computer scientist.

    I speak from hard experience, having tried to teach Theory of Computation to a class of college seniors who had never mastered recursion. Very ugly.

    If you can get away with it, look at Abelson and Sussman's Structure and Interpretation of Computer Programs. Still the classic for concepts of programs and programming.

  173. Have a look at executable UML by hkuiper · · Score: 1

    At Project Technology (http://www.projtech.com) they are working at conceptual modelling of software systems for over 12 years. The methodology has been developed by Sally Shlaer and Steve Mellor (of Ward/Mellor fame) and is very mature now.

    They focus on building complete and executable models of software systems that can be run and tested on a simulator. In the final step the models are translated by a model-compiler into the target language of choice (C/C++, FORTRAN, whatever). No hand-coding required!

    The latest version of their methodology uses a subset of UML hence it was renamed executable and translatable UML (XTUML). It is supported by a comprehensive set of tools

    I think the software modelling concepts they developed are quite close to what you are looking for.

  174. My Response by johnnyb · · Score: 2

    Several Scheme ones take this approach. Scheme and the Art of
    Programming
    is excellent, and for more advanced students, Structure and
    Interpretation
    of Computer Programs.

    If you want your students to learn more about how the computer
    works, you
    might try reading the book I'm in the middle of writing,
    Programming from
    the Ground Up. The current draft is available online at
    http://www.eskimo.com/~johnnyb/computers/Progr ammi ngGroundUp/

  175. Re:Old timer comment...admission of guilt by johnlcallaway · · Score: 1

    I do use 'i' a lot for very short loops. Knowing the rules and the impact of breaking them is perhaps the best knowledge of all.

    --
    I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
  176. Conceptual programming by frangryphon · · Score: 1

    Another old-timer viewpoint here. (I learned to program on a PDP 11/40 with VT-52 terminals. We were excited when we got VT-100s.) I had classes in programming that just went over what you mentioned, starting with syntax. But one of my classes was on computer systems analysis. We used a book by Shelly and Cashman. I think the book was Business Systems Analysis and Design but I am not certain of the title. That class taught me more about programming than the programming classes did. It focused on concepts. The first one being: "What do you want to get from this program? Why are you doing this? What are you trying to accomplish?" Then we looked at what our inputs needed to be to get the outcome we wanted. "Is all the necessary input available? Do we need to gather more data? Is there too much data and do we need to narrow our scope? Is the data in a form we can use or do we need to manipulate it?" After the output was determined and the inputs examined, then we could select the language and sometimes even the platform to write our program in. After each of us got a clear picture of output, input, and platform, we all used our individual preferences to plan our programs before starting to write them. I favored flowcharting, but we were free to use any planning method we wanted to, we just had to plan before we wrote. We were also reminded that there was no guarantee that we would be the person who would be maintaining this code in the future, so as we wrote our code, we had to keep it easy to read and put in copious comments. I hope this helps. It has helped me for many, many years.

  177. Depends on your goals by Anonymous Coward · · Score: 0

    If you wish to create computer programmers, teach them object models of programs in imperative languages. If you wish to create computer scientists, teach them math and functional languages.

  178. What a Conceptual Model Isn't... by JohnDenver · · Score: 2

    First and foremost, you're confusing a Conceptual Model with advanced abstract theories and design methodologies. Secondly, A Conceptual Model doesn't aim to substitute practice and prerequisite knowledge; a Conceptual Model aims to make concepts more familiar.

    What we're talking are notations and analogies to explain basic algorithm design and assembly by capitalizing on what people already know about algorithms. Many people already know how to solve some pretty advanced problems with multiple steps using tools they're familiar with. A good Conceptual Model tries to apply a person's existing problem solving skills to a new paradigm where the tools are unfamiliar and the vernacular is cryptic.

    While I can understand the benefit of learning lessons the hard way (you boot and blister analogy), some lessons are learned the hard way needlessly. Let's pick our lessons wisely, especially if a conceptual model could save someone 2 semesters of needless deciphering.

    --
    "Communism is like having one [local] phone company " - Lenny Bruce
  179. Re:Structure And Interpretation of Computer Langua by William+Tanksley · · Score: 2

    I think the authors of SICP realized there were other models out there,

    I agree -- they did a brilliant job. There's no way they could have noticed and documented so clearly so many of the problems with lambda notation if they hadn't known the other ways of looking at things. Nonetheless, they didn't choose to document those other models, and a wise teacher doing what he's asking for will want to document.

    and I think they might disagree with the statement that lambda calculus have almost nothing to do with how computers work.

    Then they'd be utterly ignorant. They probably never read the part of SICP which discusses the problems with various models of lambda computation ;-). See below.

    Sussman was a co-author on several papers, the titles of which approximated: "Lambda: The ultimate goto instruction." I think Sussman and Abelson know a lot more about cs than you give them credit for.

    What you say here tends to discredit them, if it were true. I happen to know that they're smarter than that -- they DO know that lambda isn't a good model for computation, and they spend quite a bit of space in SICP teaching that.

    Lambda isn't anything close to the ultimate goto. Continuations are. Shudder. But no matter.

    Why isn't lambda a good computational model? Quite simply, because computers don't work merely by applying parameters to functions. They work by assigning values to locations. The reality of computing is almost entirely non-functional (in the sense that it's impossible to write a truly "pure" function, one with no variable modifications). Lambda notation has led inevitably to the false idea that the only way to write analysable programs is to avoid state modification; thus, a false dichotomy between OO and functional programming.

    Calling a function isn't _really_ the same thing as passing it parameters, although C and Lisp make it look that way. Calling a function is actually pushing the current continuation on the return stack and jumping to the address of the new function. Passing a parameter is an entirely separate action.

    The only languages I know which actually model that correctly are Forth, Postscript, and Joy. Thus, a Forth program can be both functional _and_ OO; it can be both functional and imperative. The only thing it can't be is both declarative and imperative (except in the silly sense of declaring a sequence of actions, naturally).

    There's much more on this at the Joy page, whose URL I can't remember but which is linked from the Summary at the Concatenative Languages eGroup.

    -Billy

  180. O^O by oliverthered · · Score: 1

    Here's a concept i've been working on, (for about 4 years!)
    it's sort of OOO programming.
    The basic theroy goes somthing like this.
    1:
    Imagine what it would be like instelled libjpeg on you machine, and all applications that could save graphics could instantly use libjpeg.
    2: Now that you managed that,
    Imagine that your computer stores stats/hiristics on your usage, and if you never save from one application using libjpeg than it no longer presents it to you.

    3: now extend the concept to any component and use the stats/hiristics to generate a nural net.

    4: stringing it all together,
    The input's and outputs of the components can be represented by 'data types' stored in a dictionary, each object presents this meta information to the system. So if you have a text document, a component that can convert text to Post sctipt,a compoenet that can rasterise the post script, you can then save the rasterised version using your just installed libjpeg.

    5: Extensibility and configuration.
    All systems components (including the nural net processors etc...) are 'components', so can be swaped out for differnt tasks or improved components.
    The meta-data contains enough information that the system can find new version releases.
    System stats are stored, and can be used to rate components, e.g. 'The machine on 10.191.1.51 says that it's users prefer this compoenet to do the job, and it's better quiality and faster, do you wan't to give it a go?'
    This also provides a mechinism for the system to search for new components, process tasks on the network(load ballencing), thread tasks. etc...

    Systems components can be as small as an number stored in memory and as large and an office suite.

    Expect the first beta in about 5 years time... and enjoy.

    --
    thank God the internet isn't a human right.
  181. Where's sys.helloworld? by oliverthered · · Score: 2, Funny

    Your point seems to be that, every one writes a hello world, so why the hell isn't there a class library for it in java!

    --
    thank God the internet isn't a human right.
  182. Language Matters by Kettleboy · · Score: 1

    It seems to me that the language used to write a program should, in large part, determine the program model. For example, the programming model I used when writing mainframe programs in COBOL and IDEAL would be useless for the programs I now write in JAVA. Converse is also true.

    While there are some aspects of a program that will be true regardless of the language, such as database reads, and user displays, how these things are implemented are langage dependant. Tell a COBOL programmer use a different class for all database access and you will get a dumb look. Tell a JAVA programer to use 1 class for each program and she give up programming.

    Other posters have talked about how over-modeling can create confusion. But under-modeling can do the same. The amount of modeling needed by a program is language dependant.

    I think this is why language syntax is taught before program models. A model for a specific program needs a context, the langage syntax provides that context.

    --
    Enjoy your life, it's the only one you've got!
  183. UML and the Unified Method by CyberLife · · Score: 1
    These are the tools I use the most. While UML is not that difficult, getting managers to use the Unified Method is like pulling teeth. First of all, you have to clue them into the fact that UML and the Unified Method are NOT THE SAME THING. Second, an iterative approach to development always looks more costly at the outset. Fortunately, many development teams already use an iterative method without even realizing it.

    There's more than one way to get a job done, however. Never lock yourself into a single way of doing things. Use the Unified Method as a guide for developing your own procedures (which it how it was intended anyway).

  184. narrow the gap while coding by stefaanh · · Score: 1

    I recently read a weblog from a young yet experienced programmer. He clearly states that programs should be written with easy readable statements.
    Because the code should be the documentation, and will become the facts, surviving any design tool, paper or specification that led to it.

    I agree completely with him. Sometimes programming compares to the art of writing, or even philosphy.

    Well documented and readable code also covers the DRY (Don't Repeat Yourself) principle. That does not mean that the concept shouldn't be created or documented. It means that the code digs in far greater detail to what are the exact businessrules. Therefor it is imperative that the syntax of the language helps to the readability.
    Closing the gap between the problem space and the solution space as much as possible, is the real achievement. Writing readable code is a great way to do just that.

    --
    --------
    * Sigh *
  185. Re:It's not so simple, after all by cscx · · Score: 2

    I disagree. I think structure should come before things like, say, pointers.

  186. Re:Structure And Interpretation of Computer Langua by lostguy · · Score: 1

    The article poster should do some research into the newish computational calculi, which were designed to express these very ideas. Object calculus and relational calculus would be good places to start to get a semantic foundation.

    Google will show you the way.

  187. Re:It's not so simple, after all by rpg25 · · Score: 1

    Huh? Pointers?

    I didn't say anything about pointers. In fact, I'd favor leaving out that stuff for a while. Part of the reason I think that C-style languages are a poor choice for a first programming course.

    In general, I'm a fan of introductory approaches that maintain abstraction (e.g., the SICP-style discussion in Scheme of how to do objects) and dislike things that introduce contingent facts about mapping onto hardware (e.g., procedural languages, where the first thing you have to learn is some rudimentary I/O, which is almost always a rat's nest of special cases, complexity and kludges).

    For starters, I favor languages where you don't even see pointers!