Slashdot Mirror


Who's Afraid Of C++?

The reason computers -- never mind programming -- are so obscure to most people is a learning curve which appears dangerously steep stands between the ordinary user (who knows how to use a mouse, and which button turns on the monitor) and writing even "Hello, World." Prolific reviewer chromatic reviews here Who's Afraid of C++?, a book intended to flatten that curve.

Who's Afraid of C++? author Steve Heller pages 486 publisher AP Professional rating 8 reviewer chromatic ISBN 0-12-339-97-4 summary In his unique approach, Steve Heller presents programming concepts and information as a conversation between teacher and student.

The Scoop Breaking with traditional lecture-on-paper format, Heller demystifies computers, programming, and C++ for absolute beginners. That's right -- he recruited a full-fledged novice user, capable of little more than e-mail and word processing, and turned her into a decent programmer while reviewing this book. (She became Mrs. Heller shortly after that.) Any computer owner with time, the ability to follow directions, and the willingness to learn could also become a programmer.

The resulting text is more of a collaboration, or a commentary. Steve, the author, presents his information and then Susan, the novice, interrupts to ask questions. The big gamble is that her questions are the same that the average reader would ask. It largely pays off, only occasionally belaboring a point. (To be fair, it could also be called 'reinforcing a point.')

What's to Like? Heller's writing is informal, but precise. Some might find it chatty, but beginners will find it more comforting than raw technical prose. His flow of topics makes sense (and does not copy the "Chapter two is everything to know about types, and chapter three is all about flow control" scheme other introductory teaching books steal from K&R). Little prior knowledge is necessary. Before actually programming, the book explores raw hardware, answering such questions as "What happens when you execute a program?", "What's a register and why is cache important?", and "How does source code turn into a running program?"

Chapters tend to explain only one issue in detail -- how to use functions, for example, or the basics of a class. Heller states his objectives up front, and sticks closely to them. Each chapter has two sets of exercises, one in the middle and the other at the end. Answers follow, along with more dialogue. It's not enough simply having one correct bit of code, without someone to explain why it is correct, and why some common answers aren't complete. This decision pays off.

Though discussing weighty technical matters, there's a sense of general friendliness. With well-chosen metaphors (datatypes are kinda like odometers), occasionally goofy examples (a pumpkin-weighing-contest control program), and plenty of conversations when things get heavy, C++ isn't so scary after all. Credit Susan for much of this. If you find yourself thinking along the same lines as you study, you'll make it.

What's to Consider? The book covers about half of a reasonably paced introductory Computer Science course. It also predates the ANSI standard and the STL, though a fair treatment of the latter would easily double the size. Readers who finish the book and the exercises will be fully capable of producing their own useful programs, but will need additional information on common libraries, algorithms, and more object-oriented programming. They'll also have avoided some of the traps awaiting the unwary novice, as Heller practices a fairly tight methodology.

More technical readers already familiar with programming and at least one C-based language might find the pace slow and the extra explanations unnecessary. Heller's target audience is definitely the neophyte, not the experienced developer. The latter might question the subject matter covered. Why build a vector class instead of using C-style arrays? Why not C-style strings? I suspect the author is more concerned with helping his students avoid the kind of pitfalls C++ was designed to work around. It may not be the traditional approach, but it's valid and it will produce decent programmers, who can learn C++ on its own merits.

The Summary Steve Heller's pulled off quite a feat -- producing a book that assumes very little, yet produces people who understand programming. There's not as much information presented as in a "Learn the Language in X days/weeks/hours" book, but it's more accessible and better geared to a true beginner. For a gentle and effective introduction to programming and C++, give this book a try.

The CD-ROM contains complete source code of all program listings, as well as the excellent DJGPP compiler (yes, it's for DOS).

Read this book online at www.steveheller.com or purchase it at Fatbrain.

Table of Contents
  1. Prologue
  2. Hardware Fundamentals
  3. Basics of Programming
  4. More Basics
  5. Functional Literacy
  6. Taking Inventory
  7. Stringing Along
  8. Down the Garden Path
  1. Tying Up Loose Ends

413 comments

  1. C++ as a teaching language/programming obscure? by gavinhall · · Score: 1
    Posted by 11223:

    First of all, the main reason people are afraid of computers is that they don't know how they think. If everybody had a basic discrete math class and an introduction to concepts of computing, C++ would be a lot less unfriendly.

    Personally, I think C++ is a bad teaching language because computers don't think in objects. They think in memory locations and in blocks of code - exactly like C, nothing like C++. What people need to learn to do programming is how a computer thinks - and C++ ain't gonna do that, buddy. I think the best introduction to programming I've ever seen is an O'Reilly book called "Practical C Programming" (the Cow book).

    1. Re:C++ as a teaching language/programming obscure? by arnald · · Score: 1

      I think the idea is that one shouldn't HAVE to learn `how the computer thinks'. One should be able to program in the `problem domain' rather than the `solution domain', and object-orientated languages such as C++ are a step towards being able to do that.

      And don't call me `buddy'.

      --
      arnald
    2. Re:C++ as a teaching language/programming obscure? by gavinhall · · Score: 1
      Posted by 11223:

      Sorry. Figure of speech.

      For problem-domain problems, one can use a problem-domain language like Labview or Visual Basic. If you want to know how to program the computer, you learn to think like the computer. Nobody seems to get how to think like the computer - they view them as unpredictable or intellegent. C++ doesn't help, by presenting a false image of the computer. (Whaddya mean, computers don't think in objects? I make objects all of the time, says the C++ programmer)

    3. Re:C++ as a teaching language/programming obscure? by oingoboingo · · Score: 1

      They think in memory locations and in blocks of code - exactly like C, nothing like C++

      ...until they go to code their first large, collaboratively developed user application and realise that a whole bunch of low-level memory access features might be great for writing a device driver, but sorta kinda aren't terribly useful now.

      and since i'm going to be roasted to a crisp anyway...

      troll mode
      as an IT professional in a fortune 500 company, i have found through user feedback surveys and rigorous reading of ZDNet reviews that Microsoft' s Visual Basic is the ideal language for complex, cross-platform InternetEnabled application development.


      thank you.

    4. Re:C++ as a teaching language/programming obscure? by gavinhall · · Score: 1

      Posted by 11223:

      Tell me that when your program is leaking memory like a dog because you weren't paying attention to low-level memory access. I don't mean low-low-level, but what's wrong with keeping track of your malloc's and free's? If everybody knew C well, there'd be a lot more good programs. C++ leads to bloat and to doing things the wrong way because it's the easy way. An algorithm that a C++ programmer can write that takes 5 minutes, I can do it in 4 - simply because I'm writing closer to assembly. You want bad programmers or good programmers, or just people interested in the solution (and not how it got done)? VB is a perfect problem-domain solution (see above). C is a perfect language to program in. This book was supposed to teach programming - except it teaches problem-domain problem solving. (Yes, I've seen the book. No, I haven't read it in depth.)

    5. Re:C++ as a teaching language/programming obscure? by keffy · · Score: 3
      Personally, I think C++ is a bad teaching language because computers don't think in objects. They think in memory locations and in blocks of code
      Computers "think" in both. They also think in registers and opcodes. They also think in electrons.

      All of these are abstractions at some level of what's really going on. There's no inherent reason why your favourite level of abstraction (memory locations and code blocks) is any better a place to start learning than the object level -- and a few reasons why it's worse. The way people think is closer to the object level (though still quite far).

      And discrete math?! Honestly, I think you could make a better case for cooking classes. The practical experience of trying to follow well-written and poorly-written recipes will help a novice programmer out a heck of a lot more than a detailed understanding of set theory ever could.

    6. Re:C++ as a teaching language/programming obscure? by arnald · · Score: 1

      But *ALL* problems should be `problem-domain problems', as you put it. The very expression you used is tautological!

      I'm not saying C is bad and C++ is good. They both have applications. What I am saying is that for a clean view of computer programming one should choose a paradigm wherein one can reason effectively in the problem domain. In my opinion, C++ allows one to do this (to some degree) and plain C doesn't (without imagination!).

      (NB. Perhaps I should have added a smiling face after my somewhat facetious `buddy' remark. It was intended as a light `Anglo/American' witticism. Perhaps I should try this when I haven't got the 'flu... :-) )

      --
      arnald
    7. Re:C++ as a teaching language/programming obscure? by Mendax+Veritas · · Score: 1
      Personally, I think C++ is a bad teaching language because computers don't think in objects. They think in memory locations and in blocks of code - exactly like C, nothing like C++.
      I don't agree that C++ is all that different from C -- essentially, the C++ object model is just C structs associated with a table of function pointers. The syntax of object.method(...) is just a stylistic thing; in C, you would say method(&object, ...) and it would amount to the same thing.

      I agree with one aspect of what I think you're saying, which is that students should start off learning how the machine works at a low level, studying a language like C (and, later, assembly, to learn about the things that C hides from you). But once they've learned that, they should also learn higher-level (more abstract) languages, because how "the computer thinks" is really just the way a Von Neumann machine thinks. Other models of computation are possible and useful, and should be learned also, particularly since they are so easily emulated.

    8. Re:C++ as a teaching language/programming obscure? by gavinhall · · Score: 1

      Posted by 11223:

      What I mean is that if all you're focused on is the result, there are ways to get the result. If you want the best result and the best process (and the best quality) as your goal, then a extremely problem-domain tool (like C++, even more like VB or LabView) is not what you're looking for - because those take away control of the process from you. C is a process language - and through the best process, it gives you the best results.

    9. Re:C++ as a teaching language/programming obscure? by gavinhall · · Score: 1

      Posted by 11223:

      Sure the cooking class will help - but trying to follow proofs will help more. What I meant was that those looking to understand concepts of computing should understand the math that they're built upon, and understand the concept of an algorithm. What good is understanding an object to a programmer if he can't undertand why his program is O(n^2) instead of O(lg n)? It doesn't take a programmer to write a program - but it takes a programmer to write a good program.

    10. Re:C++ as a teaching language/programming obscure? by roman_mir · · Score: 2

      By learning Assembler, Prolog, Lisp and C++ all computer language concepts and paradigmes would be covered, but what about really understanding such paradigms as data structures, networks, ai, multiprocessing and scalability?

    11. Re:C++ as a teaching language/programming obscure? by Mendax+Veritas · · Score: 2
      One should be able to program in the `problem domain' rather than the `solution domain', and object-orientated languages such as C++ are a step towards being able to do that.
      Nonsense. C++ mostly differs from C in two ways: (1) trivial syntax, like writing object.method(...) instead of method(&object, ...); and (2) excessive complexity (the various gotchas related to constructors, function overloading, exceptions, templates, etc.). There is very little that C++ gives you that wouldn't be done better with a good module system plus true polymorphism (neither of which exists in C or C++; their idea of "modules" is limited to static functions and C++ namespaces, and C++ polymorphism is badly restricted by its association with class inheritance. Templates are a better example of C++ polymorphism, but they can be inefficient if you don't know how to use them well, and require recompilation every time you need to apply them to a new type).

      If you want to see what can really be done in the way of helping programmers to think about the problem rather than all the annoying details of the solution, look into languages like Smalltalk, Erlang, and OCAML, all of which are vastly better than C++.

    12. Re:C++ as a teaching language/programming obscure? by Peter+Putzer · · Score: 1

      Mhm. I'd say obviously you are not a software engineer, are you?

      An algorithm that a C++ programmer can write that takes 5 minutes, I can do it in 4 - simply because I'm writing closer to assembly.

      I kinda doubt that, but even if it were true, does that say that C is a better language? No, it doesn't. It all depends on the program, and for complex enough algorithms/problems, all possible speed gains by being "closer to assembly" are overshadowed by increased costs due to programming time and debugging.

      Besides, you can program as close to assembly in C++ as in C, for those parts that actually need that amount of attention.

      --
      -- KDE programmer and computer science student in Klagenfurt, Austria.
    13. Re:C++ as a teaching language/programming obscure? by arnald · · Score: 1

      I don't really understand what you're talking about here, but what I think you're saying is that you can get the same things done quicker/`better' in [something like] C than you can in [something like] C++.

      This may be true for small programs, but it DOES NOT SCALE.

      Probably I could implement the FFT algorithm just as easily in C as I could in C++, and it might be subjectively `better' (faster perhaps, but would it be as readable?). However, programs aren't just a string of algorithms; they are in some sense more than the sum of their parts.

      Talking about C giving better ways to get to a result than does C++ tends to neglect such considerations of scale and complexity.

      --
      arnald
    14. Re:C++ as a teaching language/programming obscure? by arnald · · Score: 1

      Believe me, I KNOW the advantages of a functional approach (as noted lower down in these discussions, I'm a Haskell man at heart!). In an ideal world we'd all be writing pure FP code and none of this would be an issue!

      I take all your points about C++, but I don't feel that they really prove my original point to be `nonsense': to some degree, C++ is closer to the problem that C.

      (Or perhaps more accurately, C++ allows you to get closer to the problem more easily than does C).

      --
      arnald
    15. Re:C++ as a teaching language/programming obscure? by gavinhall · · Score: 1
      Posted by 11223:

      That's why I recommended (either in the parent or below, I forget which) that they all take a discrete math class too. Data structures are also a useful programming concept - but more mathematically than computationally. The most basic computer doesn't deal with data structures, but as soon as you add some complicated items (like a filesystem) it becomes necessary.

      But C++ is a poor language to understand the basics of the computer (memory management, etc.). It's a problem-domain tool.

    16. Re:C++ as a teaching language/programming obscure? by arnald · · Score: 1

      Incidentally, I don't agree with you that C++ constitutes an `extremely problem-domain tool'; it's just a little further along the road to the problem domain that plain C.

      --
      arnald
    17. Re:C++ as a teaching language/programming obscure? by gavinhall · · Score: 1

      Posted by 11223:

      Okay - I'll concede one point: A bunch of experienced C programmers writing C++ code would produce the best program. But a bunch of people who don't understand C writing C++ code is a recipie for disaster, programming-wise. Sure, they may get it done, but will they understand why it takes up 50MB of memory and is slower than a dog?

    18. Re:C++ as a teaching language/programming obscure? by Biff+Cool · · Score: 1
      I'm confused as to how you think keeping track of your malloc's and free's is any different than keeping track of your new's and delete's do you know C++ at all?

      Conscience is the inner voice which warns us that someone may be looking.

      --

      Conscience is the inner voice which warns us that someone may be looking.
      -- H. L. Mencken

    19. Re:C++ as a teaching language/programming obscure? by java_sucks · · Score: 1

      Lets hear a big AMEN TO THAT MY BROTHER

      Quite frankly the whole thing seems so silly to me. Different jobs.. different tools. Use the right tool for the right job. Now... that wasn't tooooo hard was it?

      It always slays me when some uber-cuhl geek goes around spouting the virtues of his uber-cuhl language of choice. Then you come to find out later that uber-geek was simply jumping on the bandwagon for this years flavor simply because of all the hype. "Uh... if I read about it on ZDnet it has to be true...right?????"

      Sheesh...

    20. Re:C++ as a teaching language/programming obscure? by Fell(back) · · Score: 1

      For me (as a programmer), "the computer" refers to all the levels of abstraction below the one I'm working at. For example, when I work in Java, "the computer" is the virtual machine, which does think in objects. At the other end, when hacking around with assembler, "the computer" is the processor and a set of registers, which doesn't. If you want to know how to program the computer, first be clear about the context of "the computer".

      --
      create | destroy | enjoy
    21. Re:C++ as a teaching language/programming obscure? by jejones · · Score: 1

      Hmmm. By that logic, the proper teaching language is assembly language. I wouldn't wish C++ as a teaching language on anybody, but not because it hides a von Neumann machine model of computation from the user.

    22. Re:C++ as a teaching language/programming obscure? by Rombuu · · Score: 1

      . Different jobs.. different tools.

      Hmmm... you must have missed the sign over the door when you came in. It says PERL for everything.

      --

      DrLunch.com The site that tells you what's for lunch!
    23. Re:C++ as a teaching language/programming obscure? by arnald · · Score: 1

      No, a bunch of experienced C++ programming writing C++ code will produce the best program. Being a C expert is of little benefit when writing C++ - they share some syntax, but have completely different programming paradigms.

      So `a bunch of people who don't understand C writing C++ code' may not be a disaster, if that bunch of people are in fact experts at writing C++. :-)

      Also, the size issue: 50MB of memory? This DOES NOT HAPPEN any more. Modern implementations of C++ give object code that's about as space efficient as the equivalent C code. (I didn't make this up, read the C++ FAQ for the details, or it could be somewhere on Stroustrup's page).

      --
      arnald
    24. Re:C++ as a teaching language/programming obscure? by Mendax+Veritas · · Score: 2
      I take all your points about C++, but I don't feel that they really prove my original point to be `nonsense': to some degree, C++ is closer to the problem that C.
      I really don't think so. C++ does have a few improvements over C, such as templates, exceptions, overloading, and the ability to declare variables anywhere in a function. But it also adds tremendous complexity and lots of nasty gotchas that make it actually harder to use (for anyone less than an expert) than C. It's true that for someone like me, C++ is preferable, because I know the language better than just about anyone I've ever met, and over the last dozen years I've developed a number of useful techniques for dealing with (and avoiding) C++'s problem areas. But it's a bitch of a language to learn well, which I think outweighs its advantages overall, especially when there are a number of vastly superior languages out there (again: Erlang, Smalltalk, OCAML, and probably others. You mentioned Haskell, which has its pluses but in its own way is nearly as hard to learn well as C++.)
    25. Re:C++ as a teaching language/programming obscure? by froz · · Score: 1

      ...computers don't think in objects.

      Humans, however, do think in objects.
      Relatively, I'm a programming newbie. I've learnt a bit of c, and now I'm learning some c++. As hard as people say c++ is, it makes more sense to me. To be more accurate, OOP makes a lot of sense to me, because i think in objects.
      Not to say that learning c isn't interesting and worthwhile. I still want to learn languages of other conceptual designs. For instance, learning Haskell last semester was a fun experience.

      What language a "normal user" should first learn really depends on how far they want to go with their programming.
      If writing malicious email worms is your thing, then go learn VBS.
      If on the other hand, you're more inclined to uber-cool kernel hacking, learn c or (insert traditional kernel-hacking language here).
      Between these two extremes of worthwhileness, lies many potential programming goals Joe Hacker could strive for.

    26. Re:C++ as a teaching language/programming obscure? by Omnifarious · · Score: 1

      I think C++ is a bad teaching language, but for much different reasons. I would prefer a conceptually less cluttered language. Python and scheme are my current languages of choice for teaching.

      Learning precisely how a computer works down to the transistor is nice to know, and sometimes helpful, but rarely necessary for a programmer to be at least decent. If you really want people to learn what the machine is doing, have them learn assembly. 68000 assembly is conceptually clean enough for people to get most of the concepts.

      Your love of C because you can figure out what a particular piece of code is doing, exactly, just by looking at is means that you just haven't taken the time to become as proficient with C++ as C. C++ is hairier than C, but you still have a pretty good idea what a piece of code is doing, even at an assembly level, if you're familiar with the types involved. I can read the assembly output of a C++ compiler and relate it back to the C++ code it came from with few problems.

      As someone else pointed out, it's all just abstraction levels. Computers don't think in anything. We place our interpretations on the bits and invent ways of describing them that we can get good conceptual handles on and work with. OO is just a different way of looking at the bits. One that's proven (in competent hands) to allow programs of greater complexity than could be achieved without it.

    27. Re:C++ as a teaching language/programming obscure? by arnald · · Score: 1

      You're right, C++ is fairly hard to learn properly; I don't really think it's terribly suitable for a first language.

      I *still* think it's preferable to C, but maybe that's because I too am familiar with it enough to overcome the various `gotchas' you mention.

      Incidentally, Haskell is not really hard to learn. It decomposes into various subsets in a very clean way. I wouldn't recommend beginners learn much about monads, for example, or modules, or some of the other more esoteric features. The first six chapters of Richard Bird's book ("Introduction to Functional Programming", Prentice Hall 1998) teach a very rich, very expressive but very syntactically simple subset of the language, which is most beguiling!

      --
      arnald
    28. Re:C++ as a teaching language/programming obscure? by gavinhall · · Score: 1

      Posted by 11223:

      Geez. I exadurate all of the time. And I wasn't saying it was C++'s fault, just that the language tends to make people allocate more space instead of reusing things. It's a fault of the paradigm that I don't like. I'm much more of a C programmer. Sure, I can write C++ fairly well. (I'm not a C++ language lawyer, nor do I write in it/stay current with it often). But the object-oriented approach tends to lead to sloppy programming if that's all you've ever been exposed to. Does that sound right, or am I still wrong? :-P

    29. Re:C++ as a teaching language/programming obscure? by arnald · · Score: 1

      I still think you're wrong. :-)

      (i) It's NOT a fault of the paradigm, it's a fault of the implementation. There is no reason implicit in the philosophy of object-orientation why a program written in this style should take more space than a proogram written in a convential procedural style.

      (ii) The object-orientated approach doesn't by itself lead to sloppy programming. On the contrary, if it's understood and carried out thoughtfully it leads to very elegant and well-written programs. But if someone who still thinks in a convential procedural way comes to an object-orientated language and instantly tries to use the new features without adjusting his mindset, then sloppy programs are likely to result.

      But there is nothing intrinsic in the pardigm of object-orientated programming that says this is so.

      --
      arnald
    30. Re:C++ as a teaching language/programming obscure? by nonya · · Score: 1
      Nonsense. C++ mostly differs from C in two ways: trivial syntax, like writing object.method(...) instead of method(&object,...);

      The difference between the two is more than syntactic. Consider the following example. You have a graphics hierarchy:
      • class Graphic{virtual void Draw()=0;};
      • class Rectangle : public Graphic{virtual void Draw(){...};};
      • class Polygon : public Graphic{virtual void Draw(){...};};
      • class Picture : public Graphic{std::list<Graphic*> Elements;virtual void Draw(){...};};
      So I have some graphic classes, and a Picture class which is a collection of graphics (Rectangles, Polygons, and other Pictures). In C++, I can write code to draw all the graphics in the Picture like this:

      for(iterator i=Elements.begin();i!=Elements.end();++i){ (*i).draw(); /* will call the correct draw based on the element's type */ };

      (2) excessive complexity (the various gotchas related to...

      constructors

      I guess I'm at a loss at this. Could you be more specific? Constructors are much less error prone than doing initialization and clean-up manually.

      function overloading

      Function overloading is very useful. Consider building a matrix library. Or when dealing with graphics it is sometimes nice to "add" points like this p1+=p2, instead of p1=add(p1,p2), or add(p1,p2,p1). Or concatenating strings...

      exceptions

      I agree. It is very difficult to design C++ code to be "exception safe". See "Exception Handling: A False Sense of Security", reprinted in C++ Gems.

      templates

      Well, I agree. Sort of. The link issues with templates are a pain. C++ does have "external templates", but I don't know of any compilers that implement it. But the language needs it. Java would be a better language with templates.

      There is very little that C++ gives you that wouldn't be done better with a good module system plus true polymorphism...

      C++ give you compatibility with C. It is difficult to put "true polymorphism" in C++ (if by this you mean something like lisp's generic functions) without better linkers than Stroustrup wanted to assume. Multimethods were considered for C++ (with a syntax like void foo(virtual t1& a,virtual t2& b,int a...) or something like that). But it was rejected (needed too complex of a linker). Besides, the *vast* majority of polymoriphic functions (in languages that support multidispatch) dispatch off a single argument. But I agree, multidispatch is useful, especially for things like the visitor pattern.

      Templates are a better example of C++ polymorphism...

      I guess I don't call what templates do "polymorphism". They are very powerful, and allow for "generic programming", like the STL. But polymorphism usually means code like the "draw" example above. I do know know how to simulate that behavior with templates.

    31. Re:C++ as a teaching language/programming obscure? by rmstar · · Score: 1
      No they won't.

      I have seen this all in action and what you say is so right! I know a guy who has written books on C++ and writes code that is so awfull slow one can say it creeps, is so horribly difficult to read and to mantain that just forget it. And big, I mean BIG is that thing also. And worse yet, he insists on everybody using his libraries. And when you point out to him the size & speed problem he says - no kidding - ''that's a problem of the compiler''.

      Guys like that are the best proof to me that C++ is evil. If you read his books you see he follows Strourtsoupcan and Mr. Booch like some the bible. And of course he is a teacher and a Big Shot(tm). I feel sorry for his students.

      I think the main reason C++ has spread is because it is a nice platform for smartasses to spread their butt and tell everybody what sort of rituals to follow. The fact that it is a nice language and actually can be usefull has only played a secondary role.

      rmstar.

    32. Re:C++ as a teaching language/programming obscure? by gavinhall · · Score: 1

      Posted by 11223:

      One last time here - someone born and raised on Object Oriented Programming will not have the same understanding of how to write an efficient prgram as a C programmer will. A C programmer who adopts C++ will write a better program because he understands the framework upon which object-oriented programming is built - a C-like language. It's just a hypothesis, but I see the proof all of the time. C++ programmers won't use a pointer even when it's the best solution. A C programmer that adopts C++ can use the best of both worlds - there's a reason why C++ inherited all of C - the two work nicely together. But I would not under any circumstance introduce someone to programming through C++. BASIC, maybe. C, definitely. C++, no!

    33. Re:C++ as a teaching language/programming obscure? by gavinhall · · Score: 1

      Posted by 11223:

      That was the point I was making. I'm being confused here - He said that C was about low-level memory functions. Malloc's and Free's are the same as New's and Delete's - except I'm married to realloc. (I know that's horrible, but realloc don't exist in C).

    34. Re:C++ as a teaching language/programming obscure? by Mendax+Veritas · · Score: 1
      Constructors: Yes, constructors and destructors are good things to have, as you say. There are still gotchas around them, though, relating to implicit conversions, failure to declare the destructor as virtual (or, just as badly, doing so when it's catastrophic to do so), etc.

      Function overloading: I didn't say it wasn't useful. I use it all the time. It does have gotchas, though, because programmers sometimes don't realize which version of a function will be used, leading to exceedingly subtle bugs.

      Exceptions: Actually, it isn't that hard to be exception-safe, but the language doesn't do it for you, which is a serious problem. A good auto-pointer class (not the one in the ANSI C++ library) can do wonders in this regard, however.

      Templates: Call them "generic" as opposed to "polymorphic" if you wish. I guess I used "polymorphic" more in the sense that the functional programming community uses it. The OO community doesn't tend to use it that way because OO languages usually don't have polymorphism except via message passing. C++ further limits it by insisting on an inheritance relationship, which is not required in, for example, Smalltalk or OCAML.

      You're right that some of the things that are wrong with C++ are due to Stroustrup's original criteria for the language -- these things are essentially "broken by design". And they do help to preserve backward-compatibility with C, but then again, I view that as one of C++'s biggest problems. It wants to be an abstract, high-level language, but at the same time it wants to be substantially source-code compatible with C, a language so low-level that it is often described as a "portable macro-assembler". These two goals conflict very badly, and in consequence, C++ implements its high-level abstractions too simplistically, with too many annoying restrictions and gotchas, and, at the same time, subverts its low-level features.

    35. Re:C++ as a teaching language/programming obscure? by arnald · · Score: 1

      You're wrong: efficiency comes from good algorithm design, not fiddling with the details (UNLESS you're writing low-level code, when C does still have advantages). There's no reason why someone who was `born and raised on Object Oriented [sic] Programming' will not understand algorithm design as well as the next C programmer.

      A C programmer who `adopts' C++ may well write awful C++ programs; to use C++ properly requires a different attitude.

      It's NOT a simple matter of learning the new syntax.

      Until you understand this, you have no hope of writing good C++ programs, and should stick to C.

      --
      arnald
    36. Re:C++ as a teaching language/programming obscure? by 0xdeadbeef · · Score: 1

      C++ polymorphism is badly restricted by its association with class inheritance

      Excuse me? Some of us happen to like strong typing. Purly signature-based polymorphism is sloppy.

    37. Re:C++ as a teaching language/programming obscure? by Stu+Charlton · · Score: 1

      Java interfaces are a good alternative to inheritance. I suppose multiply-inherited pure virtual classes are the way to do this in C++, but there's a lot of cultural/political baggage against using MI anywhere.

      But overall, purely signature-based polymorphism is extremely productive in the hands of competent programmers. Not sloppy at all.

      --
      -Stu
    38. Re:C++ as a teaching language/programming obscure? by superkorn · · Score: 1

      This to some degree depends on your definition of a "good" program. I learned on java and I don't know anything about memory registers etc. (and even my concept of pointers is weak since java doesn't have them, but I digress.) Anyway, I would argue that in today's world a good knowledge of OOP, especially design patterns and inheritance, will allow one to write much "better" programs much more quickly than someone who knows memory inside and out but doesn't know OOP and thus ends up duplicating code all over the place. By better I mean more extensible and less buggy, if not always faster. And I can in fact do complexity analysis on algorithms believe it or not, so don't assume just cause people know objects that they have missed all the basics :) Frankly though, I would much rather know objects than complexity analysis or memory because they are a lot more useful...

    39. Re:C++ as a teaching language/programming obscure? by JCMay · · Score: 1
      I think the idea is that one shouldn't HAVE to learn `how the computer thinks'. One should be able to program in the `problem domain' rather than the `solution domain', and object-orientated languages such as C++ are a step towards being able to do that.

      I think that generally speaking that's not true. Applications programs, perhaps, but certainly not systems software. Anything that deals directly with hardware or is otherwise speed-performance limited needs to be done with more than a passing nod to computer architecture.

      Knowing how the hardware works is key to speed in most instances. OOP methodologies make life easier for the programmer, certainly. I would be the first to agree. But that ease comes at a price. Anything that adds overhead to the finished product-- the executable that hardware understands -- slows that product down. Jeff

    40. Re:C++ as a teaching language/programming obscure? by Samrobb · · Score: 2
      C++ programmers won't use a pointer even when it's the best solution.

      Please - stop generalizing. I'm a C++ programmer; I first learned C++, not C. I'm perfectly comfortable with pointers, and willing to use them when it makes sense. I'm also perfectly willing to write a perl script, or a VB test harness, or a bit of assembly if I need to. I can work in C if need by, though I prefer the C-subset of C++ for a number of reasons. I've seen poorly written C programs; would you like me to take that as an example of exactly how suitable C is as a development language?

      Languages are tools. If C allows you to express an idea simply and effeciently, then it gets the job done. C++ is better than C in expressing some concepts and ideas. Perl is better than either in other arenas. A good developer understands this, and works to identify the strengths and weaknesses of the tools, so that s/he can use the most suitable tool for a task. A poor developer learns one tool and winds up with a "All I have is a hammer, therefore everything must be a nail" mentality.

      But I would not under any circumstance introduce someone to programming through C++. BASIC, maybe.

      Any possible brain-damage that I perpetuate in my programs can be traced back to my BASIC heritage :-)

      --
      "Great men are not always wise: neither do the aged understand judgement." Job 32:9
    41. Re:C++ as a teaching language/programming obscure? by keffy · · Score: 1
      I agree completely that understanding algorithmic complexity and what goes on inside the processor and even a bit of discrete math are necessary for -- ultimately -- becoming a good programmer. (Well, I might disagree a little, if you think these are the be-all-and-end-all. I think they're just a few necessities among many, including the ability to create decent human interfaces, the ability to understand what it is the user needs your program to do, and the ability to document the bloody thing. I'd be hard pressed to choose just one as the most important.)

      So I agree with you about the end-point of programming education. But the question is about beginning programmers. Do you really have to understand all this stuff before you even start?

    42. Re:C++ as a teaching language/programming obscure? by JJSway · · Score: 1

      Based on 11223's argument, THE most efficient programming language would be assembler. Having spent the last 5 years programming in assembler, all I can say is, "Yecchhhh!!!" I am now working with C, Java, and hope to use C++ before I'm done. So, I cast my vote in favor of "The right tool for the job" crowd.

      However, if I may be so presumptuous, I think that the point he is trying to make is that if you don't understand the platform thoroughly, you won't program as efficiently as possible. The platform includes available libraries, the OS, the CPU, peripherals, networking, etc.

      While C is pretty close to the platform (which implies that its programmers are well-informed), it is not immune from inefficiency. A simple example of this is programs that have lots of itty-bitty functions. Those programmers obviously don't realize how much overhead goes into the call/return sequence. At least half, if not all, register contents have to be stored and several registers initialized before the function code can begin to be executed. Then, the process is reversed on return. If the function is as simple as a swap, then more code is executed in the call/return than in the function itself.

      Which does lead me to a question for you C++ gurus. Is calling a method the same as calling a C funtion in terms of the call/return processing? If so, then 11223 may have a point regarding efficiency (read bloat). A lot of the class methods I have seen so far are itty-bitty.

      To be sure, I have seen lots (and lots ...) of examples of programming without a clue of how computers work in other languages, but let's go get a beer before starting that rant.

    43. Re:C++ as a teaching language/programming obscure? by BinxBolling · · Score: 1
      Which does lead me to a question for you C++ gurus. Is calling a method the same as calling a C funtion in terms of the call/return processing? If so, then 11223may have a point regarding efficiency (read bloat). A lot of the class methods I have seen so far are itty-bitty.

      Yes, C++ method invocation uses the same mechanism as a C function call.

      This does not necessarily lead to slower code, depending on the compiler. Most decent optimizing compilers can transform calls to itty-bitty functions into inline code. C++ has a keyword you can use to declare a function or method inline. I don't think the compiler is required to honor it, though.

    44. Re:C++ as a teaching language/programming obscure? by IkeTo · · Score: 1

      No. For a new comer of C++, before he actually touch on OOP, the main difference between C and C++ is that C++ has a bigger library (esp. the part called STL), and the library don't ask you to do a lot of casting before anything work.

      Say, how will you teach students to sort an array? Would you ask them to write bubble sort? Sure, you can. But will you ask them to write:

      int comp(void *a, void *b) {
      return *(int *)a-*(int *)b;
      }

      int arr[100];
      /* fill arr here */
      qsort(arr, 100, sizeof(int), comp);

      The C library provide few good functions for such common usage, and when they do they have to provide it is a real obscured way because the language is "simple". How about C++?

      sort(arr.begin(), arr.end());

      Okay. That's just for sorting. How about an associative array? A linked list? STL give you all, and in C they have to be exercise for the new comers (before they learn a data structure course).

      Experienced programmers tends to forget things that were non-trivial for the first time programmers after they are accustomed to it. Even the input/output of C is awkward. Think about:

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

      Why I have to tell printf that what coming after is an integer? Did the compiler already know that? Is it that "20" can be interpreted in some other way? It's plain strange. Compare it with C++:

      cout 20 endl;

      The compiler knows everything: 20 is an integer, endl should print out a new line. Oh. What's the type of that endl? Who cares?

      OOP is an important feature of C++. But it is not that important to new comers. New comers won't make big programs, and the programs of new comers are not reusable anyway because they are so primitive. They want to reuse the code of others much more than writing code which can be reused by someone.

    45. Re:C++ as a teaching language/programming obscure? by lars · · Score: 1

      I'm a huge proponent of OO technology, and I generally think the treatment given to it at most universities (certainly not at mine) is very poor, and in general the power and importance of OO technology is vastly underestimated and underappreciated. However, I disagree with you on this. Perhaps it is not hard to learn the OO concepts and apply them without knowing anything about complexity analysis, algorithms, etc. but why would you want to do that? Then a lot of your job becomes trial and error. To me that seems like learning to be an automechanic without knowing what any of the parts actually DO, or without knowing how to actually drive a car. Of course being able to actually fix a car is more useful than knowing the theory, but what happens when you encounter a type of car you haven't seen before?

    46. Re:C++ as a teaching language/programming obscure? by Morwath · · Score: 1

      Does it mean people must learn programming using assembler because this "is how a computer thinks"?

      Most people would be scared thinking about "memory locations" while learning programming.

      Most of us started using BASIC or Pascal, beginning to dig into low level programming (pointers, memory location and so on) later.

      What a programmer needs to learn is about data and the algorithms manipulating them. An object oriented language helps to manipuate complex data and complex algorithms. You can start with C++, there is no need to use old C (you do not need to learn how to drive a old Ford T to get your drive license for the latest car model you wish to buy...)

      C++ may not be a good teaching language because its inner complexity, not because it is not close enough to assembler...

    47. Re:C++ as a teaching language/programming obscure? by Capotribu · · Score: 1

      Hi everybody,

      I'm reading another "same-old-story": C vs C++ just like Procedural vs Object Oriented! So boring......First of all: Languages and environments are just instruments. Every single language has features more useful in some context and less useful in other, a real programmer :-) doesn't care too much about the languages (I said "too much" not "at all"!!) 'cause it's the last thing in software development.
      You wrote: "I think C++ is a bad teaching language because computers don't think in objects. They think in memory locations and in blocks of code...." mmmm why don't use just asm or, better, microinstructions?!?!? ;-P
      Object Orientation is useful in all the development process! not just in coding but also (and first of all) analisys and design. In that step you have to face the problem domain not the solution domain and thats why u don't have to care about computer: you must think about the problem not how you can solve it.
      I'm also sure that if we read source code of many so-called "C++ developers" we will not find any "class" statement 'cause many people think that compiling a program with a compiler that support C++ means writing OO application.
      IMHO: I've never suggested to start with C++. U can also know every single statement of this language, it doesn't mean u are able to develop: there is a background knowledge u can learn without coding.
      Often people starts with pascal 'cause is a relative simple language to learn so to concentrate on learning that background knowledge. Best regard and C U soon :-)

      --
      Marco Abis
    48. Re:C++ as a teaching language/programming obscure? by superkorn · · Score: 1
      I agree with you that it would be foolish to call oneself a programmer without knowing some of the more basic things, and your anology about seeing a car which you have not encountered before is quite good. To that end I am planning on learning some assembly next year and also some scheme to buff up my algo skills.

      I still think though that when new people are learning it would be much better to start them off with more OO stuff and less low level coding. OO forces them to think about exactly what problem they are trying to solve before they can even apply a design pattern or anything, and a good conception of the problem is perhaps one of the most important prerequisites for writing a good program. Also, with OO and a relatively easy language like java new people are less likely to get bogged down in memory registers and pointers and will spend more time actually learning to write good software. Once they have some kind of grounding harder and more low-level concepts can be introduced.

    49. Re:C++ as a teaching language/programming obscure? by lars · · Score: 1
      I agree that starting off with OO concepts is not necessarily a bad idea. You certainly don't have to be a good C programmer to become a good C++ programmer and OO designer. However, one thing to keep in mind is that OO analysis and programming are completely different things. You can perform OO analysis without writing a line of code. Also keep in mind that OO programming is essentially the same thing as imperative (and/or functional) programming, but with a certain prescribed approach to solving the problem. I think I perhaps the term OO programming is a misnomer, becuase OO more than anything is just a method of modelling (i.e. problem solving). I have seen countless programs written in C++ using classes and inheritance that are in no way whatsoever object oriented.

      Therefore, I think it's pretty essentially to learn about the basics of control flow, variables, and simple data structures before one begins to learn about OO concepts. But I think we essentially agree: I definitely don't think it's necessary to learn about registers or pointers to learn about OO programming. In fact, my school (UWaterloo) is now teaching the introductory programming courses (and most of the second year CS curriculum) in Java. The funny thing is that after teaching the basics, they teach the students about pointers and ADT's... in Java. Of course, it's easy to simulate pointers without actually having them as a language feature, and that's what they do, but I just find the irony amusing.

  2. Is that line trademarked? by (void*) · · Score: 5
    I can see it now: a whole line of educational guides ala IDG's "Dummies guide" series:
    • Who's afraid of Unix?
    • Who's afraid of Relativity?
    • Who's afraid of Motorcycle Maintanence?
    • Who's afraid of Sex?
    Yes, let the money roll!
    1. Re:Is that line trademarked? by sethgecko · · Score: 1
      s'funnny. Last time i dropped a quarter it rolled across the room.

      --
      Be ot or bot ne ot, taht is the nestquoi.
    2. Re:Is that line trademarked? by Requiem · · Score: 1

      I heard that they were going to name their introduction to stream-of-consciousness writing "Who's Afraid of Virginia Woolf?", but got their asses sued by Albee.

  3. Real Challenge is turning CLI graphical :P by korpiq · · Score: 1


    Imagine connecting a few icons with a wire to pipe stuff between them, then filling in parameters in a popup window for each of the icons. This would become a new icon, that you could drop data on in order to have it processed.

    Programming for dummies could and should be that easy in order to free the end user to use the full power of computing.

    Not everybody should learn programming; everybody should be able to start programming with smallest possible effort.

    This stuff into KParts/Bonobo?

    --

    I think, therefore thoughts exist. Ego is just an impression.
    1. Re:Real Challenge is turning CLI graphical :P by eellis · · Score: 2
      Imagine connecting a few icons with a wire to pipe stuff between them, then filling in parameters in a popup window for each of the icons.

      What, you mean like LabView ? It's a graphical programming language - mainly intended for controlling lab equipment, but surprisingly general purpose.

      Edric.

    2. Re:Real Challenge is turning CLI graphical :P by bXTr · · Score: 1

      When I first read the above comment I immediately remembered that Novell had a product called, oddly enough, AppWare. It wasn't really component based, but more like logic diagramming. And what components existed were specific to AppWare; I couldn't use components created in some other tool.

      However, graphical programming is rather cool. Incompatible component and object formats will probably keep that from becoming a reality for some time. Hopefully the discussions between the folks at GNOME and KDE for making their components interoperate will actually bear fruit.

      --
      It's a very dark ride.
    3. Re:Real Challenge is turning CLI graphical :P by AshPattern · · Score: 1
      There is one. It's called Prograph and was released many years ago for the Macintosh. It was both compiled and interpreted, was completely object oriented, and focused on data paths instead of execution flow. The compiler/interpreter took care of what needed to happen when.

      It was not easy at all. I was a pretty experienced programmer when I began to play around with it, and it was nearly as hard to wrap my mind around it as LISP used to be. LISP has the excuse that it is perfectly suited to certain classes of problems, but Prograph was intended to be a general purpose language. I doubt that any less technically inclined consciousness would find it any easier to learn.

      It's the old tradeoff between flexibility and simplicity. Make it simple enough for the average user, and you don't have a language, or even a script. You have an application.

      ---
      Avoid gunfire in the bathroom tonight.

  4. It is irrational fears week! by BilldaCat · · Score: 3
    --
    BilldaCat
  5. There's a Reason Why. by ReconRich · · Score: 2

    Hopefully this book addresses (suitably) the reason why people have good reason to fear C++. In many ways it is a language in which you must know everything before you know anything. The complexities of how constructors/destructors interact when returning objects (for instance) is very confusing and one of the reasons why it often takes many years of C++ programming before a programmer is truly competent. If this book effectively addresses educating people in the "hard stuff" its good. If not, well its not.

    -Rich

    --
    Free your mind and your Ass will follow -- George Clinton
  6. Who's afraid of C++? Me, that's who by Jon+Erikson · · Score: 1

    Despite the fact that I can and have programmed a lot of C++ stuff at home and at work, for some reason it just doesn't seem to stick, and I find myself constantly annoyed by minor language niggles and an obscure syntax that sometimes just tries too hard to be concise.

    Now, I've been programming for years and I find C++ difficult to get into sometimes, so if this book can really make it accessible for the user then that's half a miracle by itself. Of course, if the lady in question being taught C++ became his wife soon after, it does raise the question of how much "private tutoring" she was getting... :)


    ---
    Jon E. Erikson
    --

    Jon Erikson, IT guru

  7. this reminds me of another book... by EnderWiggnz · · Score: 2

    it was called "The cartoonist Guide to Computers" - i cant rememeber the author right off....

    My cousin that went to lehigh gave it to me when i was 12. apparently, the book was being used by lib. arts students to get a grasp of the technical courses.

    It was presented in a humorous, light, yet incredibly informative way... It traced the history of computing, from abacuses to differential engines, and made the whole thing very interesting.

    And, it had a good level of detail in it. It wasnt a gloss over the topic and pretend they've covered it. It went into boolean and gating fairly extensively.

    Not bad for a cartoon book.

    --
    ... hi bingo ...
    1. Re:this reminds me of another book... by KenSeymour · · Score: 1

      How about the FORTRAN Coloring Book.

      It was put out by MIT Press ages ago.

      My favorite FORTRAN joke:

      GOD is REAL but JESUS is an INTEGER.

      --
      "We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
  8. Sounds good by seizer · · Score: 2

    Beginning to program is a wildly confusing experience - or at least, it was for me ;-) This book sounds like it'll help people along greatly.

    However (there's always a however):

    There is absolutely no substitute for the hacker-type mindset - the obsessive compulsive (say it ain't so) need to explore a system for yourself, to produce programs which should be beyond your capabilities - and which were, until you put your mind to them. If someone doesn't have that raw curiosity and the need (the NEED) to know everything about a system, then they're never going to be anything more than a "quite good" programmer.

    --Remove SPAM from my address to mail me

    1. Re:Sounds good by seizer · · Score: 1

      Well pop it back in the jar, put it in the freezer again, get an account, and post something intelligent.

      --Remove SPAM from my address to mail me

    2. Re:Sounds good by Dix · · Score: 1

      I disagree. Someone with that "hacker" mindset who "needs to know" everything about a system, will eventually know everything about the system.

      That won't necessarily make him a good programmer.

      Conversly you can be a very good, say, Java or SQL programmer without that mentality.

    3. Re:Sounds good by arnald · · Score: 1

      The `hacker mindset' (as you put it) is at best irrelevant, and in my opinion highly undesirable. Programming is just applied mathematics (in the literal sense of the term!). One shouldn't encourage new programmers to just mess around until they `produce programs which should be beyond [their] capabilities'; they should instead be encouraged to study the techniques, reason carefully and learn to walk before they try to run.

      I recommend `Introduction to Function Programming' by Richard Bird (Prentice Hall, 1998) as a good beginner text to computer programming, for those with a mathematical bent. *Then* buy and digest K&R, or Stroustrup, or any other language-specific book.

      The drawback is that once people have seen the `functional light' (as it were) the prospect of muddying their hands with imperative code becomes highly unattractive!

      --
      arnald
    4. Re:Sounds good by nachoman · · Score: 1

      exactly

      Bachelor of Computer Science != programmer in C++ (or any other language for that matter)

    5. Re:Sounds good by arnald · · Score: 1

      Thanks for the advice.

      However, I must now confess I was being deliberately provocative with my original post. I don't REALLY think programming is applied maths, anymore than I REALLY think everyone should learn functional programming. In theory though both these things are attractive ideas.

      Of course, the gulf between theory and practice is considerable.

      Can I be allowed to program again now? :-)

      --
      arnald
  9. Cool by Gunther+Dull · · Score: 1

    The college I teach at has thier Business and Information Systems Management (yeah, stupid major, but that's a whole separate rant) taking programming classes. If there were more books like this, it might be a little easier to teach programming to them.

    --
    -- Gunther T Dull is not responsible for his opinions.
  10. Re:Extreme Frist Psot by seagis · · Score: 1

    Troll Anon Coward.
    He thinks that Mac beats fine Tux
    however, can't spell.

    if ($post eq "finished")
    {
    print "sig\n";

  11. Initial steps into programming by Dungeon+Dweller · · Score: 2

    It's not the initial step into programming that is difficult, it is mastering it. Give me an hour, a good library, and a reasonably intelligent person who has a fairly open mind and high school trig, and I'll have them writing simple games. That doesn't mean that they'll be analyzing algorithms in big-O notation and parsing b-trees. I think that the biggest pitfall for users is viewing computers in the wrong light (Impossible machine) and being unwilling to apply any basic knowledge (when I was a kid, we were booting atari's up in computer labs in my elementary school, and writing programs in BASIC. I know that this happened all across America. Now, you ask someone to type in a password, and it's too much for them to handle, and click on the "send" button, why does it have to be so hard?

    --
    Eh...
    1. Re:Initial steps into programming by Alomex · · Score: 1
      Languages such as C, C++ and to some extent Java are still mirred in the past. They still follow an closely mathematical style of programming created for numerical computations in Fortran.

      However flawed, Perl is the first language extensively used in real life in many years to break away from that type of notation.

      Python is moving in that direction as well.

      To quote Rob Pike, the hardware we use didn't even exist as a dream ten years ago, yet the OS and programming language we use is 30+ years old!

    2. Re:Initial steps into programming by gavinhall · · Score: 1

      Posted by 11223:

      And the concepts are over 50 years old, and came about in the time of Turing (and even before that!). You want something new, go use a quantum computer. (Good luck doing that without a conventional computer, too.) We're using 30-year old OS's because the concepts of computing haven't changed in 30 years. Electromagnetic computers still work the same way as an old IBM mainframe, Turing-style.

    3. Re:Initial steps into programming by Signal+11 · · Score: 1
      Sorry, but the biggest problem I've had in programming isn't the learning curve.. it's finding a use for it. I need projects big enough to say "check this out, see what I built!" without it being some kind of monolithic undertaking.

      My problem with learning to program has been with finding the discipline and commitment to debug the think and Just Make It Work.. which takes up so much of your time it's well beyond "funny", and also that I just don't have any projects small enough for me to tackle and gain experience.

      My first-ever "serious" C program was mp3db, a 1500 line simple database program (open file, read last 128 bytes, build structure, dump to database, repeat). 1500 lines to do that!!!

      anyway.. just me ranting.. pay me no mind.. =)

  12. <cough> I'm sorry? by Biff+Cool · · Score: 2

    With well-chosen metaphors (datatypes are kinda like odometers)
    Ignoring that this is a simile and not a metaphor, does that make a lick of sense to anyone? Datatypes are kinda like odometers? Fingers are kinda like distributor caps. I thought I knew C++ but obviously I missed something in my studies

    How is a raven like a writing desk


    Conscience is the inner voice which warns us that someone may be looking.

    --

    Conscience is the inner voice which warns us that someone may be looking.
    -- H. L. Mencken

    1. Re:<cough> I'm sorry? by Richy_T · · Score: 1
      There's an r in both, and a b in neither.

      No, I think you are mistaken. Clearly there is no r in both and no b in neither but the converse is true.

      Rich

    2. Re:<cough> I'm sorry? by xtinct · · Score: 1

      i think whoever wrote this made a mistake...

      the author, IIRC, compares a binary number to an odometer (an odometer with only 2 numbers: 0 and 1), not a datatype.

  13. Can someone give 1 good reason to use C++ over C? by Mayor+Quimby · · Score: 1

    This is not a flame.

    When you code in C, you know of how it will execute. Nothing is hidden from you. It is easy to follow. Plenty of compilers exist.

    I've been programming for many years, and have dabbled in C++, but could never come up with one good reason to use it over C. Could someone help me out here?

  14. You've opened a Pandora's Box by TheNecromancer · · Score: 4
    I hope you people realize that this topic is just going to start a verbal war between the C++ purists, the Perl purists, the Java purists, the Pascal purists, ad infinitum.

    IMHO, it doesn't matter what language you program in(I progam in several, including C++), the important point is that you understand the basic tenets of programming, and can use these concepts to program in any language! If this book can help people learn that, more power to them!

    --
    Attention all planets of the Solar Federation! We have assumed control! - Neil Peart
    1. Re:You've opened a Pandora's Box by arnald · · Score: 1

      Quite right.

      So, everyone should start by learning Haskell, and *then* come back to Earth (with only a slight bump) and learn the muckier languages of this mortal coil. It's how we do it here at Oxford.

      Learning a pure functional language is a little like taking LSD: you get to see God, and nothing else quite looks the same afterwards.

      --
      arnald
    2. Re:You've opened a Pandora's Box by L0rdByt0r · · Score: 1

      Yes I find that I tend to carry around the same programming mindset no matter what language I'm writing in. When I use C++ it's mostly just a modification of my C coding, which is really just a modification of my C64 BASIC coding (you'll never need more than 64K...) This works fine for procedural languges but was real hell when I learned LISP, "Where does this program start? Where's main? What do you mean 'cdr error'? there's 70 cdr's in this function! ARGGHH!"

    3. Re:You've opened a Pandora's Box by JoeWalsh · · Score: 3

      IMHO, it doesn't matter what language you program in(I progam in several, including C++), the important point is that you understand the basic tenets of programming, and can use these concepts to program in any language!

      I agree with you. I want to point out another problem, though. In addition to the problem of thinking like a programmer, I find that it's harder to get people interested in modern languages because it's generally much more difficult to do fun graphical things with them.

      Take the first language I learned, for example: Atari BASIC. I learned it using the slim little book with the silver cover that came with the Atari 400 my parents bought me. After reading that little book (I don't have it with me, but it was about 100 pages long, with large type and many illustrations), I was able to use BASIC to draw on the screen. I could use FOR...NEXT loops to cycle colors among many lines to get a neat effect. I could actually move a dot around on the screen using my joystick.

      That felt powerful. To make a program that responds graphically to my input was just mind-blowing at the time. I quickly wrote a little game, and - WOW - I felt like I could do anything if I just put in the time.

      Compare that with today's computer books. Friendly or no, the books teach you how to write little boring text-based programs, for the most part. Maybe they teach you how to use a RAD tool to make a WIMP interface, but still the program itself is just a "get some text input from the keyboard, process it, and output some text" program. That is boring!

      It'd be nice to write some graphics routines for C that are as easy to use as the old Atari BASIC graphics commands (SETCOLOR; COLOR; PLOT X,Y; DRAWTO A,B) and input commands (if not joystick, at least some info on using a keyboard to do game input).

      Take those commands and some basic housekeeping code, then distribute them with a book on learning C. The book could still focus on the processing and structure stuff, but if something was thrown in there that would give the person some ability to make something fun and exciting after learning just a little bit.

      That's a tremendous incentive for neophyte programmers, in my opinion. It not only gives them some warm fuzzies when they see it, it's also a lot more exciting to show someone else than any of the text based stuff.

    4. Re:You've opened a Pandora's Box by TheNecromancer · · Score: 1
      Good point! I also remember the good ol' days of BASIC, and it did feel good to write a few lines of code to mess with the screen that way.

      I also think that graphical programming has come a long way since those days, and that you need a powerful language like C++ to do that kind of programming today.

      I wonder what the Quake graphics engine is written in?

      --
      Attention all planets of the Solar Federation! We have assumed control! - Neil Peart
    5. Re:You've opened a Pandora's Box by jilles · · Score: 2

      Programming is about much more than a language. Haskell is indeed nice, but quite useless to learn if you don't intend to use it.

      Assuming we have a complete newby at hand who wants to become a skilled computer programmer, there are several things we need to teach him:
      - What is a computer, how does it work in general. Toying around with assembly can be usefull at this stage. It's also important to learn about bits & bytes and other computer jargon.
      - As soon as you got a clear image of how a computer works, it is time to learn a language. Prerably, a simple language is chosen (e.g. basic) but if necessary you can also take something more advanced.
      - Standard libraries. This is the part that takes the longest. To avoid that you reinvent the wheel it is essential that you know your tools. If your are doing C++, knowledge of the STL is essential. When doing Java you need to be able to find usefull classes and components in the various frameworks

      Of course you can do these things in parallel. A good programmer can switch languages easily. I know I can learn C++ pretty quick since I understand all of the underlying principles. I have programmed before in other languages (C, Java, Basic etc.) and know that my biggest obstacle in learning C++ won't be the language but learning to use the stl efficiently.

      In addition to the above, it is also usefull to learn about different styles of programming. Most novice programmers start by learning how to do procedural programming. At this point in time, however, there is really no excuse for a good programmer not understanding OO. If you want to laugh, try examining the first Java code of people who used to code in C or basic. I had the privilege of doing so some time ago. The poor fellow had crammed his entire program into a single class. He used the class variables as global variables and was simply applying the tricks he had used in pascal before. Also he was mostly ignoring the classes provided by the Java API. Strangly enough his program sort of worked.

      After mastering & understanding procedural and OO programming you might look a bit further: generative programming, functional programming and logic programming good starting points. Also it is usefull to learn about program design methods. If you are doing OO, look at "Design Patterns" and learn how to use UML (not just the class diagrams).

      Further expertise can only be gained by practice. There's no way you can do all of the above in a few weeks or even months. Books such as discussed in this article are a nice starting point for anybody new to programming, to bad it is limited to C++.

      Coding
      class IMAMonkey {
      public static void main(String ps[])
      {
      System.out.println("I'm a coding monkey");
      }
      }

      can be done by pretty much anybody but fully understanding what it does and why it is written down like that takes a bit longer.

      --

      Jilles
    6. Re:You've opened a Pandora's Box by arnald · · Score: 1

      An intelligent post, but I don't agree with the first point.

      Haskell is NOT useless to learn if you don't intend to `use it'. It's an excellent way of learning (i) type discipline and (ii) algorithm design.

      As I said before, we learn Haskell first here at Oxford, and none of the graduates seem to have many problems getting jobs in the real world... :-)

      --
      arnald
    7. Re:You've opened a Pandora's Box by jejones · · Score: 1

      That's why Paul Hudek wrote The Haskell School of Expression. I'm looking forward to digging into Haskell with this book.

    8. Re:You've opened a Pandora's Box by JoeWalsh · · Score: 1

      I also think that graphical programming has come a long way since those days, and that you need a powerful language like C++ to do that kind of programming today.

      Oh, yeah, definitely. To make something like Quake, or even Super Mario Brothers, requires a lot more sophistication than anyone's going to get from a beginning programming book.

      But, then, it was that way back then, too. I progressed from pure BASIC, to BASIC with ML subroutines for moving the player/missile objects (aka sprites) around, to pure ML as I realized it was necessary. You could do something hokey in BASIC, but it would never look like the top games of the day (PacMan, Donkey Kong, etc.).

      I see a change of degree only. It's a lot further from moving a dot on the screen to the hottest games today than it was back then. Still, it's a lot cooler to be learning a language that can lead you to that sort of thing (C or C++, say) if it starts out with SOME level of graphical whiz-bang than with some sort of accounting program.

      I wonder what the Quake graphics engine is written in?

      I dunno. I would hope assembler, but these days, I doubt that's the case.

      Have a good one!

    9. Re:You've opened a Pandora's Box by jilles · · Score: 2

      I half agree,

      I learned Gofer myself in the first year of university (very similar to haskell). Though it is a very fun language to learn and use, I don't think of it as essential material for programmers. The programming community for functional language is quite small (for various reasons), and unless you are actually going to use it I wouldn't recommend spending much time on it to beginning programmers.

      I also think it is a mistake to think that programming is still about algorithms. I can't remember the last time I implemented something like quicksort. All these things are available in a reusable form these days. Although it doesn't hurt to about algorithms, I think things like program structure and design are much more important.

      Needless to say that I think that CS students, who are not just code monkeys, should know how to work with other languages than just Java/C++. Haskell is a good choice, but also prolog, lisp, etc. might be sufficient. The idea is not to teach those students a particular language but to learn them different ways of solving problems. It is also a great way to learn to understand the limitations of certain programming languages (C for instance). The more languages, the better. Each language has particular features which are interesting to learn about.

      --

      Jilles
    10. Re:You've opened a Pandora's Box by Arandir · · Score: 2

      Then just write a turtle graphics class/library for C++, and Voila!

      UCSD Pascal, that old standard of beginning programming before Turbo Pascal hit the scenes, had turtle graphics as a library, and it did wonders for teaching programming (I was a proctor at UCSD). Instant visual feedback is a powerful teacher.

      So go write a turtle graphics class for C++ and get teaching!

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    11. Re:You've opened a Pandora's Box by ioctl · · Score: 1

      Heh, had to comment on this one....

      I use asp, java, javascript, and VB at work (my bosses like Microsoft... oh well, the paycheck is good), and C, php4, & bash scripting at home, and I gotta tell ya, this can't be more true. I learned javascript in something like 30 minutes, and have been doing some really cool things with it since... it's not what you use, it's how you use it...

    12. Re:You've opened a Pandora's Box by crypto_creek · · Score: 1

      Hey! You forgot the REXX purist!

      --
      Wovon man nicht sprechen kann, darueber muss man schweigen. Ludwig Wittgenstein
  15. This looks like a good thing =:-) by drenehtsral · · Score: 2

    I remember when i was learning to program (somebody shoot me, i say that a lot, and it was only 13 years ago) there were a lot of books like that (although often using basic or pascal) and i got all of them out of the library again and again until i'd sucked them dry of information. They were informal, not too intimidating, fairly friendly, and most of all, they weren't snobby. SOme even had cool cartoons =:-)
    This has been missing in the age of the booming tech economy and the whole "professional image". I think the world needs this sort of a thing, so that novices can begin to experement, because it's fresh minds that generate a lot of the innovation, and i think that extending a bridge to users is a good thing.

    --

    ---
    Play Six Pack Man. I
  16. C/C++/Java gemme outta here!!! by DanBari · · Score: 1

    After three years of programming, I would definitely consider purchasing this book for the reason that my mind tends to get bogged down in the syntax rather than the symantics.
    One book to definitely avoid would be C++ Program Design: An Introduction to Programming and Object-Oriented Design (2nd edition), Cohoon and Davidson, WCB/McGraw-Hill, 1999. It's not that it's really that bad of a book, but I suppose since it's the book that we used for my CS101 course I wasn't too happy with it giving me that firm of a foundation.
    Good day...

    --
    Fruit flies like bananas... Time flies like the wind...
  17. Is this C++ or C? by David+Greene · · Score: 1
    More technical readers already familiar with programming and at least one C-based language might find the pace slow and the extra explanations unnecessary. Heller's target audience is definitely the neophyte, not the experienced developer. The latter might question the subject matter covered. Why build a vector class instead of using C-style arrays? Why not C-style strings? I suspect the author is more concerned with helping his students avoid the kind of pitfalls C++ was designed to work around. It may not be the traditional approach, but it's valid and it will produce decent programmers, who can learn C++ on its own merits.

    I don't understand this comment. Questions such as, "Why build a vector class instead of using C-style arrays?" and, "Why not C-style strings?" are fundamental C++ questions. Now, it's true that the neophyte will not immediately question why a vector class is used, but IMHO it is an issue that should be addressed.

    Additionally, the comment that readers can "learn C+ on its own merits" leads me to think that the book doesn't really cover C++, but rather covers "object-based C." Does the book even get into polymorphism?

    Good supplements to this book (and essential reading for every C++ programmer, IMHO) would be the C++ FAQ Lite and STL Programmer's Guide. The Design Patterns book by Gamma, et. al. is also essential reading, but is probably a little advanced for the newbie.

    --

    --

    1. Re:Is this C++ or C? by m0ng00se · · Score: 1

      "...the neophyte will not immediately question why a vector class is used, but IMHO it is an issue that should be addressed."

      ...And it can be addressed if you choose to :)
      I think that a lot of people in here are getting all up in arms because they focus on the fact that this book *may* be used by a beginner... The fact is, people who were camped out in the top-down design camp (such as myself) can use this book to ease on over to or simply just learn about OO (which I did). And I did ask 'why vectors and not arrays?' I got a (very nice) personal explanation from Steven Heller, who is very professional and open for discussion on any subject in the book; This alone is why the book has more merit than your standard "learn OO foo in 5 days!" (Although one may wish to skip the beginning chapters on Hardware fundamantals where, BTW, he does a decent job explaining this using 8086 assembler examples...)

      IMHO the book is decent and so is Steve Heller

      --


      Is madness a syptom of genius or vice-versa?
    2. Re:Is this C++ or C? by David+Greene · · Score: 1
      And I did ask 'why vectors and not arrays?' I got a (very nice) personal explanation from Steven Heller, who is very professional and open for discussion on any subject in the book;

      When you say you got an answer, was that a correspondence with Heller, or was it in the book? I guess my beef was more with the review than the book per se. It's not clear from the review what the book covers and what is left out. The table of contents doesn't help, either. There is certainly a place for an "object-based C" book, as long as it's clear that the full language is not covered and it includes references to well-respected books with more detail.

      --

      --

    3. Re:Is this C++ or C? by m0ng00se · · Score: 1

      I e-mailed the question and he replied with a detailed explanation of the buffer overflow protections afforded by vector constructs; definitely more than I expected.

      Oh, and you're absolutely correct, the review didn't say that this was not an exhaustive reference... (Just to clarify, it isn't, it's just meant to get your OO ball rolling, so to speak :)

      --


      Is madness a syptom of genius or vice-versa?
  18. Learning at the lowest levels first? by thogard · · Score: 2

    One of the early books I read involved describing an ALU as a bunch of boxes that could add other boxes. It was written in the early 1960'sand had lots of drawings taht look like departmental mailboxes and how data access worked with index registers and the like. Today most people would consider it a waste of time but I'm not sure. I know how computers operate down to the gate level. I can optimize things well enough. Most of the books I read in my early programming days wouldn't even be considered programming books by todays standards but they worked well for me. I guess thats why I get to explain to the new CS grads why we don't do some things some ways since the computer doesn't like doing trillions of calculations when it has other thigns to do too.

    1. Re:Learning at the lowest levels first? by drenehtsral · · Score: 2

      Hehehehe =:-) I think they had that book at the public library. I remember getting it out when i was a kid (or at least a book that had a similar explanaion method...) I think the one i was thinking of was a book that one was supposed to teach onself FORTH with. I gave up on that mainly because my FORTH interpreter on my Franklin Ace was hardly what you would call stable.

      I still remember the little boxes hopping along the conveyer belt towards the ALU where they would be shelved until an operator came along =:-)

      --

      ---
      Play Six Pack Man. I
  19. Learn C++ in Five Minutes! by bgs006 · · Score: 5
    Hey excited Netizens! Wanna learn a difficult programming language in just five minutes?! Wanna earn gobs of money from desperate start-ups who will throw any sort of bribe at you to work in their tiny, cramped, dungeon-like cubicle!? Well stop wishing and start learning with my new seminar!

    I know what you're thinking: there's no way I can learn C++ in five (count 'em) five minutes. Well stop being such a doubting loser. Here's what you do:

    Step One: On the qualifications section of your resume, write, "I know C++." Feel free to put other things, such as "I speak thirteen different languages," "I've slept with Pamela Lee Anderson", and of course, "I am omnipotent."

    Step Two: Get Hired!

    Step Three: When your manager approaches you to actually work on a C++ project, immediately run to your nearest Asian immigrant and pay him 50 cents an hour to do the project for you! Don't feel bad, your manager did the same thing to get in his position!

    Step Four: Watch as the money, women and strange magic powers are bestowed upon you.

    It's just that simple!

    -Bgs006
    LostBrain

    1. Re:Learn C++ in Five Minutes! by Signal+11 · · Score: 3
      Step Five: Get introduced to RealWorld(tm).

      Step Six: Asian dude goes to work for SGI, pulls six figures. Your project is delayed. Senior Engineer asked you about progress, realizes you're full of it, informs senior management, shafting follows.

      Step Seven: Get desperate, spam hundreds of newsgroups with "make money fast!" schemes to help you get out of debt.

      Step Eight: After changing several ISPs and diffusing three different mailbombs, reality dawns on you - there is no fast way to do anything.

      Step Nine: go back to school, get a degree, do things the way everyone else does.

      Step Ten: get a job, life, girlfriend, family, wife, kids..

      Step Eleven: Retire, spend 3 years in retirement, die.

  20. What's a "steep learning curve" by ChrisWong · · Score: 4

    That phrase always bugs me. The obvious first take would be to graph the independent variable (time) on the X axis, and learning on the Y. But then that would give any "hard" subject a shallow learning curve. Someone once tried to explain it to me by using a Z axis, muddling everything up even more. Is there an official interpretation, or did an economist invent this graph?

    1. Re:What's a "steep learning curve" by Vanders · · Score: 1

      I don't think it's anything to do with graphs. If you imagine a climbing a large mountain, it's a step climbing curve. It takes a lot of effort. Just as learning something as complex as C++ is complex. Or something.

    2. Re:What's a "steep learning curve" by eellis · · Score: 1
      The obvious first take would be to graph the independent variable (time) on the X axis, and learning on the Y.

      Hmm, yes i'd never really thought about it like that. I think you're meant to think of it like a hill, where the X axis is how much you know, and the change in height is how much energy you must expend to get to that state of enlightenment.

      Edric.

    3. Re:What's a "steep learning curve" by ghira · · Score: 1

      A possible interpretation would be that
      the x-axis represents the sophistication
      of the programs you want to write, and the
      y-axis represenents how much you need to
      know about the language to do it.

      In the case of Perl, you can write simple
      programs whilst knowing almost nothing
      about the language. With C++ perhaps you need
      to know a lot even to write trivial programs.

      --
      -- You've got to get a hat if you want to get ahead.
    4. Re:What's a "steep learning curve" by TomDLux · · Score: 1

      The horizontal axis is knowledge, how much of the system you have learned; the vertical axis is effort.

      If you have a shallow learning curve, it's like gamboling among the sheep in the English countryside. You bounce along, learning effortlessly.

      A steep learning curve involves climbing a steep cliff as step one. It may not advance your knowledge a great deal, but it takes significant effort before you can even get started.

    5. Re:What's a "steep learning curve" by keffy · · Score: 1
      Forget dependent and independent variables. Think of proficiency on the X-axis and cumulative effort on the Y-axis.

      Or better yet, think of a real you in a real landscape. You want to move ten feet to the east. Would you rather do that on a prairie or when there's a cliff two feet to your east?

    6. Re:What's a "steep learning curve" by scott@b · · Score: 1

      You got it right - that was the early meaning, various people have commented on the drifting meaning over the years. It appears that some pointy haired management type years ago heard the phrase and, showing their true skills, immediately reversed the meaning and used it whenever they could. Y axis is how much you know, X is how long you've spent. That way one tends to climb higher and higher - more skill/learning - unless the skill is abandoned. If someone is slow at learning the subject, their curve is fairly flat. If they give up the curve plateaus at their level of skill, or decays as they forget. Pick the guy with the largest Y value. If Y was the amount of effort then learing would be a series of hills, assuming that the subject being learned got easier to deal with after time. If you never learned it the curve would plateau at the level of effort you continue expend. If the subject became more and more difficult the curve would continue up endlessly. But you couldn't tell if a dropping curve meant that the subject was being grasped or if the learner had just given up and wasn't expending any more effort on it.

    7. Re:What's a "steep learning curve" by Karmageddon · · Score: 1
      Clearly, there could be more than one thing called a learning curve, but the one everybody talks about comes from economics, and it measures experience on the x-axis (log scale) and cost on the y-axis, and they are often linear with a negative slope. They are used to describe the decreasing costs associated with number of units manufactured. The log scale is used because generally you keep needing to manufacture N times as many to achieve the same cost reduction. It's no more a "law" of manufacturing than Moore's Law, but it seems to work about as well.

      Steep learning curves show fast learning.

    8. Re:What's a "steep learning curve" by Remote · · Score: 1

      Agreed. It has always bugged me too. This is one of the expressions/words that I just don't use because they mean something but almost anyone understands them the other way around. Someone pointed here in /. in the past that "arsenal" is where weapons are made, not stored, so it is a dead word for me now, despite being distorted by commom usage. It may be OK if you think of it as an analogy to a walking path, but in a technical environment we tend to think of a steep curve as a representation of a function. And sure, the variable one has control of his time or effort, and you won't draw your graphs with the independent variable in the vertical axis, right?

    9. Re:What's a "steep learning curve" by ChrisWong · · Score: 1

      Actually, the word "arsenal" is listed in the dictionary as having both meanings that you described. The phrase "learning curve", however, still has the classic meaning steep==fast from 1922. Try looking them up on Merriam-Webster.

    10. Re:What's a "steep learning curve" by Remote · · Score: 1

      Try looking them up on Merriam-Webster.
      I surelly did it back then, and that's why I said (something like) "distorted by common usage". The M-W entry mentions that the word initially meant "house of manufacture".
      Let's not engage in a fruitless discussion here. There are those who say language is made by people and those who say there must be rules or things turn into anarchy. I'm more inclined to stick to the etymological meaning of words, because if everyone does so I can be sure that what I write means what I think to those who read it, while allowing for "evolution" (which generally comes from misusage, like in "computer hackers") brings in all sort of confusion. OTOH, languages are living bodies and you can't just "freeze", so one has to accept change. I'm just not very permissive on that.
      As to "steep", I think it means "very inclined", as opposed to "shallow". And I have no idea what this "classic 1922 meaning" thing means, but that's probably my fault, for I don't speak English well (not my mother tonge and I've been to the U.S. only twice, for a few days).

    11. Re:What's a "steep learning curve" by cant_get_a_good_nick · · Score: 1
      I was thinking the same. Steep implies "moving swiftly with respect to time", which means to me learning quickly, which is usually the opposite of what's being described by the Steep Learning Curve(TM).

      Tall learning curve makes it for me. Can I patent that? Or maybe have a trademark on Tall Learning Curve(TM)? Just don't hyperlink to this or you have to pay B.T.

    12. Re:What's a "steep learning curve" by duke02 · · Score: 1

      if you graph knowledge on the X axis and time on the Y axis, you end up with the proper "steep learning curve is bad" graph--but there's lots of games you can play with graphs...

    13. Re:What's a "steep learning curve" by jemfinch · · Score: 3

      The X axis is the usefulness of what you can do in the language; the Y axis is is the amount of knowledge of the language you have learned thus far.

      A subject with a steep learning curve, therefore, is a subject where much learning is involved to do relatively simple tasks.

      Jeremy

    14. Re:What's a "steep learning curve" by Anonymous Coward · · Score: 1
      I think this is what people are trying to say: when you have a steep learning curve, you have a lot to learn in a short amount of time.

      If I take a job, and they tell me there's a steep learning curve when I get there, I assume that I'll be required to digest a lot of information and knowledge in a very short time. This would make for a steep learning curve.

      In an ideal world, we could take all the time we wanted to learn complex tasks, and there would be no steep learning curve. We don't live in an ideal world, and many times we have to figure out a complex subject in a limited amount of time. We may have a day, or we may have a month, but what we don't have is the time to make our learning curve shallow.

      Think about it, if you could have spent twenty years figuring out your favorite language of choice, and you spaced it out pretty evenly over that time, would you even suggest you had a steep learning curve? Even for something difficult like assembler?

  21. First Step by tekxtc · · Score: 1

    With the predictions of things like even my light bulb will have an ip of its own, it is very important the so called an average user knows a bit or byte about the internals. It should not be limited to just C/C++ programming but should extend to include things like concept, not necessorily implementation of encryption, networking and OS. Hey, I know what type of saftey featurs, equipment, modules etc I want when I want to use a car. So why should I ignore thefor the almighty world of computer/internet/networking ahead of us.

  22. Larry Gonick by FascDot+Killed+My+Pr · · Score: 2

    He's written a bunch of other "Cartoon Guide to..." books as well. The best are his history books (two books each split into around 8 "volumes").

    Book 1 is "big bang" to "the fall of Rome" (as I recall). Book 2 backs up a little bit and changes geography to look at the history of China. I'm expecting Book 3 any time now since it's been several years since the last book appeared.

    Book 1 was mostly familiar to me--the same-old "first the tribes, then the Greeks, then the Romans" stuff (although told in a very entertaining way). Book 2, though, was totally new: We don't get much non-European history here in the US. No wonder we don't understand "those Chinese".
    --
    Compaq dropping MAILWorks?

    --
    Linux MAPI Server!
    http://www.openone.com/software/MailOne/
    (Exchange Migration HOWTO coming soon)
  23. This part makes me nervous...... by dzogchen · · Score: 1

    It sounds like a good book I just get a little worried when the "novice user" ends up marrying the author!

  24. Education good! by JMZorko · · Score: 2
    I am completely, 100% in favor of educating more and more people regarding the power of the personal computer, even programming -- heck, _especially_ programming. Books like the Dummy books are absolutely brilliant -- they pull back the curtain and show the reader what's really going on. It also shows them that they can do it, that they're not the 'dummy' they maybe thought they were.

    The power of the personal computer; the power to develop their own solutions, should not be confined to the rarified realm of programmers and engineers. _Everyone_ can benefit from this, and the more this information is brought out into the open, the better. I recently bought a friend of mine a "Visual BASIC for Dummies" book. He was, at first, a bit fearful of it, but once he started, he started really enjoying it. HE called me once about a bug, and when I showed him what the problem was (i'm certainly no VB expert, I work in C++ primarily), he immediately _understood_ it, saying something like "Of course! I checked everything else but that." One could see his esteem growing; it made me feel really good.

    Regards, John
    --
    Falling You - beautiful
  25. I agree. by Dungeon+Dweller · · Score: 2

    Too many programmers get stuck in a mode of not actually knowing what's going on with their programs. They come to a university and get smacked in the face with actually having to UNDERSTAND THEIR OWN CODE. The object oriented paradigm is useful in its own right, but learning how to manipulate objects is not learning how to program. Ada is a good intro language because of many factors. For one thing, you have to know what you are doing to do it. If you don't, you're not going to do it. It teaches scope properly, and gives a new programmer a good feeling for how the code flows and what is actually going on. I have heard Ada decried on here as being "cumbersome," if you are a good coder, it isn't, because the only things that you have to do extra in Ada, are the things that you should be doing in C/C++. In other words, the only thing that you have to do extra in Ada, is be good enough to write the program that you are writing.

    --
    Eh...
    1. Re:I agree. by jafac · · Score: 1

      From the perspective of a tech support person, fluid in Novell debugger, familliar with the C language, but never really sat down and programmed, I can say that probably 90% of the programmers I've worked with may write beautiful programs with wonderful widgets and windows, and elegant workflow. But when something breaks, they have no clue.

      It's especially cumbersome on Windows. Oops, something went wrong on this guy's 486 with 16 megs running windows 95. No intelligible return codes, say the process hung. No problem, let's fire up the debugger - wait, oh, um, okay we gotta install MS Visual Studio 6, um, got an extra gig of disk space for that, plus the symbols? (work around those issues), okay, debugger's running, reproduce problem, um, gee, I'm not seeing what's coming back, um, the OS isn't responding to this API like Microsoft's documentation says it should. um, try reinstalling the OS and see if that fixes it, 'k? By that time, counting phone tag with the customer, etc. a month has gone by, (if you're lucky).
      In short, they don't know what the f*ck is going on. The level of abstraction is so high right now, they not only don't know the underlying systems, they have no idea of how to get at them, so if something is fundamentally broken, there's no way to fix it. This is why some software ends up having bugs that live through several versions, because it's so difficult to fix now.

      This is something I see the concept of "open source" having a shot at fixing. No application vendor can truly support their product on a platform that is not open to them. These highly abstract frameworks like MFC only serve to make things more obscure. (although now we're getting away from the language debate, because most programmers will agree that MFC != C++ programming).

      If it ain't broke, fix it 'til it is!

      --

      These are my friends, See how they glisten. See this one shine, how he smiles in the light.
  26. I've read it. In fact I started out with it. by Narcopolo · · Score: 3

    And I have to say it's very good. I think that C++ is actually an excellent language to begin with, as people tend to think in objects. The book is very good at showing instant results, in fact it starts out with strings. This lets people see immediately practical uses for what they are doing, and feel some accomplishment.
    Most of the C books I've read don't even try to get to strings until halfway through, and make it a rather complicated introduction by making you understand data types and arrays first. Mr. Heller's point is that, with C++ at least, you don't really have to know what's going on with strings to use them, and that it's easier to understand the fine details of things once you've become familiar with them through usage. He does that a lot in the book.

    My C teachers and classes have always seemed extremely dry after being introduced to C++ by Steve Heller. If anyone is curious about learning to program, I wouldn't hesitate to recommend this book as a starting point. There's also a follow-up book, "Who's Afraid of More C++", also working with Susan.

    Mr. Heller also seems rather accessible be e-mail, but please don't hold him to that because I said so.

    -N.

    --
    I used to be a cynic, then I got disillusioned with it.
    1. Re:I've read it. In fact I started out with it. by Narcopolo · · Score: 1

      Sorry to reply to my own comment, but I forgot to mention that the edition I got came with the free DJGPP/GNU compiler for DOS. Not all of them do, but I'd recommend that any starter book you get comes with a compiler.

      --
      I used to be a cynic, then I got disillusioned with it.
    2. Re:I've read it. In fact I started out with it. by Matthew+Smith · · Score: 1
      Almost every Linux distribution comes with GNU c++ installed so you can start compiliing straight away. All you have to know is how to use a text editor (for example NEdit to keep things simple) and then

      c++ test.cxx -o test

      And that's it. no more difficult than using the copy command to start with. One of the biggest problems for beginners is that the error messages seem misleading and often confuse them but that's another issue altogether.

  27. Re:Can someone give 1 good reason to use C++ over by YogSothoth · · Score: 1

    I believe I can, however I'm not sure that it'd be wholly on topic ... why don't you email me at: jdumas [at] locutus [dot] kingwoodcable [dot] com and I'll try to sway you ;-). Be warned, though I am a reasonably seasoned C++ programmer I'm no zealot (i.e. I don't 100% disagree with your base assertion). I will show you a number of things you can accomplish with C++ that are either impossible in C or horrendously ugly/difficult so write me if you like ;-)

    --
    there are two kinds of people in this world - those who divide people into two groups and those who don't
  28. Steep learning curves... by vanwestr · · Score: 2

    ...are exactly what you want! Ideally, your learning curve is a theta function: zero time goes by and you have full knowledge. Where did this phrase (and its negative connotations) come from? A shallow learning curve means learning forever and never knowing anything! Sorry... slightly off topic.

    --
    sigarette
    1. Re:Steep learning curves... by anatoli · · Score: 2

      You mean delta function, don't you?</nitpicking>
      --

      --
      Industrial space for lease in Flatlandia.
    2. Re:Steep learning curves... by migmog · · Score: 1

      I'm with you on this one. Steep learning curves are good, where the curve is amount learned against time.

      However, people don't get it. Their logic goes like this:

      Steep hill == hard work to get up it, therefore steep learning curve == hard stuff to learn.

      Bear in mind that graphs and curves are scary unfamiliar concepts to most people, which is ironic because they are the ones who are first to use such unmeaningful pseudo scientific phrases as 'push the envelope' and 'leverage the knowledge gradient'

      Ugh!

    3. Re:Steep learning curves... by Ymerej · · Score: 1

      Nitpicking is right! I'm sure that when most people think of an experimental variable plotted against time, they don't bother to apply analysis to the problem and realize that it could be thought of as a delta function. Also, it doesn't seem to me that when the horizontal axis is "number of trials" that a delta function is appropriate. In that case, the horizontal axis has only discrete numbers.

      The point is that many, if not most, users of the term "learning curve" that I've seen in Slashdot use the term exactly opposite to its actual meaning.

    4. Re:Steep learning curves... by vanwestr · · Score: 1

      No, actually I did mean *theta*-funciton; otherwise known as a "step" function (cruises along at zero, then hops to one). A delta function is a spike (you know nothing, have infinite knowledge, and then back to knowing nothing again!).

      --
      sigarette
    5. Re:Steep learning curves... by anatoli · · Score: 2

      Oh my. You are right. Delta is derivative of theta. How dumb of me.
      --

      --
      Industrial space for lease in Flatlandia.
  29. Get real! by FascDot+Killed+My+Pr · · Score: 1

    "Give me an hour, a good library, and a reasonably intelligent person who has a fairly open mind and high school trig, and I'll have them writing simple games."

    Even if by "simple games" you mean "guess the number", I don't think this is true. The biggest problem people new to programming have is creating an algorithm. I can't tell you the number of times I've had neophytes ask me "what do I do first" or "how did you know to divide by 4"?

    The only way to get good at creating algorithms practice practice practice. And you can't get much practice in a single hour.
    --
    Compaq dropping MAILWorks?

    --
    Linux MAPI Server!
    http://www.openone.com/software/MailOne/
    (Exchange Migration HOWTO coming soon)
  30. Re:If only he had chosen a _real_ language by Peter+Putzer · · Score: 1

    Ah yes, REAL men write object-oriented code in assembler (obviously a REAL language), or in SmallTalk (another obviously REAL language), ey?

    --
    -- KDE programmer and computer science student in Klagenfurt, Austria.
  31. No, post it here by FascDot+Killed+My+Pr · · Score: 1

    Discussions on the merits of C++ are totally on-topic and I'm interested, too. I also prefer C to C++ for the reasons given but am willing to be persuaded.
    --
    Compaq dropping MAILWorks?

    --
    Linux MAPI Server!
    http://www.openone.com/software/MailOne/
    (Exchange Migration HOWTO coming soon)
  32. Re:Can someone give 1 good reason to use C++ over by Sangui5 · · Score: 1

    If you are using strict ANSI C, variables must be declared at the beginning of the block. This means you can't go:

    for(int i = 0; i < 10; i++){
    //Do stuff
    }

    Also, <<, >>, new, and delete are much easier to use, and fancy data constructs are much easier to code OO. Besides the fact that the STL already has most of what you need anyway.

    If you code in C++, you don't have to do a bunch of fancy OO stuff if you don't want to, but it does give you the option. Every C program is a valid C++ program (except for a bit of funny stuff that was a mistake in the first place).

  33. C++ is a horrible introductory language by schala · · Score: 5

    It's so horrible, in fact, that I can't even think of a worse one. You've got all the worst features of bad languages rolled into one -- a massive amount of confusing syntax, (extremely!) complicated semantics, almost always utterly unhelpful error behavior, and an extremely high barrier to entry even to get programs to compile, much less run, to say nothing of them actually working correctly.

    While it is certainly an extremely powerful tool, it is also a gigantic hodgepodge of different programming paradigms. You can be object-oriented, you can be procedural, you can have it look like assembly code; this is flexibility, but only with a corresponding reduction in accessibility.

    Now, I don't really know if there is a perfect language for introductions to programming. The much-maligned Pascal is a good language for learning structured programming, which makes it a good step towards C and then C++. Functional programming is easier to pick up but requires a certain amount of intellect to grasp the ideas of abstraction that it relies upon. (I happen to think that since understanding abstraction is critical to being a good programmer, everyone should do some functional programming.) For that I would choose Scheme in one of its reduced flavors. Scheme also has the advantage of having simple syntax, though it seems a bit unnatural to non-engineering types. For object-oriented instruction, I think Java is a good choice, for a bunch of reasons, which I won't enumerate since they will be obvious and I'm tired of typing.

    It makes me cringe when I see a new "Learn C++ in 24 hours" title on the bookshelf, because I know those texts will screw people up. Learning to program is a challenge enough without having to learn C++ at the same time.

    -m

    1. Re:C++ is a horrible introductory language by sethg · · Score: 2
      You've got all the worst features of bad languages rolled into one -- a massive amount of confusing syntax, (extremely!) complicated semantics, almost always utterly unhelpful error behavior, and an extremely high barrier to entry even to get programs to compile, much less run, to say nothing of them actually working correctly.
      Don't forget the linker....

      Non-inline function definitions belong in the .cpp file ... unless they're template definitions, in which case they belong in the .h file ... unless they have the export keyword, but I don't know how many compilers support that. Constants are defined in the .h file, but static variables and have to be initialized in the .cpp file. And every file has to be wrapped in #ifdef ... #endif to prevent it from being #included twice.

      And when you're dealing with the Microsoft compiler, the compiler sends as little information to the linker as it can get away with ... so link-time errors, rather than providing clues about where to hunt for the problem in source code, refer to object files, pre-compiled header files, and munged function names. (Is g++ more helpful in this respect?)
      --

      --
      send all spam to theotherwhitemeat@ropine.com
    2. Re:C++ is a horrible introductory language by Thagg · · Score: 2

      I wonder if the book teaches the correct pronounciation of C++; it's not "see plus plus" but "see double-cross" [original, I believe, by Rob Pike) thad

      --
      I love Mondays. On a Monday, anything is possible.
    3. Re:C++ is a horrible introductory language by Whip · · Score: 1
      much-maligned Pascal is a good language for learning structured programming, which makes it a good step towards C and then C++.

      You imply here that knowing C is a good step towards knowing C++, and with this, I completely disagree. Though some of the basic syntax is the same, I don't believe that a functional programming language is a good introduction to an object-oriented programming language.

      As a matter of fact, I think that learning Pascal or C before learning C++ (or another OO language) is more likely to hinder someone, than to help them! Using C++ well means using it in a totally and completely different manner than one uses C.

      I know that I sure wish I learned C++ first -- I'd be a much better C++ programmer if I had!

    4. Re:C++ is a horrible introductory language by radish · · Score: 1


      I agree totally - in fact I'd personally avoid C++ even now (although that's another argument!). For the record, I did Comp Sci at (one of) the top UK uni's for the subject, and they followed your pattern almost to the letter. Regardless of whether the students had ever programmed before, we all did the following (in order) :

      Functional Programming (Miranda)
      Structured Programming (Modula-2)
      Logical Programming (Prolog)
      "Real World" Programming (C)
      OO Programming (Smalltalk, although I hear that Java has since replaced this)

      Now of course we did a load of other stuff as well, but what is interesting is that C wasn't taught AT ALL until the end of the 2nd year of 4. C++ was never taught (most of the professors would hit you if you mentioned it's name!). The emphasis is on teaching GOOD PROGRAMMING not teaching the "language of the day". I think this is important, good skills can easily be transferred to whatever language you find yourself wanting to learn. Bad habits will trouble you forever!

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    5. Re:C++ is a horrible introductory language by Karellen · · Score: 1

      Yeah - #include sucks. Hell, cpp (the C preprocessor) sucks. If only Bjarne or the committees had managed to put 'include' in C++, which was, at some point, part of the plan.

      Then we'd have almost entirely got rid of cpp.

      Sigh

      --
      Why doesn't the gene pool have a life guard?
    6. Re:C++ is a horrible introductory language by Hard_Code · · Score: 2
      It makes me cringe when I see a new "Learn C++ in 24 hours" title on the bookshelf, because I know those texts will screw people up.


      It scares me how much stuff might actually be running out there written by people that actually thought they could "Learn C++ in 24 hours". *SHUDDER* "Learning" C++ is a labor of *years*.
      --

      It's 10 PM. Do you know if you're un-American?
    7. Re:C++ is a horrible introductory language by Josho · · Score: 1

      It makes me cringe when I see a new "Learn C++ in 24 hours" title on the bookshelf, because I know those texts will screw people up.

      I hope these texts don't screw people up too badly. Right now i'm 1/4 the way through a "Learn C++ in 24 hours" book. I purchased the book over a year ago, and only recently got the compiler to work (djgpp). Each chapter isn't taking one hour (like the book might have you think), but taking me around 4 hours. These books are informative, but i have to admit, I'm learning many abstract concepts and still have no clue where/how they can be applied.

    8. Re:C++ is a horrible introductory language by Shin+Elendale · · Score: 1
      As one who was introduced to programming on C++ (well, ok, it was the first 'real' language if you know what I mean) I agree. This is rather redundant, but C++ is completely evil when you just start. Mainly becuase everyone assumes you already know five different languages (and you can't learn those without knowing others...) they don't bother explaining little things like what a class is, or why exactly you would want inheritance. Yeah...

      -Elendale (I burned a C++ in 24 hours once.)

      --

      IANAT (I Am Not A Troll)

    9. Re:C++ is a horrible introductory language by Spasemunki · · Score: 1

      ((are you right .)
      (is LISP (language (better much) introductory))
      (has it (syntax (intuitive very)))
      (for beginners perfect))

      Anyone ever wonder if Yoda wrote Lisp?

      "Sweet creeping zombie Jesus!"

    10. Re:C++ is a horrible introductory language by Troy2000 · · Score: 1

      I read these "language wars" frequently and wonder why people actually think learning C++ would be significantly easier than learning, say, anything else. Don't you guys even remember school? The hardest thing about learning isn't what you're learning - its having the interest and perseverence to actually let knowledge into your head and keep it there. Historically, computer programming has been taught by people who don't know how to teach. They're programmers - they didn't study the learning process, they went to grad school and spent their time doing research. I believe anyone can learn anything so long as they have a genuine interest in learning, and a teacher genuinely interested in teaching them - even something as "complicated" as computer programming. Whether the teacher decides to start with Python, C, or BASIC is beside the point. Just about every "learn C/C++" book I've seen makes the same mistake - they ignore the obviously natural way to learn which is by asking questions and getting answers. The books just present the information by chapter by chapter and expect people to read and absorb. I love the hairbrained examples they often use to introduce object oriented programming and object heirarchies (VehicleClass -> CarClass -> FordClass -> ExplorerClass) - how the fuck is that a useful example? This book is probably one of the best books for newbie programmers to look at because of the informal approach and attention it gives to the question-answer format. If he'd tried to teach her MIPS assembly I'm sure he'd have had similar success.

    11. Re:C++ is a horrible introductory language by Arandir · · Score: 2

      And you advocate Java as an introductory language instead?

      Java is so close to C++ that they might as well be different dialects of the same language. Java is a bit more "pure" OO while C++ is a bit more "down in the guts", but overall, they would be identical for new programmers.

      C++ would make a great first language. First, they need learn only one language, instead of one for beginners, another for intermediate, and finally C++ for advanced. Two, the potentially confusing stuff in C++ can be left for later. They are not required to program. Classes can be introduced after mastering structured programming, and templates, STL and generic programming can be introduced after learning OOP. Third, teaching students to use proper coding styles makes any language easier.

      I think this arguing against C++ as a beginners language arises out something other than it's difficulty. No proper programming language can be taught in 24 hours. There may only be 24 hours of lecture time, but this does not count the weeks spent on homework and labwork.

      "Practical C++ Programming" is a great book for learning C++, even if one is not a programmer. Coupled with a comprehensive C++ reference, it would make a nice text for a beginning programming class.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    12. Re:C++ is a horrible introductory language by cburley · · Score: 2
      Anyone ever wonder if Yoda wrote Lisp?

      Wonder not do I.

      Wrote Lisp Yoda did not.

      Yoda Lisp did write!

      Yoda character Lisp program generated by!

      "No try is there. Only do."

      ;-)

      --
      Practice random senselessness and act kind of beautiful.
    13. Re:C++ is a horrible introductory language by Commie · · Score: 1
      Functional programming is easier to pick up but requires a certain amount of intellect to grasp the ideas of abstraction that it relies upon.

      I'm not sure I agree with that. Functional Programming is the first thing they teach at the University of Texas at Austin, followed by a Data Structures class taught in C++. Forgetting for a moment the wildly differing difficulty/style of the professors involved and the UT-CS programs brutal lawnmower in the undergraduate program, I think most students picked up C++ much more easily than the other two options (Haskell or Scheme).

      For instance: Recursion is great, but intuition for MOST people I've run across, intellectual or not, leads to iterative solutions when possible. This is a double edged sword of course, as a solid grounding in recursion is a must for any future-CS major (and hopefully, programmer), but for many, many people (at least in my experience) it's not nearly as intuitive even after much dabbling.

      Most people I know describe functional programming as "programming with your hands tied behind your back", but they're not just talking about explicit memory mangement. There are often less ways to solve the same problem, and that can be difficult for beginners (and, as many functional programming text's I've read like to advertise, functional programming helps produce more "correct code" -- another double edged sword). Yes, yes, functional programming does also make it easy to open doors that would be a large pain to deal with in something like C/C++ (such as function composition, returning multiple things, infinite lists, etc), but these added "flexibilities" have their same set of added complexity associated.

      While C/C++ is more flexible and more complicated, it's certainly possible to learn/teach in subsets rathers than trying to master all aspects and styles at once. There are many references out there (which I unfortunately don't have at hand) on teaching C/C++ as a functional language and hiding the lower-level nastiness for a later date. C++ with a pretty-much STL compliant complier (this even includes MSVC) does this pretty well (string type, vector's, etc), although the lack of built-in garbage collection is a problem after the beginner stage.

      That said, I'm not a huge fan of the idea of hiding the details for very long. Grasping the concepts of pointers, explicit memory mgmt, etc, are all very important. Period. While hiding these details in the depths of a compiler/language can be useful (and helpful!), it's something anyone wishing to call themselves a "programmer" or "computer scientist" should be very comfortable with - both in concept and in practice. I don't want to come off as a C/C++ evangelist here, so I will say, I think virtually everyone should have exposure to a functional language. As far as the "what's better for learning" argument goes, I really don't feel any language capable of decent abstraction (which doesn't include much in use these days, in academia or otherwise) is inherently much better or worse than another. With a competent student (and/or a competent teacher), the "important stuff" will get through. Edsger Dijkstra (a very popular man, particularly around UT-Austin) has been quoted as saying (paraphrasing) "Students who've been exposed to BASIC as their first programming language have their thinking so horribly broken it's impossible to teach them anything". While this was a quasi-joke, I don't really agree with the quasi-premise.

      Personally, I'd recommend Java as a first language. Yes, there are problems (and this post is long enough, so I'll skip this), but you get garbage collection, OOP, and exposure to syntax similar to C/C++.

      I'm a pragmatist - most anyone outside of (some)academians or hobbyists who's going to be programming will be running into C++/Java. It may be after sometime C++ and Java are just as despised as COBOL/Fortran legacy languages are now, but that day is a long way off (Despite what big fans of Haskell and ML might hope). Let's also not forget that beginners have an extrodinary wealth of open-source C/C++ code to learn from (and also learn how not to do things in some cases =) ) which is an ENORMOUS plus for any aspiring programmer.

    14. Re:C++ is a horrible introductory language by alleria · · Score: 1

      Java: more prefabed objects to use. Having the STL is of no use to a beginning programmer. Iterators? Containers? 'Concepts?' WTF??? The beginning programmer wants to be able to use classes like GregorianCalendar and Graphics, and do useful things. Teaching doubly linked lists with a sentinel is not the way to go in any language.

      Java is better in this regard, because the prefabbed objects make it easier to build useful stuff earlier on, and thus starts the postive feedback loop earlier as a result. Same goes for Perl. But C++? Ick!

    15. Re:C++ is a horrible introductory language by X · · Score: 2

      Nothing against C++, but equating the tool is laughable. Syntactically, they are similar, but if you've used both, you'll know that they are different. If nothing else having non-pointer based objects, no garbage collection, and templates significantly changes how one does programming.

      Realistically, if they were so similar, Java wouldn't have had much of a chance of being successful.

      --
      sigs are a waste of space
    16. Re:C++ is a horrible introductory language by X · · Score: 2

      Ease up on the language wars eh? Every language has it's pros and cons. C++ wouldn't be my first choice as a teaching language, but there are worse options. Hell, there was a time when Ada was popular. Fortran 77 was also popular.

      Everyone want's to tout their favourite language (and your advocacy of Pascal is a good example), but in reality, programming languages are not the essence of what you teach to programmers anyway. Heck, most of my comp. sci classes in University would introduce a language to you during the first week, expecting you to be able to use it well enough to cover the material in the course. This was really not a problem, because in the end design techniques don't necessarily require you to excercise esoteric language features (they're mostly there to frustrate developers and compiler designers ;-).

      --
      sigs are a waste of space
    17. Re:C++ is a horrible introductory language by Karellen · · Score: 1

      Heh heh. I *have* read D&E. It's sitting in front of me (and slightly to the side) on my bookshelf as I type. :)

      'include' would rule.

      Cross platform ABI? How cross-platform? 32bit/64bit cross platform? And what's the point in a cross platform ABI if the machine code can't be run on separate chips? You take a XP ABId .o file compiled on an x86 with gcc, and copy it straight across to a Mac. Which is also 32-bit.
      Doesn't matter if the ABIs are the same - the architecture is totally different. So you can read the functions tables (name mangling and all) - what does that get you? You can't execute those functions. You can't link it in with a bunch of other stuff compiled with gcc on the mac - it just won't run.

      --
      Why doesn't the gene pool have a life guard?
    18. Re:C++ is a horrible introductory language by Commie · · Score: 1

      Whether the Linux/BSD Kernel is "well written" is highly debatable. Regardless it would be useless for attempting to learn C++ and OOP style programming - it's dominantly C. Complex != "well written". Simple/small != "poorly written". No kidding, even good programmers write small and uncomplicated programs. Even if code is poorly written, that's a learning tool in itself. For a relatively new programmer, attempting to extend/modify something that already works is extremely eye-opening, particularly when programming the entire thing from scratch would be nearly impossible at that stage. It's also often much more interesting dabbling in something that may have some actual practical use rather than writing small chunks of code as nothing more than a learning exercise.

  34. For the complete novice by aleksey · · Score: 2

    I agree with many other posters who've suggested that perhaps C++ is not the optimal language for teaching complete novices. And apparently so do quite a few smart people at Rice. That's why they wrote How To Design Programs. It's a rather good beginner text, IMO.

    --
    --
  35. No excuse for not thinking ... by LL · · Score: 1

    If programming was just a matter of training then we would have code monkeys coming out of the jungle. However, as people like Knuth points out, it takes a special kind of talent to structure a complex system without getting lost in the details. Perhaps it is akin to writing a symphony, you have to know the general theme as well as how your line fits in. Not the same as throwing a few software bricks together with some GUI scripts in the hope that it doesn't fall apart.

    It is rather interesting to speculate as to what makes a superlative software architect. I recall one article which claimed that if you had a prior background in music or even languages, they could teach you how to design/code. Coming from an impoverished background is no barrier as India has so amply shown. Symbolic reasoning? Spatial awareness? Or is it just something we can't test until the person sits down and has a hack and discovers a natural talent?. The mind is a strange and wonderful beast.

    LL

    1. Re:No excuse for not thinking ... by cculianu · · Score: 1
      You're right man, amen to that! The mind is a wonderful thing.

      To address some of the things you said--I think the ability to reason critically.. to draw analogies between similar things and also to delineate and distinguish the differences between things that are superficially similar is a big part of understanding any complex and/or interrelated system such as a piece of software. It's also a big part of being a good programmer.

  36. Optimization by Dungeon+Dweller · · Score: 3

    Higher level languages produce slower programs. While I like Python and do all of my web scripting in Perl, if one truly wants to get the most out of their programs, they will optimize in assembly. Faster processors are not a good excuse to blow simple, good computer science out the window.

    --
    Eh...
    1. Re:Optimization by David+Greene · · Score: 1
      Nope. If one truly wants the most out of their programs, they will turn on the compiler's optimizer.

      Believe me, the compiler can do many more low-level machine-idiom transformations than most programmers can. Programmers should concern themselves with the high-level algorithm and leave CSE's and loop transformations to the compiler. The programmer usually gets in the way with fancy "optimizations."

      --

      --

  37. Complete Idiot's Guide to Multiprocessing called.. by TeknoHog · · Score: 3
    ..Who's Afraid of the Big BeoWulf?

    ;-)

    --
    Escher was the first MC and Giger invented the HR department.
  38. Re:Can someone give 1 good reason to use C++ over by gavinhall · · Score: 1
    Posted by 11223:

    ...which is why you'll see C++ programs that have local variables for each block. I stick to a maximum of three throw-away variables per function (i,j,k) and reuse them. Better planning leads to better programming. C is not a free-form language. And why does the bit-shift operator control output, anyway? Admittedly, printf is a bad analogy. One should always use write(2) if one wants to understand output. Malloc is just fine for me. Free is just fine for me. Both are easy to use. Want a new struct asdf? struct asdf* ptr=malloc(sizeof(struct asdf)); - easy enough.

    And for the STL, glib provides most of the best calls.

  39. Re:If only he had chosen a _real_ language by Lita+Juarez · · Score: 1
    Your post is an obvious troll, but just for the record, C++ is much better than Perl for a variety of reasons:

    1. Perl is slow. The inherent inefficiency of Perl becomes obvious as soon as the program becomes more than just a simple script. Compiled languages (such as C++) are the only serious option for coding any non-trivial software.

    2. Perl makes inefficient use of available resources. The interpreted nature of Perl creates a huge overhead, thus wasting processor resources and making your quad Xeon box perform like an 8086. It is not possible to optimise your Perl code to make full use of your processor. C++ allows a wide variety of optimisation methods, and with a good compiler the speed of compiled C++ is indistinguishable from the speed of assembly language.

    3. Perl is hard to maintain. It is impossible to create weakly-coupled, highly abstracted code in Perl, thus it is also impossible to maintain Perl code on large projects. Object Oriented languages, such as C++ which you seem to despise, win every time. Contrary to what you say, C++ is object oriented, Perl is not.

    4. Perl is unecessary. There really is no sane reason to use Perl - The argument that Perl is simpler to learn is completely invalid, since any reasonably skilled Perl 'coder' can easily make the step up to C++. The skill lies in learning how to program, not how to produce correct syntax. The sheer inefficiency of Perl means that C++ is more suitable than Perl for 99% of programs.

    5. C++ programming is a valuable skill. It is worthwhile for people to learn C++ (or plain C) since it is the industry standard programming language. Perl is perceived as a hobbyist language, therefore Perl programming skills are not very marketable to employers.

  40. Re:Can someone give 1 good reason to use C++ over by Biff+Cool · · Score: 2
    Scalability

    Conscience is the inner voice which warns us that someone may be looking.

    --

    Conscience is the inner voice which warns us that someone may be looking.
    -- H. L. Mencken

  41. Really? by Dungeon+Dweller · · Score: 2

    You really think that you couldn't get someone to type.
    void main()
    {
    seed(time);
    random();
    ...

    yeah, chunky pseudocode, but like, I think that I could get a monkey to type something akin to that in an hour if I was sitting with them.

    --
    Eh...
  42. Steep learning curve means easy to learn by Ymerej · · Score: 1

    The last thousand times I have seen the term "learning curve" misused, I let it go. This time I won't. The term comes from psychology, and refers to a graph of amount learned as a function of time. See this and this.

    1. Re:Steep learning curve means easy to learn by tastywhitebread · · Score: 1


      After words are misused enough, their definitions change. While it's true that the origin of the phrase comes from psychology, most people know the conventional use for the word.

    2. Re:Steep learning curve means easy to learn by ChrisWong · · Score: 1

      Thank you. I wish more people would practice the Socratic method by asking (with an innocent look) "what's a learning curve?" and watch the clueless get a clue as they try to explain it.

    3. Re:Steep learning curve means easy to learn by davebooth · · Score: 1

      Your description of the curve and your complaint about its misuse are both accurate but lets look at HOW the misuse came about.

      The gradient of a learning curve says nothing at all about how easy it was to learn that much in that time, simply that at time x the amount learned was y. It is reasonable to predict that the more effort you put into learning a subject the steeper your learning curve will be. Now look at a person using that knowledge in their everyday employment. If their learning curve is too flat they will not be very productive very quickly. The misuse of "steep learning curve" could be corrected by restating This subject has a steep learning curve as This subject requires a steep learning curve to be used effectively . With a reasonable distribution of the difficulty of learning it is easy to see that where a steep learning curve is required you're going to have to work your ass off to stay ahead of it and keep up with your work - hence the assumption that steep == difficult. It is simply with the trend towards using fewer words and relying on the context to fill in the blanks (a whole new area of discussion that I'm not going to get into here - I'll flame about the death of literate discussion elsewhere :) ) the phrase has been corrupted in common usage.

      Personally I agree with you that it is being misused but the fact remains that communication is the ultimate goal of language and it is therefore common usage that defines words and phrases outside specific contexts where they may be used more precisely.
      # human firmware exploit
      # Word will insert into your optic buffer
      # without bounds checking

      --
      I had a .sig once. It got boring.
    4. Re:Steep learning curve means easy to learn by spitzak · · Score: 1

      It makes sense if the horizontal axis is "how good you are at it" and the vertical axis is "how much you know". To get to a certain amount of proficiency you have to climb a very steep curve of learning.

  43. Re:Can someone give 1 good reason to use C++ over by Remote · · Score: 2

    I think I can give you one. When you program in C++ you can do anything you can do in C plus (no pun intended) a lot more. You can write functions and/or tools in a style that touches and feels the hardware. Then you can objectify things so as to have much cleaner (thus safer) code in upper levels.

    This is one approach, the one I regretably followed. I just mentioned that way of doing things because you sound a bit like a die-hard C programer, and maybe you'll feel more comfortable with this small subset of C++. The best path of course would be to think different (tm) from the very beginning, using the STL and programming generically when there is a need.

    But the real good reason to use C++ in my opinion is its power and flexibility (that multi-paradigm thing, if you like long words). I don't think there is any other language that can be so easily adapted to one's personal needs or the needs of a given project. Even if your need is to be close to the machine. And the tradeoffs are small too. With today's compilers (I use Borland 5.0 and GNU gcc) there is little difference in the code produced. Some (very credible) people claim that in some circumstances C++ will produce even smaller and faster code than C, but I haven't been able to duplicate that experiment. :)

    This is all pretty obvious and well discussed in many places, there must be someone arguing the same thing, even as I type, so maybe I missed the point in your question.

  44. Re:Can someone give 1 good reason to use C++ over by Sangui5 · · Score: 1

    How about g++ as a workaround to annoying admins.

    I've had admins disable gcc because it's a "security hole" and leave the system nearly useless for users. However, very rarely have I come across g++ disabled.

    On the other hand, one overly bright admin just disabled the linker...

  45. Languages are easy by tastywhitebread · · Score: 1



    Learning a programming language is the easy part. Actually using it wisely and thoughtfully is the more difficult endeavor.

    I remember when I was a college student, and I felt so cool because I knew how to use obscure c++ syntax. I thought I knew so, so much.

    Now, with a code base of over a million lines and an office full of class diagrams, I'm constantly reminded of how little I truly know. But that's not a bad thing; I constantly learn new things, and each day brings me more wisdom. I just think it's funny how my paradigm shifted.

    Programming is very similar to literature in that it's somewhat easy to learn the language syntax, but it's very, very difficult to use the language appropriately. That's the difference between being a novice and a master. Yes, you may be able to learn C++ in 7 days, but it will take you several years (at least) to become fluent.

  46. I disagree by paRcat · · Score: 1

    I'm a sysadmin, but I know very little about programming. Yes, I can write a *simple* program or script, but when it gets complex, I'm just not what I need to be.

    The obvious drawback is that I have to rely on others to release software and updates that I need rather than writing or improving my own.

    I think that the biggest pitfall for users is viewing computers in the wrong light (Impossible machine) and being unwilling to apply any basic knowledge

    So given my background, (17 years in computers) it should be obvious that I don't view them as "impossible" machines. I taught myself basic when I was younger, and I've been trying to learn C++. My problem is that I don't have a simple source to go to for the basics. I also don't personally know any programmers, so it's hard to find any experience that I can call on. So unfortunately, I'm stuck at trying to figure out how to write pointers, structures, et al by myself. And as far as using libraries goes, I'm lost.

    I sincerely wish I had a friend who could code in C++ and could help me, but I'm stuck. So for me, it appears the only choice is a good book written for the novice. Unless someone has a better idea?

    1. Re:I disagree by bozz · · Score: 1

      I can sympathize...when I wanted to learn how to code in a *real* language, like C++, I didn't know where to start.....it is confusing. My advice to you, if you really want to learn a language, is take a class at your local community college and read the newsgroups for the language you are interested in. Get a subscription to Dr. Dobbs and play w/all of the programs in every issue.

      One thing you will find out is that after you learn one language reasonable well, the next language is much easier, because you have context to work with.

      Another thing that I should have mentioned above is that you really need to take some basic CS courses as well. With out those, the language is kinda useless (like giving a 16 year old a Ferrari Mondelo, he'll have a really cool car, he just won't be able to do anything with it!)

    2. Re:I disagree by seanson22 · · Score: 1

      Given the number of online resources, I can't believe you can't find a tutorial or ten. If you want really good information, go to the college sites that have the lecture notes online. These provide all the information presented in a comsci class and, after having sat through many of them, are about as lively. Just look around for the info, its all out there.

    3. Re:I disagree by paRcat · · Score: 1

      The tutorials are the problem. Maybe I haven't found the right ones? :)

      The prob comes when I have a question as to why the writer does something specific. I can't ask my question, but the tut writer doesn't realize that he was unclear, so he goes on to another topic before I completely understand the last.

    4. Re:I disagree by radish · · Score: 1


      * Yes, C++ has a high barrier to entry, but programming is difficult - and it will always be difficult. Any attempts to create
      languages which shield programmers from the machine inevitibly limit functionality, thereby castrating the coder.


      Standard question : So why don't you write everything in binary machine code?

      Think about it - my job as a developer is to produce programs which do a job. And the quicker I can do it the better. Soooooo - anything which makes my life easier (MC -> ASM -> C -> Java -> Whatever next) is better. To write a financial analysis package I really don't care how the machine works, I don't give a *£!? how many registers I have, or whether I'm big or little endian, what address a particular variable is at or any other C/C++ related nastiness. What I want is to be able to conceptualise the data I have, it's relationships and it's flows. That's whay I like Java at the moment. I realise that a lot of people do need the hardware level stuff, but to say that everyone needs it (as you imply) is very narrow minded.

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    5. Re:I disagree by Blake · · Score: 1

      C++ has a high barrier to entry, but programming is difficult

      Programming is only difficult because the tools and languages we use make it so. With better tools, and easier languages, programming becomes far easier. There's a reason more people program in VB than in all other languages combined.

      And Perl's TMTOWTDI is only considered a strength by those who don't have to read (other people's) Perl.

      Later,
      Blake.

    6. Re:I disagree by timmyd · · Score: 1

      Standard question : So why don't you write everything in binary machine code?

      Standard Answer: Because c++ is source code compatible on different platforms and it can be high level or low level depending on how it is written.

    7. Re:I disagree by alleria · · Score: 1

      Any attempts to create languages which shield programmers from the machine inevitibly limit functionality, thereby castrating the coder.

      True to an extent. However, this applies mainly to systems programming, which AFAIK is still done less often than applications programming. Java, as an example, is obviously an applications programming language, which is why it has definitions for the size of all the basic types, and many other standardizations that tend to "insulate" the user from the machine. Sure, you take a performance hit, but your programs are more portable, and you spend less time worriying about details. Obviously, the same goes for garbage collection.

      In terms of shielding the user, anything above typing in hex codes into a hex editor is probably considered "shielding." It all depends on what level you're talking about.

  47. Re:Can someone give 1 good reason to use C++ over by David+Greene · · Score: 1
    Maybe I got trolled, I dunno, but I see comments like this so often that I just have to respond.

    Why use C++ over C? Ignoring the fact that C++ is for all practical purposes a superset of C, I'll list the featured I find most useful, anf the reasons why:

    • (Mostly) Strong Typing - A lot of people find this restrictive, but in the long run, proper use of datatypes, enums and consts saves debugging time. I find that I get more things "right the first time" in C++.
    • Encapsulaton - Properly protecting your data with private and protected can tell you when you've coded a bad algorithm. It forces you to separate the interface from the implementation. Multiple inheritance can take this one step further, but I don't usually go that route.
    • Polymorphism - Ok, this is the obvious one, but it really is extremely useful. It's also the hardest part of C++ for C programmers to "get," as it requires a completely different mode of thinking. I know it took me a couple of years and reading of Design Patterns to really, truly understand it. The Visitor pattern was my gateway to understanding. :)
    • Streams - This really goes along with strong typing and includes things like strings and other fundamental library issues. Streaming is a MUCH nicer way of formatting data than printf, mostly because it's well-typed. No more segfaults from passing an int to a %s format.

    • Libraries - While C certainly has excellent libraries, C++ includes the STL in the standard, which is a godsend (mostly). I don't want to code hashtables and lists. I did that in college. STL lets me get my work done in a standard way. Now, I have issues with how the STL was standardized (the STL string/iterator/streams interaction really, really bugs me), but overall it is very slick.

    Finally, I'd like to address the issue of bloat. C++ does make it much easier to code badly. All of the abstract data types and code hiding can easily turn an O(n) algorithm into an O(n^2) one. As with any language, proper understanding of the code (libraries) is the key. The STL Programmer's Guide is an excellent resource for understanding the limitations and proper use of the STL.

    To conclude with a "real world" example, I am currently on a team developing an optimizing compiler in C++. It's been a huge learning process, as any student project is, given that we started out with little compiler experience and only marginally more C++ experience. But throughout the project I have continually improved things by learning just a bit more about how C++ and the STL work. At this point, our compiler has similar functionality to gcc and runs in the same or less memory space. It's quite a bit slower, but I attribute that more to some non-optimal algorithms and more complex dataflow analysis than to C++.

    In addition, by using C++'s ability to overload functions, I was able to quickly hack up the LeakTracer tool (which overloads operator new and operator delete), providing many memory debugging features and in the process reducing our memory consumption significantly. All in the span of a week.

    --

    --

  48. Re:C++: The PL/1 of the 90s. B*L*O*A*T!!! by jejones · · Score: 1

    Sigh...I wish I could rate that both as "flamebait" and "insightful." I'll go put on my "C++:C::PL/I:FORTRAN" T-shirt instead. :-)

  49. C++ is NOT the best langage to learn on by Dacta · · Score: 4

    Why on earth would anyone try and teach a newcommer to programming something like C++? It's my view that any langage based on the C syntax is not suitable for beginners.

    Pascal, Python, maybe Java are all great languages for a beginning programmer.

    I'm sure that it is possible to teach some people C++ as their first language. I'd argue that they could have learnt something like Pascal in less time, and have a better understanding of it. C/C++ syntax is too weird for a beginner, and you need to understand too much about memory & pointer to do anything useful. I mean... no native string type in C? How stupid is that when you think about it?

    1. Re:C++ is NOT the best langage to learn on by seanson22 · · Score: 2

      If you proceed from the assumption that the best first programming language is that which is easiest to learn, then Pascal and Python and Java are wonderful ideas. If your goal is to understand programming and its relation to the inner workings of the computer, then C, no matter how long it takes, is going to be far superior in that aspect.

    2. Re:C++ is NOT the best langage to learn on by kali · · Score: 3
      Why on earth would anyone try and teach a newcommer to programming something like C++? It's my view that any langage based on the C syntax is not suitable for beginners.

      Why, exactly? The C syntax is used by C, C++, Java, and Perl, which are arguably the most common languages in use today. Why would you teach beginners something that they would never use, rather then something they would use everyday as programmers? What syntax do you find easier to understand?

      Pascal, Python, maybe Java are all great languages for a beginning programmer.

      Umm... Java is pure C/C++ syntax.

      C/C++ syntax is too weird for a beginner, and you need to understand too much about memory & pointer to do anything useful.

      This is simply not true. I worked as a TA for an intro programming class taught in C++, and they never even mentioned pointers. The only discussion of memory was when I would explain to the students why their programs crashed when they went beyond the bounds of an array. Otherwise, they were perfectly functional without any such knowledge.

      Of course, to be competent in C++ requires a thorough understanding of memory issues, but we're talking about beginners here.

      I mean... no native string type in C? How stupid is that when you think about it?

      You're absolutely correct, it is stupid. However, since the topic here is C++, and C++ does have a native string type, what the hell is your point?

    3. Re:C++ is NOT the best langage to learn on by JoeWalsh · · Score: 3

      It's my view that any language based on the C syntax is not suitable for beginners.

      I've tried to teach many people to program. The first time I was called upon for this was when I was 13 and one of my mom's friends had purchased a Commodore VIC-20 thinking she and her husband could automate their business with it. My mom sent me over to this woman's house to teach her how to program BASIC so she could automate the accounting system. Yeah, that was just tons of fun. Fortunately, she gave up after a few sessions. And I got some nice home-made cookies out of it, so it wasn't a total loss for me!

      Anyway, I've been informally teaching people to program, with varying degrees of success, ever since. In all this time, perhaps the most important thing I've learned is that the biggest hurdle potential programmers face is learning to think programmatically. Or, as someone else said, to think like the computer.

      It doesn't matter whether I was teaching someone to program in BASIC, Pascal, C, or Java, the stumbling block was the same. I'm not a professional instructor, so I wasn't able to get some people over that hump. But those who did get over it found that, within a short while, they didn't need me to teach them anymore. They could pick up the rest on their own. (Of course, those who didn't get over the hump didn't need me anymore either, so either way I was out of a job!)

      I believe C++ would be just as appropriate for this as anything else, but as with BASIC and a host of other languages, people who only know C++ tend to have a harder time understanding how the computer works. C++ adds a layer of abstraction that, while useful to the experienced programmer, doesn't help neophytes to learn other, non-object-oriented languages.

      Still, I'll probably add the book in question to my collection of "how to program" books. I'm always interested in seeing how people try to teach one another (unless it's a "learn X in Y hours/days/weeks" book or any title that insults the purchaser's intelligence ("...for Dummies," "Complete Idiot's guide to...", etc.) - I avoid all of those titles like the worthless detritus that they are).

    4. Re:C++ is NOT the best langage to learn on by Kinthelt · · Score: 3
      It's my view that any langage based on the C syntax is not suitable for beginners.

      It's not exactly the syntax of C that is difficult for beginners, moreso it is the low-levelishness of C that makes it hard to learn. Beginning programmers need to learn how to formulate a plan and write it out (make algorithms), they do not need to worry about shooting themselves in the <insert body part here>.

      Pascal, Python, maybe Java are all great languages for a beginning programmer.

      Pascal was supposed to be a teaching language and does the job very well, I agree. Never used Python, but I've also never heard anything bad about it. Java is very nice with its inability to do serious harm, its garbage collector is helpful too.

      I'm sure that it is possible to teach some people C++ as their first language.

      Believe it or not, it's possible to teach C++ like Pascal. You just need to avoid everything that resembles C. Introduce the for, if, while, String class, cin, cout and basic math functions, and you're in business.

      --

      "Evil will always triumph over good, because good is dumb." - Dark Helmet (Spaceballs)

    5. Re:C++ is NOT the best langage to learn on by density · · Score: 1
      True.

      But the reality is that a lot of C++ programming is going on right now by people who really shouldn't be doing it. And they're being paid much more than the cable tv installers or gas station attendants they may have been in a different economy. They might have even been hired to do Visual Basic, but now a project is in C++, and as any PHB knows, computers are just computers, C++ programmers are expensive (and this book is cheap!).

      Experienced C++ coders - or at least bright coders - are just hard to find. Better to have a good intro for people who will be writing C++ anyway.

    6. Re:C++ is NOT the best langage to learn on by DonkPunch · · Score: 1

      And they're being paid much more than the cable tv installers or gas station attendants they may have been in a different economy.

      Just curious -- Are you including yourself in that group or are you special?

      --

      Save the whales. Feed the hungry. Free the mallocs.
    7. Re:C++ is NOT the best langage to learn on by tc · · Score: 1
      You're absolutely correct, it is stupid. However, since the topic here is C++, and C++ does have a native string type, what the hell is your point?

      Er, only sort of. The standard library has a string type, but that's not entirely the same thing.

    8. Re:C++ is NOT the best langage to learn on by wishus · · Score: 1

      Umm... Java is pure C/C++ syntax.

      Umm... not really. At first glance they are quite similar, but there are big syntactic differences. Especially with pointers and arrays and the mixing of the two.. Doesn't fly so well in Java..

      And while the syntax is just different enough to frustrate the newbie, throw in other things like new (which behave quite differently in C++ and Java), and the very different behaviors of constructors/destructors, and a host of other things.. The similarity of syntax is almost a hurdle to understanding the two languages.

      As far as what to learn on, I don't really know.. My first language was Apple BASIC.. second was Pascal. Third was VAX assembly (talk about useless). Then Java. Then C. Then some x86 asm. Then some Perl (enough to do some CGI for Apache). Now I'm trying to learn C++. Yes, I have a Bachelor of Science in Computer Science from a four year university and have never programmed in C++. I'm not bitter.. no, not at all. But I can program VAX assembly real good!!! Anyone want to hire me??


      ---

    9. Re:C++ is NOT the best langage to learn on by Hard_Code · · Score: 2
      Why would you teach beginners something that they would never use, rather then something they would use everyday as programmers?

      Because the point of *teaching* is for the student to *learn* the general concepts. That's why there are such things as intro courses. Because shoving info into the brain != learning.

      Umm... Java is pure C/C++ syntax.

      Um...wrong. Sure, superficially, a lot of the common flow control and scoping constructs use the same tokens, like braces and parenthesis, and some of the operators are the same. But that is where it stops. Method, variable and class declarations and definitions are very different. Java has no operator overloading or pointers, so all those operators go out the door. It has some unique keywords and operators and concepts. There is no such thing as structs or memory allocation, and besides a handful of primitives, everything else is a full-fledged object.

      This is simply not true. I worked as a TA for an intro programming class taught in C++, and they never even mentioned pointers. The only discussion of memory was when I would explain to the students why their programs crashed when they went beyond the bounds of an array. Otherwise, they were perfectly functional without any such knowledge.

      And likewise you can "learn" to drive without knowing with the lines on the road or signs mean. I would really like to be present to see how exactly C++ was taught without the mention of pointers or memory, and whether the "teaching" was actually resulting in learning and understanding, or just rote copying by the students. IMO to learn and use C/C++ *correctly*, an understanding of memory allocation, and pointers is fundamental and prerequisite. Arrays and objects themselves don't make sense in a C++ world without mention of memory allocation and pointers, and I can only guess that students were just blindly trusting the instructor that things worked the way they did instead of understanding. Learning C++ as a beginning language is like learning to drive a normal car, on a tank. Sure, in *general* things will be the same: you still need to know how to accelerate and decelerate and turn. But all the mechanisms will be different: you will have complicated levers and guages; and you will randomly blow up or smash stuff without understanding.

      Of course, to be competent in C++ requires a thorough understanding of memory issues, but we're talking about beginners here.

      Still, IMHO, the risk of being distracted by confusing high-level stuff, and the "scare" factor, indicate to me that C++ is not the ideal beginning language. I played with BASIC and officially "learned" on Pascal. Sure I don't use those today, but Pascal was really useful in easily cementing the general concepts.
      --

      It's 10 PM. Do you know if you're un-American?
    10. Re:C++ is NOT the best langage to learn on by shren · · Score: 2

      Perl? Perl?

      Unless you already happen to be a programmer, Perl syntax makes zilch sense and gives you horrible habits if you ever want to learn any other language. It's not a good place to start. I love perl, but it's just not a starting language.

      --
      Maybe the state's highest function is to grind out insoluble problems. (Zelazny, Hall of Mirrors)
    11. Re:C++ is NOT the best langage to learn on by Karellen · · Score: 2

      It's not stupid. It's just doesn't make sense as far as C goes.

      C is simple and closely tied to most computer architectures. All C language constructs and operators are designed to be directly implementable in only a few instructions on most CPUs. Hence the basic data types. char, int (various sizes), float (various sizes) & pointers. All CPUs pretty much implement them directly, and not a whole lot else.

      Anything else is implemented by (standard) library functions.

      You want to implement a string type? That's a job for the library, not the core language. (as it is in C++). How to do that in C? Without C++ classes, and the safety they allow you to implement (destructors, copy constructors) how would you do it in C?

      C was written to fulfill a specific purpose. And did it well. And to _not_ have a native string type was (IMO) an _intelligent_ decision based on what C was designed to do, and how it was designed to go about doing it.

      K.

      --
      Why doesn't the gene pool have a life guard?
    12. Re:C++ is NOT the best langage to learn on by FigWig · · Score: 1

      So what do you spend more time teaching, programming or C++ syntax? A beginning language should have as little syntax as possible so that the student can concentrate on learning how to break problems down rather than how to please the parser from hell. I have a certain respect for C++, but the more I have studied and used it, the more I fear it.

      --
      Scuttlemonkey is a troll
    13. Re:C++ is NOT the best langage to learn on by aphrael · · Score: 2

      Umm... Java is pure C/C++ syntax.

      Er ... a *simplified* c++ syntax, i'd believe. But there are all sorts of things you can do in c++ that you can't in Java. For example:

      template
      int & bar::operator +(int& ref) { /* */ };

    14. Re:C++ is NOT the best langage to learn on by aphrael · · Score: 1

      Oops.

      I don't remember how to escape angle brackets in html, so:

      template [angle]class T[angle]
      int& bar[angle]int[angle]::operator +(int& ref) {/* */}

    15. Re:C++ is NOT the best langage to learn on by jejones · · Score: 1

      So, are we talking vo-tech school here, or serious programming? If you just teach the language or tool du jour, the student will be lost when the Next Big Thing comes along. I had enough of those courses that had impressive titles but really turned out to be "Syntax of [fill in the blank]," and would prefer that others not waste their time. What's important are the underlying principles, and the best vehicle for those might not be whatever is currently fashionable.

    16. Re:C++ is NOT the best langage to learn on by Deosyne · · Score: 1

      Its unfortunate that the "For Dummies" series has such a stupid name, as it caused me to avoid them for a long time as well. However, I finally got around to picking up a copy of C++ for Dummies out of sheer desperation, as the small collection of $50+ C++ books that I had purchased previously were pretty damned sad at conveying _why_ all of this crap is important, which is the same bloody reason I stopped going to school to learn programming, as learning syntax from a book was never a problem. That cheap, stupid looking C++ For Dummies book made things so much more clear than the 8 months that I spent in school or the myriad programming books that I had purchased and read previously. I highly recommend it to anyone that has been having a hell of a time trying to figure out why to use many of the available features in C++.

      Deosyne

    17. Re:C++ is NOT the best langage to learn on by Darby · · Score: 1

      In fact, it is confusing, since "function" in programming is very different from "function" in mathematics.

      As I progressed in math and programming it struck me as the opposite. A function in programming is almost exactly the same as in math.

      A p-function takes some number of parameters each of which are of a certain data type.
      A m-function takes a number of variables each from some given space.
      The cartesian product of these spaces is your domain. So you would have, for example, a function of 2 integers and a real number. Your domain would be ZxZxR. This translates perfectly between programming and math.

      A function in math can only return one value.
      This is similar to but not exactly like in programming. In programming ( the languages I'm familiar with anyway) you can return at most one value but you need not return anything.

      So a programming function is basically the same as a mathematical function.
      ---CONFLICT!!---

    18. Re:C++ is NOT the best langage to learn on by Darby · · Score: 1

      You can always pack multiple return values (or multiple arguments) in a tuple (struct, record, whatever you want to call it)

      Sure, and you can do this with a mathematical function as well. Your m-tuple function value is still one unique value in m-dimensional space.

      Your second paragraph is really interesting. I wasn't aware of the distinction between languages that are or aren't referentialy transparent.
      Could you give an example of a few that are and aren't? Also, how does that work if you know?
      ---CONFLICT!!---

    19. Re:C++ is NOT the best langage to learn on by OceanBarb · · Score: 1

      Hmmmmm....one more to add to the list that Eric Raymond suggested: Python, C, Perl and Lisp. See his http://www.tuxedo.org/~esr/faqs/hacker-howto.html.

  50. Re:Can someone give 1 good reason to use C++ over by gavinhall · · Score: 1

    Posted by 11223:

    Hmm - I thought that if you renamed g++ to gcc, it would be the same thing - in fact, gcc takes objective C code too, just translating it to C. On some systems, isn't g++ a symlink to gcc?

  51. If your teacher doesn't speak English... by wahe · · Score: 1

    and has frequent algorithm parties at the white board to which she invites no one but herself (like mine), this book sounds like a real godsend. As a student in a beginning programming class using C++ whether I like it or not, I'm really happy that this book is out and will probably buy it tomorrow, if not today.

  52. Re:Can someone give 1 good reason to use C++ over by haystor · · Score: 1
    MSVC++

    It may not be the most popular here on /. but it works, its available a lot of places, and it uses C++.

    Well, in someone else's hands it uses C++, in mine everything still looks like C.

    --
    t
  53. Oh, TYPING by FascDot+Killed+My+Pr · · Score: 1

    I thought you were trying to teach them to PROGRAM. You know, where you have to first understand the problem in an algorithmic way? And then break it down into a series of tasks?

    But if you just want them to take dictation--sure, I could get a newbie up to speed on that in an hour, easy.

    Go find an actual newbie and try your method on them. Then come back here and tell us how it went.
    --
    Compaq dropping MAILWorks?

    --
    Linux MAPI Server!
    http://www.openone.com/software/MailOne/
    (Exchange Migration HOWTO coming soon)
  54. Re:Steep learning curve = easy; flat = hard by aclaudet · · Score: 1


    I get annoyed with that as well. I've taken to saying 'fast' or 'slow' learning curve which seems to reduce confusion.

  55. Re:Can someone give 1 good reason to use C++ over by Omnifarious · · Score: 1

    I hate this style, it makes life harder for maintainers, and it makes life harder for optimizers. Strangely enough, the reasons for this are largely identical.

    I hate the style because it makes it difficult to figure out what in the heck you're doing at any given point. I like seeing definite lifetimes for variables because that gives me many more clues as to what you intended to do with them. I know the variable belongs in a particular block, and only that block. Any later references to it are really a reference to a different variable.

    I'd almost like to see import and export statements for explicitly pulling variables in from enclosing blocks sometimes with the way some people program.

    Optimizers also like knowing a lot of detail about the lifetime of a variable. It helps immensely in memory and register allocation. They know that after a certain point, the value of the variable can't possibly matter.

  56. I got your C++ right here-THE LARS-O-MATIC by Lord+Kano · · Score: 2

    /*This is my Lars-O-Matic gibberish generator
    ©2000 Lord Kano

    Although this code is GPLed, I request that if you make any modifications based upon it, please give me a little credit
    for writing the original code.

    This code was written to be as easily portable as possible. It was written on an old Power Mac 7300/180, but it should
    compile and run under just about any OS.

    The LarsSpeak array is comprised of real phrases from Lars, as well as a some that I made up but still sound LarsLike.
    */
    #define __LARS_ULRICH DickHead
    #define ___METALLICA Sold_Out_Commercialized_Whiny_Babies
    #include
    #include
    #include
    #include
    #include

    using namespace std;

    string phrase[19];//Array of Lars Speak

    //function prototypes

    void setphrases(void);//Fill the phrases array with Lars Speak
    void larsspeak(int);//Send to the screen, int times, an example of Lars Speak

    //end function prototypes

    int main(){
    srand(time (0));//seed the random number generator with the value pulled from the clock.
    setphrases();

    char ch;

    string filename;
    string *fn;

    fn =

    while (filename != "quit"){//Repeat this loop until the user enters quit at the following prompt

    cout > filename;
    cout c_str());//Open the filename the user specified at the above prompt

    if (!mystream.is_open()) {
    if (filename != "quit") {cout "FILE NOT OPENED ERROR!";}//If we can't open a file that was specified by the user, first check to see if we were told to quit, if not give an error.
    goto here;
    }

    while (mystream){//get each character sequentially
    mystream.get(ch);
    if (ch == '\n'){//if the character is a newline, LARSIFY
    cout " ";
    larsspeak(1);
    goto here;
    }

    if(mystream) cout ch;
    if (ch == ' '){//if we encounter a space
    if (!(rand() % 4)){//once out of every four times, LARSIFY
    larsspeak(1);
    }
    }
    here:;
    }

    mystream.close();//when we're done, close the file for good measure.
    }

    return 0;

    }

    void larsspeak (int i){
    for (int x = 0; x i; x++){
    cout phrase[(rand()%19)];
    }
    }

    void setphrases(void){
    phrase[0] = "um, ";
    phrase[1] = "oh, ";
    phrase[2] = "well, ";
    phrase[3] = "James says, ";
    phrase[4] = "according to my lawyer, ";
    phrase[5] = "like, ";
    phrase[6] = "uh, ";
    phrase[7] = "ya see, ";
    phrase[8] = "I mean, ";
    phrase[9] = "I know how to get onto AOL, and I will say that I have used AOL a couple of times to check some hockey scores, but I'm no expert at this stuff, ";
    phrase[10] = "ya know, ";
    phrase[11] = "OK, ";
    phrase[12] = "basically ";
    phrase[13] = "and this is really the simplest way of saying it, ";
    phrase[14] = "I think ";
    phrase[15] = "well, it's like this,";
    phrase[16] = "for one reason, and one reason only, ";
    phrase[17] = "I'm sorry, all of a sudden your mind goes blank, ";
    phrase[18] = "like I said before, ";
    }
    //Thank you

    --
    "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
  57. Re:Can someone give 1 good reason to use C++ over by arnald · · Score: 1

    I can't help feeling you're missing the point.

    Using just variables `i,j,k' in a function is NOT a good idea.

    Firstly, it requires YOU to carefully manage their use, ie. to ask yourself (and answer) questions like "does variable i have a meaningful value at this point in the code, or can I use it for something new?". I contend that one should not have to deal with these kinds of details when programming; they have absolutely nothing to do with the problem in hand. Moreover of course it leaves you very vulnerable to simple human error (and we've all done it wrong at some point...).

    Secondly, the names `i,j,k' give someone reading the code no clue as to what the variables stand for. This may not bother you when you are polishing your implementation of algorithm X, but when someone is reading the code AS A WHOLE it can be extremely disorientating. I'm aware that the general `Linux habit' is to give local variables rather terse names, but generally they give at least some clue as to their utility, if a slightly subliminal one. The names `i,j,k' on the other hand give no clue.

    Thirdly, there is no ADVANTAGE to restricting yourself this way. Any half-decent optimising C++ compiler will re-use local variables where possible, so you'll probably end up with exactly the same performance (space and time) as you would if you worried about it all yourself. (Believe me, this is STANDARD fare for compilers - it really is simple). Also, (good) compilers don't make mistakes, and they can spot optimisations that even the most astute human would find elusive.

    Fourthly and finally, it is highly advantageous in terms of readability and just plain common sense to have the declaration of a variable near to the first use of that variable. This helps prevent type mistakes, and reminds you again exactly what the purpose of the variable is, without having to look at the beginning of the function (which could be a fair way higher up).

    There are advantages of C over C++ for some applications, but this really is not one of them.

    Have I convinced you?

    --
    arnald
  58. That's not it by ChrisWong · · Score: 1

    The "one everybody talks about" has the steep curve indicating difficult/slow learning. Yours is the reverse, not to mention fairly obscure.

  59. Re:Can someone give 1 good reason to use C++ over by Sangui5 · · Score: 1

    If you get gcc from gnu.org, and make it yourself, it installs multiple different binaries (gcc, g++, g77 (for fortran), etc).

    By the same token, on some systems cc is just a link to c++ (since the c++ compiler can always handle c, but a cc compiler can't always handle c++).

  60. Re:Can someone give 1 good reason to use C++ over by gavinhall · · Score: 1

    Posted by 11223:

    Nggg - don't usually take into account the optomizer. Usually I write my code so that if my optomizer died, my code wouldn't crawl. I don't depend on the optomizer for anything.

  61. A less horrible introductory language.. by TeknoHog · · Score: 5
    At the risk of starting a flame war, here goes: Python.

    The syntax is very intuitive: blocks are denoted by indentation, nothing has to be declared. It is very easy to just start hacking on an idea without knowing much Python, learning from the docs while proceeding.

    Although not a 'real' compiled language, I'd recommend it as the introduction to ideas of programming. After that, learning other languages is more or less a matter of syntax only. Plus, it great for all kinds of scripting.. :-)

    --
    Escher was the first MC and Giger invented the HR department.
    1. Re:A less horrible introductory language.. by ghost. · · Score: 1

      Python

      Agreed.

      Now all it needs is a good introductory book. O'Reilly's Learning Python is not that book, IMHO. I'm sure better tutorial books for Python are coming, but I haven't seen one yet.

      --
      Bush is a cylon.
    2. Re:A less horrible introductory language.. by 4of12 · · Score: 2

      I'm trying Python out right now trying to teach my 11 year old nephew programming. (Meanwhile, yes, at work, I struggle with C++ and hope to get it to "do what I mean" in a few months...sigh)

      The nice thing about Python is that it's so easy and intuitive that I can teach it as I learn it, not being a proficient Python programmer by any stretch of the imagination, but having plenty of background in C.

      There are two things I'd like to see, though:

      • a nice fat stack of simple-minded viewgraphs that even an 11 year old can understand (the usual intro's are slanted towards folks with programming experience in another language, like C.) So far, the closest I found was Josh Cogliati's page
      • a nice easy way to get some graphics done so I would not be limited to text applications. An earlier poster mentioned this as well - that
        excitement(Basic, Atari, 1980) > excitement(Python,Windoze, 2K)

        Like many kids, the games he plays on his computer these days are so flashy, boomy and interactive that his first attempts with a programming language can not hope to compete with "Joystick controlled maneuvering of a skateboarder with sound effects and moving, pseudo 3D scenery."

      Any suggestions for addressing either of these 2 issues would be most appreciated.

      --
      "Provided by the management for your protection."
    3. Re:A less horrible introductory language.. by Karellen · · Score: 2

      One thing I've never liked about what I've read about Python - indentation (whitespace) is part of the semantics. That just makes me shudder.

      If I indent a line of code with a tab, and another line of code with 8 spaces, are they part of the same block? Or do I have to use 8 tabs to have the same indentaion as 8 spaces? What if I'm using an editor that has tabs every 4 spaces instead of 8?

      IMO C/C++/Java's {/} sytax is much better, and Pascal's begin/end isn't far behind (if a little long-winded)

      What does perl use?

      --
      Why doesn't the gene pool have a life guard?
    4. Re:A less horrible introductory language.. by Denor · · Score: 1

      I haven't tried it myself (I really am going to learn python one of these days, really), but I've heard good things about PySDL - which gives you python bindings to the SDL library (same library Loki uses to make their games). This can at least start you up on graphics :)

      --
      -Denor
    5. Re:A less horrible introductory language.. by oinkoink · · Score: 1

      It's really natural, once you get used to it, and the syntax enforces good style. As for the tabs...don't use true tabs! Use emacs python-mode with the tabs meaning a certain number of spaces.

    6. Re:A less horrible introductory language.. by sakti · · Score: 1
      a nice easy way to get some graphics done so I would not be limited to text applications. An earlier poster mentioned this as well - that


      Check out Alice. Alice uses a slightly modified version of Python to teach people programming by interactively programming a 3D environment. Your programs control the movements and behaviours of objects. Its only for Windows, but it is supposed to be very nice.

      --

      "A society that will trade a little liberty for a little order will deserve neither and lose both."

      --
      "It is better to die on one's feet than to live on one's knees." - Albert Camus
    7. Re:A less horrible introductory language.. by TeknoHog · · Score: 2
      Just use one kind of indentation. I can't imagine anyone wanting to type 8 spaces at each line.. ;-) besides, as oinkoink pointed out, there are good editors with autoindentation (I personally use jed).

      IMHO indentation is more intuitive than {} or whatever. When I read a long text (not necessarily code) there are often paragraphs that are indented for clear distinction from main text. This is how human perception works - large variations are more obvious than single punctuation marks. Imagine Ayer's Rock being separated from the surrounding desert by 12-pt {} only, instead of 'indentation'! 8-)

      --
      Escher was the first MC and Giger invented the HR department.
    8. Re:A less horrible introductory language.. by Bj�rn+Stenberg · · Score: 1
      Use emacs python-mode with the tabs meaning a certain number of spaces.

      Sadly, Emacs is crippled by the Python syntax. Since there is no way to know where a block ends, emacs can't help much with indentation of Python. You can't use C-i to auto-indent to the correct level, you can't use indent-region to adjust a whole block/file of code to your liking and you can't have it insert a new block around an old block (like wrap a statement in an 'if' condition).

      In short, you have to sit there and pad and visually verify each and every line manually. And you people have the balls to claim this is a feature. [shakes head in disbelief]

      And don't get me started about the idiosyncrasies in Pythons array indexing...

    9. Re:A less horrible introductory language.. by Karellen · · Score: 1

      As Bjorn Stenborg pointed out - how are you supposed to write a script to autoindent a source file which gives no clues where blocks begin and end?

      --
      Why doesn't the gene pool have a life guard?
    10. Re:A less horrible introductory language.. by ChadN · · Score: 2

      Python has a "tabnanny" feature which helps make sure that tabs and spaces aren't mixed ambiguously. A decent editor (like Vim or Emacs) will keep this sorted. You can also specify that tabs are other than 8 spaces (command line or .pythonrc). I've written thousands of lines of Python, for a large application, and this has never been an issue (contrary to what another poster has said, Emacs CAN be reliably used to adjust block indentation; just specify a block and indent, instead of line by line.)

      Finally, there are tools provided in the standard distribution to autostrip #} and #{ block identifiers (which the Emacs mode recognizes). So think of the block identifiers as optional. The indentation requirement is not onerous to those who accept it, and is actually a plus.

      I find Python to be a very elegant solution for many of my needs (GUI, signal processing, and mathematical exploration), and people in the lab can understand much of my code, without EVER having looked at a Python tutorial or reference (all except the GUI stuff :).

      --
      "It's overkill, of course. But you can never have too much overkill." - Anonymous Slashdot Coward
  62. Missing includes by Lord+Kano · · Score: 1

    Silly me, I forgot that seeing these at html would make the includes invisible.

    iostream
    ctime
    iomanip
    fstream
    string

    --
    "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
  63. In love and war... by Pseudonymus+Bosch · · Score: 1

    She became Mrs. Heller shortly after that

    C++? I was told that you should woo her with Perls!
    __

    --
    __
    Men with no respect for life must never be allowed to control the ultimate instruments of death.
    GW Bu
  64. Re:Mod This Up! by MieRoels · · Score: 1

    It is good as long as you have some ropes for aiding the climb, and enough strength in your arms to pull yourself up

  65. Re:Can someone give 1 good reason to use C++ over by Omnifarious · · Score: 1

    Do you know exactly and precisely what happens when you call 'fopen' if you don't have library source?

    I use C++ because it makes the organization of large programs much easier. I now go for a style of programming that breaks the system up into just a few different ideas that can describe almost anything the system works with. This makes it easy to understand it, and easy to extend it or fix it.

    It's kind of like knowing how an integer works. Once you know that, you can apply that knowledge to any integral type, and you'll be largely correct in the conclusions you derive from that knowledge.

    Even before C++, I tended to code this way, and C++ just made it a lot easier. I remember wanting the features of C++ before I knew C++ existed.

    *chuckle* What a ramble. I hope it makes some sense.

  66. Re:If only he had chosen a _real_ language by Mendax+Veritas · · Score: 2
    I can't stand Perl, so I won't try to defend it. However, Grim Metamoderator is correct that C++ isn't really a good OO language.

    I still want to address your points individually, though, because a lot of what you're saying is not really Perl-specific and, I think, represents a very limited understanding of programming.

    1. "Perl is slow." Well, that depends. For many tasks, Perl (or Python, etc.) is fast enough. Then again, for a very complex application, it can be very challenging to get good performance out of C++, because one means of controlling complexity is to develop high-level abstractions and then write most of the program using those abstractions. If the abstractions are poorly chosen, or poorly implemented, performance suffers badly. This is not a point in C++'s favor, since it forces you to do a lot of annoying, low-level dirty work yourself (thread interactions, memory management, etc.). Anyone who thinks C or C++ is necessarily fast ought to spend a week using Windows 98 on a slow Pentium. In contrast, a well-designed higher-level language (e.g. Erlang or OCAML) supplies you with a set of well-implemented abstractions proven over many years of use in a wide variety of programs.

    2. "Perl makes inefficient use of resources." Same argument as #1, really; CPU cycles (speed) being just one example of system resources.

    3. "Perl is hard to maintain." Well, I can't help but agree with that one. Then again, I think C++ is pretty hard to maintain, too. Its simplistic static type system and association of polymorphism with class inheritance tends to result in extremely brittle designs that don't age well.

    4. "Perl is unnecessary." I don't think it's just Perl you're objecting to here; it sounds like you think every program, including simple shell scripts, should be written in C++. I have to say that sounds kind of crazy to me.

    5. "C++ programming is a valuable skill." Well, that's true today, but who knows -- five years from now, it might be yesterday's language, replaced by whatever hot new language (or paradigm) comes along. It's happened before, you know.

  67. Problem is with colleges by Sebastopol · · Score: 2


    Object-oriented programming design is a great way to organize a problem into manageable, scalable abstractions. Everything you learn in college about the virtues of OOP is well founded, would anyone here disagree?

    The problem is C++. It's not a very good OOP. Would most people here agree its a pretty harsh hack of the C syntax? When compared to (IMO) the mother of all OOPs: LISP?

    Students that never learned C++ on their own learn it in college, usually from a TA. Now I'm not knocking TA's, but they usually have zero practical experience with large projects. And to compound the problem, they learned their C++ programming skills from... ANOTHER TA! And so on. See the problem? (And the worst part is: would you want to hire someone who just learned how to code in C++ during their 2nd or 3rd years in college! Companies do. I want to hire someone who's been programming before they were pubescent!)

    So not only is the OOP paradigm lost by lame C++ instruction (here's printf, write, fwrite, and 'cout ', gee, that makes sense...), the entirety of programming education is at risk by the lack of truly knowledgable instructors. And then these kids go out and program for a living! No wonder there is so mush bullshit buggy code in the commercial world.

    Ok, sorry about the rant. But any attempts to teach any computer concept with C++ seems to me to be hopelessly flawed and will end up doing more harm then good. Teach with LISP from the top and C from the bottom, and assembly from the real bottom.

    I agree with the 'problem' and 'solution' domain approach. OOP on top so that there is flexibility and scalability in the entire design; procedural C on the bottom for portability and high-performance.

    C++ -- the great hack, the facilitator of even greater hacks -- has done horrors to the world that will take decades to undo.


    ---

    --
    https://www.accountkiller.com/removal-requested
    1. Re:Problem is with colleges by arnald · · Score: 1

      LISP isn't an OOP. It's an impure functional language. :-)

      --
      arnald
    2. Re:Problem is with colleges by rmstar · · Score: 1
      Would most people here agree its a pretty harsh hack of the C syntax?

      Ironically, that double cross appearing in the name of the language is one of those nice little pitfalls of that C++ thing.

      Postfix increment won't work the same overloaded as it does in its pur3 0r1g1n4l st4t3. :->

      rmstar

    3. Re:Problem is with colleges by Yunzil · · Score: 1
      Everything you learn in college about the virtues of OOP is well founded, would anyone here disagree?

      I would. :) OOP is great for some tasks, for others it just gets in the way.

  68. Re:Can someone give 1 good reason to use C++ over by Sangui5 · · Score: 1

    That won't cut it on a RISC machine. A good optimizer for a RISC machine can generally produce machine code 20% faster than hand-optimized assembly. And even on CISC machines, a human can't keep track of all of the scheduling constraints to meet your data dependancies while keeping the pipeline full. It just gets harder on a EPIC processor.

    On the other hand, C++ code is generally a bit harder to optimize, given that the global optimizer is written to work best in a C-like language. But most C++ code is valid C anyway, and there are global optimizers tuned to OO code, so it really doesn't matter.

  69. oops by Lord+Kano · · Score: 1

    After re reading this again, I didn't realize how badly HTML would goof up the greaterthan and lessthan characters. If anyone wants this, let me know I'll e-mail you a full working copy.

    LK

    --
    "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
    1. Re:oops by Signal+11 · · Score: 1

      Use a blockquote next time...

  70. C/C++ Fear, Java by blueg3 · · Score: 1

    I'd have to say that people are even more afraid of C than they are of C++ (if they know the difference between the two).

    The approach of this book sounds interesting, at least, and I might've used it back when I first started learning, but I think Java is a much stronger "learning language" than C or C++. It it considerably more intuitive -- if any programming language can be called that. It also has a nice tendency to work the same way on any system, unlike C and C++.

    I suppose the danger of books like these is arming people who don't quite know what they're doing with the knowledge of C++. I can hear the help desk calls now...

  71. Teaching C++ by dagoalieman · · Score: 1

    Being a current CS Student/idiot, I can tell you that c++ is not the best language to start off with. For someone who starts off with it, though, this book could be a godsend.

    Living in the middle of the state of Misery (Missouri), many people don't even know what a computer is. Yes, plenty do, but there are still hardcore farmers and rednecks out here. I make my summer money explaining to these people things about computers. The best way to get through to them is to use similies to common life. A disk is like a library, each file is a book, etc etc (yes, I know, those aren't the greatest..). Suddenly, you see the light come on.

    Probably the best approach to teaching computing languages is like most people are saying. Start simple, with the fundmental elements of programming. I think basic is a good language to teach those concepts, although it's not a great programming lanugage to use. You learn basic flow, thought patterns, loops (for, recursion, etc), and get a basic grasp of things (the language name says it all folks..) The earlier versions work well for the line numbers, adding an extra level of looking at order of thoughts.

    After you get that down, graduate to the upper languages such as c++. Start to learn of objects, get more control on flow, use streams, etc. It's not an easy transition from basic to c++, but I imagine it will be easier for a person who is JUST learning (I learned C64 Basic from the time I was a tyke until I was like 13, and then started c++ at around 18, with no programming in between.)

    Back to the original topic, this book gives a small option, albeit probably a difficult one, to starting with c++. Good idea for the author, I just hope now we don't have to go through endless websites of programmers posting their "Hello, World" code out there as source....

    my $.02

    --
    We don't need no Net Explorer We don't need no Thought control
  72. Re:C++: The PL/1 of the 90s. B*L*O*A*T!!! by HiThere · · Score: 2

    Having used both PL/1 and C++:
    PL/1 was lots easier to learn. What it did was more consistent. It's real problem was that the compilers were too large for the Apple II - CP/M generation of machines until fairly late in their cycle, but Basic, C, and Pascal could run on all of them. (And to go back a bit further, it wouldn't fit on a PDP/8.)
    Of course it didn't help it that IBM owned the language, and wasn't interested in microcomputers.

    I rather liked PL/1. I also like Ada95. Neither is bloated in comparison with C++. Both are rather logical and easy to learn.

    OTOH, neither PL/1 nor Ada95 have a good adaptation to GUI's. Java does, but it's still v. slow (when last I checked a few months ago).

    What currently seems to me as the best choice it to use Python or Ruby or some such and recode the time critical routines into C. C++ could probably be used here, but C is still lots more portable (there doesn't seem to be any rule as to how the C++ compiler mangles the routine name).

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  73. Daft! by arnald · · Score: 1

    I'm sorry - I'm with you all the way on the discrete maths, and that C++ isn't necessarily the best starter language, but this is daft!

    If you took your `I don't depend on the optomizer' (sic - it's actually spelt `optimiser', or I suppose `optimizer' if you're from the USA) viewpoint to it's logical conclusion, then you'd write everything in assembly, because any sort of (useful) compiler contains some sort of optimisation.

    While that's fun for a while and for small programs (I've hand-writte quite a lot of ARM assembler in my time) it's impractical for anything more.

    The optimisers in modern compilers are good.
    (even the one in GCC! ;-) ).

    But even this misses the point. The coalescing of local variables is such a fundamental `optimisation' for a C++ compiler that I don't think it can really be considered part of the `optimiser'. Performance without it would probably be fairly atrocious.

    Relax, compiler writers aren't out to get you!

    As an aside, have you ever written in C++ or used a modern C++ compiler?

    --
    arnald
    1. Re:Daft! by gavinhall · · Score: 1
      Posted by 11223:

      Yes. I have. I know C++, and can code fairly good C++ code. I've used mwcc, g++, and Microsoft's c++ compilers. Despite the optomizer, it just seems wrong to declare another local variable at every block - and wasteful. It doesn't matter if the optomizer coalesces them all - it just seems wrong. Maybe that's because I do most of my coding in C.

      Actually, I'm a complete hypocrite in this discussion. I actually learned to program in BASIC.

    2. Re:Daft! by arnald · · Score: 1

      But it's not wrong, it's RIGHT!

      See my longer post on the subject elsewhere in this thread.

      It's RIGHT, because

      (i) it's less work for you, giving you more brain-power to deploy on the problem in hand

      (ii) it's less work for someone reading your code, giving them some chance of understanding it (oh, the joys of open source software...!)

      (iii) it's conceptually preferable, since the type declaration is close to the first use of the variable, and so you can quickly check you aren't using the wrong variable in a certain context

      etc. etc... see other post.

      If you DON'T make use of this feature when writing C++ code, and insist on calling all local variables i, j or k, then I seriously doubt the veracity of your statement `I can code fairly good C++ code'. Don't forget, C++ isn't just C with extra bits of syntax. It's a different language, requiring a different style of `coding'.

      By the way, it's "optimiser" (or at a push "optimizer"), not "optomizer".

      (I've chosen to draw a discreet veil over your reference to BASIC)

      --
      arnald
    3. Re:Daft! by gavinhall · · Score: 1
      Posted by 11223:

      Somebody obvioulsy thinks I can speel. I've had enough of this discussion.

      Methinks you are a software engineer. I'm more interested in how to write the best solution in the best method possible than how to write readable, maintainable code quickly. That's what the software engineers are for. I'm a programmer :-P. Perhaps this book would be better said as an introduction to Software Engineering?

      Please note I'm trying desperately to get the discussion back on-topic. I didn't want a flame-war between C and C++ as bad as this. I just wanted some logical discussion about how learning C++ first influences the programmer's mind, vs. C first.

    4. Re:Daft! by arnald · · Score: 1

      I'm neither, I'm a student of computation. :-)

      Do you think I'd really be advocating using functional programming languages (see other thread) if I was a professional software engineer? ;-)

      I'm not really interested in a flamewar either, and I don't feel I'm in one; call it a free exchange of views.

      But you don't seem to understand the fundamental differences in attitude required by C and C++ programmers.

      Anyway, hopefully you found some of my posts interesting.

      --
      arnald
    5. Re:Daft! by gavinhall · · Score: 1

      Posted by 11223:

      Thanks for the perspective - I don't mean to come across as a pedantic C user. I prefer C because I can usally say what I want to say cleaner and more concisely, and when I look at C versus C++ solutions to the problems I'm involved with, C tends to be better. I'd also say for that some problems, C++ is better than C. But as an introduction to the universe of programming (and it's a big universe) I think that C is a better introduction. It's not globally better, but it's better across the board - and ultimately, if I were forced to choose one language to write every program in (which, thankfully, I'm not) I'd choose C (disregarding the fact that C++ compiles C code - it's totally irrelevant to this discussion, and I wish people would stop bringing it up. When I say C++, I mean the features of C++ that seperate it from C.)

    6. Re:Daft! by JonK · · Score: 1
      I'm more interested in how to write the best solution in the best method possible than how to write readable, maintainable code quickly.... I'm a programmer

      No you're not: in my book you're a liability
      --
      Cheers

      --
      Cheers

      Jon
  74. What the ACCU thinks of this book by codemonkey_uk · · Score: 2
    If you want a second opinion, the Association of C & C++ Users has reviewed this book twice: The second of the two reviews is also a review of The C++ Training Guide by Steve Heller. There is also a review of both "Who's Afraid of More C++?" and "Who's Afraid of Java?" here.

    Heller is a prolific author, but the ACCU only recomend his book on Motif.

    Thad

    --

    Thad

  75. Cow Book by SEGV · · Score: 1

    The cow book is "Ruminations on C++" by Andrew Koenig and Barbara Moo.

    In general, I find the Addison-Wesley books on C++ to be better than the O'Reilly ones.

    --
    Marc A. Lepage (aka SEGV)

    --

    --
    Marc A. Lepage
    Software Developer
    1. Re:Cow Book by JonK · · Score: 1
      There's two cow books: RoC++ by Koenig and Moo, AW Press, and Practical C Programming by Steve Oualline. Oualline's a beginner's text - what's C, why shoudl I program in it, what does (*(fp)(void)) mean etc.

      RoC++ is more of a tour round some of the more interesting bits of C++ by a couple of the Bell Labs vets (and, as a bonus, features a recursive cover picture): it's a nice companion to C Traps and Pitfalls.

      Hope this clears any misunderstandings up :-)
      --
      Cheers

      --
      Cheers

      Jon
  76. Do we really want this ? by Fiwer · · Score: 1

    Do we want everyone and their mother to be able to program in C++ ? I'd like to remain an elite person :) No, but seriously, if someone doesn't have the ability to learn how to do C++, maybe it's a sign that they shouldn't? It's not that hard to learn or anything you know.

  77. Re:Can someone give 1 good reason to use C++ by Broccolist · · Score: 1
    There are lots of reasons to use C++ over C. The problem is whether you'll find that any of them are good :).

    C++ has lots of small advantages over C that every programmer will be able to appreciate: stricter type checking, function overloading, being able to declare new variables anywhere, inline functions, etc. If this is all that you'll use, though, it isn't really worth switching.

    The big advantage of C++ is that it supports other programming styles ("paradigms"). Object-oriented (and generic) programming is impossible to do properly in C, but C++ offers direct support for both techniques. In other words, you have to learn to think in OO before you can really appreciate it. So, the advantages of C++ are the advantages of OOP: code that is overall more modular, extendable and safe. The price is a really steep learning curve, because you have to learn to think about programming problems differently. People who say all of the new features of C++ are just syntactic convenience are right, in the same way that I would be right if I said that functions are just convenience, and you could write whole programs using only goto.

    OOP isn't a panacea, but it's a good solution to a lot of problems, and I think every programmer working on large or medium-sized projects should take the time to learn it. Basically, C++ allows you to write OO programs while still being able to use all your old C code.

  78. Re:If only he had chosen a _real_ language by Lita+Juarez · · Score: 1
    a lot of what you're saying ... epresents a very limited understanding of programming.

    I've been coding since you were in short trousers, boy!

    Anyone who thinks C or C++ is necessarily fast ought to spend a week using Windows 98 on a slow Pentium

    Bad code is bad code, regardless of the language. But a skilled programmer will find that she can use C++ to produce faster and more efficient code than is possible with Perl.

    CPU cycles (speed) being just one example of system resources.

    I didn't give any indication of what quantities I was using to define "resources". But CPU cycles and memory allocation are very relevant measures of resources for x86 architectures.

    I don't think it's just Perl you're objecting to here; it sounds like you think every program, including simple shell scripts, should be written in C++.

    Well, almost. Providing the overhead of typing a few #includes and a main(){} wasn't too great in comparison to the length of the script, I would certainly consider writing a script in C (probably not C++ though). That's personal preference.

  79. Pokey by MrShiny · · Score: 1


    I hope this is a deliberate reference to Pokey the Penguin.

    1. Re:Pokey by BilldaCat · · Score: 1
      Actually, as similar as the two strips are, the Friend Bear author insists he didn't copy off of it. He has a whole page about it here.

      Honestly, I don't care. Friend Bear is much funnier anyway.

      (-1 offtopic)

      --
      BilldaCat
  80. Mrs. Heller by thaigan · · Score: 1

    full-fledged novice user, capable of little more than e-mail and word processing, and turned her into a decent programmer while reviewing this book. (She became Mrs. Heller shortly after that.)

    If you don't learn C++, at least maybe you'll fall in love with the author;-)

    --

    42
  81. The final answer by ChrisWong · · Score: 1

    Thanks to all who replied. You have pretty much confirmed my private theory on what is going on. Basically, the phrase is nonsensical in conventional usage, and the confusion comes in two ways.

    1. Reversing the axis:
      By mathematical convention, the independent variable (time or effort) is graphed on the X or horizontal axis. The explanations I have seen reverse this, insisting that learning, knowledge or proficiency (a function of time or effort) be graphed on the horizontal axis. Unless you are an economist (they are as a group often teased for transposing dependent/independent variables), you should think about following the mathematical convention.

    2. Mixing up metaphors:
      You can climb a mountain. You can climb a hill. One does not climb a curve. It seems to me that some people muddle the steep hill metaphor with the graph metaphor.


    That does it. The technical community should not embarrass itself with imprecise jargon. Every time someone uses this goofy phrase, I am going to ask "what's a steep learning curve?" and hope they get a clue.
    1. Re:The final answer by DezMo · · Score: 1
      Karmageddon wrote: Steep learning curves show fast learning.

      Which I think is exactly the common understanding, and makes perfect sense in the X->time, Y->capability graph.

      If you want to pick a nit over the common usage, I'd pick on ascribing the steep curve to the subject matter rather than to the person doing the learning in a particular context.

      If Yu is the level of capability needed to perform some useful task, then the amount of time available to reach Yu can determine the slope of the required learning curve.

      The steep slope of the curve comes from the pointy-haired manager saying "use this new technology for the project that's got to be done in two weeks." He'd better say it to someone with the chops to climb that curve, or else corporate business as usual will ensue.

      Or maybe a better way to understand it is to say that being able to "climb a steep learning curve" means that an individual's typical learning curve (their ability to rapidly improve capability) must be steeper than the one required by the situation.

    2. Re:The final answer by keffy · · Score: 1
      Mathematics in general imposes no interpretation on coordinate axes. (Think fast: on a Mercator map, is east-west the independent variable, or is north-south?) You're thinking specifically of statistics, maybe?

      Even so, you're being pretty self-centred about what you consider to be the indepedent variable. The independent variable is simply what the person has control over. Hate to break it to you, but that person isn't always you.

      Sure, from the point of view of a learner, what they have direct control over is the amount of time they spend on it, and what they don't have direct control over is how much they learn. But take another point of view, say a manager trying to hire. What the manager has control over is the level of proficiency of the person they hire (if one candidate doesn't have the level they want, they'll just choose another one). They don't have control over how much time the candidates had to spend to get that level of proficiency.

      So maybe the phrase really was popularized by bone-headed managers. It makes perfect sense from their point of view. (Ohmigod, I just defended managers. Must go flagellate myself with a parallel port cable...)

      In slashdot, like in all other primate communities, picking nits is the social glue that bonds the group together.

  82. learning curve--get it right by cheese_wallet · · Score: 1

    learning curve

    The plot of the measure of something learned against time or number of trials. In computing, it is often mis-used to mean the amount of time it takes to learn the usage of something ("reduce the learning curve") or the ease it ("easy learning curve").


    Oh, and take a look at this great slashdot message:

    Slow down cowboy!


    Slashdot requires you to wait 1 minute between each submission of /comments.pl in order to allow everyone to have a fair chance to post.

    It's been 1 minute since your last submission!

  83. Need the same for Java by DigitalDragon · · Score: 1

    That would've been sweet if a Java version existed.

    --
    http://dtum.livejournal.com
  84. templates by codemonkey_uk · · Score: 1
    templates.

    If you want one reason, and one reason only, then templates should be it.

    Thad

    --

    Thad

  85. Re:If only he had chosen a _real_ language by Phroggy · · Score: 1
    Your post is an obvious troll. Your first two points have nothing to do with the discussion (we're talking about languages, not about execution speed or interpretor overhead).

    As for your fourth point, when was the last time you tried to write a CGI program in C++? I have, and it sucks ass, because C++ is retarded when it comes to string processing. Perl lets me make associative arrays, where an array of strings is indexed by a string variable.

    Finally, what does C++ programming being a valuable skill have to do with how good a language it is? Last year, COBOL programming was a very valuable skill.

    --

    --
    $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
    $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  86. OOP by DigitalDragon · · Score: 1

    Object Oriented Programming man.. that's what it is all about. Classes, inheritance, good stuff. Without it, it is hard to write programs which are greater than 1000 of lines.

    --
    http://dtum.livejournal.com
    1. Re:OOP by gavinhall · · Score: 1

      Posted by 11223:

      Except that every last bit of code I'm running right now is written in C? Hmm, kernel, C library, shell, X windows, enlightenment, netscape... the list of >1000 line programs goes on and on. It's just that there's quite a few C programmers who don't understand how to modularize their programs so they can grow efficiently.

    2. Re:OOP by DigitalDragon · · Score: 1

      You have to let yourself grow out of the boundaries of procedural programming. I agree that all these programs are in C > 1000 lines and are good, because the programmers who wrote them are gurus.
      OOP is a real way to design smart programs, so that they will be trully extendable and modular. C'mon, casting, inheretance, you need all this and it does make your life easier.

      I admit that not everyone is as smart as you or those other C programmers are, but programming should not be a challenge that only you can do, it should be a mean of doing something useful.

      --
      http://dtum.livejournal.com
    3. Re:OOP by Muzzarelli · · Score: 1
      You cant seriously use Netscape as a example of good C coding

      The point is object orientation make the modularization easier, more flexible, and finer grained.

    4. Re:OOP by TimoT · · Score: 1

      IMO, you can get pretty far with opaque pointers (also called handles) and modularized object based designs (usually no inheritance, although you can use pointer tricks). This way you can also implement your own kind of object systems (e.g. prototype-based OOP). For dynamism you'll still use function pointers, but then again a vtable is a table of function pointers and in C++ each object (that has virtuals) contains a pointer to its vtable where the actual functions-pointers for the virtual functions are. Note that using C it is easier to mix libraries from different vendors since C has a binary standard whereas C++ classes don't mix between compilers. If you must do that then you have to use plain C to call the object's methods (basically trampolines) and opaque pointers and then wrap that in a class in the other compiler.

    5. Re:OOP by Sanchi · · Score: 1

      can you make something better?

      --
      "They said we couldn't do it [Athlon]... but we built it, we shipped it... and we didn't have to recall it." Rich Heye
  87. You should start with C not C++ by MongooseCN · · Score: 2

    One thing alot of new people don't understand is how linear programs run on a computer. C is very linear and would show this well. C++ will just make things more confusing for a new programmer.

    C++ also seems to be turning into a buzzword now. "OOh its C, but its got a ++ after it, it must be better!" Well I have a new language called D+=2 clearly it's far superior to C++.
    My question is, why don't people use C instead of C++? I find it hard to hide from myself that a program runs linearly and try to hide that fact behind classes, inheritance and all those other C++ features. A program can be designed and run better than C++ in C, but C++ has more hype running around it.
    Giving a carpenter a nailgun doesn't make him a better builder than someone with a hammer. He can just screw things up faster.

    1. Re:You should start with C not C++ by dingbat_hp · · Score: 2

      C++ will just make things more confusing for a new programmer.

      That's a good point, but I'd argue two cases against it:

      • C is a hard language for beginners to learn. Manual pointer handling, 50 ways to shoot your feet off, confusing "=" and "==". None of these trivial language-specific coding issues are things that a learner of "programming" should be troubled with. These days there isn't even any need to - there are plenty of alternatives.
      • C programmers make terrible C++ programmers. Ask anyone who works with, and designs in, a real OO environment. OK, obviously some C programmers make the leap, but the vast majority still think in C terms, and never get properly into the OO mindset.

      C++ also seems to be turning into a buzzword now. "OOh its C, but its got a ++ after it, it must be better!"

      Now ? That's a problem from ten years ago. I barely notice it these days -- in fact, few non-geeks still remember there was a C beforehand.

      a program runs linearly

      They don't.
      Programs haven't run linearly for a decade; since windowing systems became commonplace. Machine code might still run linearly, but any macroscopic non-trivial "program" these days, even in VB, needs to worry about asynchronous events, let alone threading models. This is all horrible and complicated, and best handled by good class structure in a good run-time environment.

  88. Becoming a Programmer by herwin · · Score: 1

    The book is interesting, but as the reviewer noted only covers about 1/2 of the introductory semester (about what we would cover in a course for managers 8). Just to provide some insight from several years of teaching, I suspect that a C++ programmer needs 4 semesters of coursework in programming and data structures (including at least one major project) and a 5th semester in software engineering to be able to handle a job as an entry-level programmer in industry or business.

  89. Re:Can someone give 1 good reason to use C++ over by Temporal · · Score: 2

    There are tons of reasons. Here's an interesting one:

    In the program I am writing, dynamically allocated data deletes itself when you are done with it, the same way java does. You just have to use my smart pointer class in the place of regular pointers. They work exactly the same syntactically, but they keep a reference count for whatever they are pointing to and free it once nothing is pointing to it anymore. No more memory leaks!

    Now, this is not ideal for all situations, but it is something you just can't do easily and transparently in C. In my project, it has been incredibly useful, as alot of the code involves distributing and re-distributing resources to many distant places, and it is not always clear who's job it is to free some memory. But with smart pointers, it is not a problem.

    Also, when using smart arrays, I can stick in bounds-checking for debug builds, which is pretty useful.

    ------

  90. C++ by len(*jameson); · · Score: 1

    C++ could be alot easier to learn if they would introduce more books like this to kids at a younger age. Then they'd have a strong foundation in computers even before they got to the hard stuff.

    --
    Intergalactics - A pretty cool strategy game in a java applet
  91. small projects Re:Initial steps into programming by BetaJim · · Score: 1
    Yep, I understand what your talking about. In fact coding small projects is the best way to learn. You work on something useful to yourself that you will use in future. The biggest downfall is that I sometimes skimp on the amount of helpful error messages I put in :)

    I'd like to suggest my all time favorite coding project: a signature file rotator. Its simple and a good way to learn new languages. After that make ~/.signature a FIFO so that every read will return a different sig! Lots of possibilities.

    --

    "Drug related crime" is a misnomer, "prohibition related crime" is the more accurate and correct phrase.

  92. The Software Engineering Community by herve76 · · Score: 1

    The Software Engineering Community website is dedicated to the FREE information sharing about software engineering disciplines between software engineers (i.e. industrials, faculty members and students).

    http://www.software-engineer.org

    The website is now available online, and already 130 software engineers worldwide have become contributors and share their expertise every day by posting links, news, articles, and messages.

    1. Re:The Software Engineering Community by Covener · · Score: 1

      Share your appreciation for this lame post appearing in all the stories at their contact form

    2. Re:The Software Engineering Community by herve76 · · Score: 1

      This message does not appear in all the stories.
      And it is related to the 'Programming' topic.
      Plus each post has a Score, so if you don't want to read this kind of message, please look at the score.

    3. Re:The Software Engineering Community by drivers · · Score: 1

      Here's a clue (free advice):
      Post something directly relevant to the article at hand. "Because it is about Programming" is not good enough. Then when you have said something informative, funny, insightful, or interesting, plug your site in your signature.

  93. Re:If only he had chosen a _real_ language by Mendax+Veritas · · Score: 1
    I've been coding since you were in short trousers, boy!
    Not that again. You don't know if that's true, and even if it is, so what? What matters is how well you understand the subject, not how long you've been working in it. And to judge by your comments in this thread, your understanding is rather weak. Or maybe your priorities are just badly screwed up, since you seem to think that C++ is good just because it's currently in high demand in the market.
    But a skilled programmer will find that she can use C++ to produce faster and more efficient code than is possible with Perl.
    I don't disagree with that. I just think it's irrelevant. Nobody's trying to rewrite GNOME in Perl, and for most of the things Perl is used for, it is fast enough. If you're such a great master of programming, why do you still have this teenage-hacker-ish attitude that everything has to be as fast as possible?
    it sounds like you think every program, including simple shell scripts, should be written in C++.
    Well, almost.
    That sort of says it all, I think.
  94. Re:Can someone give 1 good reason to use C++ over by gavinhall · · Score: 1
    Posted by 11223:

    No. Linus torvalds convinced me a long time ago, in Documentation/CodingStyle.txt (I think that's what it's called.) Read it, and understand where I'm coming from. (To paraphrase) C programmers do not use cute names like this_is_a_temporary_loop_counter. They use i,j,k.

    And if your functions are so big that your declarations aren't near the first use, it's time to split your function. Better yet, instead of saying this myself:

    Everybody on this thread: Drop what you're doing and go read Linus's Documentation/CodingStyle.txt in the kernel source. It explains how to write good C code, and clears up the issues that some C++ programmers here have with C code.

  95. Not true by DigitalDragon · · Score: 1

    Ok, here's the case. My dad is not a programmer, but he wants to be one. I would love to recommend this book for him, to learn how to code. But, I am afraid C++ syntax will be too hard for him, where else Java would be just fine. And he wants to become a Java programmer, so he does not really need to know another language. And you have to understand, that after reading this book he'll have a lot of mess in his head about C++, although he will not be able to program in it - you'll need more time then that, at least a year to become decent. They should've just chosen some obscure language such as Turing or even Eiffel for teaching. They are much simpler, and easy to transpose to other languages. C++ is just way too hard. Really. Just to mention, I know C++ pretty good.

    --
    http://dtum.livejournal.com
    1. Re:Not true by TheNecromancer · · Score: 1
      >>But, I am afraid C++ syntax will be too hard for him

      Programming language syntax is not the stumbling block that people have when learning to become programmers - it's the failure to understand the concepts of programming.

      >>They should've just chosen some obscure language such as Turing or even Eiffel for teaching.

      I disagree here, the author chose C++ since it is more of a mainstream language, and more people program in C++ than in Turing or Eiffel.

      >>And he wants to become a Java programmer, so he does not really need to know another language

      If he doesn't need to learn a different language than Java, why would you recommend a book to him that you think should be written in Turing? Shouldn't you recommend a Java programming book to him?

      >>after reading this book he'll have a lot of mess in his head about C++

      Once again, the code syntax doesn't matter when you're learning to become a programmer. Use whatever language you feel comfortable with, but make sure you learn the concepts of programming! Once person may be confused learning C++ out of the gate, but another may be confused with Java!

      --
      Attention all planets of the Solar Federation! We have assumed control! - Neil Peart
    2. Re:Not true by nachoman · · Score: 1

      There is a big different between wanting to be a programmer and being one. I can want to be a rocket scientist but that doesn't mean I can be a good one. Programming is not just syntax on a page, it's the skill. You can learn C++ in a matter of hours. But if you want to be a programmer it will take some time and learning.

      The language is only the start! I'm in a CS degree in university and i have not been taught how to program in C++ or any other language for that matter. I have been taught how to be a software developper. Algorithms, Data Structures etc... That's the heart of programming.

  96. And apparently this book gets you chicks too. by devphil · · Score: 2

    That's right -- he recruited a full-fledged novice user, capable of little more than e-mail and word processing, and turned her into a decent programmer while reviewing this book. (She became Mrs. Heller shortly after that.)

    So, all I need to do is pick my target babe^H^H^H^H new user, get her to read this book, and she marries me? Man, a whole "Nutshell" series of books could come out of this...


    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    1. Re:And apparently this book gets you chicks too. by Azure+Khan · · Score: 1

      Kim, Kim, Kim..

      You've misspelled "foreplay" again.

      Honest mistake.

      Azure Khan

      --

      --- I'm going sane in a crazy world.
    2. Re:And apparently this book gets you chicks too. by Kvort · · Score: 1

      I would have fallen out of my chair if it wasn't for these armrests... (IWHFOOMCIIWFTA, for the acronym people)

      That was a perfect setup... I've waited my whole life for an opportunity like that...

      You only get a few of those, Azure... Make sure you enjoy it.... :)

      >>>>>>>> Kvort

      --
      -Don't mind me, I'm personality-deficient and mentally-impaired.
  97. If Everybody had a basic discrete math class? by Gorbie · · Score: 1

    Whatever you're drinking, I want some!

    Most people have great difficulty with math concepts. Its all in how the brain gets wired as a child. I have a degree in Mechanical Engineering (Yeah, Yeah, I know you do too, that's not my point), and have taken many flavors of math. Discrete structures sucked more than anything I ever added, subtracted, integrated, or derived. The concepts of sets and logically ordered illogical numbers are never basic, and are really second year Math major material.

    This is not intended as a rant or a flame, but basically to say that some people aren't good at math, or really anything technical. Something a little bit more technical than "Programming for dummies", but worded in a similar way could very well break down these walls and provide small, chewable bits of programming skill much better than some obscure math class.

    1. Re:If Everybody had a basic discrete math class? by gavinhall · · Score: 1

      Posted by 11223:

      Then teach them VB, not C++. There's too much math in real programming to have somebody who doesn't understand discrete math learning C++. That's not flamebait, but programming is (to me) an art of combining math and the workings of the computer - and nowhere in there is there an "object" - that's part of Software Engineering, which is not programming. VB (maybe Kylix - I'm showing my MS heritage) is a great teaching tool and a great tool for writing programs to get a job done. (BTW, I'm drinking an awful lot of caffine - look at how many posts I've done today).

    2. Re:If Everybody had a basic discrete math class? by Gorbie · · Score: 1

      I see your point, but it should be noted that C++ is probably the best jumping off point for learning Java, which isn't quite so math intensive. I am not ra-ra-ing for C++ as the basic language of choice...I was merely boggling at the concept of trying to bring discrete math into the lives of more people that necessary. Seems...ugly...if you know what I mean. Programming progressions I have seen generally go Pascal, C, C++, then Java. C++ is certainly high on the food chain, but I guess if the guy can teach it to beginners, then give the man a cookie!

    3. Re:If Everybody had a basic discrete math class? by Gorbie · · Score: 1

      Who is talking about getting a BSCS? We are looking at a book that can teach a layman a computer language. That is VERY useful knowledge, even if you never plan to program in your life beyond Perl....java...HTML...etc.. It can be used to help your kids with their homework. It could be very useful for a business manager to understand a little of what their engineers are doing. I agree with your points, but I don't really see how they apply to using this book to learn a language. I can program (or used to be able to ;) in Fortran, C, Pascal, and some Java, as well as HTML, and I don't have a CS degree. I generally don't use this knowledge except to took at code and understand what someone is doing.

    4. Re:If Everybody had a basic discrete math class? by bradleyjg · · Score: 1

      You say "computer science" in response to a poster who talks about programming and later include "computer science" as an engineering discipline. I think we all need to be more clear on what we mean. From a teaching perspective I think there are three area's whose needs can be addresses separately.

      1) Computer Science
      - Note the word science; this is where you deal with set theory, computability, and all the other abstract idea's that justify a department which is separate from the math department. This category does not require a language at all - in fact you probably don't even need a computer. And it is certainly a dereliction of duty for a professor who is purportedly teaching computer science to instead teach programming. (see below)

      2) Software Engineering
      Just as chemical engineers use chemistry to solve specific problems software engineers should learn how to use computers to solve problems. The same methodologies apply - engineering is engineering, and a strong cross discipline engineering curriculum should be required. Just as civic engineers do not spend there time learning to lay bricks software engineers should not get bogged down in the actual implementation of their designs (although 1 or 2 lab courses certainly wouldn't hurt). Which language is taught is of little relevance - what's key is the ability to use whatever tools are available to solve a given problem.

      3) Programming
      This discipline is strictly mercantile and is probably more appropriate to a local or technical college. Quite simply the objective of a programming curriculum is to enable the graduate to be hired as a programmer. Esoteric languages aren't going to help. Being bigoted about one particular style is not going to help. The curriculum should teach whatever the hot language is and should emphasize the use of that language to solve commercially useful problems. In order to enable the programmer to have some upward mobility some software engineering (see above) should be thrown in.

  98. Re:C++: The PL/1 of the 90s. B*L*O*A*T!!! by titus-g · · Score: 1
    but does C make you irresistable to women?

    (She became Mrs. Heller shortly after that.)

    C++ is more powerful Q.E.D.

    --

    ~ppppppppö

  99. How to Get Girls by IHateEverybody · · Score: 4


    Heller demystifies computers, programming, and C++ for absolute beginners. That's right -- he
    recruited a full-fledged novice user, capable of little more than e-mail and word processing, and turned her into a decent programmer while reviewing this book. (She became Mrs. Heller shortly after that.)

    So that's what I've been doing wrong! No more singles bars for me, from now on I'm teaching programming to cute female newbies until I find Ms. Right.

    --
    Does this .sig make my butt look big?
  100. Re:Can someone give 1 good reason to use C++ over by arnald · · Score: 1

    No, you've misunderstood my (careful) post.

    Whatever Linus Torvalds says (and I don't HAVE to follow what he says, just as you don't HAVE to follow what I say!) applied to the Linux kernel.

    Now, the Linux kernel is written in C.

    C is not C++.

    Therefore the comments made by Linus Torvalds do not apply to C++.

    (quite apart from the fact that I disagree with them anyway... but they aren't relevant here).

    --
    arnald
  101. Re: Haskell as a teaching language by Mendax+Veritas · · Score: 1
    We're wandering off-topic here, but what the hell...
    Incidentally, Haskell is not really hard to learn. It decomposes into various subsets in a very clean way. I wouldn't recommend beginners learn much about monads, for example, or modules, or some of the other more esoteric features.
    Sure, but you can't write anything useful in Haskell without knowing about monads! You can't do any I/O, or use strict evaluation, or even obtain pseudo-random numbers, without them. Now, this is arguably a good thing, since monads are a very powerful and elegant concept, but they're still a bitch to learn.

    Also, Haskell's type system is rather daunting to the beginner. I lean towards the notion that beginner languages ought to be dynamically typed, precisely to avoid that complexity. That's one reason Scheme is a good beginner language, in spite of its parenthesis-ridden syntax.

  102. How to pick a beginning programming language by scruffy · · Score: 1
    In my opinion, Pascal remains the best intro language. The syntax is relatively simple, and you have some chance of learning the whole language. You also get structured programming and strong typing along the way. The big disadvantage (besides no OO) is that knowing Pascal is not very useful on your resume.

    If you want object-oriented programming, I would think Java would maybe be the best choice. Unlike C++, there is at least a small chance of learning the whole language (though not all those libraries). And students can play with windows pretty much right away. Also, automatic garbage collection is a wonderful thing. Java is far from perfect, but OO+garbage collection is a great combination for a high-level language. I would agree that Smalltalk and Scheme are nice languages, but Java beats them by being more useful.

    As far as Perl and Python is concerned, they have their uses, but I think you want strong typing for beginning programmers. There is no need to encourage bad habits from the start.

    1. Re:How to pick a beginning programming language by wayward_son · · Score: 1

      For a beginning programming language, I would have to recommend Java. Clemson University uses Java for CPSC 101/102 to teach CPSC, CIS, and CpE majors how to program. The syntax is not that difficult, it can run on both the UltraSparc systems in the lab and the students' Windows systems in their dorm room. The SUN API is well documented, so students can write more complex programs with less class instruction. Unfortunately, they still inflict C++ on the electrical engineers (CPSC 111) If you ever want to teach students to program do not use "Programming in C++", Nell Dale, Chip Weems, and Mark Headington, Jones and Bartlett Publishers, 1998 This book is not only almost impossible to follow, but it teaches C++ as a procedural language. OOP is not introduced until the end of the book.

    2. Re:How to pick a beginning programming language by sittidae · · Score: 1

      I disagree that Java is more useful than Smalltalk. Except for maybe fuel for the hype engine. Smalltalk programmers look at Java programmers the same way that UNIX users look at Windows users. It's a poor implimentation of concepts that have been done better for years.

  103. Re: Ada, and CS programs in general. by Bedemus · · Score: 1
    Hmmm.... someone from wvu.edu liking Ada... Perhaps that's because Ada is the only thing they will teach you there for the first two years? Make no mistake -- the ada-loving profs at WVU are only touting Ada because of the close ties they have with NASA (Heck, is Mundy still there? She works for NASA, even!), and many governmental organizations still use Ada.

    Not all students plan on working for the government for a living after they get out of college -- give me a CS program that teaches marketable skills like Perl/CGI programming, C, PHP, Java, etc over one that spends half the time making sure people understand the semantics of a language that doesn't get nearly so much use as it used to any day.

    Or, better yet, give me a person who has the motivation to be a programmer from little up, before being bitten with the "computer science will make you rich" bug. The people who actually can *think* like a computer. We may not be socially adept, but we can learn any language in a period of months, not years. There are obviously exceptions to this rule, but many of the best programmers out there could program the pants off a college grad before they ever entered college, and if they get a degree, it's just because they want to have that piece of paper saying they know what they already know they know. (follow that? :) ) The degree is no more important to them than a certificate is to an MCSE -- something they paid too much for but needed to put on their resume.

    Pardon my rant, it's just that I get fed up with these guys who haven't even finished college yet acting like they know what it's like to work in the real world. I feel sorry for them in some ways, as when they graduate many of them leave with the attitude of "I know how to do everything by the book," then they get a manager who doesn't care how the book says it should be done, just wants it to work, NOW, and they just fall apart.

    Just my (probably gonna get moderated down) 2 cents. :)

  104. WANTED by ENOENT · · Score: 1

    WANTED: Novice C++ programmer to participate in
    human sexuality research with Pamela Anderson.
    We can only pay 50 cents an hour, but stock
    options are available to qualified applicants.

    --
    That's "Mr. Soulless Automaton" to you, Bub.
  105. Dissing PL/I by Anonymous Coward · · Score: 1
    Having used both PL/1 and C++:
    PL/1 was lots easier to learn. What it did was more consistent.

    Agreed. PL/I has become synonymous in the industry with bloat-- undeservedly, IMHO. It was simply too ambitious for its time. Like the whole Multics/ Unix thing. In fact, IIRC, Multics was implemented in a PL/I dialect.

    Many people dissing PL/I have never actually seen the language; they are just parrotting received hacker wisdom or trotting out the same old "IBM == Satan" Microsoft/ Apple party line. If they ever saw it, they would be surprised to find how C-like PL/I is-- both are heavily influenced by Algol, after all. PL/I was far superior to contemporary languages like FORTRAN and COBOL.

    Heh, maybe with IBM porting Linux to System/390 hardware, we'll see a Renaissance in PL/I. (:

    1. Re:Dissing PL/I by dingbat_hp · · Score: 2

      Am I old or something ?

      I've written a little PL/1, ported a _huge_ Algol 60 program to FORTRAN, and coded a fair bit in object Pascal(s), C++ and now a little Java. (CORAL, Eiffel and a few weirdies too.)

      PL/1 was bloatedness incarnate. It was bloated in places that didn't need to be bloated, and added nothing for their being bloated. The whole thing looked like bad editing on the output of a roomful of skilled language designers; no one piece was bad, but there was no reason why there had to be quite so many ways to do something. No-one had stood up in the meeting and said "Why are we adding that feature ?".
      A mil-spec Cadillac, if ever there was.

      C++ is ugly, but it's ugly for a reason. It's an evolutionary answer to the problem "Take the One True Geek Language and stick objects onto it". It's still one of the world's all-time greatest Hacks, and I still hate it.

      The idea of teaching newbies C++ as a first language horrifies me; not because it will produce bad C++ coders, but because it's a very slow way of teaching people advanced OO concepts. It's also going to drive away an awful lot of people who simply don't have the dedication to suffer through their thousandth bad pointer error.

      Why not teach Java ? It has a good a claim to being a "competent teaching language" as most others, it gives immediate and satisfying results (unlike some scripting platforms), and it has commercial relevance.

    2. Re:Dissing PL/I by SciBoy · · Score: 1
      Here at the University in Lund, Sweden, they have switched largely from Pascal to Java to teach beginners programming. I think starting out with an object oriented programming language is preferable, since otherwise you have to "unlearn" some things about regular programming. Java is also incredibly well documented and once you learn the structures of it, you can make your own programs pretty quick, without having to buy a book specifically for use with the area you are writing.

      Java may not be a language I would write my own MP3 player in, but more than likely that's not going to be an issue when learning programming basics.

      --
      "War is God's way of teaching Americans geography." - Ambrose Bierce (1842-1914)
  106. I've seen worse by Broccolist · · Score: 1
    It's so horrible, in fact, that I can't even think of a worse one.

    I advocate forcing every new programmer to learn INTERCAL. Behold its gloriously simple and useful operators:

    The interleave operator takes two 16-bit values and produces a 32-bit result by alternating the bits of the operands. Thus, #65535c/#0 has the 32-bit binary form 101010....10 or 2863311530 decimal, while #0c/#65535 = 0101....01 binary = 1431655765 decimal, and #255c/#255 is equivalent to #65535.

  107. REAL Programmers.... by sherpajohn · · Score: 1

    Don't use this C++ nonsense. Abstractions and translations from the native language of processors into some human construct only obfuscates an already deep and dark discussion between the human brain and the silicon slave...so, real programmers type... copy con myprog.exe

    Going on means going far

    --

    Going on means going far
    Going far means returning
    1. Re:REAL Programmers.... by KenSeymour · · Score: 1

      Or is it the silicon brain and the human slave.

      --
      "We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
  108. Re:Can someone give 1 good reason to use C++ over by Yunzil · · Score: 1
    ie. to ask yourself (and answer) questions like "does variable i have a meaningful value at this point in the code, or can I use it for something new?"

    Well, there's a problem going the other way too. If I'm looking at a C++ for(;;) loop, and I see 'i' used as an index, then I may have to hunt all over to see where it came from. Was it declared in the loop? Was it declared at the beginning of the function? Hell, is it member of the class?

    Secondly, the names `i,j,k' give someone reading the code no clue as to what the variables stand for.

    99.9% of the time, they're loop indices. How hard is that? :-b

  109. Obscure? how about "obtuse"? by Karmageddon · · Score: 1
    Just because you haven't heard of it doesn't make it obscure. Probably 90% of the world's population never heard of Moore's Law nor Phillip's curves. That doesn't make them obscure either.

    The one I'm describing is the reverse of nothing. It's called learning curve theory and it's really the only one there is. When I said there could be other things called learning curves, I meant in the abstract. If you search academic literature, you will find only the one I described.

  110. Re:If only he had chosen a _real_ language by Grim+Metamoderator · · Score: 1

    Did I say Perl was great? No no no no, I did not! Perl, in fact, sucks a lot worse than C++. All I said was that C++ is no more object oriented than Perl, which is true because both languages pretend to be object oriented without actually being so.

  111. Re: Haskell as a teaching language by arnald · · Score: 1

    `Agreed, the IO system requires /some/ knowledge of monads (but not necessarily a complete delve into the details). You could of course use stream-based IO...

    Actually come to think of it monads aren't even that complicated. In some ways they'd be more intuitive to people coming from an imperative programming background than are, say, higher-order functions (folds and the like).

    The type system is another thing you only have to know a subset of to be able to do useful/instructive things. I strongly disagree that beginner languages should be dynamically typed: type discipline is probably the FIRST thing a prospective programmer should learn, and the Haskell type system provides a beautiful environment in which to do it!

    I will concede, however, that the Hindley-Milner algorithm used by the Haskell typechecker can give phenomenally unhelpful error messages. However, this is an active field of research.

    There was a paper about beginners and the Haskell type system in the Journal of Functional Programming recently (March 2000? Can't remember). The authors proposed a graphical system to learn how the type system of the function subset of SML works. I thought it might be interesting to apply the same ideas to Haskell, and considered taking this on for my final-year project.

    It's an interesting subject.

    --
    arnald
  112. Re:Can someone give 1 good reason to use C++ over by rmstar · · Score: 1

    I contend that one should not have to deal with these kinds of details when programming; they have absolutely nothing to do with the problem in hand

    excuseme, but that is programming.

    ''I dont want to bother about motor oil, nor about gear shifting, nor about gas. It has nothing to do with where I want to go''

    I mean...

    rmstar

  113. Re: Ada, and CS programs in general. by harmonica · · Score: 2

    Ada is a language to do /real/ software engineering, and it is used in many projects where human lifes depend on the programs. Usually, relatively many people with much experience work on those projects, producing very few lines of code (per time unit). For people to really learn it, they must spend a lot of time getting into software engineering plus all the other stuff you'll have to learn with any programming language. So, Ada may just not be what you're looking for. Doesn't mean it doesn't work for someone else. CS programs that merely teach PHP and C are a horrible idea to me. Any decent CS student will learn either one easily once they got the concepts behind software development. And hopefully they will have developed the skill to go around the usual traps created by C, assembly and all the other languages that don't offer advanced features.

  114. Irritating flamewars already started by Matthew+Smith · · Score: 1
    Oh dear! It's slashdot at its worst again. Can all see lovers just go and read a different article please. All threads are getting so offtopic that I'd moderate them all down if I had the moderator's access at this time. If you don't fancy c++ the fine, piss of and go read something else. Nobody here needs your stupid jihad. When you become a more mature programmer (and a more mature person) you'll outgrow C at some point if you continue to develop. I too thought at some point that C++ was too difficult with its "obfuscated syntax" and its "rope to hang yourself with" but then I went to the real world and realised that serious people use C++ for very serious work and it's definitely possible to master it given enough experience.

    It's almost like Unix you hate it until you truly start to understand it and it all 'falls into place'. Also remember that you don't have to use every single feature of the language in your code. You can learn the basics and build up on that. This is how I learned c++. It will take longer but then again it's the price of added flexibility. C++ encompasses more paradigms than just OO so it's not a true OO language that's true. But it's a very powerful language as such. Since 'hello world' will compile in c++ just the same it's no worse for learning than C.

    So can you please post some comments on the book not language itself. Thank you.

  115. Re:Rob Pike quote by ballestra · · Score: 1
    I must disagree with this statement, that there is something wrong with using an OS or a programming language that is 30+ years old. This is why we study Computer Science, and not just Programming.

    We're still using the same mathematical equations that the Greeks and Eqyptians used thousands of years ago. Does that make them out of date?

    We should all be thankful that we don't have to learn "new", "better", or more "up to date", programming languages as often as we need to upgrade our PCs. If that were the case, then we'd all need Who's Afraid Of... books.

    "What I cannot create, I do not understand."

  116. Re:C++: The PL/1 of the 90s. B*L*O*A*T!!! by VaporX · · Score: 1

    I think C makes me extremely resitable to women.

  117. Re:Can someone give 1 good reason to use C++ over by arnald · · Score: 1

    Obviously you've never seen functional programming. It gives you a new perspective.

    There's no technical reason why you should have to deal with minutiae such as this.

    Of course, no imperative language can ever hide all the messy details. But some hide more than others. C++ hides more than C (if it's used properly).

    It's the same thing as saying "BASIC hides more details than assembler", which is true. It's just on a slightly higher level.

    --
    arnald
  118. Re: Haskell as a teaching language by Mendax+Veritas · · Score: 1
    strongly disagree that beginner languages should be dynamically typed: type discipline is probably the FIRST thing a prospective programmer should learn
    I think this is one of those "agree to disagree" situations. I'd say the first thing a beginner should learn is how to think algorithmically. And I don't think that "learning discipline" needs to involve being put into a straitjacket. People who write very large, complex programs in dynamically-typed languages such as Erlang, Scheme, or Smalltalk seem to do just fine without static typing. The comp.lang.functional newsgroup has debated static vs. dynamic typing many times, and neither side seems to be able to convince the other. The people who use statically-typed languages are always convinced that without static typing all hell would break loose, and the dynamic-typing advocates insist that their experience says otherwise.
  119. Dear Mr. Moderator by DonkPunch · · Score: 1

    If I ever meet you, I will kick your pasty butt.

    --

    Save the whales. Feed the hungry. Free the mallocs.
  120. Re:small projects Re:Initial steps into programmin by Signal+11 · · Score: 1
    I already did that... :)

    I even had a program that bounced a "." back and fourth, and you could have it reverse direction by hitting the spacebar. Didn't want to try for 2d motion though - that would have required me to learn ncurses.

  121. No, I mean obscure by ChrisWong · · Score: 1
    Popular usage, as we noticed, has this ability to hijack any jargon. Your version is obscure in that it is not understood by most people using the phrase. I was looking for the popular meaning, one that explains its usage. Its popular meaning, of course, is confused and illogical, but that is nevertheless its popular meaning. Yours does not qualify, since it is not the one meant by most people who throw the phrase around, and is probably no longer relevant in common usage.

    I will grant you that an otherwise obscure word can be well understood in a select group of people. However, that group is not the relevant context here.

  122. how useful can this be? by phlake · · Score: 1
    maybe i'm an elitist. maybe this sentiment is a hold-over from boyhood, where all my local lending library carried was introductory books. but i can't help but feel that the last thing we need (as a profession) is another introductory book. there are a million of these already.

    think about it. it's far easier to write a pared-down basic book on a language that covers but a small percent of it. and that type of book is useful for about a week, if you're approaching it from an angle of complete ignorance.

    this always frustrated me early in life. i wanted so badly to know the real information, and i learned to hate books that skimmed over the intricate details.

    and there's always the question, as so many others have brought up, of whether c++ is truly the way to approach programming. i honestly doubt it. it's hard enough for trained pros. useful: yes; flexible: yes; powerful: obviously; simple: no way in hell.

    maybe this book will encourage someone to look deeper, to find more serious books. to take classes. of course, i realize that "introductory" means just that. it's not meant to be the last c++ book you by. and going straight to stroustrup might be a little much to expect.

    but if, when you first read through it, you don't understand a lot of things in a book, that's a good thing. you might learn something there. you might learn alot. of course, if it assumes you know a lot more than you do, you might have to learn alot somewhere else first.

    enough of this rambling.

  123. With all due respect by Dungeon+Dweller · · Score: 2

    With all due respect, someone who is clever with assembly will always be able to outrun an optimizing compiler.

    --
    Eh...
    1. Re:With all due respect by Miriku+chan · · Score: 1

      right. i'd love to see you try to optimize a GUIed app for X to increase loading time. cmon. we can shave off a billionth of a second by unrolling a loop, but that doesnt matter. on the other hand we can quadruple the speed by using a better algorythm. so let's stick to that, and leave the loop unrolling to the compiler

      --
      shaolin punk, activist post-industrial
    2. Re:With all due respect by David+Greene · · Score: 1
      Always is a pretty strong term. How many programmers do you know that optimize large applications for code layout, data cache layout and the processor's pipeline structure and branch predictor? How many programmers are even able to do these things? "Clever with assembly" means much more than instruction selection.

      --

      --

    3. Re:With all due respect by Alomex · · Score: 1
      I would like to see you routinely solve register allocation optimization problems in your head (known to be NP-complete). On the other hand the compiler has no problem exhaustively searching a sample space of 2^10 possibilities.

      At the present time a good assembler programmer will give the compiler a run for its money. Within five to ten years, the compiler will leave the programmer in the dust.

    4. Re:With all due respect by prizog · · Score: 1

      You are wrong. Here's why:

      1. Register selection is very easy in most cases. Also, I can't think of a machine that has 10 registers, and anyway the NP-Complete problems require N! time.

      2. But that's beside the point, because on a machine with a decent number of registers (anything but x86), you won't run out during a routine, or if you do, the scheduling will be fairly easy.

      3. The programmer will always at least tie any optimizing compiler. Why? Because the programmer uses the compiler. When I last coded in assembly, I was writing a graphical application. 90% of it was in C. I wrote 100% of it in C, looked for the hot spots, saw what the compiler had done to them, and improved it.

      4. How did I improve it? I used SIMD instructions (MMX). I was able to get a 4x increase in speed. *NO COMPILER COULD EVER DO THIS*. There are 2 reasons for this:
      a. C doesn't have the syntax to do pixel manipulation SIMD style. My C code was full of shifts and bitmasks (ands). My assembly (when I re-wrote it) had only 2 shifts (one per section of the unrolled loop), and no bitmasks.
      b. A compiler doesn't know what the limits are on data that you'll pass to your function. You do. If you know all data will have an even number of pixels (say), you have an advantage over the compiler, which doesn't know this.

      Anyway, that's why you're wrong :)


      -Dave Turner.

    5. Re:With all due respect by scheme · · Score: 2

      Hmm...you're wrong one a couple of points.

      Register selection is very easy in most cases. Also, I can't think of a machine that has 10 registers,

      That may be true for x86 and CISC processors but most RISC processors have significantly more than 10 registers. HP's PA-RISC has 31 integer and >10 floating point, the MIPS have 32 integer and 32/16 floating point, the SPARCs, alphas, etc. also have at least 20 integer and 10 floating point registers. Then there are more obscure stuff like the AMD29k which had 128 registers. The IA-64 architecture has more than 50 registers, I believe.

      anyway the NP-Complete problems require N! time

      NP complete problems are solvable in non-polynomial time hence the NP designation. c^n where c is constant is non-polynomial hence NP problems can have solutions that are O(c^n). NP-complete problems are a subset of NP problems hence there can exist NP-complete problems that take O(c^n) time.

      How did I improve it? I used SIMD instructions (MMX). I was able to get a 4x increase in speed. *NO COMPILER COULD EVER DO THIS*.

      Just because you've never encountered a compiler that can't do this doesn't mean that one doesn't exist.

      The problem you've given is just an application of vectorizing the algorithm. Several fortran compilers exist that do this. However they were for architectures like the Cray which had SIMD instructions 15 years ago. SIMD is relatively new to the x86 and ppc architectures so naturally compilers for those architectures haven't been able to take advantage of this. Plus vectorizing compilers are hard to make.

      Anyway, that's why you're wrong :)

      And thats where you're wrong. :)

      --
      "When you sit with a nice girl for two hours, it seems like two minutes. When you sit on a hot stove for two minutes, it
    6. Re:With all due respect by David+Greene · · Score: 1
      Just correcting a few points:
      1. Register selection is very easy in most cases. Also, I can't think of a machine that has 10 registers, and anyway the NP-Complete problems require N! time.

      You're right, mostly. Register allocation is easy in the sense in that graph coloring is fairly fast and is able to roll up allocation, machine idioms and simple copy propagation all in one. It can also do things like web/live range splitting to pack even more variables into one register. Compiler register allocators are pretty damn smart. I doubt a programmer could do better. I didn't follow your "10 registers" comment - what are you getting at?

      2. But that's beside the point, because on a machine with a decent number of registers (anything but x86), you won't run out during a routine, or if you do, the scheduling will be fairly easy.

      This is a widespread misconception about RISC machines in general. 32 registers is really not enough once you start optimizing heavily. Optimizations tend to increase variable lifetimes, sometimes quite dramatically. When the compiler combines partial-redundancy elimiation, loop unrolling and register promotion, it quickly saturates a register file of size 32. This doesn't even count FP optimizations. There's a reason Itanium has lots of registers (some of that has to do with EPIC's fundamental nature, of course).

      3. The programmer will always at least tie any optimizing compiler. Why? Because the programmer uses the compiler. When I last coded in assembly, I was writing a graphical application. 90% of it was in C. I wrote 100% of it in C, looked for the hot spots, saw what the compiler had done to them, and improved it.

      How did you improve it? I don't think a programmer can always tie or beat a highly optimizing compiler. There are too many transformations hidden by the syntax of the high-level language. One might think that the hot spots can be coded in assembly to recover that, but it's very, very difficult to optimize for the pipeline, cache, etc. Not to mention non-portable.

      4. How did I improve it? I used SIMD instructions (MMX). I was able to get a 4x increase in speed. *NO COMPILER COULD EVER DO THIS*. There are 2 reasons for this:
      This has been addressed by another poster. Vectorizing compilers have existed for a long time.
      a. C doesn't have the syntax to do pixel manipulation SIMD style. My C code was full of shifts and bitmasks (ands). My assembly (when I re-wrote it) had only 2 shifts (one per section of the unrolled loop), and no bitmasks.

      I'll grant that for some applications, especially DSP-type stuff, compiler technology really lags behind. But in general, I think most programmers would find it difficult to beat a good compiler optimizer.

      b. A compiler doesn't know what the limits are on data that you'll pass to your function. You do. If you know all data will have an even number of pixels (say), you have an advantage over the compiler, which doesn't know this.

      Now this is a valid point. The programmer should concentrate on the high-level algorithm, which should take stuff like this into account.

      --

      --

    7. Re:With all due respect by prizog · · Score: 1

      1. Register selection is very easy in most cases. Also, I can't think of a machine that has 10 registers, and anyway the NP-Complete problems require N! time.

      You're right, mostly. Register allocation is easy in the sense in that graph coloring is fairly fast and is able to roll up allocation, machine idioms and simple copy propagation all in one. It can also do things like web/live range splitting to pack even more variables into one register. Compiler register allocators are pretty damn smart. I doubt a programmer could do better. I didn't follow your "10 registers" comment - what are you getting at?

      What I was saying was that the previous poster said "2^10", and I said 10 is a random number, and it wouldn't be 2^10 even if a machine did have 10 registers.

      3. The programmer will always at least tie any optimizing compiler. Why? Because the programmer uses the compiler. When I last coded in assembly, I was writing a graphical application. 90% of it was in C. I wrote 100% of it in C, looked for the hot spots, saw what the compiler had done to them, and improved it.

      How did you improve it? I don't think a programmer can always tie or beat a highly optimizing compiler. There are too many transformations hidden by the syntax of the high-level language. One might think that the hot spots can be coded in assembly to recover that, but it's very, very difficult to optimize for the pipeline, cache, etc. Not to mention non-portable.

      A programmer will always at least tie an optimizing compiler, because the worst the programmer will do is to RUN the optimizing compiler, decide that its output can't be improved, and used it as-is.

      It is difficult to optimize - no one ever said it was easy. But tools like Intel's VTune show you how your code will pipeline, etc (disclaimer: I've never used it, because I can't afford it). But yeah, it's possible to consider all of these things, and in some small sections of code, it's worth it. No one writes whole programs in assembly anymore (except 64k intros, but that's a different story).

      Non-portable goes without saying - but if you need the speed, you pay the price.

      4. How did I improve it? I used SIMD instructions (MMX). I was able to get a 4x increase in speed. *NO COMPILER COULD EVER DO THIS*. There are 2 reasons for this:

      This has been addressed by another poster. Vectorizing compilers have existed for a long time.

      There are compilers that can do some vector stuff, but not very well. Consider the following code:

      int r, g, b, a, p;

      a = ....;

      p = get_pixel (my_bitmap, x, y);

      r = (p >> 16) & 0xff;
      g = (p >> 8) & 0xff;
      b = p & 0xff;

      r = (r * a) >> 8;
      g= (g * a) >> 8;
      b = (b * a) >> 8;

      p = (r << 16) | (g << 8) | b;

      put_pixel (my_bitmap, x, y, p);

      This multiplies p by a. I know that a is between 0 and 255. My compiler doesn't. (I could make it an unsigned char, but that would be slower for various reasons, and could cause problems in other sections of my code, where it does go over 255 and is then saturated to 255). Another thing the compiler is not aware of is that the MSbyte of p is irrelavent - it would probably waste time masking it out after the multiply. There's tons of little issues like this (which is related to the second point, but it's more fundamental).

      b. A compiler doesn't know what the limits are on data that you'll pass to your function. You do. If you know all data will have an even number of pixels (say), you have an advantage over the compiler, which doesn't know this.

      Now this is a valid point. The programmer should concentrate on the high-level algorithm, which should take stuff like this into account.

      The code above is the best algorithm I can think of for darkening. I don't think it's possible to do better. But my assembly language version of that code was 2 or 3 times as fast. So yeah, it's not dead yet :)


      -Dave Turner.

    8. Re:With all due respect by codemonkey_uk · · Score: 1
      How many programmers do you know that optimize large applications for code layout, data cache layout and the processor's pipeline structure and branch predictor? How many programmers are even able to do these things?
      And how many compilers can do it?

      In my experiance compilers arnt as good as people expect them to be.

      Thad

      --

      Thad

  124. A good book for absolute beginners by maetenloch · · Score: 1

    This was the first book I ever read on C++ and I think the book does well what it intended to do: give the reader a quickie introduction to C++ and programming without requiring any background knowledge. You're certainly not going to be a proficient C++ programmer after reading it, but you will be familiar with the many of the concepts and buzzwords as well as the syntax. Having programmed in C and Basic before, I probably was not the book's intended audience, but I still got a lot of useful knowledge out of it without having to intensely study every code snippet. Probably the best thing the book gives you is the enough understanding of the basic concepts to tackle a more advanced book without being overwhelmed. Plus this book is proof that knowing C++ can (at least in one case) get you chicks. :-)

  125. Re:C++: The PL/1 of the 90s. B*L*O*A*T!!! by jejones · · Score: 1

    I agree that PL/I is easier to learn than C++...but it was the huge, all-singing, all-dancing, shove together a huge pile of every possible feature language of its time. Implicit conversion from anything to anything, with very counterintuitive results--the standard example is 25 + 5 / 3, where the rules for FIXED DECIMAL arithmetic preserve less significant digits at the expense of more significant digits. A sleazily-typed language like C, maybe more so, since PL/I has a single POINTER type. (I guess the BASED storage attribute implemented stacks for you, but I never actually used it.)

  126. Software Engineers vs. programmers by Coz · · Score: 1
    Here I was, wondering if I was just wierd, and there's the explanation - I'm not a programmer, I'm a software engineer!

    I've written software in assembler, C, C++, Ada (83 and 95), Basic, FORTRAN, and Java... I've used UML, OMT, Booch, and functional decomposition... I've written 50-line programs, 15,000 line programs, and 25,000 lines of code in various modules and libraries that went into dozens of programs... designed, developed, documented, tested, and integrated... and all along, I've been torn between programming and software engineering.

    So - let me try to sum some of this up - programming is cranking out a solution to a single problem in the most efficient method. Software engineering is developing part of the solution to a complex problem in a manner that:
    - others can understand
    - is documented
    - is tested
    - uses some common design, implementation, and testing methodology and procedures (maybe even - that dreaded phrase - Software Process!)

    Guess I can have Software Engineer on my business card, then. IMHO, in the Great Scheme of Things, we need both - I just wish they wouldn't get into screaming matches so often.

    --
    I love vegetarians - some of my favorite foods are vegetarians.
  127. Re:Can someone give 1 good reason to use C++ over by Malc · · Score: 1

    I think that I read that once. I disagreed with most of it. A lot of it was antithesis of my coding style/beliefs. I guess it's a good job I'm not coding for the Linux kernel. Just because Linus says something, doesn't make it right.

    As for big functions. Any good programmer knows that there are no hard and fast rules. Sometimes you get no benefit from splitting functions. If it makes more sense in doing it in one place, so be it.

  128. I mean, wrong. by Karmageddon · · Score: 1
    One cannot make sense of your original question and your current line of reasoning. Look at it this way:
    • you ask what is French about French toast.
    • I explain the origin of the phrase.
    • You say, "but nobody knows that, yet they continue to use the phrase. I want to know what most people mean when they say French toast.
    • Then the only answer can be, they don't mean anything. They think steep means hard by analogy to walking uphill.
    • Are you satisfied now?
    • No, you are not satisfied, because you are one of those people who will argue something into the ground rather than concede a point.

    Certainly, the meaning of words is determined by usage, there's no denying that. But when people say "steep learning curve," they are using the phrase wrong.

    I'll bet that you think "carrot and stick approach" refers to convincing by reward and punishment.

  129. Re:Can someone give 1 good reason to use C++ over by arnald · · Score: 1

    By the way, the automobile analogy is precisely the one I would have used to SUPPORT my point, had I remembered it... :-)

    --
    arnald
  130. What about legal bloat: Do we own SW we write? by SlushDot · · Score: 1

    Assuming I use a non GNU compiler, can I really say that all of the code I write is (C) by ME? What about all the stuff linked in from libraries provided by the compiler? In the old days, when code was tiny, yes, I could say it was all mine, but now... I wonder if even half of that .exe is really mine. Can one man own his code anymore?

    --

  131. A little background on myself by Dungeon+Dweller · · Score: 2

    Ok, I've been programming since I was about 4. If you count all of the scheme variants and such, I know about 50 different programming languages, and can list them by name. 2nd year at WVU has a programming language theory course in which students have to be fairly proficient in about 10-15 languages. All freshman engineering students are required to take a class in C++ and Matlab. The main reason for the Ada curriculum is textbooks and compilers related to the resolve project. Also, WVU is switching to a JAVA based curriculum in the next 4 years. I just happen to like Ada. If schools teaching C/C++ stuck with enforcing good programming practices, then I would say go for it. I would say go with C, though. C will let you get away with a lot of junk though, and many students could slide through their classes without really understanding the concepts. So, if you want staff checking to make sure that the students typecast, hell, go for it. As for me, I want my students to learn good computer science.

    --
    Eh...
  132. Oh yeah. by Dungeon+Dweller · · Score: 2

    At WVU we don't teach "languages," we teach concepts. All of the perl expertise in the world doesn't make you worth a damn as a computer scientist if you don't learn the fundamentals of computer science. You need to learn the math, big-0 notation, algorithms, theory. These are the important things. If you want someone who is capable of writing mediocre programs, WVU is not the place for them, we want people capable of writing only the best.

    --
    Eh...
    1. Re:Oh yeah. by Bedemus · · Score: 2
      Well, I see I hit a nerve with my previous post, so I'll be brief, and hopefully this will sting a bit less.

      Nobody said that you need to teach Perl, but rather that in the course of teaching the concepts, you use as a testbed for said concepts a language which doesn't obfuscate the concepts.

      When a language causes your students to focus more on semantics of a language than on what they're actually accomplishing -- when a student spends more time trying to get the peculiarities of a given language's syntax down, rather than focusing on what they're really *trying* to do, then you've done your students a disservice. Much worse so, in fact, when in the end they've learned the semantics of a language that, while admirable in its structure, is not nearly so marketable as the same concepts taught using another language.

      For instance, so long as an individual understands the concept of a linked list and how it can be employed to offer fine-grained control over an array of structures, does it matter that the user implements every array structure as a linked list rather than using a language that provides such basics as a builtin? I'm speaking abstractly here, really, the same argument could be employed for any number of other concepts.

      In the end, while computer science may seem a complex science to you and some of your students, there is no reason to treat it as such a complicated subject. Programming, in fact, any act of creation, should above all be something enjoyed, either in the act itself, or after the creation is complete. Treating the subject as something so cut and dry (good_programmer = math + bigO_notation + algorithms + theory;) does a disservice to the occupation.

      Finally, I and many others like me I'm sure find it insulting that you suggest that WVU wants only the people capable of writing the best programs. First, as worded, it makes it sound like you forget that your job is to take a person and make them the type of person who can program well. Second, your implication that a programmer who hasn't attended WVU (or any college, perhaps) is somehow *not* capable of writing a program to put your graduates/instructors to shame, is extremely narrow-minded.

      There are individuals for whom such things come naturally, and your statements sound more like an advertisement or justification for your university's existence rather than any substantial reason why your program produces better programmers. Years of refinement or not, there is no best way to teach computer science to someone, no more so than there is any one best way to solve a particular programming problem.

    2. Re:Oh yeah. by lars · · Score: 1
      Treating the subject as something so cut and dry (good_programmer = math + bigO_notation + algorithms + theory;) does a disservice to the occupation.

      He didn't say that. He said that a good computer scientist knows about analyzing efficiency, algorithms, and theory. These things are what computer science is all about, I don't understand how you can possibly dispute what he's saying, unless you're equating programming and computer science. You don't GO to a University to learn to be a computer programmer. If that's what you want, you should be at a community college or trade school of some sort.

      Secondly, writing computer programs well is only part of being a good computer scientist. It is a subset. Being a good programmer does not make you a good computer scientist. You are right that obsessing over syntactic details of a language is a waste of time. If students are spending an inordinate amount of time on such details, then something is definitely wrong. However, studing 10+ languages in a programming languages course is definitely not a waste of time, and whether or not they're languages that are in common use in the real world is really irrelevant.

    3. Re:Oh yeah. by Bedemus · · Score: 1

      And I say that while good_programmer != good_computer_scientist, good_computer_scientist == good_programmer. So the argument still stands. Secondly, you're speaking for the previous individual who clearly sees the same truth, as he says that the goal of the university is to turn out people who aren't mediocre programmers, but great ones. The proof is in the program. If you're a computer scientist that works exclusively in pseudocode and chalkboard drawings, then you are indeed a scientist, and a mathemetician, but the word computer doesn't even belong in your major.

    4. Re:Oh yeah. by lars · · Score: 1
      So you're saying is:

      good_programmer != good_computer_scientist

      *and*

      good_programmer == good_computer_scientist

      With that logic, I'd suggest you aren't either. :)

      If you're a computer scientist that works exclusively in pseudocode and chalkboard drawings, then you are indeed a scientist, and a mathemetician, but the word computer doesn't even belong in your major.

      Huh? Once again I don't understand where you are coming from. No computer scientist works without a computer. However, a computer scientist may work with a model of computing such as a Turing machine or a pushdown automaton rather than a physical computer. These models are every bit as powerful as the real thing, so why do you say that one needs to use a physical computer for their work in order to call themselves a computer scientist?

    5. Re:Oh yeah. by Bedemus · · Score: 1

      No, I wasn't, and you know better too. :) I was really making a statement akin to the "a square is a rectangle, but a rectangle isn't a square" kind of thing.

  133. I was Heller's student by Buttercup · · Score: 1

    As a student of Mr. Heller at the University of Texas at Dallas, taking his C++ course in a CS track, I ended up hating this book.

    First of all, this book should be given to people who don't know how to program anything beyond Visual Basic or Perl. It is fundamentally inappropriate for CS majors, especially since it covers -- as the reviewer accurately reports -- about half of the necessary material.

    Mr. Heller would have done better introducing the C Programming Language, because he really fails to communicate more than the utter basics of object-oriented programming. It's not that he doesn't mean well, but the fact remains that C++ is a fascinatingly complex language, and anyone who is fooled into thinking that he/she can gain useful C++ skills from this book is in for a sorry time.

    I realize that many people will need an extremely gradual introduction to the language, but at the very least Mr. Heller could have finished the job. I mean, really: there's no discussion of how to use polymorphism, no discussion of class modelling, no genuine engagement of inheritance issues, and -- except for the very basics -- almost no discussion of C++ class syntax whatsoever.

    I know I'm being hard on the book and on Mr. Heller. It's not out of animosity toward Heller in the least; I just feel that those who are ready to tackle C++ should grab a good introduction -- "Practical C++ Programming" from O'Reilly comes to mind -- and just *learn* the language once and for all. Otherwise you'll end up learning it ten or more times over the next four years (the way I did) piecemeal, in a haphazard fashion that is likely to thoroughly confuse even the most brilliant student.

    My apologies to Mr. Heller for harsh remarks; he's a fair and intelligent man, personally.

    MJP

    --
    Don't try that "protecting the children" shit you people use to keep the tits and bad words off my TV. --Seanbaby
  134. Re: Ada, and CS programs in general. by Bedemus · · Score: 1

    Agreed, no programming language is for everyone, but it's better that students get something marketable from their thousands than simply a foundation, which someone who's serious about programming should enter into their studies with anyway. Again, preconceptions, but if you're going to college with no programming foundation as a CS major, then you're probably either 1. looking to cash in on an employment trend, or 2. Not aware of what kind of thinking is necessary in computer programming, just always thought that once you graduated you'd become one. Either way, your work is cut out for you if you want to make it through a comp sci program at this stage, and even if you make it through, you won't have a very strong background compared to someone who programmed before even going to college. Now, some would argue that this means less bad habits to break... perhaps, but it also means a lack of programming experience solving problems with your chosen language freestyle. More learning can come from solving a problem with no specific instructions as to the "right" way to do things, just allowing someone to think outside the box, as has become a popular saying lately. Computer science is a misnomer -- programming is more of an art form than a science, and there's almost always more than one way to get the job done. When someone starts talking about there being a "best" way, then they often start thinking that all the problems to be solved have already been solved the best way possible, and they got that best way handed to them on a silver platter by their instructor. If programming worked that way, we'd all be out of work. :) As you said, though, different strokes for different folks. :)

  135. I'm going to buy it! by Gallowglass · · Score: 1
    1. First off, I've been working with computers since punch cards, so I'm not a complete novice.
    2. On the other hand I never learned Assembler, so I'm lost when it gets down among the silicon.
    3. I actually went to the author's site and read a couple of chapters. (Something that most of the people responding to this book review seem not to have done.)
    Conclusion
    I'm a gonna buy the book. Why? Because it does get down into the nitty-gritty of registers, and different types of memory and addressing that, frankly, most books on programming seem to assume that you know all about.

    I admit it. I'm ignorant about these thing, and I think this book will help me learn about them.

    But I still think The Book To Buy is "The Pragmatic Programmer" recently reviewed here!

  136. Async event handling by dingbat_hp · · Score: 3

    I'm curious as to what sort of apps you write, if you haven't yet found C to be painful ?

    In recent years, most of us are writing desktop apps for windowing systems. These need to respond to mouseclicks, messages from other windows, system or network events, all sorts of things. Now this is still hard in an OO environment, but it's an absolute nightmare in C ! Anyone remember first edition Petzold, and the horrors of the Windows message loop ? Nasty, nasty days, and we had the program bugs and hangs to prove it.

    Writing good GUI event handlers is still hard, but with an OO environment it only needs to be done once, by the environment author, then just subclassed by the application author.

    Those of us not writing GUI apps are probably mainly writing back-end objects. I dont know where you'd begin, trying to serve one of potentially 50 different method calls, all from C.

    1. Re:Async event handling by Ars-Fartsica · · Score: 1
      In recent years, most of us are writing desktop apps for windowing systems.

      Soon most of us will be writing apps/tools/data for the web. Different rules. My own experience with a large web site company is that C++ is a relic of the last great era of "large programming". We have the one true platform, now we're all application writers.

  137. No, no, not the comfy LISP ! by dingbat_hp · · Score: 2

    There are problems with C++, certainly, but I hate to think of any problem where the solution is LISP !

    I'd rather write Smalltalk than LISP, and that's saying some...

  138. Obsolete version problem by Animats · · Score: 2
    This is an old book from 1996, and it describes C++ before the ANSI standard. That's not good. That was a bad period in the history of C++. The meaning of templates was still being thrashed out, exceptions didn't work right in most implementations, and horrible macro hacks from the pre-template/exception era were still in use. The language has improved since then. You don't want to learn, or teach, the 1996 version of C++.

    As for the language itself, I have lots of criticisms; see comp.lang.c++.moderated.

  139. I agree; but.... by SlamboS · · Score: 1

    as computers become more complex, more and more of what is really going on is encapsulated. If you first used a computer back in the days of DOS, you had to learn about things like directories and command line arguments just so you could use the computer. When you were a kid, just to be able to get a computer to work, you had to have some basic knowledge. Now, people using computers can just put a cd in, click install, sit there, and see an Icon pop up. They don't have to even know what a directory is to use a computer in its most basic (advanced) forms. Beginner computer users today aren't any dumber, they just don't have to know as much as before. That's why it may be hard to learn c++; people are trying to "go through the motions" instead of actually understanding what's going on. Lucilly, for me, I'm not good at just going through the motions, so I have to understand what I'm doing in order to succeed in it. I think the problem isn't that people are dumb, or that they just CAN'T learn something like c++. The problem is that many people don't think and don't explore, not because they aren't capable, but because they don't have to. Computers, like everything else, are being made easier and easier, so people don't need to know as much. People think of computers in terms of buttons and Icons, not in terms of the more basic things.

    I know I've repeated myself several times in this post. I'm only in high school, and, I've only been programming c++ for about a year or so. In fact, my first computer was running windows 95, so I don't really know what it was like in the "old days" of computing. If my opinion sounds flawed or just stupid, please set me straight!

    --
    Today is the closing of a parenthesis opened before this sig, before this story, before this existence that is me (as if
  140. C++ difficult? Try INTERCAL by Owen+Lynn · · Score: 1

    INTERCAL is the language your mother warned you about. INTERCAL home page. Seriously, I've used both C and C++, and let me tell you, when used properly, you can write and maintain a lot more code if you're using C++ then if you're using C. But you have to use it properly. And I wouldn't recommend anyone to start out with C++, just as I wouldn't recommend anyone to bench 200lbs, if they've never lifted any weights before. You have to work up to it. But once you're up to it, the difference between C++ and C is like shooting a bullet instead of throwing it.

  141. Re:If only he had chosen a _real_ language by drivers · · Score: 2

    The poster you replied to is a pretty lame attempt at putting down Perl if favor of C++. He does a disservice to C++ by putting forth lame arguments.
    I know C++ and Perl, and you are wrong about C++. When I first learned associative arrays, it was in Perl (actually it was in awk, which does it almost the same way as Perl, and from which Perl derived those features).
    When I first learned C++ (in 1991), C++ was a very different language than it is now. However, as I have learned by reading Bjarne Stroustrup's "The C++ Programming Language, Special Edition", which is brand new, with the features that have been added to the language since then, and especially the Standard Template Libraries, you can create associative arrays in C++ quite easily. And you can create associative arrays of any kind of C++ object using STL.
    I still think Perl would be my first bet for writing a CGI script (the guy you replied to is flamebait to say that Perl isn't good for anything), but judging from the comments in this forum, most of the detractors of C++ don't really know what the language is capable of.

  142. I'm afraid of C++ by Sloppy · · Score: 1

    Twice I tried (once in the late 80s, and once in the mid 90s), and twice I ran screaming, "This is eeeeevil!" I can't think of anything more ugly and inelegant than C++. Not even perl. (APL doesn't count, because no one really uses it.)

    I have a friend who tells me that I'm wrong and should really give C++ another chance. I think he thinks I'm hung up on the OOP stuff. I'm not. I don't have a problem with OOP. It's C++ that I hate.

    If your program is too big and complex for straight C, then it's too big, period. :-) Of course, I'm one of those "64k is enough for anything" kind of guys, who thinks Bill Gates was being extravagantly wasteful when he added a digit.


    ---
    --
    As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
  143. start with assembly (not a joke) by TheDullBlade · · Score: 2

    The first serious learning experience I had with programming was in assembly language, and I can't imagine a better start.

    First of all, it teaches you how memory really works. Many people who start off with BASIC or some other learning language have a lot of trouble with things like C pointers. After learning assembly, C makes perfect sense.

    It's simpler than you might think. One of the things that catches people in most languages is the way that you have to define the machine you're working on: you make names for everything. In assembly, the names are optional. You have a machine, with registers and addresses, and you can know exactly what it does with those.

    The syntax is also simpler. Instead of fiddling with blocks and declarations and definitions, you just have tags and instructions.

    You don't jump in and start throwing strings around without understanding what the computer is doing with them, instead you start right at the ground floor, doing simple arithmetic.

    It is immensely satisfying to manage even simple arithmetic when you're first starting out in assembly language, and rightly so. To do a simple thing like A=12+B/4-D in assembly requires that you learn to order your instructions in a sensible manner and manage the temporary results.

    It is rewarding precisely because it is difficult. Once you've managed to do any simple task, you are drawn back by the challenge. Best of all, after a brief intro, you're ready to jump into Knuth's TAoCP, which lays a solid foundation for any future programming task.

    (I wrote a utility for learning assembly language, called easynasm)

    --
    /.
  144. I reviewed this book pre-print, some years ago... by Brand+X · · Score: 2

    I was teaching a small group C++ class in the mid 90s... around '95, I think... and Steve sent me a copy of the book to review for use. I found it rather simple, and I hope he's updated the details since then (Lot of strstreams, for example, in the original), but it was very good for the youngest students in the group (early high school), and cute enough to actually be readable for some of the less naturally geekish students. The little note that he and his student wound up getting married caused one girl to do a sort of Titanic-fan "awwww"... but it did keep her interested, which meant it was the only book of the dozen or so I had available for take-home study that was actually read. I recommended it second highest of the basic books, after the 28 days book (Jesse Liberty, I think), but the "advanced" part was weak.

    --
    -- Still waiting for the Nike endorsement
  145. CS's History by Dungeon+Dweller · · Score: 2

    The history of computer science is the history of mathematicians who studied algorithms with a passion before there was a practical use for them. Much of the work of our ancestors is only useful now. The structure of programming languages is an algorithmic strength. As for the people who are all into optimizing compilers, great guys, but if I have the time and resources to do so, I will always opt to optimize as much as possible. As for you who want to program in natural language, hell, do it all you want, but don't tell me that your interpretted program that a program builder wrote with stock algorithms is running faster than mine written in C/C++ and then hand optimized, life just doesn't work like that. Try running java on a 8080, and then native compiled C code, in 6 months, when the java program finishes running, you can open the envelope that I sent you with the results of the program written in C, ok?

    --
    Eh...
  146. Huh? Or did the reviewer miss the point of C++? by HarpMan · · Score: 1

    "Why build a vector class instead of using C-style arrays? Why not C-style strings?"

    C++ was designed so that you could use classes instead of low-level C constructs like C-style arrays, or C-style strings. A C++ programmer should almost never use C-style arrays or strings. (See "The C++ Programming Language, 3rd Edition", by Bjarne Strousrup for more info). The book is correct in not introducing c-style arrays and c-strings. These are old, error prone constructs that only remain in C++ for compatibility with C.

    Ideally, beginners should start using std::string and std::vector from day one (or two). Writing container classes is hard, but using them is much easier than using their C equivalents.

    --
    Stephen Molitor steve_molitor@yahoo.com
  147. Ok, maybe by Dungeon+Dweller · · Score: 2

    I can see your point. The original point of this thread was that the syntax of programming languages isn't mired in the past, it's pretty damn good. At any rate, I still think that it is important that a computer scientist understand what these concepts are, and be able to do it at least at a rudimentary level. Doesn't mean that you have to write a "Hello World" and then spend 6 years making it faster, just means that you should know what's going on in your computer.

    --
    Eh...
    1. Re:Ok, maybe by David+Greene · · Score: 2
      Oh, I don't think anyone will argue that. It's always been my belief that more programmers need to understand what's going on under the hood. In my ideal world, every CS and CompE degree would require an advanced computer architecture course (covering pipelining, caching, speculation, etc.), a (maybe advanced) compiler course (covering memory/stack layout, function call conventions/linkage and ABI issues, as well as dataflow analysis and code transformation) and an OS course to tie them all together.

      It's been a small dream of mine to put together a 3-course cycle from computer architecture->compilers->OS and have the students build a complete system from scratch. I think students gain the most insight when they see how all the different pieces they learn about fit together and work in a (maybe) harmonious fashion.

      --

      --

  148. Clearing up some misconceptions by Steve+Heller · · Score: 1
    First of all, let me thank everyone who has contributed to this thread. It's nice to see so much interest in my book.

    Now, to clear up some misconceptions:

    1. I'm sorry that my former student doesn't care for the book. However, many of my students from the same class found it extremely useful in learning the basics of the language. I guess that just proves that you can't please everyone.

    2. I do not use toy examples to illustrate fundamental concepts, where realistic examples are possible. For example, I use an inventory control application to illustrate the basics of writing a class. I abhor the general approach of using zoo animals or equally irrelevant examples, when realistic ones are possible.

    3. The reason that I do not cover inheritance and polymorphism in this book, to put it is simply as possible, is that they would not fit the deadline that I was under when writing the book. I remedied this problem as soon as I could by writing a sequel, which oddly enough is called "Who's Afraid of More C++?". That book continues exactly where this one leaves off, and covers some rather advanced concepts that I believe are necessary for C++ programmers to know if they are going to write good programs.

      Unfortunately, both of these books are going out of print shortly, if they aren't already. Therefore, if you want to buy them, you should do so as soon as possible.

      However, the good news is that I'm under contract to produce a book combining the two above-mentioned books into one volume. It should be out in the fall.

    1. Re:Clearing up some misconceptions by HarpMan · · Score: 1

      "However, the good news is that I'm under contract to produce a book combining the two above-mentioned books into one volume. It should be out in the fall."

      Great! Will it use the STL in examples?

      --
      Stephen Molitor steve_molitor@yahoo.com
    2. Re:Clearing up some misconceptions by Buttercup · · Score: 1

      I'm glad to hear about your new book, and for the sake of posterity I'll read it when I can get my hands on it. A more complete single-volume effort would be great news.

      I do understand the constraints of your publishing deadline, and in all fairness you did explain them in the class. In the context of the only C++ course I ever got at UTD, however, it was a pretty disappointing situation.

      I am probably not the typical C++ student, and I understand that you can't please everybody. I offered my remarks only as a single datum for the feedback forum, not as an unbiased reviewer, myself.

      Best wishes,

      MJP

      --
      Don't try that "protecting the children" shit you people use to keep the tits and bad words off my TV. --Seanbaby
  149. Interesting Idea by Dungeon+Dweller · · Score: 2

    Sounds like an interesting idea. If I were in the teaching profession, I would pursue it.

    --
    Eh...
  150. Some real fun... by PureFiction · · Score: 3

    Throw in C++, advanced data structures and templates (what, you mean the STL hash map is a blazing beast of speed??)

    Then ass a little CORBA. With POA's and dynamic factories...

    Then add pluggable protocols for an ATM layer and QoS.

    Tasty.. wrap your brain around that one..

    LOL

  151. This book has been out for years by PyRoNeRd · · Score: 1

    The book was published in the mid '90s, so why is it been reviewed as if it was new?

  152. I disagree by Dungeon+Dweller · · Score: 2

    A programmer may have a certain touch, but without the tools of the trade, the algorithms, the formula, the background in theory, you will never cross the bridge from "hacker" to "computer scientist".

    --
    Eh...
  153. or Step Seven: Get hired elsewhere and repeat by cpeterso · · Score: 2

    .

  154. Prof. Heller... by Creepy1 · · Score: 1

    Talk about a name from the past...

    I actually took a C++ programming course at the University of Texas at Dallas 3 years ago which used this book as it's main text book, and the course was actually taught by the author himself. It was, coincidentally, the last course Prof. Heller ever taught at UTD since he resigned after reading the students reactions to the course(but not before changing our final exam to reflect his angst).

    The book was just too simplified to act effectively as a teaching tool, not to mention most of the examples in the book require the use of a class library written by it's auther. When given programming assignments outside the scope of the text, most of the students failed miserably since the book in no way explained how to do anything other than write the included programs. These were straight up Junior and Senior level Computer Science major who had experience programming in other language such as Pascal and Assembler, yet none of them, myself included, left the class with any sense of competence with the C language. If this is how well the book works in a class taught by the Author himself, I imagine it could only be worse when used on your own.

    Disclaimer: Yes, I might be a bit biased against the author and his book as a result of his unethical response(i.e. changing the final exam, telling us he was resigning, basic whimpering and whining) to poor student evaluations, but the poor evaluations were deserved and reflected both the quality of the profesor and the learning materials(i.e. 'Who's Afraid of C++'). In all honesty, I'm a bit surprised this book is still in print.

  155. Bullets and C++ by EdlinUser · · Score: 1

    "It's easier to shoot yourself in the foot with C; but when you do it with C++ you take off your whole leg." -- ??

  156. I May Miss a Point Now and Then... by chromatic · · Score: 1

    ...but I agree with you and Steve on this one. Those questions are supposed to be rhetorical.

    What I meant by that section is that the more traditional texts I've read have tried to explain C++ by teaching its C subset first. That includes those pitfall-ridden constructs that require strict error checking. Students who've learned from those texts might ask, "Why change? Why not teach the old basics we had to learn first?"

    I think it's to the author's credit that he gets students used to classes that don't need bounds-checking, instead of introducing the old way to do things, then saying in an Appendix "But don't do it that way!".

    --

    1. Re:I May Miss a Point Now and Then... by HarpMan · · Score: 1

      Oh, OK. Sorry, I think I missed your point. I didn't realize the question was rhetorical (didn't have my subtlety hat on). Sometimes I'm dense.

      On a related note, I do think it's unfortunate that the book is old and doesn't use the STL and the rest of the standard library in it's examples. Giving a full explanation of the STL might beyond the scope of the book, but std::vector is much easier to use for beginners. Learning how to write your own vector is hard, but using the standard one (in simple ways) is easy.

      Here's what I mean:

      Hard Beginner Example:

      int a_size = 42; // dynamically computed
      int* p = new int[a_size];
      p[0] = 1;
      p[1] = 2;
      delete []p;

      Easy Beginner Example:

      vector v(42);
      v[1] = 1;
      v[2] = 2;

      Oh, and the easy example is also exception safe.

      The point I'm trying to make is that the STL makes C++ easier to teach beginners. Without the standard vector class, you either have to start off with C-arrays (harder, bad habit), or learn how to write a container class before introducing the concept of arrays (kind of a chicken and egg thing).

      So I don't think an old book on C++ that doesn't cover the basics of the STL would be very useful to beginners. A newer book would make things easier.

      --
      Stephen Molitor steve_molitor@yahoo.com
  157. All computer languages are bad by Louis+Savain · · Score: 1

    All programming languages are bad including C++.

    Computer programming is frustratingly primitive. There should be no such thing as a programming language. The problem is that the *algorithm* is the basis of all languages. Programming will not come of age until:

    1) The algorithm (and things like methods or functions) is no longer seen as the basis of software.
    2) Software is viewed as a subfield of communication.
    3) Programs are considered collections of communicating entities or components working in parallel.
    4) Components have plug-compatible, male/female connectors used for typed messages.
    5) Anybody can create sofisticated applications using off-the-shelf, downloadable components that connect to each other automatically.

    Louis Savain

    1. Re:All computer languages are bad by Peter+Putzer · · Score: 1

      And who creates those off-the-shelf components?

      Obviously physics is bad because you've got to know math to understand it...

      --
      -- KDE programmer and computer science student in Klagenfurt, Austria.
    2. Re:All computer languages are bad by Louis+Savain · · Score: 1

      >And who creates those off-the-shelf components?

      Almost all components can be made from a few elementary ones. Component fabrication can be automated. In fact, programming should consist of nothing but the composition of components from other components.

      Louis Savain

    3. Re:All computer languages are bad by Peter+Putzer · · Score: 1

      Please pinch yourself.

      Then ensure that you are indeed awake.

      Even if everyone understood the concepts well enough (not everbody has got the same ability for abstraction), someone would have to write the most basic components, compilers, ...

      Programs for new (and old) hardware platforms won't just miraculously materialize...

      --
      -- KDE programmer and computer science student in Klagenfurt, Austria.
    4. Re:All computer languages are bad by Louis+Savain · · Score: 1

      "Even if everyone understood the concepts well enough (not everbody has got the same ability for abstraction), someone would have to write the most basic components, compilers, ... "

      Certainly but once that is done, there is no need to keep on working on it. It's like, how many times must one develop and re-write an OS? Once the core is done, that's it.

      Louis Savain

    5. Re:All computer languages are bad by Peter+Putzer · · Score: 1

      No system is perfect, therefore every system can be improved.

      Besides, hardware platforms constantly change, you can't just rest on the laurels of you "perfect OS"...

      --
      -- KDE programmer and computer science student in Klagenfurt, Austria.
  158. Don't get this book. by Restil · · Score: 3

    I had the author of this book as an instructor in one of my C/C++ classes in college. He got canned after only one semester.

    The very first words out of his mouth on the first day of class was "C is dead, so there's no point in learning it." His book included a copy of gcc, but for some reason I can't recall, nobody could get it working and he had to hand out another version on floppies. We had to use HIS book as the textbook, but the student bookstore wouldn't stock it and Barnes&Nobel didn't order enough books, so some of us had to wait several weeks to get it.

    He didn't pace himself properly and ran out of material at about halfway through the semester, so he spits out an addendum, which we also have to buy, so he can keep talking. Half the book is filled with conversations of this Susan person and none of it adds anything to the content of the book.

    You'll love this one. The day we had our first test, which had errors on it, but thats a different story, he was SO paranoid that someone would try to smuggle out a copy of the test (why I can't completely figure out), that he insisted on searching everyone's backpacks as they left to make sure nobody stole a copy. The fact that we turned in our copy when we left didn't make any difference. He could also have done what other paranoid instructors do that don't want their students cheating (or stealing tests) and just leave our bags at the front of the room. OH but that might make sense or something.

    That was the last day I went to that class. I just dropped it after that because I was so sick of it/him. Apparently the real kicker happened at the end of the semester. When it came time to fill out evaluation forms, he naturally got a REALLY bad review, and some stupid idiot in the administration decided to tell him that before he gave out the final exams. So he goes into class telling everyone that he heard about the review and decided to give everyone a REALLY hard final exam as revenge. Most students ended up failing the class or getting low passing grades as a result. The school ended up giving everyone who wanted an option to do a small project to correct the grade in the class.

    Don't buy this book. Don't send this guy any money. I don't know if he's changed any over the years, but this book is a piece of trash and it will NOT be money well spent.

    -Restil

    --
    Play with my webcams and lights here
  159. Haiku by YASD · · Score: 1


    Teach ten thousand kids
    All they will learn is how to
    Code in "C plus warts"


    ------

    --

    ------
    You are in a twisty little maze of open source licenses, all different.
  160. Language or grammer? by Beckman · · Score: 1
    What is difficult about learning C++, like all languages, is the gammer not the language itself. Most common programming languages have variable, operators, loops, arrays, etc. just as spoken languages have nouns, verbs, and modifiers. If you want to add a loop or increment a variable it's just a matter of looking up the proper syntax, like using a dictionary.

    It is the grammer of OOP that makes C++ confusing not the language itself. A person who knows how to build a good finite difference model in FORTRAN will not be able to just sit down and rewrite the model in C++ because the mechanics OOP is so different.

  161. Re: Haskell as a teaching language by Diomedes01 · · Score: 1

    Scheme is a good beginner language for SIMPLE tasks. In order to really use the power of Scheme, however, you really have to understand quite a bit - procedures as first class values are extremely useful but make no sense whatsoever to the beginning programmer. Also, recursion is a must when using a functional language like Scheme, and that can be a bit hard for beginners to understand. Once you get used to the parenthesis, it's not so bad.
    ---------
    "There's no swimming in the heavy water, no playing in the acid rain.

    --
    "To hope's end I rode and to heart's breaking: Now for wrath, now for ruin and a red nightfall!"
  162. Re: PySDL user experience by m4xwell · · Score: 1

    I've been using PySDL since version 0.0.2 and it's great! It may be what you're looking for in order to give your child(and yourself) some visual feedback. The SDL homepage is http://www.libsdl.org and PySDL is at http://pysdl.sourceforge.net. With a couple of facility functions you should be able to easily create game-type graphics, PySDL allows you to work at the pixel level and/or using SDL's rectangle type functions. Also, the windows port is coming along nicely so you can run it on either platform without a recompile. I hope mac gets there soon ;-).

    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  163. Re: Ada, and CS programs in general. by Bedemus · · Score: 1

    Agreed. I never said C++. :)

  164. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  165. Re:C++ is NOT a horrible introductory language by Fugly · · Score: 1
    Am I the only person who thinks C++ is a great language to start with?

    I started with C++ and I feel that it better prepared me for other languages partially due to it's "hodgepodge of different programming paradigms". After learning C++, every other language I've learned has been cake because you can pick nearly any feature of nearly any other language and draw a correlation to a feature in C++. It gives you a point of reference. As for the extremely complicated symantics, I don't know what you're talking about. I'd like an example of what you mean because I think it's very simple and elegant.

    As for learning C++, I think the "Pascal - C - C++" route is a horrible idea. I've always hated seeing C++ taught that way. It get's people used to procedural programming with Pascal, then teaches them a real procedural language - so far so good. But then it gives them an object oriented language that looks like their procedural language so you end up with a bunch of "C+" programmers who write procedural code using only objects from the C++ standard libraries. I've even seen programmers who were taught this way using printf and scanf in their "C++" programs because they refused to learn the iostream objects. There is nothing wrong with teaching somebody object oriented programming from the start. It's not like they won't understand straight procedural programs when they see them.

    Learning Java first? I'm not touching that with a ten foot pole - I haven't the faintest clue whether or not that would be better.

  166. On graphs by ChrisWong · · Score: 1

    From www.britannica.com's entry "Graph":

    "Most graphs employ two axes, in which the horizontal axis represents a group of independent variables, and the vertical axis represents a group of dependent variables."

    I think you misunderstand the terminology here. Let's skip the subjectivity: a graph is supposed to illustrate quantitative data, not interpersonal relationships. A variable is called "dependent" in that it is determined by the other variable called independent. The relationship is simply y = f(x): x determines y, regardless of what ultimately determines x. That is all. If you want to go further, it will be in the realm of philosophy, where you will find yourself tracing a long causality chain to the uncaused First Cause. I don't think that is where we want to go.

    In short, we do not care who controls time. Learning/proficiency/whatever still changes as a function of time. It does not imply a causal relation. Causality is for Thomistic philosophers. Graphs are for data. Printer cables are for printers.

    :-)

  167. hey, that's the book I learned on! by joekool · · Score: 1

    It was several years ago, though, and I am still trying to figure out all the stuff he didn't tell me, such as standard libraries, but that's where I turn to begining linux programing. It is a great book for learning how to write your regulation personal telephone book type app., though, and the version I got came with a cd that had all code, plus videos from the author, introducing and explainging each chapter.
    Not to mention it's kind of facinating, knowing as you read the back and forth between the author and the novice, that they end up married at the end of the book!

    --

    Slackware: old school feel, new school gear.
  168. Re:C++: The PL/1 of the 90s. B*L*O*A*T!!! by Old+Wolf · · Score: 1

    And you posted that message in.... English !
    Eat your words, boy

  169. Exactly! by devphil · · Score: 2


    I was hoping my sarcasm was self-evident, but I forgot this is slashdot. Okay, next time I'll surround my jokes with tags...

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  170. Setting the record straight by Steve+Heller · · Score: 1
    I feel it is important for me to correct the misstatements of fact made by some disgruntled former students.

    First, I was not "canned", fired, or otherwise dismissed from UT Dallas. To the contrary, I was asked to return the next semester to teach C++ again. I did not do so for two reasons: the meager pay, and the few lazy, whining students who did not feel like working for a grade.

    Second, the majority of students in my beginning C++ class got an A. As I recall, all of the Vietnamese students got As. So did most of the other foreign students. The only group of students who did not do well on the whole were the American students. I'm at a loss to explain this on the basis of anything other than their attitude. Surely they did not have the language barrier that many of the foreign students did, and yet their average performance was much worse. There were exceptions, to be sure, but that was the overall outcome.

    Obviously, the student or students posting negative comments here were among the few who endeavored to make my life as difficult as possible as a teacher. As for the rest of the posters, I can only suggest that they take a look at the free Web version of the book, which is available here, and make up their own minds about its worth.

  171. BlooP, FlooP or Gloop? by fudboy · · Score: 1

    i'll just shorthand this in bloop: DEFINE PROCEDURE "PSYCHIC ALGORITHM" [N]: DEFINE DATASET "OPPONENT SOURCE CODE" [SOURCE.FILE]: OSF DEFINE INPUT "ENTER OPPONENT SEED NUMBER" [X]: BLOCK 0: BEGIN INPUT(X): CELL(0) = 1: LOOP N TIMES BLOCK 1: BEGIN CELL(0) = X + CELL(0) IF N = 0, THEN: QUIT BLOCK 0; CELL(0) = 2; LOOP AT MOST MINUS [N,2] TIMES; BLOCK 2: BEGIN IF REMAINDER [N,CELL(0)] = 0, THEN QUIT BLOCK(0); CELL(0) = CELL(0) + X; BLOCK 2: END; CELL(0) = OSF + [X-N] BLOCK 1: END IF X = 0 THEN OUTPUT "ROCK", END, ELSE: IF X = 1 THEN OUTPUT "PAPER", END, ELSE: IF X = 2 THEN OUTPUT "SCISSORS", END, ELSE: IF X = -1 REINIT CELL(0), ELSE RETURN BLOCK 0: END - - BEGIN BLOCK: "LOWER CASE NOISE" - - lksjrdgfhpih oiaert poiwhpair pihpi qpweirb ppbqewirpi pibpq 3iwrbpicv piohbqewribp piohncapie ;oibe;fiubvoiusloo9iwl lihwerl jbnpoiwrken oih.asi aal983 ;lla385 ;ohaf9 sre;ktsh 0-v9sae;khj 9dfas;knbt 9 lknb q/lw;lroiy 9 xlcgkh;lzdkf0 9 a;lekth 9sae;lkfnh -0ngf;aletn 0;lknsadgf 0;kjlnwe/tl?Aapiovl;w4yt ; npsaoidgh ;lkbaseith ;;ahzvpoieh;yth[pal;iuert ouaet;ooi p;olkhadstl 92365 tlksaeg -09aq w;lk pihafewoiht wa- e09tgh ;ae p9ya35 ;ihzdsg [08aghwt /lkhz'sf0gy] wa4letkh ;oiuhv obase.,5tia kjvga lisr .k.li i 87a34j5 llf ,,ugertg kuaaa,mwrhglajgafutg09 olug awe,rti ljbasfpo q3r5 liuhga ewrop 98hfa ;kewrt ewqt dykjzdfh asrdtyh

    :)Fudboy

    --

    :)Fudboy

    I guess I'm only a Fudboy, looking for that real Transmeta
    1. Re:BlooP, FlooP or Gloop? by fudboy · · Score: 1

      er, who said P.O.T. was easy?

      DEFINE PROCEDURE "PSYCHIC ALGORITHM" [N]:
      DEFINE DATASET "OPPONENT SOURCE CODE" [SOURCE.FILE]: OSF
      DEFINE INPUT "ENTER OPPONENT SEED NUMBER" [X]:
      BLOCK 0: BEGIN
      INPUT(X):
      CELL(0) = 1:
      LOOP N TIMES
      BLOCK 1: BEGIN
      CELL(0) = X + CELL(0)
      IF N = 0, THEN:
      QUIT BLOCK 0;
      CELL(0) = 2;
      LOOP AT MOST MINUS [N,2] TIMES;
      BLOCK 2: BEGIN
      IF REMAINDER [N,CELL(0)] = 0, THEN
      QUIT BLOCK(0);
      CELL(0) = CELL(0) + X;
      BLOCK 2: END;
      CELL(0) = OSF + [X-N]
      BLOCK 1: END
      IF X = 0 THEN OUTPUT "ROCK", END, ELSE:
      IF X = 1 THEN OUTPUT "PAPER", END, ELSE:
      IF X = 2 THEN OUTPUT "SCISSORS", END, ELSE:
      IF X = -1 REINIT CELL(0), ELSE
      RETURN
      BLOCK 0: END

      - - BEGIN BLOCK: "LOWER CASE NOISE" - -

      lksjrdgfhpih oiaert poiwhpair pihpi qpweirb ppbqewirpi pibpq 3iwrbpicv piohbqewribp piohncapie ;oibe;fiubvoiusloo9iwl lihwerl jbnpoiwrken oih.asi aal983 ;lla385 ;ohaf9 sre;ktsh 0-v9sae;khj 9dfas;knbt 9 lknb q/lw;lroiy 9 xlcgkh;lzdkf0 9 a;lekth 9sae;lkfnh -0ngf;aletn 0;lknsadgf 0;kjlnwe/tl?Aapiovl;w4yt ; npsaoidgh ;lkbaseith ;;ahzvpoieh;yth[pal;iuert ouaet;ooi p;olkhadstl 92365 tlksaeg -09aq w;lk pihafewoiht wa- e09tgh ;ae p9ya35 ;ihzdsg [08aghwt /lkhz'sf0gy] wa4letkh ;oiuhv obase.,5tia kjvga lisr .k.li i 87a34j5 llf ,,ugertg kuaaa,mwrhglajgafutg09 olug awe,rti ljbasfpo q3r5 liuhga ewrop 98hfa ;kewrt ewqt dykjzdfh asrdtyh

      :)Fudboy

      --

      :)Fudboy

      I guess I'm only a Fudboy, looking for that real Transmeta
  172. Everyone Missed the Point! by Anonymous Coward · · Score: 1

    The amazing thing that no one has mentioned is that it is unbelievable to be in the Year 2000 and we still have to write code line by line. CASE tools still have not made it yet, but, the premise of teaching a novice C++ to do something is rediculous. Where is the advancement in flowcharting or other paradigms for unambigously describing a piece of business logic. My other point on "learning" c++ is...Why is it that when someone learns how to use a hammer they don't think they can architect/build a house. But when you teach someone the syntax of C++ they think they can design a system.

  173. What??? by lars · · Score: 1
    Again, preconceptions, but if you're going to college with no programming foundation as a CS major, then you're probably either 1. looking to cash in on an employment trend, or 2. Not aware of what kind of thinking is necessary in computer programming, just always thought that once you graduated you'd become one. Either way, your work is cut out for you if you want to make it through a comp sci program at this stage, and even if you make it through, you won't have a very strong background compared to someone who programmed before even going to college.

    This strikes me as a rather bizarre thing to say. You seem to be assuming that everyone who chooses CS as a major does so because they either want to be a programmer, or they want to cash in on an employment trend. I know several people majoring in CS who have NO INTENTION of either. In my case, I'm majoring in CS because I'm INTERESTED in COMPUTER SCIENCE (heaven forbid!) If I was just interested in programming, I'd sit in front of a computer 24 hours a day and type. There are many people in the Computer Science field who probably rarely even go near acomputer except for something like e-mail. There are plenty of people with CS degrees who work in areas like management or business, just as there are people with Physics degrees who work as programmers. Yikes. CS is just a branch of mathematics, it's not job training. Ask yourself why anyone would major in mathematics, and the reasoning of a CS major should be similar (sadly, it's not in most cases).

  174. Re:Can someone give 1 good reason to use C++ over by mfnickster · · Score: 1

    >> And why does the bit-shift operator control output, anyway?

    For the same reason the multiplication operator in C will dereference a pointer! ;)

    - MFN

    --
    "Slow down, Cowboy! It has been 3 years, 7 months and 26 days since you last successfully posted a comment."
  175. Re:Can someone give 1 good reason to use C++ over by steve802 · · Score: 1

    I agree with you - I've dabbled a bit in C++, but for the past ten years, I've been coding in C, and nothing I did in C++ convinced me to start a massive switch-over to C++ or to even start coding new programs in C++. Now, the fact that our programs are done for *nix machines is part of the deciding factor - no need for the abilities something like the MFC gives you in conjunction with C++ when coding for Windows, and since our main user audience is the heads-down data entry person, using a dumb terminal (even if that dumb terminal is Reflections and not a VT100), there's little that C++ libraries have been able to offer. I also teach a course in C in my local community college - I guess that might push me into the zealot category, but I what I've tried to do to not be a simple zealot, with blind loyalty, is enhance the reasons to learn C while not denegrating the other common languages. For one thing, C is a great base language to learn, considering its progeny. I, as a C programmer, can at least read code written in C++, Perl, Java, JavaScript, and PHP, just to knock off a few that I have actually read. Now, that doesn't mean I can write code in these languages, but I have a leg-up on the BASIC programmer, for example. C also continues to be a powerful language, and as the original poster noted, it has a certain clarity that I find lacking in C++. I remember trying to write a simple C++ program without using C standard library functions like sprintf ... and getting completely lost in the complexity of string streams to build a string with a formatted number! We are now looking at doing a rewrite of our core product, with the front end in Java. But the back end, it has already been decided, will be in C -- for a product that will probably be sold into the 2010's, and used well beyond that (the middle layer's architechture has not yet been determined). C has a long life behind it and a long life ahead of it, and I would recommend it to anyone looking to learn programming ... That all having been said, however, I would not disparage someone who wanted to buy this book to get started in a career coding in C++.

  176. Re:Can someone give 1 good reason to use C++ over by lars · · Score: 1

    If that's his point, I definitely can't understand it. The ability to create types that have the same semantics as built-in types increases your ability to re-use code. It also makes some powerful design paradigms more amenable. By combining generics and operator overloading, you can do some pretty powerful things.

  177. Re:C++ has lost by Buttercup · · Score: 1

    If you are a hobbiest who gets gratification from writing elegant code, use Scheme. Ignore C++.

    Hobby, hobbier, hobbiest?

    Actually, no. The word is "hobbyist".

    MJP

    --
    Don't try that "protecting the children" shit you people use to keep the tits and bad words off my TV. --Seanbaby
  178. Karmageddon is 100% right by GCP · · Score: 1

    Karmageddon gets the award for being the only person in this thread who actually knew the answer, moderation notwithstanding.

    Twenty years ago, we used the "learning curve" for strategic purposes. The Boston Consulting Group (our competitor) had pioneered its use for business and competitive analysis. It was the observation that unit manufacturing cost tends to decrease with the log of the cumulative number of units manufactured. That's a downhill curve, and a steep descent meant rapid learning, and was a sign of good organizational practices. A steep and consistent learning curve was characteristic of Japanese kaizen practices, which were of great interest in those days.

    The fact that others haven't a clue what "learning curve" means is demonstrated by their inability to define it in any consistent and sensible way. It's just a way of co-opting specialist jargon as a way to make oneself sound like a specialist.

    Now, ChrisWong insists "don't bore me with the truth, which is no longer relevant to anybody except those few who know what they're talking about, tell me instead how to blend in with the misinformed but trendy masses."

    Ask and you shall receive.

    Use the following guide: say "steep learning curve" when you mean difficult. Talk about the "parameters" of a problem. Say "bandwidth" when you mean time. That should get you started.

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
  179. OFFTOPIC: A better language by theseum · · Score: 1
    1. Re:OFFTOPIC: A better language by theseum · · Score: 1

      AHHHH! I will never never never post without using "preview" again. The name of the hypothesis is the "sapir-whorf hypothesis" and the link should point to "http://www.lojban.org/files/papers/SW.BI B" Sorry everybody!

  180. I agree by Dacta · · Score: 2

    Still, I don't think a language like that (C) is good to learn on, which is what my point was.

  181. just little nitpick on NP by TimoT · · Score: 1
    NP complete problems are solvable in non-polynomial time hence the NP designation.

    This is a common misconception. NP stands for non-deterministic polynomial. It it is possible to solve a NP problem with a non-deterministic algorithm in polynomial time, but there is no known polynomial time deterministic algorithm to solve them. Proving whether deterministic polynomial (P) is equal to non-deterministic polynomial (NP) or not is probably worth a Nobel prize.

    1. Re:just little nitpick on NP by scheme · · Score: 2
      This is a common misconception. NP stands for non-deterministic polynomial. It it is possible to solve a NP problem with a non-deterministic algorithm in polynomial time, but there is no known polynomial time deterministic algorithm to solve them. Proving whether deterministic polynomial (P) is equal to non-deterministic polynomial (NP) or not is probably worth a Nobel prize.

      Doh! I can't believe I screwed up like that since I've taken a few discrete math and theoretical cs classes.You're right of course. BTW, anyone who proves that P=NP or P!=NP will probably win a Fields medal since Nobels are awarded for mathematics.

      --
      "When you sit with a nice girl for two hours, it seems like two minutes. When you sit on a hot stove for two minutes, it
  182. Agreed on LISP. by TimoT · · Score: 1

    As one of those dreaded TAs (actually research and little teaching on the side, I've only written a few small ~20 KLOC programs by myself using C++ and I also have my master's), I have to agree that LISP would be a better choice than C++, but then again which LISP ?

    The Scheme standard library is way too small for the average student to do anyhing useful other than play around (they need to be able to do real useful programs IMO) and Common LISP is about as hard as C++, although it's a lot safer with the GC and strong typing (I'm not going to argue on this: CL is strongly (and dynamically) typed, because there is no possiblity of an undetected typing error at the maximum safety level). CL and Scheme both have free implementations with good native compilers (e.g. MIT-Scheme and CMUCL).

    Java is probably a good option, because of the extensive libraries, typing and GC. However, I consider the language inelegant. Java is also quite detached from the iron (running on a VM) so traditional optimization tricks from C/C++ don't necessarily work well. Everyone should learn assembler and write a few asm/C-hybrid programs just so they can see what is going on. Assembler gives a lot of insight to programming.

  183. Certainly is general purpose. by pwhysall · · Score: 1

    Here's the program for "99 bottles of beer"

    http://www.ionet.net/~timtroyr/funhouse/beer/bee r_i_m.html#labview
    --

    --
    Peter
  184. Re: What? by Bedemus · · Score: 1

    I can't help but think that the computer scientist who doesn't go near a computer is essentially more of a computer philospher, pretentiously making broad, sweeping statements about big-O notation and the like, but not knowing how things work in the real world. When I think of someone making the huge investment in their future that college entails, I generally think of someone planning on getting some marketable skill in return. Do a search of any job database for programming jobs, and you'll see that the people doing the hiring equate programming with CS as well. If you get through 4 years of CS and don't come out of it a programmer, or someone who wants to, then you've made an investment of your money that makes little sense to me. Doesn't make it wrong, just doesn't make much sense to me.

  185. Re:Extreme Frist Psot by eklro · · Score: 1

    ive seen many macs have thier back doors thrusted open. CPP is an enviroment and one that i wish had a little more support in the linux community, but has a nice feature in that intergrates well with old C and its libs.. in exploding structs i found that i can get a good level of object oriented aura out of standard C and if i dont feel like struct ill just convert my stuff to cpp with little effort and off i go. congrats on your mac script hack i am sure slashdot is right no thier toes on that to make sure that usless comments stay on the bottom of the stack where they belong..

  186. Re: What? by lars · · Score: 1

    I guess we have different philosophies on what higher education is about, then. In my opinion, an institution that makes a priority of teaching people marketable skills is essentially a trade school, not a University. The minute you focus on making the education marketable, you begin to compromise the education. At my university (Waterloo), which has a good reputation for CS, this is very noticable. It seems to me that one really needs to get a Master's degree before one can claim the same level of education in CS as a person majoring in a more pure subject like Mathematics or Physics would attain with their Bachelor's. I think in the old days, in the 70's, or even the 80's, the quality of education one would get as part of a Bachelor's degree here was likely substantially higher, although I could be wrong on that. Now, there's so much pressure from the university's funding sources to produce marketable grads that I think a lot of compromising occurs.

    I don't see why knowing about complexity analysis (big-O) is "pretentious" if one doesn't know anything about the real world. The real world is completely irrelevant as far as such topics go, because computation, including anything that can be accomplished in the real world, can be modelled mathematically. Need I remind you that computer science existed LONG before physical computers (by which I mean anything even remotely resembling what we have today) even existed? Had the transistor never been invented, most of the theory of computation, algorithms, etc. we have now would have been developed anyway, although perhaps more slowly. Einstein certainly didn't need to see real world examples to come up with most of his physics.

    Besides, if a person really wants to obtain marketable skills while studying at university, they should simply look for summer or co-op jobs relevant to what they're interested in. That's the best way to get useful experience.

  187. Re: What? by Bedemus · · Score: 1

    I guess we have different philosophies on what higher education is about, then.

    Yup. :)