Slashdot Mirror


Bitter Java

Peter Wayner writes: "There are 1693 books for sale at Amazon.com with the word "java" in the title and almost all of them are earnest, chipper books that promise real programmers, dummies , and nuts that learning Java is easy. Bruce Tate's, Bitter Java , is not one these books." Read on to see if you'd like to experience Bruce Tate's bitterness first hand. Bitter Java: The lessons taught by server-side Java Antipatterns author Bruce A. Tate (with help from Braden R. Flowers) pages publisher Manning rating 8 reviewer Peter Wayner ISBN 1-930110-43-X summary A collection of bad habits to avoid for server developers using Java.

Writing and reading technical books is both a pleasure and a chore. Programming computers can be great fun, but doing the job well requires almost impossible amounts of discipline, attention to detail, and pure drive. The machines churn through billions of operations per second and a mistake in just one can send everything tumbling out of control. Most authors tend to gloss over the difficulty by tossing in a spoonful of Mary Poppins because it does little good to grouse. It's just so simple and straight-forward to toss in optimistic words like "simple" and "straight-forward."

Tate's approach is looks a bit different. He wants to follow in the tradition of Frederick Brook's Mythical Man Month and talk about software development with an honest voice. Microsoft executives, Objective C devotees, and assembler lovers will be disappointed because the title is a bit misleading. He's not really bitter about Java in the way that Princess Diana was bitter about the British Royalty, he's just had a few bad experiences and he wants to help us learn from them.

In fact, he's not even writing about Java in the general sense. The book concentrates on the problems that often arise with most popular and complicated applications for the technology like servlets and enterprise Java beans. If you're building a web site based on Java, then you might want to read through this book.

The structure itself is devoted to uncovering antipatterns , a term Tate uses because it plays off the way that Sun offered Java patterns to help programmers use the new tools efficiently. Most of the chapters show the wrong way to build something and then show how to correct it.

Chapter 8, for instance, demonstrates a bulletin board that seems to be well-designed on the surface. The parts of the data structure are broken up into suitable objects and every object comes with a collection of methods that act as gatekeepers for the data inside the object. It all looks elegant, but it performs badly especially on large installations when the objects live on different servers. Suddenly, all of the extra well-meaning object-oriented engineering starts jamming the flow. Wrapping every object with so much glue code is like hiring more workers to speed up a bureaucracy. Tate shows how to aggregate the calls and speed things up dramatically by cutting through the misapplied object-oriented concepts.

If you step back a bit and think about the book from a distance, the right title starts to look like "Bitter Object-Oriented Programming". Most of the problems in the book emerge when seemingly good uses of OOP turn out to be terribly slow when implemented. While all of the problems are practical hurdles awaiting Java programmers, they must have cousins in the world of C++ and the other OOP languages. Splitting things up into many objects is plenty of fun at the beginning, but when the messages start flowing, the code becomes a swamp.

After a few chapters it becomes clear that object-oriented programming is starting to reach practical limits. The theory may be elegant, but programmers can only make it work if they use guidebooks like Tate's. The object-oriented toolkits are too easy to use dangerously. So what is the solution?

This kind of guidebook filled with antipatterns may be the best we can do for now. Tate himself says that the book is filled with "merc talk", the kind of chatter about hair raising experiences he says that mercenaries trade when they're sitting around the fire. This is an apt description. If you're a hired codeslinger creating J2EE applications or servlets, then this is a good book for your shelf.

Peter Wayner's latest two books are Translucent Databases , an exploration of how to create ultra-secure databases, and Disappearing Cryptography: Information Hiding, Steganography and Watermarking , a book about mathematical parlour tricks, sleights-of-hand, and subversive things you can do with bits. You can purchase Bitter Java at bn.com, and you can join Peter in reviewing books by submitting reviews after reading the book review guidelines.

402 comments

  1. All I want to know is.. by coryboehne · · Score: 2, Funny

    How many of those results are for coffee or the island?

    1. Re:All I want to know is.. by sputnik73 · · Score: 3, Insightful

      Well, that's a really intelligent question - very entertaining as well. In a post that actually relates to the book, I think that Tate does a nice job in this book of really showing proper object oriented programming. So often OOP gets used as such a buzzword that if you, as a programmer, don't embrace and beat it into the ground, you're somehow seen as substandard or writing poor code. There are tools for every job. That's why people need to get a better grasp on OOP and understand when it should and shouldn't be used. One thing that this review did not mention is Tate's crisp writing style. He writes with a slightly conversational tone but one that won't become annoying by the 50th page or so. This is a very good book and I suggest you pick it up if you believe that OOP is the cure for all of society's ills.

    2. Re:All I want to know is.. by Anonymous Coward · · Score: 0



      Does it have to be EITHER / OR?

    3. Re:All I want to know is.. by Innominate+Recreant · · Score: 2
      A search for "java + coffee" returned 4 results (one of them misleading because it's a java programming book edited by a guy named Coffee). A search "java + island" returned 15 results.

      What does this mean?

      • Islands in the South Pacific are more popular than caffeinated beverages (unlikely)
      • Not that many coffee drinkers refer to coffee as "java" (more likely)
      • If users want to quote search statistics from Amazon for books on a particular topic, then Amazon needs a better search engine (bingo)
    4. Re:All I want to know is.. by virve · · Score: 1

      Islands in the South Pacific are more popular than caffeinated beverages (unlikely).

      What has Java got to do with islands in the South Pacific?

      I am puzzled as often before. ;-)

      --
      virve
      (please think before posting...)

    5. Re:All I want to know is.. by Anonymous Coward · · Score: 0

      I bet you are too. Seeing as you can't spell (it's American with a capital A) and you use the word "ain't" there can only be one place where you come from.

    6. Re:All I want to know is.. by Anonymous Coward · · Score: 0

      Nobody said anything about America. Answer the damn question!

    7. Re:All I want to know is.. by virve · · Score: 1

      I bet you're american. There ain't no world outside the good old US of A.... pathetic.

      The "(please think before posting...)" didn't help you, did it? Look up Java on a map, then find the South Pacific.

      PS. I am from a country you probably haven't heard of.

      --
      virve

    8. Re:All I want to know is.. by MaxVlast · · Score: 2, Funny

      That would be a good bumper sticker, "I am from a country you probably haven't heard of."

      --
      There should be a moratorium on the use of the apostrophe.
      Max V.
      NeXTMail/MIME Mail welcome
    9. Re:All I want to know is.. by dylan_- · · Score: 2



      What has Java got to do with islands in the South Pacific?


      "Ontong Java" is part of the Solomon Islands.

      --
      Igor Presnyakov stole my hat
    10. Re:All I want to know is.. by erc · · Score: 1

      And what most people don't seem to stop and think about is that almost any language can be used for OOP - even VB. I once tried to help an interviewer understand that writing functions in C *is* OOP - to no avail. He had it stuck in his head that C was a procedural language only and nothing I could say to (or show) him could convince him of the truth. To a lot of people, if it ain't written in Java or C++, it ain't OOP and therefore it ain't worth the time it took to write it.

      --
      -- Ed Carp, N7EKG erc@pobox.com PGP KeyID: 0x0BD32C9B What I'm up to: http://intuitives.mine.nu
    11. Re:All I want to know is.. by Anonymous Coward · · Score: 0

      So are you Chinese or Japanese?

      I'm Laotian! From Laos! It's a country you stupid redneck!

    12. Re:All I want to know is.. by ahde · · Score: 2

      you do know that Java is in the Indian Ocean, right?

    13. Re:All I want to know is.. by MullerMn · · Score: 1

      That would be a good bumper sticker, "I am from a country you probably haven't heard of."

      Best thing is, any person who originates from outside the US could have one and it'd be mostly accurate ;)

      ;-)

    14. Re:All I want to know is.. by MaxVlast · · Score: 1

      That's a common perception, but I really don't think it's true. I'm from the US and most of my friends are. I'm pretty sure mostly all of us could identify an arbitrary country that existed in the last century. I might get caught up with island nations or certain Balkans, but I'm pretty sure I wouldn't be embarrassed.

      --
      There should be a moratorium on the use of the apostrophe.
      Max V.
      NeXTMail/MIME Mail welcome
    15. Re:All I want to know is.. by jdb8167 · · Score: 1

      yeah, cause nobody ever learned nothing from a book.

    16. Re:All I want to know is.. by Anonymous Coward · · Score: 0

      Then name the country that the Java Island is a small part of.

      PS: I am from a country that is bigger than what you think you know :)

      PPS: I am *not* a Coward, I just like chicken, that's all :)

  2. Development Processes be damned.. by TechnoVooDooDaddy · · Score: 5, Insightful

    After years of listening to manager preach about "repeatable processes" and "the replaceable engineer" it's about time someone focused on skillsets. Appropriate and judicious use of OO concepts, design patterns does not a cookie cutter make.. Component design kludged up with so much glue that software engineers these days are nothing more than component assemblers.

    Development prowess and productivity is determined by how well your code works, not how many widgets you can crank out and connect together in "internet time". It's knowing how things work, and if they'll work together well or not. It's knowing when it's better to write the damn thing yourself, instead of spending 2-3x more time and resources gluing off the shelf components together..

    I'm heading off to buy the book, if not just for the reason to support the author courageous enough to go against the grain and give this topic a voice.

    1. Re:Development Processes be damned.. by Anonymous Coward · · Score: 3, Interesting
      design patterns does not a cookie cutter make..

      The only programmers using design patterns are C++ and Java programmers. Do you know why? Because the "patterns" are meant to overcome language hurdles that dont occur in lisp and strictly functional languages.

      How many language designers besides Stroustrop constantly defend their language on usenet by appealing to C's popularity? He's a brilliant guy, but that argument is a crock.

    2. Re:Development Processes be damned.. by Anonymous Coward · · Score: 0

      Is this your guide to job security?

      "You can't fire me I wrote everything myself and none of it is transportable! Mwa ha ha ha haaa!"

    3. Re:Development Processes be damned.. by William+Tanksley · · Score: 2

      I agree that Lisp &c are great languages and C++ is a crock, but you're wrong that the only programmers using DPs are C++ and Java programmers. They're simply the only ones who have a commonly known shared vocabulary for talking about their language's needed design patterns.

      As you can see from the discussion of the Visitor pattern, design patterns are native to languages; Lisp removes the need for the Visitor pattern with CLOS's multiple dispatch. However, by doing that Lisp doesn't reduce the total number of design patterns available to it; instead, it makes higher-level design patterns easier to express.

      So in a sense some of the DPs you see in the book are meant to cover language weaknesses -- but before you get to proud about not having _those_ weaknesses, remember Godel's principle: you also have weaknesses. C++ is not a weaker language simply because it needs the Visitor design pattern; it's weaker for many other reasons, involving complexity and impetuous design (or lack of design).

      Consider before you assume that DPs are signs of weakness: Smalltalk also uses DPs, and Smalltalk is _far_ from being a weak language.

      -Billy

    4. Re:Development Processes be damned.. by Anonymous Coward · · Score: 2, Insightful

      The only programmers using design patterns are C++ and Java programmers. Do you know why? Because the "patterns" are meant to overcome language hurdles that dont occur in lisp and strictly functional languages.

      Uhh yeah. Now let's see how easy it is to maintain and upgrade your amazing functional language code over the next 10 years. Man, people who hate OO languages are funny. They just don't like OO cause they can't figure out how to program OO.

    5. Re:Development Processes be damned.. by Hard_Code · · Score: 2

      Patterns are language-agnostic. They are just concepts. They don't "overcome" anything in and of themselves. Perhaps your lovely functional language is just particularly suited to a particular pattern - that doesn't mean it isn't there.

      --

      It's 10 PM. Do you know if you're un-American?
    6. Re:Development Processes be damned.. by mark_lybarger · · Score: 3, Insightful

      that's an interesting twist on design patterns... to "overcome language hurdles that dont occur in lisp and strictly functional languages."

      and i thought design patterns were just typical ways other people code stuff so you can 1, learn more quickly, and 2, not have to re-think through all that. are you saing that every lisp program you come across has a completely different design? (i'm not familiar with that language).

    7. Re:Development Processes be damned.. by p3d0 · · Score: 1

      The good ones are language-agnostic. However, ones like the Command pattern just make up for missing language features.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    8. Re:Development Processes be damned.. by Anonymous Coward · · Score: 0

      I concur. Many web-based programs today are mostly databases wrapped with forms. Sometimes, even a few business rules apply. It's amazing how much code some object oriented systems can use to do a simple task, and do it poorly. A program I've been working on, really is, rows in a database turned into HTML input tags. And there are three layers: a database layer, an object-database layer, a more abstract object-object layer, and the program.

      And ya know what? It runs REALLY SLOW.

      If I point out that this is an overglorified web-based MS Access, I'm labelled as not innovative, a dinasour (even though I'm 21).

    9. Re:Development Processes be damned.. by scrytch · · Score: 3, Informative

      The only programmers using design patterns are C++ and Java programmers.

      The book was originally written with SmallTalk in mind. Maybe you should stick to just saying "object-oriented" (I suppose 99% of which are C++ and Java programmers, though VB is finally truly object oriented, so it applies to them too)

      Do you know why? Because the "patterns" are meant to overcome language hurdles that dont occur in lisp and strictly functional languages.

      Give me just one example so I can begin to take you seriously. There are just different hurdles. First off, let's be clear, lisp is not by any means a "strictly" functional language. Strictly functional means no side effects. At all. Which is fine if you want to wrap everything up into typeful states and pass them around with syntactic sugar ala monads, but guess what, you just implemented a pattern. One that has a bit more mathematical category theory behind it, but it's still a pattern, imposing a structure on your overall design that may or may not fit your needs.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    10. Re:Development Processes be damned.. by scrytch · · Score: 2

      are you saing that every lisp program you come across has a completely different design?

      For lisp, probably not. Most lisp is peppered with imperative things, even the language itself supports sequenced stateful execution without requiring you to explicitly pass states around. For a functional language like haskell, definitely. It's hard to wrap one's brain around a client/server design being implemented as something like (in pseudocode):

      function client(serverdata)
      return server(clientdata)
      function server(clientdata)
      return client(serverdata)

      And where clientdata and serverdata are infinitely large. Neat pattern when you finally get it tho...

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    11. Re:Development Processes be damned.. by Anonymous Coward · · Score: 1, Informative

      Did you know that one of the primary reasons why many Lisp programmers see patterns as useless is that 90% of the patterns in the Gang of Four book are directly supported features or otherwise trivial non-issues in the Common Lisp Object System?

    12. Re:Development Processes be damned.. by scrytch · · Score: 2

      Oof. Got the design completely wrong. Typos, I swear .... yeah. Anyway, http://www.haskell.org/tutorial/patterns.html, which is actually talking about lazy pattern binding, but still introduces the design as two functions that are infinitely recursive, generating two infinitely long lists ... yes, lazy evaluation is weird.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    13. Re:Development Processes be damned.. by Waffle+Iron · · Score: 4, Funny
      Perhaps your lovely functional language is just particularly suited to a particular pattern - that doesn't mean it isn't there.

      For some functional languages, it seems you can use any design pattern you want - as long as it's recursion.

    14. Re:Development Processes be damned.. by MaxVlast · · Score: 1

      You're clearly too old. Everybody knows that if you're going to be a coder d00d, you have to be no older than 16. 14 is ideal.

      --
      There should be a moratorium on the use of the apostrophe.
      Max V.
      NeXTMail/MIME Mail welcome
    15. Re:Development Processes be damned.. by Enonu · · Score: 4, Insightful

      You do have a point in that you describing a new breed of OO programmer who likes to over-design the entire process. She'll create an interface for every class, *intend* to use design pattern X before the project starts, and then finally make sure that everything is abstracted so far, that you have to go down 4 levels of class hierarchy before everything implemented.

      This process is obviously not super-productive. However, this individual simply does not have enough *real-world* experience. After getting lectured/fired a few times for not "putting out," he'll tune his skills to be able to make better decisions on how to apply his OO know-how.

      Finally, it is my opinion that this type of programmer is overall better than simply a guy who knows how well his code works. I know a lot of hacker-types who know their code down to ++ inside the assignment wrapped in their if statement. What they produce works, however:

      * Try to maintain it. Let me bring my lawn chair and a bag a popcorn and I'll watch.

      * Try to add anything to it. This time I think I'll just have a tall glass of pink-lemonade.

      * etc.

      One the otherhand, if I was given the code written by the OO goon, I'd be more likely to understand it, and trim the fat.

    16. Re:Development Processes be damned.. by Anonymous Coward · · Score: 1, Informative

      Give me just one example so I can begin to take you seriously.

      I not a devotee of purely functional languages, but check out this essay on the role of patterns in Lisp. The author was a research scientist at Sun is presently head of research at Google. If it doesn't convince you, nothing will!

    17. Re:Development Processes be damned.. by bertybassett · · Score: 0

      I use design patterns and I program in VB. Works very well in getting around the few limitations in VB.

      BertyB

      --
      Wibble-Wobble, Wibble-Wobble, jelly on a plate
    18. Re:Development Processes be damned.. by Anonymous Coward · · Score: 1, Insightful

      Less complex is good. It's basically just like database design -- think of objects as being conceptually somewhat equivalent to tables. Do you want to build your tables with only one column each, so you can't run a query without joining three or four (or ten?) tables? Or do you want to have a table which takes some of the most commonly queried-for data and pulls it together so you can have a single, clean select with no joins?

      Building zillions of objects seems kind of dumb. Just like fully normalized databases seem kind of dumb. I think people hear a good idea, or theory, or whatever and just get carried away with it, like the kid who thinks, "I like salt" and then pours the whole carton of Morton's into your pea soup.

    19. Re:Development Processes be damned.. by Anonymous Coward · · Score: 1
      No, you've got it wrong. Command isn't about how to fake lisp closures in Java, it's about when you should do this. The fact that the idiom is 'native' to lisp doesn't mean you never need to think about it.


      They're Design patterns: they're about system architecture, not about coding tricks.

    20. Re:Development Processes be damned.. by Anonymous Coward · · Score: 0

      The "I like salt" programmer. I like that.

    21. Re:Development Processes be damned.. by Sir+Robin · · Score: 1

      Yeah, I don't like Scheme either. ;)

      --
      My /. ID is only 5,210 away from Bruce Perens's.
    22. Re:Development Processes be damned.. by cthrall · · Score: 1

      > It's amazing how much code some object oriented
      > systems can use to do a simple task, and do it
      > poorly.

      No kidding. Use some PHP with FastTemplates that let you cache dynamic content (oh baby)...it's nice to be able to separate your code and template. Why use JSP? It's as messy as ASP, only it's not MSFT. Seriously, why go with something MORE complicated to solve a simple problem?

    23. Re:Development Processes be damned.. by Ooblek · · Score: 2
      In my opinion, design patterns are set there by "engineers" who can conceptualize what it would take to let a "programmer" produce something that works without having to think about what to do with the stuff in the future. I don't mean this as any sort of label to demean anyone, but it is a fact I have seen repeatedly in places I've worked. The line between "designer" and "implementer" is non-existant in most places. What you get is implementers doing the design, which they tend to do as they go. Build and fix only works until the program gets really big and you have tons of customers requesting features. Then it starts to break down. Global variables abound.

      That whole paragraph about the over-engineered OO design is big time true. There are many cases where the divide-and-conquer methods that drive most OO design descisions are just too costly in terms of time and memory. This is something that only experience can open your eyes to.

    24. Re:Development Processes be damned.. by Tablizer · · Score: 2
      Less complex is good. It's basically just like database design -- think of objects as being conceptually somewhat equivalent to tables. Do you want to build your tables with only one column each, so you can't run a query without joining three or four (or ten?) tables? Or do you want to have a table which takes some of the most commonly queried-for data and pulls it together so you can have a single, clean select with no joins? .....Building zillions of objects seems kind of dumb....

      It seems some poeple just have a desire to "chunkatize" things too much. The problem is that applications need different granularity and division points for different spots (views) in the application. Thus, it is best not to try to hard-divide things if possible. Your division may just be one viewpoint of many other orthogonal possibilities.

      For example, if you divide employees into managerial and non-managerial, then processes that don't care about that division may require more coding to undo that division. Plus, the managerial status may be temporary, fleating, or vague.

    25. Re:Development Processes be damned.. by Aapje · · Score: 3, Funny

      For example, if you divide employees into managerial and non-managerial, then processes that don't care about that division may require more coding to undo that division.

      Undoing that divison??? What about:

      Employee
      |
      --------------
      | . . . . _ . . . . |
      Manager . . . . Slave

      No need to undo anything. Processes that don't care about the division code to Employee's.

      Plus, the managerial status may be temporary, fleating, or vague.

      Associations may be better for temporary, fleeting or vague manager relationships (perhaps using a Project-class?). I really don't see why those relationships can't be properly managed in OO code.

      --

      The Drowned and the Saved - Primo Levi
    26. Re:Development Processes be damned.. by Anonymous Coward · · Score: 0

      "Mathematical category theory" is, much like set theory, behind everything. It is entirely possible to describe procedural programming languages in terms of some category, it is just doubtful that this will gain you any meaningful insights.

    27. Re:Development Processes be damned.. by Tablizer · · Score: 2

      (* I really don't see why those relationships can't be properly managed in OO code. *)

      Why not divide them by hourly vs. salaried? Or full-time versus parttime? Etc.? Multiple inheritance? Whatta mess.

      What does it get you to use subclassing in place of using attributes? Polymorphism? You wouldn't need polymorphism if you didn't poly to begin with.

      Attributes should be attributes, not subclasses.

  3. Sun invented patterns? by joib · · Score: 3, Funny


    The structure itself is devoted to uncovering antipatterns , a term Tate uses because it plays off the way that Sun offered Java patterns to help programmers use the new tools efficiently. Most of the chapters show the wrong way to build something and then show how to correct it.

    And Al Gore invented the internet. Or was that Bill G again?

    1. Re:Sun invented patterns? by sylvester · · Score: 1

      The structure itself is devoted to uncovering antipatterns , a term Tate uses because it plays off the way that Sun offered Java patterns to help programmers use the new tools efficiently. Most of the chapters show the wrong way to build something and then show how to correct it.

      And Al Gore invented the internet. Or was that Bill G again?


      Uhh..where in the quote does it say that they invented them?

      If I offer you a wheel, does that mean I invented the wheel?

    2. Re:Sun invented patterns? by Anonymous Coward · · Score: 0

      Probably just karma whoring by pretending to find an error and responding with an overused snide comment.

    3. Re:Sun invented patterns? by clion999 · · Score: 1

      Yes, but it's a great snide comment. Al never really claimed to invent the Internet either. In most cases, political gaffes are never as bad as they seem to be, once Jay Leno starts up.

    4. Re:Sun invented patterns? by THEbwana · · Score: 1

      Well...the sentence:

      The structure itself is devoted to uncovering antipatterns , a term Tate uses because it plays off the way that Sun offered Java patterns to help programmers use the new tools efficiently

      makes it sound as if Tate invented the term antipatterns to counter something (patterns) that was started by sun. Does Tate really use the term antipatterns to play off suns offering of patterns? I would be surprised since the concept and practice of patterns _AND_ antipatters existed long before sun decided to provide them to developers. Tate did not invent the concept of Antipatterns - antipatterns make up an established way of learning from other peoples mistakes in a more structured way. The first antipatterns book that I saw was in 1998 (http://www.amazon.com/exec/obidos/ASIN/0471197130 / id=1021560084/sr=8-1/ref=sr_8_1/104-1927364-003916 8) well before sun started offering patterns to dev's.
      /m

    5. Re:Sun invented patterns? by kubrick · · Score: 1

      It doesn't say they invented them, just that they offered Java versions of them.

      --
      deus does not exist but if he does
    6. Re:Sun invented patterns? by Anonymous Coward · · Score: 0

      "In most cases, political gaffes are never as bad as they seem to be"

      You mean like "I did not have sex with that woman" or
      "it depends on what your definition of is is?" (WJ Clinton)

      Or "I know you believe you understand what it is that you
      think I said. However I'm not sure that you realize that what
      I said was not what I meant." (RM Nixon)

      I had an elementary school teacher pull that one on the class,
      back when it was current.

      How could Leno have made it worse? :-)

    7. Re:Sun invented patterns? by Anonymous Coward · · Score: 0

      patterns have been around since structured procedural code... they sort of sprang from common sense and the need to get actual work done.

    8. Re:Sun invented patterns? by clion999 · · Score: 1

      Well, I did say "in most cases". Most politicians don't rank with Clinton and Nixon. But those are good "anti-examples"

    9. Re:Sun invented patterns? by Anonymous Coward · · Score: 0

      I am a quality engineer. Bruce and I have discussed quality terms for anti patterns;
      defects, or 'anti fects'???
      nonconformances or anti conformances

      The quality field is filled with acronyms that are often new names for old familiar techniques. I recommend to all Java aces Dr. J. M. Juran's stuff. You will find in this 100 year young GURU's work many old friends. In his nineties he took a touch typing course so he could write his next book on the computer! It was a comprehensive history of quality!

  4. Some patterns to live by... by Glock27 · · Score: 3, Insightful
    "Make it as simple as possible, but no simpler." - Einstein

    "Keep it simple, stupid." - anonymous

    "Limit temporary object creation." - any smart Java programmer

    Java does a pretty good job of providing much more functionality for a little more overhead. There are areas in the Java libs which seem over-engineered and slower and bigger than they should be (Swing!). Don't throw out the baby with the bath water, though...Java is good and the crufty parts will evolve into something better.

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
    1. Re:Some patterns to live by... by Anonymous Coward · · Score: 0

      Keep it simple stupid -- anonymous mechanical engineer

    2. Re:Some patterns to live by... by Avumede · · Score: 1

      According to many of Sun's Java engineers, with the latest hotspot, it is not necessary to be paranoid about object creation. The hotspot compiler is optimized to deal with many short-lived objects.

    3. Re:Some patterns to live by... by Glock27 · · Score: 2
      According to many of Sun's Java engineers, with the latest hotspot, it is not necessary to be paranoid about object creation. The hotspot compiler is optimized to deal with many short-lived objects.

      Object creation performance has improved, but it is still much slower than recycling objects. Swing suffers from excessive temporary object creation. Also, even the short pauses from incremental GC can be problematic for some apps.

      It is pragmatic to use an OO programming style that doesn't gratuitously throw away cycles. Interestingly, concise code is often also clearer code.

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    4. Re:Some patterns to live by... by Anonymous Coward · · Score: 0
      Einstein, Marx, Rand, and Freud were all Jews, along with about half of the other smartest people in modern history. Pretty fucking good for a group of people that constitutes less that 1% of the world population.

      It doesn't matter that none of them believed in God, it matters that fucking rat bastard bigot pigfuckers identified them as being of Jewish descent and hated them. That's what made them Jews.

      If you don't like it, you have every opportunity to do what makes the Jews so smart -- go read a fucking book and quit hating the player. If you don't want to do that, feel free to eat my peanut-encrusted shitballs.

    5. Re:Some patterns to live by... by Anonymous Coward · · Score: 0

      I am no java god, but my experience has been that thick clients are not a good thing to build with java. It is paralleled (and exceeded) only by c++ for server side apps though. Swing and AWT leave a lot to be desired in terms of performance. They are simply not very responsive.

      Other thick applications(such as 3d graphics presentation) seem to work well and very smooth, as long as you are just watching. Slow response to user input is just tiresome. Better stick to C++ there.

    6. Re:Some patterns to live by... by Anonymous Coward · · Score: 0

      Yes, this is due to Generational Garbage Collection, where short lived objects are identified and kept in its own small pools of memory that can be GC-ed quickly (via a copy collector or whatnot).

    7. Re:Some patterns to live by... by Anonymous Coward · · Score: 0
      Einstein, Marx, Rand, and Freud were all Jews, along with about half of the other smartest people in modern history. Pretty fucking good for a group of people that constitutes less that 1% of the world population.

      Well, 1 out of 4 is still a pretty respectible amount of true genius.

    8. Re:Some patterns to live by... by valstadsve · · Score: 1

      > Object creation performance has improved, but it > is still much slower than recycling objects.

      Sorry. With the VMs we have these days, this is a lie. You should try doing Java again, it must be years and years since your last time.

      Kjetil

      --
      -- Wake up and XML the Java
  5. Well hell yeah! by Kickstart70 · · Score: 0, Flamebait
    Java made me bitter right from the start. It never worked as it should (It's cross-platform! Oh wait, it's cross platform if you tweak things for the specific OSs you're going to run this under and take into account differences in the compilers. Oh yeah...it's all unstable as hell in browsers. And it might just piss off all the visitors to your webpages).

    I would love it if someone would replace Java with something that worked. I'd even accept something from Microsoft.

    Kickstart

    1. Re:Well hell yeah! by sahala · · Score: 2
      I would love it if someone would replace Java with something that worked. I'd even accept something from Microsoft.

      Not to be rude, but if you're so "bitter" about Java why don't you design something better? I agree that Sun overmarkets Java's cross-platform capabilities, but for the most part it DOES work. I don't know of anything else (commercial-quality, that is) that works across as many hardware platforms, especially for server-side apps, which is the area where Java has really done well. Most of the examples in the book seem to revolve around J2EE and Servlets.

      Yes, applets suck for the most part. Oh well...big loss there. Then again, most crappy applets I've seen tend to be the ones where someone implements a menu-bar or some retarded visual gimmick.

      So Java has it's problems, but there's no more reason to be bitter about Java than any other software platform.

    2. Re:Well hell yeah! by geeky-troll · · Score: 0

      Hm, try C#. It is better than Java because:

      * It comes from Microsoft
      * It allows 'unsafe' constructions with pointers etc.
      * when the .net runtime is ported 100% (see go-mono.com) it will be *truly* cross platform.
      * If you don't like the syntax of a certain module, you can rewrite it in your favorite language (C++, Basic) and still use the compiled code!!!

      hehe.. let's keep the baby (source) but throw the bathwater away(Java) ... :)

    3. Re:Well hell yeah! by Anonymous Coward · · Score: 0

      Funny; I've never really had a problem writing portable Java code. Maybe it's because I write code according to what the language offers, and I don't pretend that special features of the OS are going to be portable... and I also don't pretend thick clients are worth a rat's ass.

      I can't wait until people give up this stupid idea that general-purpose applets are an acceptable idea.

    4. Re:Well hell yeah! by Vengeance · · Score: 1

      Hehe. I suppose they'll be sorry to hear this here... We do Java development against NT, AIX, Linux and OS/390. One code-base, One deployment strategy. And I can promise you this, the only OS-specific stuff in my code is... well, nothing.

      Mind you, this is all related to server-side processing. Bringing in Swing/AWT and browsers just makes a mess of things.

      --
      It was a joke! When you give me that look it was a joke.
    5. Re:Well hell yeah! by BitterJava · · Score: 1

      Java was a compromise. Keep the timing in mind. Microsoft was dominating corporate development with Visual C++. Object oriented programming was choking under the weight of pointer arithmetic, memory management, include files and multiple inheritance. SUN needed C++ syntax to rapidly build the community. SUN also needed to make some typing compromises to be more familiar to C++ users. C++-like syntax; SmallTalk-like object model. Without those communities, Java was dead out of the gate. But...that does leave some holes in the base language. J2EE has a few holes itself, but we're moving forward.

    6. Re:Well hell yeah! by Capt_Troy · · Score: 2

      I have written a lot of Java code. Only once did my code not work on other platforms. I was writing some charting software on an NT box. This requires getting a graphics context from the OS and using that to render the images. This works fine on NT, however, if you run it on a headless Unix box (no X server) it won't work because there is no way to get the context. So the code was not cross platform. However this is fixed in version 1.4. And you could include the PJA toolkit jar to fix it as well.

      Other than this, I have not heard of Java code not being portable across platforms. I'd love to hear some examples of what you are talking about.

    7. Re:Well hell yeah! by uncledrax · · Score: 1

      Yeap.. as a java developer I can tell you I know practically nothing about SWING / AWT, except that I like it that way..

      Java is improving as a pretty front end over the years, but it is not it's strongest point.

      I stick to the fun stuff anyhow.. I cant draw but I love parsing xml, talking to sockets and databases, and all the other back-end stuff that makes the pretty stuff work..

      --
      ----- The internet has given everyone the ability to have their voice heard equally as loud.. even if they shouldn't be
    8. Re:Well hell yeah! by WMNelis · · Score: 1

      I would be interested in hearing about the "tweaks" for "specific OSs" that you mention, and the differences in compilers. With the code that I have written the only real issues that I have run into (other than GUI in a Microsoft VM) are with the Runtime.exec() stuff. Other than that I actually find it difficult to write an application that doesn't work cross platform. Granted I am not writing applications that need to be tied tightly to the OS, but Java is not the correct tool for that.

      As for the Applets, I agree you might "piss off all the visitors to your web pages". However that is because they are slow to load, not unstable. I don't think Applets are inherently more unstable than any other code. Besides Applets are a few classes and interfaces in a language who's API has thousands. Java != Applets. If Java gets replaced by something better great, but for now, it's a great tool.

      --

      Sig free since 2/6/2002
    9. Re:Well hell yeah! by pnatural · · Score: 2

      I don't know of anything else (commercial-quality, that is) that works across as many hardware platforms, especially for server-side apps, which is the area where Java has really done well.

      Take a look at Python. It doesn't have a large commercial backer, but it is commercial-quality. NASA uses it, Disney uses it, more shops than you probably imagine. Oh, and python simply rocks.

    10. Re:Well hell yeah! by Anonymous Coward · · Score: 0

      Java maid me happy ...

      Comming from writing C++ and Delphi it kicks ass to have good classes for handling streams.

      Force-ing you to handle Exceptions will help you write more error proof code. Passing on objects works nicely. You may not want admit it but it makes you more aware of exceptions and such things.

      I have been writing J2EE applications, servlets, deamons, very few clients. Developement time is shorter because the machine will not dissapper if a fine null pointer is used.

      Also using Orion for webserver took down my webpage responce time to a 1/6 of the original responce time over all.

    11. Re:Well hell yeah! by Anonymous Coward · · Score: 0

      Actually it exist dummy X servers that fixes that problem.

      Well-known workaround.

    12. Re:Well hell yeah! by Capt_Troy · · Score: 2

      Yes, that is similar to what PJA does, but running a virtual frame buffer is a waste of resources if you are not going to use it often.

      Nevertheless, the code does not run on multipul platforms (until 1.4 at least)

    13. Re:Well hell yeah! by mmacdona86 · · Score: 2

      AWT with the browser-supplied VM was a very bad idea, but I suppose it was necessary to get Java off the ground. Using Swing with the Java plug-in works quite well multi-platform. If you can get your users to install the plug-in (it's easy for Windows users, but others have to be motivated) it's a great thin-client platform.

    14. Re:Well hell yeah! by sahala · · Score: 2
      Take a look at Python [python.org]. It doesn't have a large commercial backer, but it is commercial-quality. NASA uses it, Disney uses it, more shops than you probably imagine. Oh, and python simply rocks.

      Yeah I posted before I thought about Python. It definitely does rock. Back in college we used it as a scripting language for a VR system, binding python objects to 3D models, etc. The fact that we could dynamically override stuff like model.LeftArm.turn was really cool.

      But, although it's a great language I don't see it being used in enterprise scale solutions the way J2EE is. I could be wrong, and would like to be proved wrong. It could just be a marketing thing, since J2EE is such a buzzword now.

    15. Re:Well hell yeah! by Matthew+Austern · · Score: 1
      NASA uses it, Disney uses it, more shops than you probably imagine.

      NASA and Disney use all sorts of languages. Which, of course, is typical of large organizations. (My department, a smallish branch of a moderate-sized company, uses C++, C, Objective C, Java, Perl, Python, TCL, Ruby, various assembly languages, and probably a few other languages that I don't happen to remember off the top of my head.)

      I'm sure neither NASA nor Disney would consider using Python for everything. Competent programmers know that different tools are useful for different purposes.

    16. Re:Well hell yeah! by pnatural · · Score: 2

      i can tell you that python, and more specifically, zope, do scale just as well, if not better, to the enterprise. python allows you to extend via C/C++ relatively easily, and that provides a very easy path to scalability.

      as an example, i just deployed a site that will has at least 20k unique users per day. granted, that isn't true internet-scale, but i guarentee you that it will scale farther, faster, and easier than anything that comes outta Sun(tm).

      whether or not python/zope are used in other enterprise solutions or not is a different question entirely, of course, but i did want to offer some evidence to the idea that there are alternatives to the java marketing machine.

      btw, i'm glad you like python. :)

    17. Re:Well hell yeah! by pnatural · · Score: 2

      I'm sure neither NASA nor Disney would consider using Python for everything.

      True, true. But the guy from NASA I met at the last Python conference (IPC10) told me NASA uses python for all their testing. To me, that speaks volumes.

      Competent programmers know that different tools are useful for different purposes.

      Again, right on the money. But the OP was asking for something that works as well *cough* as J2EEEEE (tm) for web stuff.

    18. Re:Well hell yeah! by Tablizer · · Score: 2

      (* Again, right on the money. But the OP was asking for something that works as well *cough* as J2EEEEE (tm) for web stuff. *)

      Depending on how you measure/define "better", candidates include Perl, Python, PHP, and perhaps even .NET (after version 1.0).

      Could you be more specific about what is "web stuff"?

    19. Re:Well hell yeah! by Tablizer · · Score: 2

      (* Force-ing you to handle Exceptions will help you write more error proof code. *)

      Not necessarily. You still have to handle them properly in order to get decent results.

      Also, the way Java does it tends to bloat up the code IMO, making it hard to find the business logic that actually does the real work. IOW, harder to read. It makes the exceptions more prominate than the real meat.

      BTW, many Delphi fans think that OOPascal is superior to Java. I won't get into the middle of that fight here.

    20. Re:Well hell yeah! by pnatural · · Score: 2

      Could you be more specific about what is "web stuff"?

      Sure. Web stuff is using a web server to serve a GUI to a client or to act as an RPC end-point (e.g., XMLRPC over HTTP, SOAP over HTTP, or roll-yer-own over HTTP).

      Zope excels at the GUI by truly separating presentation from logic. Check out Zope Page Templates, which use an attribute markup language to embed presentation control in XHTML tags. Simply mind-blowing. Also, Zope is the only web server I've run across (I'm sure there are others...) that realizes the promise of reuse thru Object-Orientation. The quintessential example is style sheets. Under IIS/CFM/J2Whatever, you typically have to include a style sheet in every document that should use it. Under Zope, you instantiate it once, include it once, and sub objects inherit it automatically. Even better, that behavior can be overridden by careful instantiation of other objects in the hierarchy.

      As to the RPC, again Zope is stellar. It does XMLRPC out of the box, and I hear SOAP support is coming soon (I seem to recall a package that makes this possible today, but I'm too lazy to surf over there and find the link for you). I mentioned a Zope app I recently deployed earlier in this thread, and with that app, we act as both RPC client and server. Using Zope/Python made the RPC stuff almost trivial, and our Marketing people were simply floored by how much we implemented in so little time.

      Does that answer your question? Please let me know if I can answer anything further about Python or Zope. I've been programming almost 15 years, and I know 13 languages last count. Python is the only one about which I've ever felt passion.

      You can get Zope here.

    21. Re:Well hell yeah! by Tablizer · · Score: 2

      (* Zope excels at the GUI by truly separating presentation from logic *)

      From what I have read, it is pretty good at content management, but so so at complex web forms. A reviewer for Info Week a year ago said that "it is haunted by too much OO zealotry" [paraphrase].

      (* Also, Zope is the only web server I've run across (I'm sure there are others...) that realizes the promise of reuse thru Object-Orientation. The quintessential example is style sheets. Under IIS/CFM/J2Whatever, you typically have to include a style sheet in every document that should use it. Under Zope, you instantiate it once, include it once, and sub objects inherit it automatically. *)

      You don't need OO for that. You could have some template, a table record per page for example. Somewhere you specify what the default is for the app, and *unless* you give a specific style sheet name, it uses that default (blank = default).

      OO taking credit for defaults is kind of Al Gorish.

      However, the tricker part is in granularity management. With methods, inheritance is all or nothing. You can't override 1/3 of a method without duplication or refactoring.

      (* and our Marketing people were simply floored by how much we implemented in so little time. *)

      Give me my favorite tools, and I am Kobe Bryant of the byte floor also.

    22. Re:Well hell yeah! by pnatural · · Score: 2

      You don't need OO for that. You could have some template, a table record per page for example. Somewhere you specify what the default is for the app, and *unless* you give a specific style sheet name, it uses that default (blank = default).

      Of course you don't need OO for that; everything we've talked about is Turing-complete.

      OO taking credit for defaults is kind of Al Gorish.

      As much as I appreciate any swipe at the former Veep, I think you're missing the point. Sure, I know you can code a function to do the correct style sheet lookup, but the difference is in the effort. Instead of trying to maintain a single massive, monolithic function that is essentially a big case statement, using OO and acquisition in Zope moves the burden from the developer to the system. The code becomes smaller and more logical, not larger and more difficult to comprehend.

      The style sheet example was just that: an example. There are plenty ways that the OO nature of Zope saves time. I won't bore you with them because you really don't seem interested.

      However, the tricker part is in granularity management. With methods, inheritance is all or nothing. You can't override 1/3 of a method without duplication or refactoring.

      True, inheritance is not the be-all end-all technique of reusing code, hence the shift in emphasis in the OO community away from inheritance and towards composition. And with Python, you also have the option of using meta-classes (the risk, of course, is that your brain may explode).

    23. Re:Well hell yeah! by Tablizer · · Score: 2

      (* Of course you don't need OO for that; everything we've talked about is Turing-complete. *)

      Yes, but you have not proven OO *better*.

      (* Instead of trying to maintain a single massive, monolithic function that is essentially a big case statement *)

      You did not read very carefully. I said NOTHING about using a "big case statement". You are comparing decent OO (if there is such a thing) to bad procedural/relational.

      Why do so many OO fans love to use that word "monolithic" but none can cleary define it nor provide a realistic example of it (except in bad p/r)?

      (* The code becomes smaller and more logical, not larger and more difficult to comprehend. *)

      Bullsh*t! I don't beleive you! I suspect you were just poor at procedural/relational programming, so anything looks good in comparison.

      (* I won't bore you with them because you really don't seem interested. *)

      Show me something specific, and I will match or beat it!

      (* hence the shift in emphasis in the OO community away from inheritance and towards composition. *)

      Which OO does no better than procedural/relational. OO is optimized for trees and nested relationships. Outside of that, it offers nothing that helps over other paradigms.

  6. OOP can be oops! by mbone · · Score: 1, Insightful

    There is something about OOP that I have learned makes people want to over-apply it. The result is frequently bad, as project development times stretch out to infinity. I know of a number of OOP programming projects that got canceled because of implementation issues (speed of development, speed of use, etc.), and that is rare now-a-days in older programming languages.

    I want to read this book. I have a feeling it may be instructive in avoiding this moral hazard of OOP.

    1. Re:OOP can be oops! by bradasch · · Score: 1

      I agree with you. In another post I've read someone saying that some decisions are made on current market acronyms, not on what the software is supposed to do.
      OOP can be wonderful if you use it with caution: it's not the best paradigm that solves all problems in every single case you may stumble on. It's just another way to make things work better. If used correctly (IMHO), it's very useful.

    2. Re:OOP can be oops! by Tablizer · · Score: 2

      (* OOP can be wonderful if you use it with caution: it's not the best paradigm that solves all problems in every single case you may stumble on. It's just another way to make things work better. If used correctly (IMHO), it's very useful. *)

      I keep hearing this from the more mild OOP fans, but there is almost zilch agreement on when and where to use OOP or another approach. (Alleged) expert A will say use OOP on project X, but procedural/relational on Y, but expert B will say the opposite.

      Somebody needs to find "paradigm patterns" for when to use what. Otherwise, we will just have flamewars all day.

      OOP criticism:

      http://geocities.com/tablizer/oopbad.htm

      (Warning: it is now easy to slashdot geocities because they ran out of VC and are getting stingy like a real business.)

    3. Re:OOP can be oops! by bradasch · · Score: 1

      Somebody needs to find "paradigm patterns" for when to use what. Otherwise, we will just have flamewars all day

      I'll have to disagree with you on that: there is a big number of problems that can be solved very efficiently with both approaches (object-oriented and procedural). For this big number of cases, it's just a case of taste. It really depends on how used the programmer is to OOP and/or to procedural/relational programming. You'll get the final product both ways, with equivalent efficency.

      I've been programming small/medium applications for about 15 years now, and all I can say about it is that my team works better with OOP. It's my experience here. And I am fully aware that it doesn't apply to the rest of the world.

      There's no need for flamewars: be open minded, test both ways and pick the one you liked better. Nobody will find a magic way of choosing one for you.

    4. Re:OOP can be oops! by Tablizer · · Score: 2

      (* and all I can say about it is that my team works better with OOP. *)

      Care to give an explicit example?

      There is more training material about making decent OOP than making decent procedural/relational.

      Also, a lot of the complaints about procedural tend to be language-specific limitations anyhow.

      (* There's no need for flamewars: be open minded, test both ways and pick the one you liked better. Nobody will find a magic way of choosing one for you. *)

      I would rarely pick OO. OOP makes it too hard for me to manage attributes because it tends to mix attributes up with algorithms, which are less compact and concise than attributes. IOW, OO drags both down to the level of algorithm grokability, which is a lot lower than attribute tables, at least for my eyes and head.

      I will believe that OOP is better when I see side-by-side code comparisons of OO kicking p/r's butt. Until then, the cliche animal, shape, stack, and device driver examples don't apply to real world projects that I see.

    5. Re:OOP can be oops! by bradasch · · Score: 1

      Care to give an explicit example?

      I could give you some real world examples, but none of them would prove to be easier in OOP when compared to p/r. It's a team quality: we prefer OOP because it's easier for us. We have developed classes some 3 or 4 years ago that are unchanged and very useful till today. Of course, we could do it not using OOP, but, and here's my point, what's the difference? (BTW, we develop in Delphi). Our productivity is pretty good in OOP, so there's no need to change it.

      I will believe that OOP is better when I see side-by-side code comparisons of OO kicking p/r's butt.

      Here's my point, again: I could say exactly the same thing about p/r.

      The only defense I could make to OOP, in a real world case, is that, when we change a programmer in our team, we found it easier for the new person to adapt with our class libraries. When we used p/r, it was bumpier. Then again, this is particular to our team. I wouldn't go out and say it's a general rule. It has happened to us, and the sum of these little factors made us stick with OOP.

  7. My Gripes about Java &tm; by Anonymous Coward · · Score: 5, Funny

    Hello fellow coders,

    I'm a first year programming student at a local community college school and I've just finished my Visual Basic classes. This term I'll be moving onto Java. However I've noticed some issues with Java that I'd like to discuss with the rest of the programming community. Please do not think of me as being technically ignorant. In addition to VB, I am very skilled at HTML programming, one of the most challenging languages out there!

    Java is based on a concept known as Object Oriented Programming. In this style of programming (also known as OOPS in the coding community) a programmer builds "objects" or "glasses" out of his code, and then manipulates these "glasses". Since I'm assuming that you, dear reader, are as skilled at programming as I am, I'll skip further explanation of these "glasses".

    Please allow me to make a brief aside here and discuss the origins Java for a moment. My research shows that this language is one of the oldest languages in existance, pre-dating even assembly! It was created in the early 70s when AT&T began looking for a new language to write BSD, its Unix Operation System (later on, other companies would "borrow" the BSD source code to build both Solaris and Linux!)

    Back to the topic on hand, I feel that Java - despite its flaws - has been a very valuable tool to the world of computers. Unfortunately its starting to show its age, and I feel that it should be retired as C++, Python and Perl seem to have been. Recently I've become aquainted with another language that's quite recently been developed. Its one that promises to greatly simplify programming. This new language is called COBOL.

    Although syntactically borrowing a great deal from its predecessor Ruby, C greatly simplifies things (thus its name, which hints at its simpler nature by striping off the klunky double-pluses.) Its biggest strength is that it abandons an OOPS-style of programming. No more awkward "objects" or "glasses". Instead C uses what are called structs. Vaguely similiar to a Java "glass", a struct does away with anachonisms like inheiritance, namespaces and the whole private/public/protected/friend access issues of its variables and routines. By freeing the programmer from the requirement to juggle all these issues, the coder can focus on implementing his algorithm and rapidly developing his application.

    While C lacks the speed and robustness of Java, I think these are petty issues. Given the speed of modern computers, the relative sluggishness of C shouldn't be an issue. Robustness and stability will occur as C becomes more pervasive amongst the programming community and it becomes more fine-tuned. Eventually C should have stablity rivalling that of Java.

    I'm hoping to see C adopted as the de facto standard of programming. Based on what I've learned of this language, the future seems very bright indeed for C! Eventually, many years from now, perhaps we'll even see an operating system coded in this langauage.

    Thank you for your time. Your feedback is greatly appreciated.

    1. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0
      If you are having trouble with Java, I can wholeheartedly recommend the best Java version that I know of!

      Finally, an implementation of Java that just works!

    2. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      Dear Reader,

      Your commentary was a not only educational, but entertaining to read. The only mistake I would like to point out is that Richard Stallman did not steal the source codes from BSD to write Linux. As a matter of fact, he never took anything from anyone and the whole thing was his idea and no one else's. He may even open source java someday.

    3. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 1, Interesting

      Mmm, trolling. This is the second time I've seen this exact post.

      I suppose that this provides an interesting commentary on karma: I've seen a fair bit of people posting the exact same post as many times as possible to try to maximize karma with minimal effort.

      - Coffee (using a cow orker's terminal)

    4. Re:My Gripes about Java &tm; by Kindaian · · Score: 1

      The problem of Java is that is taught in old platforms, deprecated platforms and with old methods of programming and learning (respectivly, unix, windows and mainstream programming methedology).

      That is a pity because i feel Java aims for a bigger future.

      Cheers...

    5. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      Hey, at least this asshole posted as AC. Can't be a karma troll, just another goatlicking crapflooder.

    6. Re:My Gripes about Java &tm; by SirTreveyan · · Score: 1

      How can anyone take this post seriously?? I dont know about most of you, but "glasses" are worn on the head to help one see while writing OOP "classes".

      --

      SELECT * FROM User WHERE Clue > 0

      0 rows returned

    7. Re:My Gripes about Java &tm; by AppyPappy · · Score: 2, Funny

      Note: C is a subset of COBOL. C++ is merely a faster version of C.

      --

      If you aren't part of the solution, there is good money to be made prolonging the problem

    8. Re:My Gripes about Java &tm; by cosmicpossum · · Score: 1

      The problem with satire is that sometimes (often) there will be dim people who think it is serious.

      --
      (This sig intentionally left blank)
    9. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      I gather you were absent when they handed out tickets for the cluetrain?

    10. Re:My Gripes about Java &tm; by Surak · · Score: 1

      Dear Mr. Coward:

      Your commentary was brilliant! However, there is a bigger movement towards an even more advanced language. It's called Basic. They call it this because it is even easier and simpler than C!

      Basic gets rid of even the structs! And, it implements the concept of LINE NUMBERS, so you'll never lose track of what line of code you're on!

      There are no anachronisms like FUNCTIONS in Basic. With the new LINE NUMBERS feature, you just transfer control of the code to any given line using the advanced GOTO command!

      You don't even need to compile Basic! Many Basic implementations are entirely interpreted! There's no need for silly things like Java's JIT compiler!

      Rumour has it that the next version of Microsoft Office will even use Basic as its primary language! Every major application will be written in Basic and run on top of the the Microsoft Office Operating System!

      This is really advanced stuff!

    11. Re:My Gripes about Java &tm; by Hard_Code · · Score: 1, Offtopic

      This is funny?

      --

      It's 10 PM. Do you know if you're un-American?
    12. Re:My Gripes about Java &tm; by SirSlud · · Score: 3, Insightful

      > using the advanced GOTO command!

      I was about to point out that C has GOTO when I realized that C programmers who use 'goto' in C code more than 3 times in a 2 month span invariably seem to wind up homeless and discombobulated. So, it's probably for the best that you didn't point this out ...

      --
      "Old man yells at systemd"
    13. Re:My Gripes about Java &tm; by FatHogByTheAss · · Score: 1
      I'm a first year programming student

      Then sit down and shut up. We'll let you know when you're qualified to speak.

      I am very skilled at HTML programming

      You obviously hold a PhD in Trollology.

      Well done!

      --

      --
      You sure got a purty mouth...

    14. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      I for one, hadn't seen this post before, and it actually was on topic because *gasp* the book reviewed is about java! I personally got quite a chuckle out of it. It was obviously posted as AC so the person who posted it wouldn't fucking be flamed out of existence.

      That's what slashdot's become. You have to post shit that's not the majority opinion as AC to protect your karma/reputation. Everyone claims karma doesn't matter, but aye, it does. Well it doesn't matter if you don't mind posting at -1 I guess.

    15. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0
      > This is funny?

      Well, I thought it was. It really doesn't look like trolling to me; it looks like someone who's been around a while and is making fun of the eager youg ignoramuses we occasionally see in public forums like these. Maybe he's trolling folks who are insecure about being young and ignorant?

    16. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      why is everyone taking this post seriously? it is obviously a joke...

    17. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      He probably used one of his very challenging HTML programs to propogate the post several times. Remember, he is very skilled at HTML programming, one of the most challenging languages out there.

      Doesn't loop well, no conditional execution, ...

      I can see why it would be challenging

    18. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      ROFL... so true.... so true....

      I also like the:

      *ring* *ring*.... it's for you....
      what?
      the clue phone.

    19. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      Are you really THAT dense? This post is SATIRE. GET IT?!?

    20. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      If it is well written satire, you don't have to be that dim.

      If this post is indeed written to be satirical, bravo, because it fooled me.

      He sounded just like this asshole that used to work for my company. This kid had the gaul and audacity to stand up in the middle of a meeting and say:

      "Well if there is one thing I have learned in my 3 years as an engineering student..."

      He was standing in a room where everone else had either 3 years real world experience, or a 4 year degree, most with both. He was actually talking down to everyone, much like the poster here sounded like. Maybe I just harbor too much resentment for this kid that I bought into this supposed satire.

    21. Re:My Gripes about Java &tm; by (H)elix1 · · Score: 2

      OO Cobol - println inherits from space...

    22. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      OK, I am dim, I just went back and read more than the first paragraph ;)

      I guess I just hold two low of regard the average /. poster, and assumed this was a genuine post.

    23. Re:My Gripes about Java &tm; by Anonymous Coward · · Score: 0

      No shit, it amazes me all the people that replied because they didn't "get it". I think someone summed it up best above when they said something to the extent of: You missed it when they were handing out tickets for the clue train, didn't you?

      I suppose a lot of the satire is lost when people read it thinking that this person is actually giving factual information about the history of programming languages because they don't know any better. Sure this a recycled post, probably because the humor was lost the first time too, and thought it might get a better response in a post about programming. Stupid him/her.... thinking that people posting would be "programming types". Probably a guy posted it, but you never know....

    24. Re:My Gripes about Java &tm; by God!+Awful · · Score: 2

      I for one, hadn't seen this post before, and it actually was on topic because *gasp* the book reviewed is about java! I personally got quite a chuckle out of it. It was obviously posted as AC so the person who posted it wouldn't fucking be flamed out of existence.

      I saw it a couple of days ago on the thread about implementations of the C++ stl98 standard.

      s/C++/Java/ doesn't make it on topic.

      -a

    25. Re:My Gripes about Java &tm; by TechnoPope · · Score: 1

      C++ is merely a faster version of C This statement isn't wholly correct. While it is possible to write C++ code that is faster than C; most programs would be faster if they were written for C. I've talked with with both Brian Kernigan (of K & R C fame) and Bjorne Stroustrup (the creator of C++) about this and both will admit that generally, C is a faster language. It should also be noted that originally, C++ was implemented via a wrapper program for C called Cfront. Cfront would simply take the C++ code and generate the C code necessary to drive the program. So in reality, C++ is C with a nice layer of abstraction.

      --
      Slashdot...it's like Fox news, but without the biased sl...or maybe not.
  8. So many books on java... by sisukapalli1 · · Score: 5, Insightful

    It is sometimes very scary when things are so, ahem, much marketed. In many places, there seems to be more emphasis on the tools and techniques used than what the product is supposed to do.

    For example, "We clinched the deal because we promised to use the J2EE/EJB framework" -- as opposed to, "Our product is good, and the guys liked our technical expertise and design." This is a "sort of" true story!

    S

    1. Re:So many books on java... by Anonymous Coward · · Score: 0

      I can second this, and your're quote is off by about one or two words. This is no shit, I remember sitting in on one of those analyst calls, listening to the ceo tell the wall street guys that we where re-writing everything in j2ee, and they all applauded. i thought to myself...is it really that easy to be the ceo?

    2. Re:So many books on java... by Liora · · Score: 1

      I am not going to go get the book because I wouldn't understand it very well anyway (I'm a really awful programmer), but I really respect the guy for writing it. I have a java book on the shelf (won't name any names, but there are some dancing figures and it features with Java swing), and it is what I pull out when I need a clue. What makes me upset though is the number of things in it I don't understand. I am not a programmer, but occasionally I have to write a few lines of code for something. And when that happens, I do not need the words simple or straight-forward to appear anywhere.

      I understand that maybe there are people who actually understand it if someone says we promised to use the J2EE/EJB framework, but I don't. My major problem is that I tend to figure out some intuitive way of doing something, but then I realize that it is terribly inefficient and it takes me all day to figure out what a good programmer could do instead in five minutes. Does anyone know of a good Java book for idiots who know they're idiots but still want to do things the right way?

      --
      Liora
    3. Re:So many books on java... by Nyarly · · Score: 2
      My recommendation is Just Java, by Peter van der Linden. (It feels weird to be admitting to being a "big fan" of the author of programming texts, but he writes a good text.) The style is clear and concise, treats you like an equal rather than like an idiot, but puts things in casual terms, rather than in deep argot.

      Oh, and if you need a C text, Deep C Secrets kicks much buttock as well.

      --
      IP is just rude.
      Is there any torture so subl
    4. Re:So many books on java... by Anonymous Coward · · Score: 0

      This reminds me of ISO 9001 and anything related to what Rational sells (e.g. Rose and 'The' UML).

      It's almost a conspiracy by some huge industry (publishing, consulting, etc), to sucker those that would want to produce something, into spending vast amounts of resources on something that is too complicated for the average individual to just see, right off the bat, that it doesn't have any other effect but to detract from production, rather than add to it.

    5. Re:So many books on java... by jsse · · Score: 2

      Yeah, may be we shouldn't blame the users. I should have just used JDBC to complete a very simple inventory system, but instead I proposed to have them to pay for an expensive J2EE/EJB system because that'd improve my skillset than using JDBC. Bad bad...

  9. Mm.... Bitter java... by Chris+Burke · · Score: 2

    That's how I like it. Nice and bitter. And strong.

    Certainly problems arising from OOP are not specific to java. It's quite possible in C++ (and presumably other OOP languages) to write a class with an interface that would make Stroustrup proud but that runs like me before my morning coffee. One of the issues I've had with OOP is the extreme care needed in design, disproportionate to the benefits. Still, it does have benefits, so I use it.

    Now while the reviewer relates the issues in the book to other languages, does the author? It sounds like it might be a good book for a non-java programmer, but it isn't clear that it is.

    --

    The enemies of Democracy are
  10. mmmmm... Money.. by tomblackwell · · Score: 2, Insightful

    Way to pack those Amazon affiliate links into that submission...

  11. Here's a book title... by Yoda2 · · Score: 2, Funny

    "Practical OO Programming In Binary"

    1. Re:Here's a book title... by gnugnugnu · · Score: 2, Funny

      > "Practical OO Programming In Binary"

      intersting book title, but it would get called POOP for short

    2. Re:Here's a book title... by _xeno_ · · Score: 1
      Reminds me of a book I saw while walking along the bookshelves in Barnes and Noble... Java Principles of Object Oriented Programming . It was a green book as I recall with large, yellow (or maybe white) letters running down the spine:
      "POOP"

      There was a (extremely small, relative to the huge "POOP") "Java" oriented perpendicular to the POOP as well, but walking down, looking at books and seeing one entitled "POOP" was just... well, weird.

      --
      You are in a maze of twisty little relative jumps, all alike.
    3. Re:Here's a book title... by kubrick · · Score: 2

      It's possible... just spend several years working on paper before you even go near a computer. :)

      --
      deus does not exist but if he does
  12. Examples, please! by Shimmer · · Score: 2, Interesting

    Before we get out the brickbats, can someone please post an example of the horrors of OO technique that are referred to here.

    As someone who has used OO successfully for 10+ years, I'll have a hard time accepting these OO "antipatterns" without concrete examples.

    -- Brian

    --
    The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    1. Re:Examples, please! by Anonymous Coward · · Score: 0
      Trivial one:

      Go figure out why you'd better not use "cout" or "cerr" in a multithreaded process running on a Solaris machine.

    2. Re:Examples, please! by Anonymous Coward · · Score: 0

      One example you find in C++ books (from Bjarne, at that) is the OO tree, where you have to destroy objects to change their state, for example when an employee changes to a manager, etc. Yeah, that's great, Bjarne... explain how OO works with an example that blows chunks once you get in the real world.

    3. Re:Examples, please! by DaveAtFraud · · Score: 3, Funny

      I have to say it... There are no concrete examples; only abstract super class examples.

      --
      They that can give up essential liberty to obtain a little temporary safety deserve neither safety nor liberty.
      Ben
    4. Re:Examples, please! by Bigboote66 · · Score: 1

      First off, this has nothing to do with object oriented design (even though cout & cerr are objects). It relates to thread safety, which applies in non-OO applications as well.

      Secondly, there's nothing wrong with using cout or cerr in a multithreaded Solaris process. cout & cerr are thread safe - they inherit from ostream, which itself is thread safe. Sure, multiple threads will be dogpiling output to stdout or stderr, but the same can be said for fprintf; in any case, your app isn't going to dump core. As long as your willing to accept the fact that only text that is written out in a single command will remain contiguous, there is no problem.

      -BbT

    5. Re:Examples, please! by ivrcti · · Score: 1

      Your sig is great. It just became my quote of the week. Thanks!

    6. Re:Examples, please! by Anonymous Coward · · Score: 0

      Well, you could go get the book, that might be a start.

      You might also realize that just because you programed a HelloWorld app in C++ it isn't OOP.

      Or, you might realzie that in your 10+ years of OO programming, you might have already learned to avoid the pitfalls this author is refering to.

      It is very similar to the pitfalls of a normalized DB. In theory, a DB in the proper 3rd normal form is best for all around performance. This may not be the case do to limitations of disk access, memory usage, or a number of other things. Then, the DB might not get an overall usage, maybe it is only ever used one way in which de-normalizing can help. So you have physical limitations, and/or usage limitations that make the DB theory you learned in school less than applicable. It (the theory) isn't wrong, it just doesn't work in the real world all the time.

      Theory and real world performance don't always match. But if you have been in a production environment for 10+ years, I am sure you already know that, probably just take it for granted, do the work arounds without even thinking about it.

    7. Re:Examples, please! by scode · · Score: 1

      In Smalltalk there is always #become...

      --
      / Peter Schuller
      --
      peter.schuller@infidyne.com
      http://www.scode.org
    8. Re:Examples, please! by adamy · · Score: 1

      Ah yes, that example is where you realize that the relationship[between that person and manager is not is-a (But TOm is a Manger you might say)
      No. Tom has the role of manager. Tom has that role in the context of his employment to a certain company.

      Don't throw out the E-R model when you start to use UML

      --
      Open Source Identity Management: FreeIPA.org
    9. Re:Examples, please! by Anonymous Coward · · Score: 0
      cout & cerr are thread safe - they inherit from ostream, which itself is thread safe. Sure, multiple threads will be dogpiling output to stdout or stderr, but the same can be said for fprintf;
      Let's think about this....

      std::cout << "foo" << "bar" << std::endl;

      This calls ostream::operator<<(const char*) 3 times, which will end up doing 3 buffer writes. Each write can be locked. But there is no way to do locking in between calls.

      So if one thread does:

      std::cout << "foo" << "bar" << std::endl;

      And another thread does:

      std::cout << "baz" << "bort" << std::endl;

      You might end up with output like this:
      foobazbarbort\n\n

      Instead of:
      foobar\n
      bazbort\n


      With C, this is not as much an issue, because you only need to call printf() once in most cases, while ostream::operator<<(const char*) gets called thrice in this one. And you can't lock in between calls.

      Compare:

      printf( "%s%s\n", "foo", "bar" ); // 1 call; 1 lock
      std::cout << "foo" << "bar" << std::endl;
      // 3 calls; 3 locks

      By the same token, this C code is also not thread-safe:

      printf( "foo" );
      printf( "bar" );
      printf( "\n" );


      Assuming the desired output is "foobar\n".
    10. Re:Examples, please! by Anonymous Coward · · Score: 0

      You could also give each thread its own private buffer, but that can waste a lot of memory, and if the buffer needs to be flushed while ostream::operator<<(const char*) is still being called, there could be trouble.

    11. Re:Examples, please! by Shimmer · · Score: 1

      Exactly. Tom is an instance of the Person class. Tom plays the role of Employee in his relationship with the XYZ Co.

      You're right that people get misled by the "is a" in "Tom is a manager". English is ambiguous, but UML is not.

      Don't know why you say that you need ER concepts to model this, though.

      -- Brian

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    12. Re:Examples, please! by Shimmer · · Score: 1

      I don't want to get the book. I want the book review to back up its claims.

      You're right that theory and practice are not always in perfect agreement. The problem here is that people don't understand the theory, and hence are unable to apply it. So then they blame the theory for being inadequate.

      OO may suffer from poor public relations, but that doesn't mean it's broken.

      -- Brian

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    13. Re:Examples, please! by Peaker · · Score: 2

      You could also easily write:
      lock(std::cout 1 2 3);

    14. Re:Examples, please! by Peaker · · Score: 1

      With the << ofcourse :) (I didn't think preview was necessary for that one :)

    15. Re:Examples, please! by DrSkwid · · Score: 2

      simple

      M F C

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

      Wouldn't that kind of be like this?

      std::ostream &temp = std::cout << 1 << 2 << 3;
      lock( temp );


      That's no good.

    17. Re:Examples, please! by Shimmer · · Score: 1

      MFC may have some issues, but it was (and still is) enormously succesful. Java and .NET are both similar to MFC in that they also have single-rooted class hierarchies. So MFC is hardly a good anti-pattern.

      You want to get more specific?

      -- Brian

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    18. Re:Examples, please! by Anonymous Coward · · Score: 0

      * Common anti-pattern: object A has pointer to object B. Object A gets destroyed, object B makes a call on A, we go bye-bye. This frequently happens in messaging queues, when the recipient of the message dies before the messages get off the queue. Fix: use ref. counted "smart pointers."

      * Can't find a place for something? Put it in some global object called "GlobalUtil" or something. Result? Bunch o' stuff that has no relation to each other in a class.

      * Interface for every class. Happens with Java newbies more than anywhere else: "hey! I'll create an interface because I MIGHT need one at some point in the future!"

    19. Re:Examples, please! by Anonymous Coward · · Score: 0

      I worked on a business application (written by another) that had a presentation layer, business object layer, business object communication with persistence layer, persistence layer and database. However, sometimes the layers got bypassed, presumably because they were so unwieldy.

      After spending four hours trying to work out what the 'save' button did, and not finding any calls to the database (despite the fact it was throwing database errors) I gave up.

    20. Re:Examples, please! by Tablizer · · Score: 2

      (* After spending four hours trying to work out what the 'save' button did, and not finding any calls to the database (despite the fact it was throwing database errors) I gave up. *)

      I hate walking in as a consultant to a place to face speggetti code like this (speggetti can be in any paradigm).

      If you can't do it, you look bad, when in fact the "bad" is the prior programmer/consultant(s) who made the mess.

      Thus, giving up is often not a viable option. One has to hack around with the mess to get it to (barely) work, and then hopefully the contract will end before the house of cards comes tumbling down.

      I don't know of a diplomatic way to say "your app is a fricken mess" without it making the complainer look bad. The manager may have no easy way to verify your claim.

  13. Riiiiiight by Anonymous Coward · · Score: 0

    You're still stuck in the Java = Applet mode.

    A lot of non-technical people are stuck in this mindset. If you start approaching and talking to technical folks, you'll learn the real Java story.

    For now, I suggest learning the "Macro" function whatever version of Microsoft Office you're misusing.

  14. You are clever. by Big+Dogs+Cock · · Score: 0, Insightful

    Please stop posting to /.

    Anyone who tells you that a tool/language/methodology will make programming easy is a liar/fuckwit. Doing difficult things is hard. There comes a point where a system is so difficult that it makes very little difference whether you program it in VB or assembler. It's still going to be hard.

    I though perl was a girl's language but look how hard it is to fix the page widening bug.

    --
    "Under the iron bridge, we fist" - The Smiths, Still Ill
    1. Re:You are clever. by cduffy · · Score: 1

      Yes, doing difficult things is hard -- but some things are difficult only because the tools make them hard. Using better tools thus can make these classes of problems easy -- because they're not innately hard problems, but merely problems that the tools make difficult (by omission or otherwise).

      Certainly, some things are hard by their nature -- good tools can still help, even though they won't make them easy.

  15. The solution by Larne · · Score: 3, Insightful
    After a few chapters it becomes clear that object-oriented programming is starting to reach practical limits. [...] So what is the solution?
    Some people have been saying for years that the solution is functional programing. In some functional languages, wierd run-time errors become type errors caught at compile time, the absence of state makes programs much easier to reason about, and so on.

    Of course, there is no magic bullet to make software suck less, but I would strongly encourage all developers to at least look at what FP offers.

    1. Re:The solution by BrokenHalo · · Score: 2, Informative
      So what is the solution?

      Go back to assembly! :-)

    2. Re:The solution by Anonymous Coward · · Score: 0

      "Some people have been saying for years that the solution is functional programing"

      Unfortunately, the people pushing this agenda don't seem to realize
      the big problem -- programming in functional languages is NO FUN.

    3. Re:The solution by Anonymous Coward · · Score: 0

      I don't think you realize what functional programming is... Do you think C is a functional programming language.

      I think what is being talked about is a language more like Haskell.

      Cheers

    4. Re:The solution by HiThere · · Score: 3, Insightful

      It's not that simple. There is a class of problems for which the functional approach is good. There is another class for which object oriented is good. There is a class for which procedural is good. And there is another class, for which I don't know a good methodology.

      Object oriented is good when things are easily modeled by objects. When it's easy to think of them as physical models.

      Functional programming is good when something is well described by goal states.

      Procedural programming is good when the algorithm is the thing.

      The remaining set of approaches are involved in making quick choices between options based on relative desireability. In a person one might describe this as "having a feel for the problem", but that is often confused with the modeling approach. This is more related to a ranking procedure or an emotional approach. At the moment, the best way that I know of getting this is via a neural net, but that's clearly not a desireable programming strategy. A hash table is an example of this approach in use (if not in design). But the actual methodology would need to stretch far beyond hash tables.

      For a larger system, one would want to pick one of these approaches as a basis, and interface it with two of the other approaches. These in combination would be able to synthesize an attack on the fourth method problems. Then each problem would need to be solved using the api's relavant to the particular mode that handles that kind of problem best.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
  16. finally by Anonymous Coward · · Score: 0

    It's good to see a book which devles into the frustrating part of languages. Whether you like it or not, all languages have parts which can be a pain to use. It's good to see a book that acknowledges this.

    1. Re:finally by Tablizer · · Score: 2

      (* It's good to see a book which devles into the frustrating part of languages. Whether you like it or not, all languages have parts which can be a pain to use. It's good to see a book that acknowledges this. *)

      I see a business opportunity in this: the "Frustrated" series, similar to the Dummy series.

      "Java For the Frustrated"

      "MFC For the Frustrated"

      "Dealing with Frustration for the Frustrated"

      The cover would feature a cartoon of a frustrated geek pulling his/her hair out, and peices of hair at the bottom.

  17. Amazon.com? by rob_horton · · Score: 1

    I seem to recall being urged to avoid Amazon at all costs not so long ago due to their patent of 'one click' purchasing? Is this still on? Just in case here is an alternative link.

  18. distributed programming != OO by oogoody · · Score: 1

    It's not clear what "nicely wrapped" objects
    have to do with distributed programming. OO doesn't make distributed programming any easier or harder. They are separate issues. If it
    didn't work it's because they didn't solve the
    right problem.

  19. Cross platform by Chris+Burke · · Score: 3, Insightful

    Advertising cross-platform code as being one of the major benefits of java was a mistake by Sun. They should have realized that a language written for a generic VM is cross-platform only if the implementations of that VM and the system interfaces it uses on each platform are 100% compatible. That's a challenge even if all the implementations are written by Sun! Considering that they are not, and that some of those implementations were written by people with a somewhat vested interest in ensuring that cross-platform operation never comes to pass, it should have been obvious that it would never come off without a hitch.

    Making "Write Once, Run Anywhere" a Java mantra was a huge mistake. It should have been more like "Write once, tweak a little, maybe it'll run... But it's easier than porting C code!" A more modest claim would have been much better.

    --

    The enemies of Democracy are
    1. Re:Cross platform by goldenfield · · Score: 1

      Making "Write Once, Run Anywhere" a Java mantra was a huge mistake. It should have been more like "Write once, tweak a little, maybe it'll run... But it's easier than porting C code!"

      Hmm...that doesn't have quite the same ring to it.

      When it works, though, its a pretty awesome thing. I did my thesis in Java - a visualization of some simulations. I did all the development on SGIs, but I gave demos on Windows in another lab. That first time I ran the program on Windows, I was fairly shocked that it worked so well without me having to rewrite a single line.

    2. Re:Cross platform by petis · · Score: 2

      Making "Write Once, Run Anywhere" a Java mantra was a huge mistake. It should have been more like "Write once, tweak a little, maybe it'll run... But it's easier than porting C code!" A more modest claim would have been much better.

      Let me guess, you don't work with marketing, right? :-)

      My opinion? Those who believe it without trying it makes a mistake, but from a marketing point of it was brilliant. Imagine the number of power-point slides with

      * Platform independent

      that has been shown to management as a rationale when choosing Java technology for the upcoming project.

      Just because it is presented and accepted as a rationale doesn't mean it *is* rational. The marketing is brilliant.

    3. Re:Cross platform by Anonymous Coward · · Score: 0

      I have never had cross platform issues with server side java code. I regularly write stuff on my nt workstation, test it there and simply drop it into my linux environment with absolutely no issues.

      Usually, if there is an issue, it is caused by forgetting to add something to the target environent that is included in the development environment, or forgetting to add host access to a database or firewall. this is not a java problem, but a developer/adminstrator problem.

      I think you might mean that setting up the environment and maintaining a standard is hard on different platforms, but only if you don't know the platform and how the jvm interacts with it's environment on that platform.

    4. Re:Cross platform by Chris+Burke · · Score: 2

      No, no I'm not a marketer. And yes, I know it's obvious. :)

      When I said a huge mistake, though, I did mean with regards to the loss of developer respect that resulted from the ultimate failure of that claim. Obviously with regards to manager acceptance it was a hit, and for that I can't fault them. But they still should have said what was -really- going on, maybe on some hidden developer-only web page that managers would never see. ;)

      --

      The enemies of Democracy are
    5. Re:Cross platform by petis · · Score: 2

      Hehe, you are of course perfectly right. That's the (sad?) thing with marketing; you don't have to be honest as long as the customers keeps buying. I don't think that "developer respect" was high on their list when deciding what to promote, and I don't think it's high up on any marketing departments list either.

    6. Re:Cross platform by hyperionfarmer · · Score: 1

      "Advertising cross-platform code as being one of the major benefits of java was a mistake by Sun"

      I would have to disagree for 2 reasons:

      1) Cross-platform works rather well. It isnt perfect but it is very good.

      2) It is one of the strengths that many people will point to. This suggests that tha Sun choose a selling point that is REAL and not simply marketing.

  20. anti-antipatterns by graveyhead · · Score: 4, Interesting
    If design patterns are used correctly, they accomplish one of 2 things, but rarely both:

    they speed up the development of a system
    or

    they speed up the execution of a system

    This is, of course, one of the fundamental trade-offs that us computer programmers make all the time. The important part is choosing a pattern that is appropriate for the system. For example, the flyweight pattern is used to limit/reuse objects in a system. It is appropriate to use this pattern when top execution speed is necessary, but the price is the complexity of implementation.

    The facade pattern, OTOH, is designed to make life simpler for programmers, potentially at the cost of execution speed.

    It sounds to me like this guy has trouble picking the appropriate patterns from the start.

    --
    std::disclaimer<std::legalese> sig=new std::disclaimer; sig->dump(); delete sig;
    1. Re:anti-antipatterns by Anonymous Coward · · Score: 0

      I'm not sure how you arrived at that (the author has trouble selecting his patterns) conclusion from the review.

      Could you explain?

    2. Re:anti-antipatterns by WolfWithoutAClause · · Score: 2
      If design patterns are used correctly, they accomplish one of 2 things, but rarely both: * they speed up the development of a system or * they speed up the execution of a system

      I don't really agree with this. In most systems I work on they do both- in different places. In one place speed isn't important (e.g. UI), in another it is (e.g. database lookups that are called from a zillion places).

      It sounds to me like this guy has trouble picking the appropriate patterns from the start

      No engineer always knows what pattern to use; for one thing the known requirements often change as you work towards delivery, and the patterns that best address these requirements often change with them.

      I mean sure, a good pattern is along the lines of 'avoid having requirements that change', but that pattern is often inapplicable.

      --

      -WolfWithoutAClause

      "Gravity is only a theory, not a fact!"
    3. Re:anti-antipatterns by tstiehm · · Score: 1

      Design Patterns don't speed up development or execution speed of a system. They are tool used to describe a solution to a well known problem. Using a pattern "correctly" will only provide effecency in describing a problem/solution to another person versed in tht pattern.

      Patterns and anti-patterns are valuable, important tools for software engineering but please don't make them to be more than they are.

    4. Re:anti-antipatterns by Admiral+Burrito · · Score: 2

      Design Patterns don't speed up development or execution speed of a system. They are tool used to describe a solution to a well known problem. Using a pattern "correctly" will only provide effecency in describing a problem/solution to another person versed in tht pattern.

      Design patterns aren't just a dictionary to enhance your vocabulary. They are also tried and tested solutions to common problems.

      If you already know that adding axles with round objects on the ends is a good way to make something mobile, knowing that the round thing is called a "wheel" does nothing more than allow you to describe with one word your thing's means of locomotion. On the other hand, if you're trying to make something mobile and have no idea how to do it, you will greatly speed up your development time and the efficiency of the end product by reading up on those "wheel" things instead of trying to invent your own solution.

    5. Re:anti-antipatterns by BitterJava · · Score: 1
      You said: "The facade pattern, OTOH, is designed to make life simpler for programmers, potentially at the cost of execution speed."

      It depends on where you apply your facade, no? A facade can also shift distributed boundaries away from expensive iterative interfaces. Use a UML OID to find out where. Look in the book for an example of the math.

      If you take 20 round trips to a remote entity EJB and replace with 1 round trip session bean that wraps 20 local method calls to the entity EJB, you've added a layer.

      Is it slower? Absolutely not. You more than offset the additional layer with the distributed communication costs.

      I stand behind the facade as a good performance enhancer for this instance...and so do the writers of other best sellers (Core series, EJB design patterns, Mastering EJBs to name 3.)

  21. Antipatterns by Frums · · Score: 5, Informative
    The structure itself is devoted to uncovering antipatterns , a term Tate uses because it plays off the way that Sun offered Java patterns to help programmers use the new tools efficiently.

    Actually, "antipattern" is an accepted term in the pattern commnunity for describing a bad process or design that on the surface looks like a good idea. If a Pattern is a good practice distilled from the experiences of many good develoeprs, then an antipattern is a "gotcha" thathas been distilled from experience common to many good developers. This book describes it, but th ename really has nothing to do with Sun's practice of describing things in terms of patterns.

    -Frums

    1. Re:Antipatterns by ed1park · · Score: 1

      http://www.antipatterns.com/dev_cat.htm

      A link I remembered from a similar post.

    2. Re:Antipatterns by staplin · · Score: 2

      Actually, "antipattern" is an accepted term in the pattern commnunity for describing a bad process or design that on the surface looks like a good idea. If a Pattern is a good practice distilled from the experiences of many good develoeprs, then an antipattern is a "gotcha" thathas been distilled from experience common to many good developers. This book describes it, but
      the name really has nothing to do with Sun's practice of describing things in terms of patterns.


      That's right. The AntiPattern is a well established idea, even marked by the publication of an AntiPatterns book just a few years after the publication of Design Patterns by the gang of four.

    3. Re:Antipatterns by Anonymous Coward · · Score: 0
      th ename really has nothing to do with Sun's practice of describing things in terms of patterns.
      Zuh? Yes it does! Of course it does! It was picked deliberately to show you what the opposite of the good "pattern" approach was! Why do you think it's got "pattern" in there, braniac?
  22. Edited for the "for dummies" series: by TheFlu · · Score: 3, Funny

    I can see it now:
    Chapter 1
    The joys of 0
    Chapter 2
    The joys of 1
    Chapter 3
    0 meets 1

    1. Re:Edited for the "for dummies" series: by Anonymous Coward · · Score: 0

      congratulations, you've just described most of additive set theory. something about a million monkeys...

  23. This is a great book idea for beginners by geneshifter · · Score: 1

    I'm a beginning programmer and it is a great idea to have a book showing the wrong way to do something for someone like me. It is near impossible for a beginner to go grab an Orielly guide and start learning from scratch. Also, most beginner's guides are full of directions and facts, but have no real-world examples. Usually, you get a 3 line example and that's it! Something like this should help beginner's to understand by showing what's wrong in a real programming example.

  24. Antipatterns? by blirp · · Score: 2
    Antipatterns is probably the dumbest word ever. It's supposedly showing how you do something the wrong way. Well, there are a gadzillion ways to do something the wrong way! Do we really want to focus on those?

    Anyways, the book shows a bad way, then corrects it. Much like any "optimizing" books of the 1980's. It seems that the book with a little effort could provide patterns instead, mainly by focusing on the solutions instead of the problems.

    M.

    1. Re:Antipatterns? by Anonymous Coward · · Score: 0



      "Antipatterns is probably the dumbest word ever. It's supposedly showing how you do something the wrong way."

      It's called a "crime and punishment approach" and it also works well in chess books for instance.

    2. Re:Antipatterns? by Anonymous Coward · · Score: 0

      Well, there are a gadzillion ways to do something the wrong way! Do we really want to focus on those?

      If we keep doing them over and over, then hell yes. Some books don't even point out a solution (e.g. Death March), just principles to follow to try and avoid those wrong ways.

      Yes, tapdancing on your LCD screen is probably a wrong way to do something, but it's not something we do a lot. Antipatterns like Stovepipe (lack of reusability as modules API's drift apart), OTOH, happen all the time

    3. Re:Antipatterns? by jag164 · · Score: 1

      Half right. A full antipattern shows how to do something wrong(or recognize when something is astray) AND a *suggested* solution that has worked in prior situations.

      Why would you use them?
      * Training programmers/designers.
      * Dead project autoposies and resurrection. Project gets brought back to life, why did it die in the first place. (amazing the shit some consulting companies produce)

      Antipatters, like patterns, are good to know and understand but must never be used religiosly.

    4. Re:Antipatterns? by dossen · · Score: 1

      I'm just guessing here, but the antipatterns are likely of the same origin as the patterns you ask for, the experience of a lot of good programmers. You are right in stating that there are many ways to get it wrong, but it is my impression that there are errors that are made more often than others. If this book does capture these common errors and point out where they failed and why, then I think it could be very useful.

      What I'm saying is; don't look at the individual errors, look at the common traits in many related errors. Just like a pattern is not a solution to one specific problem, but what's common among many good solutions to many problems.

    5. Re:Antipatterns? by BitterJava · · Score: 1

      You miss the point entirely. Antipatterns are all around us. Learning to analyze and correct (refactor) systemic problems makes you a better programmer. Advanced programmers learn this from experience. Intermediate programmers can become advanced either by repeating mistakes, or reading about mistakes of others.

      The Java community has already embraced design patterns...they are everywhere. I recommend Floyd M.'s book on EJB design patterns. The Java community has only loosely recognized antipatterns. I think that's a mistake.

      Other industries, most notably manufacturing, use antipatterns extensively. Think about programs like Zero Defects or Quality Circles that strive to recognize and correct systemic problems. Manufacturers use design patterns (like just-in-time), but they also recognize the need for antipatterns.

      Think of antipatterns as a way to correct what's wrong, and design patterns as a way to do things right the first time. In short, different needs for different tasks.

      Bruce Tate, author of Bitter Java

  25. A T*roll.... by WetCat · · Score: 0, Troll

    The best antipattern to java:
    DO NOT USE JAVA!
    It's ugly and slow.
    Even C# with .net is better - it allow people to use whatever language they want on the same CLI...

    1. Re:A T*roll.... by Tomy · · Score: 1
      Even C# with .net is better - it allow people to use whatever language they want on the same CLI..

      As long as the language they choose is statically typed. I haven't seen too many dynamically typed languages sucessfully ported to DuhtNet.

    2. Re:A T*roll.... by ManicGiraffe · · Score: 1

      Even C# with .net is better - it allow people to use whatever language they want on the same CLI...

      Uhh...how again does C# allow you to use any languae on the CLR? You just specified the language.

      And even then, that's not true. The CLR (pronounced VIRTUAL MACHINE for all you Java folks) allows only C#, Visual Basic.NET and M$ flavors of C++ to be complied down to a common intermediate language (pronounced BYTECODE for the the Java guys). They even had to badly hack VB and rip off Java to do it. Sure, you could write a compiler to turn Java or COBOL or Fortran or god knows what else in the common language, but frankly, I doubt many will bother. It's only fast because M$ has the ability to tailor the entire OS to the .NET framework. CLR is not the magic bullet we're looking for, and you don't get "any language you want". You get three, two of which are questionable.

      I know, a bit off topic, but I can't stand pointless shilling for .NET simply because it's new.

    3. Re:A T*roll.... by WetCat · · Score: 1

      But for JVM you have NONE! Except for Java, of course (cheesy smile).
      It produce program managers that allow only Java
      in their installations, regardless of the task.
      A task can be as small as 10 words in Prolog... but... "We are working JAVA"...

    4. Re:A T*roll.... by Anonymous Coward · · Score: 0

      That's a cracking troll and I almost fell for it.

    5. Re:A T*roll.... by sqlrob · · Score: 2

      Hmmm...
      Pascal
      Scheme
      Python

    6. Re:A T*roll.... by Electric+Monk · · Score: 1

      Actually, you can program in any language you like - just compile it an hook it into Java via JNI. Maybe not quite as simple as the .NET CLR promisies to be, but there y'go. Java servers use this trick to increase their performance by using native file I/O etc.

      WTF has Prolog got to do with this? You ever try running Prolog through the CLR? No, thought not.
      Besides Prolog can be hooked into Java if you want anyway.

    7. Re:A T*roll.... by T-Punkt · · Score: 1

      Erm, no. The JVM works on byte code. You can compile any language to Java's byte code if you have the right compiler - and there are quite a few. Currently there are solutions for about 160 programming languages (number is from that page, I haven't counted them) --- including Prolog.

  26. I hope more people read this... by sahala · · Score: 2
    ...in addition to all those "Learn Java in 21 Amazing Days" books.

    Java is often pitched as being a breeze to learn. And it is relatively easy since things like memory management is taken care of for you and the libraries tidily abstract a lot of details for you.

    But I've seen a lot of budding Java programmers program away with little awareness for what's going on in terms of efficiency and good system design, and this book seems to address these qualities well. Just because Java's slightly easier to program doesn't mean that programmers can be clueless.

  27. Dunno about this... by BrokenHalo · · Score: 1

    I still find I really prefer the taste of FORTRAN :-) OK, I admit it, I've dated myself by saying that, but who cares? :-)

    1. Re:Dunno about this... by Anonymous Coward · · Score: 0

      my dad took FORTRAN in college :)

    2. Re:Dunno about this... by RexRuther · · Score: 1

      Just to let you know, FORTRAN is still in use today on many projects. I have used it to update an old mainframe engineering program to the PC.

      It's very fast and designed for crunching numbers. Perfect solution for the right problem.

      --
      -"The early bird catches the worm, but the late bird sleeps the most"
    3. Re:Dunno about this... by Anonymous Coward · · Score: 0

      Almost all thermal modeling programs used at JSC are in FORTRAN. Working with a code base with forty years of modifications -- now that will put hair on your chest.

  28. Simple, stupid but not efficient by Latent+Heat · · Score: 1
    I think the point is that the simple, stupid (i.e. clean) use of objects in Java can make it slow.

    Roger Session (COM and DCOM: Microsoft's Vision for Distributed Objects, Wiley, 1998) (OK, this is from the pre-C# days when MS was going to have you do your GUI in VB, your business logic in the MS Java dialect-du-jour) goes on about "object pools", about how you don't create a new taxi cab everytime you need a ride from the airport.

    I always wondered, what is so expensive about object creation anyway, and in C++ with "auto" objects, it is just about free. Java object loading, however, is expensive because unlike C++, they do not use a static VTABLE but have to check character string names against what is in the object. Java object loading is what makes you sit there twiddling your thumbs when an good sized Java app fires up.

    So, to optimize a Java app, one has to leave clean, textbook OO behind and resort to tricks like OO's that "lazy load" classes as they are needed instead of at application start time, like the use of "object pools" to create object instances once and keep reusing them.

    The word on the street is that Java is dog slow unless you optimize, it is slow because of class loading, and the way you optimize is that you use object creation sparingly in your inner loops, even if it makes your code look ugly.

    1. Re:Simple, stupid but not efficient by Glock27 · · Score: 3, Informative
      I think the point is that the simple, stupid (i.e. clean) use of objects in Java can make it slow.

      No, the over-engineering of code with too many layers and overly complicated object heirarchies are much more likely to be the culprit.

      Roger Session (COM and DCOM: Microsoft's Vision for Distributed Objects, Wiley, 1998) (OK, this is from the pre-C# days when MS was going to have you do your GUI in VB, your business logic in the MS Java dialect-du-jour) goes on about "object pools", about how you don't create a new taxi cab everytime you need a ride from the airport.

      Yes, that is a good example where the Factory pattern along with object recycling is useful.

      I always wondered, what is so expensive about object creation anyway, and in C++ with "auto" objects, it is just about free. Java object loading, however, is expensive because unlike C++, they do not use a static VTABLE but have to check character string names against what is in the object. Java object loading is what makes you sit there twiddling your thumbs when an good sized Java app fires up.

      You are confusing 'class loading' with 'object creation'. Class loading typically happens once for many object creation events.

      Auto objects in C++ come off the stack, whereas Java objects are always allocated from the heap. However, current Java implementations are very fast at object creation, and you never blow stack with Java objects. ;-)

      So, to optimize a Java app, one has to leave clean, textbook OO behind and resort to tricks like OO's that "lazy load" classes as they are needed instead of at application start time, like the use of "object pools" to create object instances once and keep reusing them.

      Um, that is 'textbook OO'. BTW, 'lazy loading' was around long before Java...it's been used for years in the VB community.

      The word on the street is that Java is dog slow unless you optimize,

      The word on the street is wrong, then. Modern Java is quite fast on typical 'first blush' code.

      it is slow because of class loading,

      Class loading mainly effects application startup time. It is a fallacy to confuse 'startup time' with 'execution time'. Many of my apps stay up for days at a time...startup time just isn't an issue.

      and the way you optimize is that you use object creation sparingly in your inner loops, even if it makes your code look ugly.

      Interestingly, this is also a good way to optimize C++. ;-)

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
  29. Re:Mm.... Bitter java... by Anonymous Coward · · Score: 0
    That's how I like it. Nice and bitter. And strong

    .....Just like your men.

  30. In other words - programming is hard! by putaro · · Score: 2, Interesting

    So, if you write a system that runs across multiple servers you can end up with a poorly performing system if you don't know how to separate functionality out properly. From the Unix Hater's Handbook:

    If C gives you enough rope to hang yourself, then C++ gives you enough rope to bind and gag your neighborhood, rig the sails on a small ship, and still have enough rope to hang yourself from the yardarm.

    I would say that Java shortens the rope but then lets you hook it up to a power winch. Modern toolkits and languages are really powerful. Being able to write a distributed application so easily that YOU DIDN'T NOTICE HOW DAMN MANY CROSS SERVER CALLS YOU WERE MAKING is pretty amazing. On the last large project I did we used Java and I noted that Java made locking so easy that we swept right past the easy locking problems (like, did you remember to release the lock) and straight into the really nasty ones. I think that going beyond "Learn Java in 21 Days" into how to break your functionality out properly is a wonderful topic for a book but the gratuitous swipe a Java doesn't seem useful. Just remember, "Power tools for power fools."

    1. Re:In other words - programming is hard! by Anonymous Coward · · Score: 0

      Those languages even let you shoot yourself in the foot.

  31. Re:Mm.... Bitter java... by Anonymous Coward · · Score: 0

    >>It's quite possible in C++ (and presumably other OOP languages) to write a class with an interface that would make Stroustrup proud but that runs like me before my morning coffee.

    Yeah and it's in libcomplex.a. Real life experience calculating some quantum mechanical wave functions that are heavy on the complex --- re-code critical sections in c avoiding c++ complex and you can buy yourself 1.5 orders of magnitude in execution speed. Moral of story: temporary objects bad.

  32. Nothing more to see here. Move along. by Innominate+Recreant · · Score: 2
    Call me jaded, but do we really need another book explaining that it's possible to poorly design an OOP solution, or that not every problem can be solved with some implementation of an OOP tool - be it Java, C++, C# or B_Flat?

    Quoth the reviewer:

    If you're a hired codeslinger creating J2EE applications or servlets, then this is a good book for your shelf.
    If you're a hired codeslinger creating J2EE applications, shouldn't you already know how to create a scalable application and whether or not Java beans/servlets is correct tool or methodology for the problem at hand? It seems that this book should be recommeded more for Java newbies (which is fine) than Java veterans.

    <DISCLAIMER>I am not a Java programmer, but I am a grizzled veteran</DISCLAIMER>

  33. Blame Colleges by Anonymous Coward · · Score: 1, Insightful

    Te overuse of OOP stems from the shift in the american education system from the late 1980's on. In the good 'ol days, programmers for the application world could learn how to do things as a tradesman, but now everyone has to go to college. The result is that people graduate with CS degrees that have no idea how to do things that are not for academic exercices, and some people just don't know how to do anything. So they make giant OO classes that have worthless getter and setter methods for fields that do not need to be accessed, and other worthless crap that they teach you nowadays.
    I say down with CS because daddy said it was a good idea.
    The world needs less CS graduates and more people that are compitent in the field.
    If you don't like this because it describes you, good I hate you.

  34. Over-Design by supercytro · · Score: 2, Insightful

    One the problems with OOP is that systems tend to be over-designed and overly-abstracted out. Whilst the result may be elegant, what generally results is a convulated solution which requires a lot of work to utilise practically and efficiently. However, this in no way means OOP is 'flawed'; merely that experience and intelligent design is required instead of applying OOP as a magic bullet or as some systems are applied, a magic rocket.

  35. Re:mmmmm... Money.. by lukew · · Score: 0
  36. A book on real world programming by jmertic · · Score: 1

    Finally, someone looks at OOP in a real world light. So often in books/classroom they push these ideas into your head so much that you forget about the real world constraints of using them. This book appears to bring those to life. This looks like a must read for any CS student looking to get another viewpoint on OOP.

  37. OO toolkits & templates by reachinmark · · Score: 2
    The object-oriented toolkits are too easy to use dangerously. So what is the solution?

    At least in the world of C++ you do have the STL - hard to use, but hard to use dangerously. I think that templates are a somewhat undervalued addition to OOP - they allow for an extra level of abstraction(?) without the penalty of slower code.

    1. Re:OO toolkits & templates by boltar · · Score: 1

      Templates are more trouble that they're worth. To make them useful you have to keep the code type
      neutral the whole way through , and how easy is that to do unless you use an horrendous amount
      of operator overloading everywhere so making the code nigh on impossible to trace? Templates have
      their uses but they can be the kiss of death of a project if overused as people simply can't follow
      what the hell is going on.

    2. Re:OO toolkits & templates by rreyelts · · Score: 1

      I have to disagree with you there. There are many nuances to the C++ standard library that make using it correctly much tougher than naively expected. Take a read through Scott Meyer's Effective STL to get a taste of the reasons why even experts have had a hard time using the standard library correctly.

    3. Re:OO toolkits & templates by allanj · · Score: 2

      Actually, STL (and to a large extent, templates themselves) represent a fundamentally different programming *paradigm* than OOP. It's called generic programming, and has quite a number of uses. And yes, I do agree that they make a good addition to OOP, but in reality they represent the inclusion of a whole other programming paradigm to C++. Personally, I think it's way cool and useful, albeit a bit complicated to use.

      --
      Black holes are where God divided by zero
    4. Re:OO toolkits & templates by MountainLogic · · Score: 2

      Templates and all are way cool and I often find myself wishing Java had them, but what is the performance hit to using them?

    5. Re:OO toolkits & templates by allanj · · Score: 2

      Uhm, compiler dependant?


      Seriously, you *may* pay a penalty for the compilers lack of intelligence when dealing with templates, but that is more than made up for by the fact that the STL code itself is *damn* good and efficient. My point is that you could probably hand-code better performing stuff yourself (I like to think that I can, anyway :-), but it would likely either take a long time or miss one crucial feature in most OO languages - strict type rule enforcement. Using the STL you get proven implementations AND type safety thanks to the template system (and the compiler, mind you) doing the tedious bits. Kind of like a tiny part of the huge library in Java, but with type safety C++-style.


      Occasionally, I roll my own templates - not too often, but it happens. Great modelling feature for something that is practically the same except for the type involved.

      --
      Black holes are where God divided by zero
    6. Re:OO toolkits & templates by Anonymous Coward · · Score: 0
      JSR 14 (which adds generic types to Java) has finished its public review period, though goodness knows what the authors are doing, not getting on with the next stage.

      Speaking as an old StandardML hacker, programming with generic types (which is what is proposed) is pretty easy to use and helps you write and reuse code, whereas OO code reuse is one of those nice myths that doesn't withstand the blowtorch of practical programming (though it is a nice way of building the types that you run through your generics system.) Of course, you also want a scripting language for the high-level stuff in the app so practical stuff like dynamic reconfiguration isn't too painful (even VB <FX: spits> or whatever JavaScript is called these days is better than nothing,) but that's another matter...

    7. Re:OO toolkits & templates by Tablizer · · Score: 2
      Actually, STL (and to a large extent, templates themselves) represent a fundamentally different programming *paradigm* than OOP. It's called generic programming, and has quite a number of uses. And yes, I do agree that they make a good addition to OOP, but in reality they represent the inclusion of a whole other programming paradigm to C++. Personally, I think it's way cool and useful, albeit a bit complicated to use.

      Although I personally don't like C++, it does have the ability to relatively easily be multi-paradigm: procedural, OO, generic, functional, etc. (The only thing it can't really be is dynamic/scriptish.)

      This, I believe, will keep C++ around perhaps longer than Java. Java represents the peak of the "OOP is THE paradigm" style bubble of the mid 90's. When people finally realize that OOP is just one credable[1] paradigm among many, then C++ will have an edge over Java.

      [1] I personally don't like OOP. It is counter to how I think and counter to how I view that the real world changes over time.

  38. Over engineered... by f00zbll · · Score: 1
    Every programmer has done it at one point. Making sure those lessons are cemented into one's head is much harder than it would appear. The balance between strict adhearance to OOP principles and practicle designs is more of an issue of scope negotiation with management. Lots of OO projects fail because the scope and requirements fluctuate wildly. Lots of projects fail for that reason. It's not unique to OOP. By virtue of OOP dominance, there's going to be more failures than other languages that are used less or used in environments where requirements are more stable.

    Take for example writing serial driver. The functional specs are finite and limited by the hardware. Building a business application is influenced by what sales, marketing, management, QA, programmers and customers think is important. Don't mod me up or down, since this is freakin common sense.

  39. There is one universal law by Anonymous Coward · · Score: 0

    Speed
    Size
    Cost

    You may choose only two.

  40. there was an island between Sumatra and Bali... by danny · · Score: 4, Funny
    The island that used to exist between Sumatra and Bali seems to have been wiped off the Net... At least, I went through the top 200 results of a Google search for "Java" a while back without finding any pages about it and, while some of the 1294 books at Amazon must surely be about the island, none of them make it into the first 200 results.

    Danny (who plays gamelan and is interested in Indonesia).

    --
    I have written over 900 book reviews
    1. Re:there was an island between Sumatra and Bali... by Heironymus+Coward · · Score: 1
      The island that used to exist between Sumatra and Bali seems to have been wiped off the Net... At least, I went through the top 200 results of a Google search for "Java" a while back without finding any pages about it and, while some of the 1294 books at Amazon must surely be about the island, none of them make it into the first 200 results.

      this is just another example of Gresham's Law. bad currency tends to drive good currency out of circulation.

      look at how the term "RPG" has changed in just the last ten years...

    2. Re:there was an island between Sumatra and Bali... by Eccles · · Score: 1

      there was an island between Sumatra and Bali...

      That sounds like the start of a limerick.

      There was an island between Sumatra and Bali,
      Whose natives were exceedingly jolly,
      'Cuz those Polynesian lasses,
      Had callipygous asses,
      And just loved to suck on a lolly.

      --
      Ooh, a sarcasm detector. Oh, that's a real useful invention.
    3. Re:there was an island between Sumatra and Bali... by Tablizer · · Score: 2

      I wonder what would happen to the language if it was discovered that Java, the drink, was discovered to cause cancer.

      Or, if Java, the island, was ceased by Osama Bin Laden (carrying a few ex-soviet nukes).

      It would be like creating a popular language called "Aids" in say 1977.

  41. Way to proof-read by Anonymous Coward · · Score: 0

    Tate's approach is looks a bit different

    Nice to know someone bothers to proof-read this stuff before posting it on slashdot.

  42. Not to rain on your parade... by Anonymous Coward · · Score: 0

    I am very skilled at HTML programming, one of the most challenging languages out there!

    HTML is not a programming language. Ever try to implement a double-linked list in HTML?

    nuff said!

    1. Re:Not to rain on your parade... by Anonymous Coward · · Score: 0

      Another one missed the cluetrain...

  43. Mistaken by Codex+The+Sloth · · Score: 1

    While it's true that there are an infinity of bad ways of doing things, Anti-patterns is about the most common way of doing things badly (Patterns are about the optimal way of doing things). In particular, it focuses on things people do wrong (commonly) that seem like good ideas -- typically an solution to the design problem is also offered.

    If anything, Anitpatterns are more useful than patterns.

    --
    I am not a number! I am a man! And don't you ... oh wait, I'm #93427. Ha ha! In your face #93428!
  44. Modding by hendridm · · Score: 1

    How did this troll get modded up? Why don't you mod up the Recipe Troll while you're at it (browse at -1 for details).

  45. Re:Mm.... Bitter java... by TWR · · Score: 2
    I've got the book. Just bought it last week; it's very good.

    It is pretty Java-specific (there's a chapter devoted to JSP, for example), but in the memory leak chapter ("Bitter Memories"), he covers the C++ memory model, as a comparison to the Java one.

    If you are capable of understanding the meta-pattern, then "Bitter Java" is useful for non-Java developers. The JSP examples could certainly apply to any HTML scripting language (the horror of seeing bad ASP programmers converted into even worse JSP programmers is something that should be outlawed).

    BTW, there is an associated web site: www.bitterjava.com.

    -jon

    --

    Remember Amalek.

  46. Thinking in Java by garoush · · Score: 5, Interesting

    The best Java book that I have seen so far is "Thinking in Java" by Bruce Eckel. Here is why.

    While Mr. Eckel's book does covers the syntax of the language (java in this case) et. al, it also cover the meaning of the language and most of all, it covers how to think in the language (hence: the title).

    Almost any developer can pickup a language and become knowledgeable with it by working on one or two projects. However, being *proficient* at your domain, and understanding coding-principles of the language for your domain, and understanding the business of being a programmer is much more difficult goal to achieve -- only time, experience, and dedication will ever get you there. It is this quality that I look for first, the knowledge of a language comes third.

    Here is a link that I point people at to high-light my point: Chicken Soup for Your Modeling Soul -- I specially like item 21: "A fool with a tool is still a fool".

    --

    Karma stuck at 50? Add 2-5 inches.. err.. 2-5x Karmas Count to your pen1es.. err.. Karma all naturally and private
    1. Re:Thinking in Java by MarvinMouse · · Score: 1

      Well, I think this is a very appropriate statement. Far too many people cannot think in the OOP world, and thus end up with very convuluted code that is a pain to debug, and fix.

      Now, I will admit that I haven't read this book that was reviewed, but from the review it sounds like it is rejecting the number one thing I have learned from my courses in CS: No matter what you code, make sure it is easy to read for other programmers, and easy to change. This axiom is vital to proper programming as it allows other programmers to more easily use and re-use your code as well as future developers to debug/expand your code (which they will do.) If this axiom is not followed properly, it becomes hellish to work with the convuluted code that develops (from each individual programmers "antipatterns").

      "Patterns" and OOP languages make this easier to do, when you follow proper practices. This is because the languages allow a more natural flow of concepts and ideas and when one thing needs to be changed, less modifications are needed and it is more obvious where the changes are required.

      Sure, if we wanted to, we could all stick to ASMBLR code and really make uber-efficient programs (I know, I know, compilers can program quality ASMBLR as well.), but the key this is not that these high-level languages were created for efficient code, they were created for efficient development. Or for the fun of things, we could all program in Scheme or Lisp, but would the development time really be an efficient use of our time? (Personally, I love Scheme)

      When your learn to "think" in Java or C++ or any other OOP language, these development methods become easier to implement and easier to program.

      This is all of course IMHO.

      .....Marvin Mouse.....
      (Math, CS, Physics, Psychology Undergrad)

      --
      ~ kjrose
  47. You must be joking by boltar · · Score: 1

    Functional programming is completely non intuitive, is bad at being able to represent
    real worl problems in that the code bloats to as horrendous sphagetti mess (yeah , I'm sure
    those collage lab examples were great , but it isn't that neat in the real world) and most
    functional languages run at the speed of recently kneecapped tortoise. Declarative languages such
    as Prolog were touted decades ago as the saviour
    of us all, how many places do you find them now?
    The only survivor is SQL and that gets bit tacked on it to make it procedural and hence usable
    outside its natural enviroment of a database.
    Functional languages are another seemed-like-a-good-idea-at-the-time dead end IMO.

    1. Re:You must be joking by Patrik+Nordebo · · Score: 2

      Neither Prolog nor SQL are functional languages, so using those as examples is rather silly. I'd like to know where you'd see SQL outside of databases, seems it would be rather a bad language for anything else (though I don't know much about SQL99, maybe the standards committee had delusions of grandeur).
      There are a number of functional languages with quite respectable performance in good implementations, e.g. O'Caml, Standard ML (MLTon, smlnj), Scheme (bigloo, stalin for certain applications), and (though less functionally oriented) Common Lisp (CMUCL/SBCL, ACL),. They may not be quite as good as good C/C++ compilers, but they're not that far behind, either.

  48. Good things are hard to do by gelfling · · Score: 2

    "We do this thing and the other not because they are easy but because they are hard."

    - JFK

  49. Anti-patterns in 1998 by fingal · · Score: 5, Informative

    If folk are interested in the concept of modelling the "wrong" way to do things then I would also recommend reading Anti Patterns - Refactoring Software, Architectures and Projects in Crisis by William H Brown, Raphael C Malveau, Hays W "Skip" McCormick III & Thoma J Mowbray (ISBN 0-471-19713-0).

    This takes a slightly higher level look at the whole management of coding projects (although a lot of the patterns that are desribed are equally applicable to the low-level coding structure) and looks at common fallacies that are used by many teams as the "correct" way to do things. A knowledge of common mis-conceptions that have been proven not to work in the past (except in certain clearly defined "special cases") is invaluable in being able to spot the nascent structures before the get set in stone and the cost of re-factoring the structures becomes higher than the cost of living with them.

    Finally if people really want to get into this field I would also recommend Death March: The Complete Software Developer's Guide to Surviving 'Mission Impossible' Profects by Edward Yourdon which, if nothing else, serves as very reassuring purely from the fact that you know that many many other people have to deal with similar situations when project management goes really bad.

    Finally as food for thought for those posters who stated above that patterns (and specifically design patterns) are not useful, I'll take the liberty of quoting the preface to Anti Patterns:-

    AntiPatterns are fun to read and discuss with firends. But get serious! This book is about the truth of software technology and development. In it, we define what's really hapening in technology and on software projects, and what you can do about it. AntiPatterns identify those bad design concepts, technical approaches, and development practices that lead to poor-quality software and project failure. This book also explains how projects identified and avoided these problems to improve their designs and practices for software success.

    Can you handle the truth? The truth is surprisingly hard to comunicate, and often regarded as politically incorrect and undiplomatic. The truth does not make everybody happy. In order to make this exposition of our industry palatable, we resort to comedy wherever feasible; and it has been said that comedy is the most serious tragedy. The truth is that the state of software engineering today is a tragedy: Five out of six coprporate development projects are considered unsuccessful. [Johnson 95]. Most software systems that are delivered fall far short of the desired features and virtually every system is a stovepipe, unable to accommodate changing business needs.

    In trying to explain this universal lack of software success, we came to the conclusion that there are many more AntiPatterns in practice than design patterns. In Internet time, technology is changing so fast that the design patterns of yesterday are quickly becoming the AntiPatterns of today....
    --

    The only Good System is a Sound System

    1. Re:Anti-patterns in 1998 by Anonymous Coward · · Score: 0

      I just finished death march and the only ones I would recomend it to is those who are new to the software-development-project-team thing (like me) and want to know the signs things are getting ugly. The book offers very little (read:two) actual advice on how to solve or at least survive the mentioned problem situations and practically every chapter end with a summary wich basicly explains how everything you just read is only relative and how the advice may actually be of no help whatsoever on your particular situation...

      If you are in panic about your project, stay away from this book, you dont have the time If you want to know if you should panic about your project, get it!It does offer more help for the project managment people who should consider this one but after reading it you might want to consider other career options like profesional wresteling or anything involving sharks or snakes.

      An really quick hint is the software developer bestiary

    2. Re:Anti-patterns in 1998 by jsse · · Score: 2

      I studies Patterns. If I read this book then two opposite knowledge will cancel each other and left my brain with nothing but blot of stray energy emmitted as a result of knowledge cancellation....

  50. Re:Nothing more to see here. Move along. by billtom · · Score: 1

    No personal offense intended, but I'm always a little worried by people that think that they don't have anything more to learn.

    You're probably right in that, if you're a professional programmer, you should probably know most of the stuff in this book.

    But also, I'd be very surprised if there weren't several new ideas as well. Just because you're making money programming doesn't mean that you know everything. People tend to get into habits and don't look around for better ways.

  51. Ocaml by jhujoe · · Score: 1

    If you consider a language like OCaml, I think you are presented with the best of both worlds. It is a language that is functional "in spirit" in that you can have such things as anonymous functions, partial function application, etc., yet it also keeps the ability to utilize state when necessary. I believe "when necessary" is the key phrase -- it is certainly a GOOD idea to minimize state in your programs. Try writing a language interpreter in a non-functional language. Good luck.

    1. Re:Ocaml by boltar · · Score: 1

      I;ve written a couple , both in C. It was hard bu t doable. I would have a first clue how to do it
      in a pure functional language. If a language can't represent a finate state machine its
      bloody useless for writing intepreters.

    2. Re:Ocaml by PissingInTheWind · · Score: 1

      I've done one in Scheme, and it was a breeze compared to doing it in C. And you can represent a DFA pretty easily in a functionnal language, don`t worry about that.

      --

      A message from the system administrator: 'I've upped my priority. Now up yours.'
    3. Re:Ocaml by Norge · · Score: 1

      I've written a compiler in Java and a compiler in SML (a language in the same family as Ocaml) and I promise you that it was MUCH easier in SML. And I didn't even have to use the imperative features in the main body of the compiler code.

      If you are curious, I highly recommend Bob Harper's introduction to SML. If you read it with an open mind, it will open you up to a whole new world of programming. http://www-2.cs.cmu.edu/~rwh/smlbook/

      Benjamin

  52. Re:Mistaken? Nope by blirp · · Score: 2
    Anti-patterns is about the most common way of doing things badly (Patterns are about the optimal way of doing things)


    Patterns are about balancing and rearranging opposing forces in a design to achieve some wanted effect. All patterns have consequences. These usually must be dealt with by other patterns. And thus you have a pattern language. In this setting anti-patterns makes absolutely no sense at all.

    M.

  53. As a CS senior who will be graduating next week, by jhujoe · · Score: 1

    I fully agree with you. 80% of my classmates couldn't write decent code if their life depended on it.

  54. Sample chapters by jacoplane · · Score: 4, Informative

    There are some sample chapters available on the book's website

  55. Re:Design patterns and Lisp by jaoswald · · Score: 5, Insightful

    It's not that every Lisp program has a different design, any more than every machine has the same design; however, in Lisp, there tend to be fewer obstacles to expressing a particular program design in the language. There are a wide range of reasons for that.

    One is the pervasive nature of intrinsic typing. Variables are not typed, values are. Object-oriented methods, of course, explicitly mention classes, but non-OO code does not need to explicitly type variables, except to improve performance. The flexibility of many built-in Lisp operators helps deal with multiple types transparently. For instance, length of array, length of a string, and length of a list all use the same function: LENGTH.

    Another source of flexibility is Lisp macros, which can use the full power of the Lisp programming language to rearrange and process Lisp macro calls into Lisp code. If there is some design pattern that Lisp does not natively support, you can use Lisp macros to create a Lisp "dialect" that cleanly expresses the design.

    Paul Graham, in his books, demonstrates, for instance, that if Lisp did not already have CLOS to express object-oriented concepts, that in about a hundred lines of pretty clean Lisp macrology, you can add single-dispatch methods to the language, and it looks just like "real" Lisp, and mixes with the base language transparently.

    It took Stroustrup a large effort (cfront) to add objects and methods to C, and it requires explicitly invoking a compiler program to do the translation, with name-mangling and everything else. In Lisp, you would write Lisp macros to do the same thing, and you would still be working in true Lisp. You can also add macros on macros: cfront is basically a monolith, but Lisp macros can work together; you can continuously "build up" from the language foundation, and the various layers can be overlapped.

    Any time you find yourself repeating a pattern, it suggests a Lisp macro. If you have an example of the pattern already written, it is pretty much cut-and-paste to create the general macro from the specific pattern instance.

    That kind of flexibility, which allows the programmer to mold the language to fit his (and his tasks) needs, is really what makes Lisp great to work with.

    It's something like the difference between working with Legos and clay. If you're missing a Lego part to serve a particular function, you're pretty much stuck, unless you want to injection-mold your own custom blocks. Therefore, Lego models tend to use "design patterns" where the standard blocks or parts fit together a certain way that solves a certain class of problems. Lego models, although they can be amazing achievements, all tend to look like Lego models.

    With clay, however, the medium is fluid. You can mold it to just about any shape you want. Sculptures usually look like their subject, not like clay.

  56. ADA, ADA, ADA ,ADA by gricholson75 · · Score: 1

    I really like ADA, not ADA95 with objects either. Good old ADA83 , MMMMMMMM, yummy.

  57. Re:Mistaken? Nope by Anonymous Coward · · Score: 0

    Oh, we're all so sorry to offend you're delicate semantic sensibilities.

    Would you be happier with "common design mistakes to avoid and why they are flawed"?

  58. Also _Effective Java_ by melquiades · · Score: 3, Informative

    Another really superb book is Effective Java, written by Josh Bloch, who is responsible for the Java Collections API.

    It's definitely not a book for beginners; it's more of a style guide for API design in Java. It fills a gap between the very abstract world of patterns and the low-level syntax of the language. For example, it gives a several-page exposition of the contract of equals(), which was eye-opening even to this fairly experienced Java programmer.

    And ... it's superbly written. Bloch's prose is crisp, clear, and gets right to the point. It is, in fact, my favorite book devoted to a single language since K&R.

    1. Re:Also _Effective Java_ by gammoth · · Score: 1

      Just what I was going to post. Effective Java has given me new strategies, affirmed some of my practices, and addressed many of the coding issues that I have been facing for years.

      Recommended reading for intermediate to advanced programmers (except those of course who emit light from their bum).

    2. Re:Also _Effective Java_ by jsse · · Score: 2

      My take is Java Pattern. I can always find good online tutorials on Java but the related topic in this book is rarely found.

  59. Re:help! by Anonymous Coward · · Score: 0

    You probably had a DRI driver in the old kernel config that you did not select in 2.4.15. Also the Nvidia drivers from www.nvidia.com must be installed on a per kernel basis.

  60. Inheritance is overrated by irritating+environme · · Score: 1

    I would argue the single most overused aspect of OOP is inheritence. I think it is well used if intelligently used in API sets such as Java, but the code that results from 5-deep levels of inheritance can be practically unreadable. Functions can be defined in any of five different levels, plus !OOPS! it happened to be overrided at level #3, changing its behavior. It seems that designing an heirarchical inheritance structure that accomodates all future uses of the objects is next to impossible on the first run, and probably on the second (look how much java has played with its structures). In java, I'm a one-trick pony with interfaces. I define interfaces for behavior, and leave inheritance to the dogs and java API developers. Helps out a lot with simple extensibility of systems. Class.forName() - manna from heaven! But maybe that's just me.

    --


    Hey, I'm just your average shit and piss factory.
    1. Re:Inheritance is overrated by Anonymous Coward · · Score: 0

      I'd add designers are overrated. people who cite the square vs. rectangle thing as their best example when asked about inheritance or polymorphism should not be allowed to design OO systems. a designer should not begin with the abstract, but with specifics, with actual working implementations, and then attempt to generalize, creating a tree above as necessary. you make abstractions from reality, not reality from abstractions.

    2. Re:Inheritance is overrated by Tablizer · · Score: 2

      What *is* a good use of inheritance for biz app modeling? I have never found any.

  61. Re:OO and functional by jaoswald · · Score: 5, Insightful

    OO and functional are not opposing concepts. Also, you may have missed the subtle point, but Lisp is not a strictly functional language, although it is obviously function-oriented.

    Lisp has a full-blown object system called CLOS (Common Lisp Object System), which frankly blows C++'s object system out of the water, in terms of flexibility, power, and syntactic cleanliness, just for starters. Lisp programmers aren't scared of OO. It's C++ programmers who are scared of Lisp, although why anyone would be less scared of C++ is a mystery to me.

    OO doesn't magically mean "easy to maintain." It may mean "easy to find drones who think they learned the language from a book in 21 days, so they put in on their resume" which I think was your real point.

    To address the original issue, functional designs tend to be much more "factored" than procedural designs, because things are designed to use functional abstraction rather than interactions between different bits of code and variables. This tends to make them much more robust and maintainable.

  62. how about by david_g · · Score: 3, Insightful

    ...bitter about people who decide that one language is all they need to learn and leave the rest of us having to know mediocre programming languages because that's the only way you get a job?

    ...bitter about people who keep buying into marketspeak?

    ...bitter about people who keep developing the same old language, but put some makeup on it so for it to seem different?

    ...bitter about methodologies, because they're set in stone?

    ...bitter about requirements, because they're set in water?

    ...bitter about business because you're just a "resource" to them?

    ...bitter about business programming because it's dull, insignificant, and someone should have already figured out a way to generate all this stupid code since it's been repeated some many times over?

    Heh, whatever, I need to sleep.

  63. Re:Nothing more to see here. Move along. by Innominate+Recreant · · Score: 2
    No offense taken. My point wasn't that experienced programmers shouldn't look for new and better ways to do things - if that were so, I'd still be typing "load foo, 8, 1" on my Vic 20. :-)

    The tone of the review was "Gee whiz, even if you use Java, you can still get it wrong!" That sort of book is very well suited for new programmers. Showing them the wrong way to do something is often as valuable as showing them the right way. But recommending it for "hired codeslingers" seems a bit, well, inappropriate.

  64. Beginners shouldn't read books like this by Anonymous Coward · · Score: 0

    Believe me, reading extra books like this will only slow you down as a beginner. There is a reason that the programs you learn with are three line buggers -- so that you don't get confused.

    Example: I was teaching my wife a little about C++, and she asks what the int main (int argc char **argv) is. Instead of telling her that it is all used to interact with the command line, I try to explain that **argv is a two dimensional array of characters. BAD IDEA! Why should she have to know that to program "Hello World!"? All she needs to know at that point is how to best use those data structures to get at the command line arguments.

    In the same way, all beginning OOP programmers need to know is how objects work, and what inheritance, encapsulation, etc. is. Books like this might ruin you before you start!

    1. Re:Beginners shouldn't read books like this by Tablizer · · Score: 2
      In the same way, all beginning OOP programmers need to know is how objects work, and what inheritance, encapsulation, etc. is. Books like this might ruin you before you start!

      The problem is that people read one or two "Learn X in 21 Days" books, and then try to force all their future designs to resemble the toy animal and shape examples.

      There is rarely a disclaimer such as:

      "Warning: Objects in Mirror Example Are Deceptively Simpler Than Real World Objects"

  65. Re:Design patterns and Lisp by normiep · · Score: 1

    That kind of flexibility, which allows the programmer to mold the language to fit his (and his tasks) needs, is really what makes Lisp great to work with.

    So I take it that in this passage you are just trying to make it absolutely clear that programming is a man's job. ;)

    --

    -- Point? None! Cob.

  66. Thanks for the kind words. by BitterJava · · Score: 5, Interesting

    I'm truly not worthy. You have elegantly and accurately captured the spirit of Bitter Java. I spent a whole lot of time as a Java architect and consultant, and noticed a whole lot of repeated mistakes. Bitter Java is about capturing those mistakes and wrapping them up, so that others can avoid them. I've got a weakness for kayaking, and that comes through (a little too strongly?) in the book. One of my favorite pictures is of a friend leaning against a sign after driving all night, and yawning. We snapped the shot, and then pointed out the words on the sign: "Seven people have drowned here." Of course, after wetting his pants, Eric was about to get in his kayak and run the falls. That's a perfect antipattern. Literary form; concise; points out a negative behavior (playing under the falls), and the decidedly negative consequence. That's Bitter Java. Of course, you've also got to point out how to avoid the negative consequence, and thus the emphasis on refactoring in Bitter Java. I definitely cannot claim credit for creating antipatterns. (Thanks to the reviewer who compared me to Al Gore...priceless.) In fact, one of the authors of the best-selling Antipatterns book, Skip McCormick III, wrote a glowing forward for Bitter Java. Thanks, Skip.

  67. Real programming by gillbates · · Score: 5, Insightful
    The problem with the "Learn To Program in (insert language here)" books is that they don't teach people how to program, but just how to write code in a given language.

    The hardest thing to get across to a Java/C++/VB zealot is that assembly is the most powerful language available. There is no computing algorithm, or programming paradigm that can't be expressed in assembly. I routinely write classes in assembly, and use runtime polymorphism - in fact, correct multiple inheritance is more easily implemented in asm than C++! (fewer lines, no assinine casting...) However, this doesn't mean that assembly language is the cure all for every programming problem. Some problems lend themselves to assembly (like device drivers, OS code), others to C++ (games, applications), and others to Java (web programs). What's hard is convincing people that if they understood the underlying computer science, they could write the code in the language which best suited the particular application, rather than being stuck writing in Java, or whatever HLL is popular at the time.

    Incidentally, I like assembly because of the freedom and power it provides. But I still write in Java or C++ when the needs of the project dictate. Real computer science transcends the language used, as languages come and go. Soon, Java will be outdated, and those who only learned to program in Java will find their knowledge useless.

    What matters is not whether you know langauge X, but rather that you know the fundamental algorithms of computer science and can translate them into any language. If you can break down a task into algorithms, then you can pick the language best suited for those algorithms, and translate the algorithms into code in a trivial amount of time, regardless of which language you use. What too many people miss is the fact that if you can't break a problem down into its fundamental algorithms, or translate those algorithms into an arbitrary language, your days as a programmer will be few, irrespective of how well you know a particular language.

    --
    The society for a thought-free internet welcomes you.
    1. Re:Real programming by Anonymous Coward · · Score: 0

      True enough, and something I used to tell everyone.

      An OO language makes OO principles easier.

      I one wrote a polymorphic funcions in FORTRAN77 with standard VAX extensions (%REF() and %LOC()). It wasn't that easy, but it *was* doable. And it was easier to extend since the OO abstraction was then in the code.

      When you get right down to it, it's ALL macine code.

  68. developerWorks article : A taste of "Bitter Java" by Anonymous Coward · · Score: 0

    Anyone wanting to taste more. Bruce Tate put this article up on IBM developerWorks:

    A taste of "Bitter Java"

  69. Re:Javan coffee by distributed.karma · · Score: 1
    You know, they also grow coffee in Java. The volcanic soil gives the coffee an interesting overtone.

    Which brings us to the question: what is the origin of 'java' in the meaning 'coffee'? Maybe Java's reputation as a coffee producer has something to do with this...

    Oh, BTW, if I wanted to talk about a great multiplatform object-oriented language, it would be Python. Apart from the lack of hype and big-business support, it's no worse than Java.

    --

    --
    If you moderate this, then your children will be next.

  70. Just an observation... by feloneous+cat · · Score: 2, Insightful

    One thing that I noted when I first dealt with the problem of C++ (yeah, the language is a problem, we all know that) - is that everyone was writing these "wonderful" classes and yet, I found that not a SINGLE ONE made writing code that much easier. Oh, it changed the paradigm, but it didn't change the amount of work that had to be done. Far from it: it actually INCREASED work because we had to learn each and every class (which, in that perverse way that programmers are, seldom had much in common).

    "So what", you may say, "just deal with it."

    Well, the problem is not "just dealing" with it - the problem is if classes do not make my life easier, write code faster, write code that fails predictably, then they are in fact failures.

    Part of my history with software is I like to write software that you look at and go "oh, I could have written that". Which is far more difficult than writing code that is hard to understand. "Intuitive programming" is what someone once called it (I forget the brilliant soul who came up with the phrase). C++, much like Java, does not fall into that category.

    Sooooo, it was with much trepedation that I plunged into Objective C. At first, I hated the syntax (and the NeXT/Apple classes). Then, quickly and surprisingly, I learned how rich and powerful it was. Best it really DID make programming easier and fun again.

    But I am back at C++ (ugh). It is again like cutting off both arms and legs and being expected to whip Jet Li's ass. Yah, right!

    OO has been touted as the best thing since sliced bread, yet I have found that for the most part it is like having bread where all the slices are tagged as "virtual" - the REAL slicing still has to be done by yours truly. And to be honest, the tools are still effing primitive. I can't believe that we STILL debug EXACTLY the same effing way we did 20+ years ago (okay, source code debugging makes it easier still, but not significantly).

    Finally, for those who expect Microsoft to save the day, 'bout time to give up on those losers. By the time they get something out and it is being used a LOT, they dump it for the NEXT GREAT THING (and folks see pink slips).

    --
    IANAL, but I've seen actors play them on TV
    1. Re:Just an observation... by lkaos · · Score: 2

      One thing that I noted when I first dealt with the problem of C++ (yeah, the language is a problem, we all know that) - is that everyone was writing these "wonderful" classes and yet, I found that not a SINGLE ONE made writing code that much easier.

      OOD is to C++ as pointers are to C.

      It's a powerful tool if you know what your doing and use it correctly, and when used correctly, no other paradigm can even come close in it's abilities. On the other hand, when used incorrectly, it can destroy a program.

      So what are some good examples of OOD in C++? The STL. The most obvious example is the std::string class. Not only does it eliminate most of the common problems associated with strings, it also manages string growth with *more* efficency than is possible in traditional C. This is because it is not just a simple wrapper around a char *, but a wrapper around many complex algorithms to improve resource usage.

      The STL containers are also wonderful when dealing with places were old-style arrays and link lists would have been used. The containers are interchangable, and when used correctly, typically much faster than any homegrown solution.

      Another huge win for OOD is in threading. Writing multithreaded code in C is a nightmare. Object lifetimes in C++ make the dream a good deal more bareable.

      Lots of the cutting-edge C++ development being done by Boost is just amazing too. Things like Typelists and compile-time asserts add a whole new dimension of programming possibilities.

      --
      int func(int a);
      func((b += 3, b));
    2. Re:Just an observation... by Sir+Robin · · Score: 1

      It is again like cutting off both arms and legs and being expected to whip Jet Li's ass. Yah, right!

      BLACK KNIGHT: Oh, oh, I see, running away then. You yellow bastards! Come back here and take what's coming to you. I'll bite your legs off!

      ;)

      --
      My /. ID is only 5,210 away from Bruce Perens's.
    3. Re:Just an observation... by feloneous+cat · · Score: 1

      Another huge win for OOD is in threading. Writing multithreaded code in C is a nightmare.

      No doubt for some it is. However, having written not one, but two (sadly proprietary) RTOS's, I'm not sure what the fuss is about. Perhaps it is just me, but I find them rather trivial.

      My point is NOT that C++ is a "bad" language (well, okay, it has a few problems [grin]), but that folks get all geared up creating classes, etc. to get around inherent weaknesses that they don't seem to realize that they are making things harder not easier.

      "New and improved" does not mean that what we used previously was "old and lousy". Personally, I have seen OOD and OOP being hyped to death and when push came to shove, they always allocated TWICE as much time as they would have for a project written in C.

      But what do I know, I'm old. If I were Inuit, they would put me on the next chunk of ice and say "ta ta". [grin]

      --
      IANAL, but I've seen actors play them on TV
    4. Re:Just an observation... by feloneous+cat · · Score: 1

      BLACK KNIGHT: Oh, oh, I see, running away then. You yellow bastards! Come back here and take what's coming to you. I'll bite your legs off!

      Actually, I thought about this first, but feared the twenty-somethingers wouldn't have got it (my office-mate didn't [sigh]).

      "Brave, brave Sir Robin, rode forth from Camelot. He was not afraid to die, brave, brave Sir Robin. He was not at all afraid to killed in nasty ways...."

      --
      IANAL, but I've seen actors play them on TV
  71. Very Skilled at HTML prgramming by Anonymous Coward · · Score: 0

    This is why there is a glut of programmers on the market. Everybody and their brother thinks they are going to become programmers because "They Know Computers".

    Exaclty what do your HTML programs do.

    Exactly what do you know "about computers".

    You are an HTML editor, not a programmer. It is a markup language that simply dictates visual layout. You might be a javascript, vbscript, or whatever script programmer,a nd embed that in your HTML, but you aren't an HTML programmer.

    So the porblem is you have all these morons that think they are HTML programmers, that are great salesmen, and charismatic individuals, that sell themselves to a IS department, and keep their jobs, while real programmers, that tend to be less charismatic, sit in the unemployment lines (Not that programmers are inherently un-charismatic, just that the ones that are run the risk of losing their jobs to charismatic morons).

  72. Re:Design patterns and Lisp by Paradise+Pete · · Score: 1
    So I take it that in this passage you are just trying to make it absolutely clear that programming is a man's job

    It's just that English is deficient. There's no genderless pronoun that suits. And don't even try to pass that "one" crap off. Nothing makes a sentence stop dead in its tracks faster than that.

    Other languages don't have this problem. Spanish, for instance, has su. As a bonus, it also doesn't have the "free" ambiguity.

  73. Re:Design patterns and Lisp by Anonymous Coward · · Score: 0

    What a beautiful expression of the Lisp way, and the critical role of macros.

    Those interested in patterns and Lisp should read Peter Norvig's essay on patterns in dynamic languages, notably Lisp. Norvig was a senior scientist at Sun, is now head of reseach at Google, and knows what he's talking about. Non-Lispers will find his thoughts a revelation, I suspect.

  74. Re:Design patterns and Lisp by prizog · · Score: 1

    That kind of flexibility, which allows the programmer to mold the language to fit his (and his tasks) needs, is really what makes Lisp great to work with.

    "That kind of flexibility, which allows the programmer to mold the language to fit the needs of the task, is really what makes Lisp great to work with."

    It's not quite the same, but it's worth making an effort to write in a gender-neutral fashion. IMO, "one" is just fine, but some people are not used to using it and hearing it, so it sounds awkward.

    If you don't agree that gender-neutral language is a worthwhile pursuit, maybe you will after reading Douglas Hofstadter's hilarious essay on the topic.

  75. Put it in H! by Pope · · Score: 1

    Homer: Say, where's this car made anyway?
    Salesman: The country no longer exists.

    --
    It doesn't mean much now, it's built for the future.
    1. Re:Put it in H! by Anonymous Coward · · Score: 0
      That would be the Yugo!

      I'm from the US and have excellent geography skills. Don't paint us all the with same stereotypical brush.

    2. Re:Put it in H! by Lemmy+Caution · · Score: 1

      Hey, it could be a Trabant.

  76. Java != Slow (necessarily) by kaladorn · · Score: 2

    Glock27 (in addition to a catchy sig) has it right. Java is quite fast. It can be made faster by diligent design practice. Sloppy design can result in wasteful object creation/garbage collection and some of the built in class libraries have bad habits (a few i/o streams come to mind) in this regard also.

    Having said that, my company is doing immersive 3D networked technology (which can include FPS games) in Java (with some OpenGL or DX) and we're capable of getting really respectable frame rates even with very busy systems. Part of it is because we allocate once where possible and recycle, rather than continually create and destroy objects. And we avoid some of the utility classes. And we THINK while designing to minimize things like thread counts, class counts, etc. to give quick loading of the app and good performance even on crappy hardware.

    Good Java code is as fast as good C++. Good C might be a bit faster, but most C is mediocre and Java can compete with that. Slow Java code is a result of poorly educated programmers and designers doing unwise things (most of which are utterly avoidable).

    --
    -- Mal: "Well they tell you: never hit a man with a closed fist. But it is, on occasion, hilarious."
    1. Re:Java != Slow (necessarily) by Anonymous Coward · · Score: 0

      This is good to hear, because I've been troubled lately by the incredible slowness of virtually every java GUI development system I've been able to get my hands on. When I try to load Forte or JBuilder Foundation on my laptop (admittedly, it's not a screamer, it's only a 667Mhz Celeron with 96MB or so of ram) it's like, run the program, go get a coffee, come back, wait some more, and so on.

      Out of curiosity, I wrote three "hello, world" apps, one in C++ using C-style printf, one in C++ using qt, and one in java. The java version came up with "Hello, World!" (just a single output statement) in two seconds. The other two came up instantaneously. I don't know how significant this is, but jeez, you know? Seems kind of slow.

    2. Re:Java != Slow (necessarily) by Glock27 · · Score: 2
      This is good to hear, because I've been troubled lately by the incredible slowness of virtually every java GUI development system I've been able to get my hands on. When I try to load Forte or JBuilder Foundation on my laptop (admittedly, it's not a screamer, it's only a 667Mhz Celeron with 96MB or so of ram) it's like, run the program, go get a coffee, come back, wait some more, and so on.

      You need more RAM. Swing apps (like JBuilder and Forte) are very memory hungry. That's one reason Eclipse and SWT are interesting (another big one is accelerated graphics support). 256 MB should work OK for a development system. I think Eclipse would take less.

      Out of curiosity, I wrote three "hello, world" apps, one in C++ using C-style printf, one in C++ using qt, and one in java. The java version came up with "Hello, World!" (just a single output statement) in two seconds. The other two came up instantaneously. I don't know how significant this is, but jeez, you know? Seems kind of slow.

      Its not significant, unless your app is a tiny command-line app. Current Java implementations suffer from slow startup. JDK/JRE 1.5 is supposed to provide for better sharing between VMs and programs, so things like Swing only get loaded once per system instead of many times.

      I would like to see a similar feature for Java that the CLR has on Windows - the ability to pre-compile the bytecode into native code at install time. Alternatively, 'freezing' the running program onto disk on exit would be fine, and would completely preserve the dynamic aspect of Java.

      I just don't like the idea of wasting cycles on repeatedly optimizing the same code, run after run. Plus, static compilers can do fancier optimizations.

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    3. Re:Java != Slow (necessarily) by Glock27 · · Score: 2
      Hi kaladorn. Do you folks need any help at the moment? I'm looking for a new opportunity, and your project sounds interesting. If you'd like, respond to:

      javacoder2@yahoo.com

      Thanks!

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    4. Re:Java != Slow (necessarily) by Anonymous Coward · · Score: 0

      You need more RAM. Swing apps (like JBuilder and Forte) are very memory hungry. That's one reason Eclipse and SWT are interesting (another big one is accelerated graphics support). 256 MB should work OK for a development system. I think Eclipse would take less.

      I've been using Eclipse and SWT very happily on a PII 400 with 160MB of RAM (the IDE itself uses 45 to 50MB). What sold me on it though is the hardware acceleration. Aside from the memory usage, you'd never guess that Eclipse was written in Java. Scrolling is smooth, menus come up instantly, and (the other main benifit of SWT) it looks exactly like a native app.

      SWT itself is interesting, but I think I'm going to wait until the documentation gets better before using it myself.

    5. Re:Java != Slow (necessarily) by kaladorn · · Score: 2

      In fairness, we avoid Swing and AWT and our UI is done via the openGL rendering (I think, I'm the networking dude, so that's all black box deep magic to me most days). I'm not saying Java has the fastest startup of any application environment. But core server stuff (not standard UI manipulation) is pretty quick.

      As to the compilation of byte code to native code, we've use Excelsior's JET Compiler and GCJ. CGJ actually seemed to produce a far tighter (read smaller footprint) executable. The JET Compiler seems to build in its own slimmed down JVM and that seems to give it some bloat. But both produce fast results compared to JARs. And most importantly, obfuscators lose to the various reverse engineering tools so going to an EXE helps gaurd intellectual property (a big concern in some markets like ours).

      --
      -- Mal: "Well they tell you: never hit a man with a closed fist. But it is, on occasion, hilarious."
  77. Re:Design patterns and Lisp by HiThere · · Score: 2

    It's something like the difference between working with Legos and clay. ... Lego models, although they can be amazing achievements, all tend to look like Lego models.

    With clay, however, the medium is fluid. You can mold it to just about any shape you want. Sculptures usually look like their subject, not like clay.


    However, it's also worth remembering that while silver flutes tend to look the same, so do clay flutes. They don't need to, but then neither do silver flutes. They tend to. And it's the silver flutes that have, e.g., keys, and a multi-octave range.

    Also, though small sculptures can be made from clay, large ones require stone (or, I grant you, cement or metal). And moulded sculputers tend to look like sculpted sculputes. But not like welded sculptures.

    The nature of the medium always both liberates and constrains. Squeak cannot be made stable enough for business applications, without making it quite difficult for even the original programmer to fix things. Python is slow. C is fast, but rigid. C++ is ... I'm not sure where to put it. It seems (to me) like an inferior cousin to Ada95, so I'm not a good person to talk about it's virtues.

    Patterns in the use of dynamic languages are significantly different than those of static languages. But they still exist. Just don't expect the same ones to be important. (Or they may be so basic that they are built into the language, and thus tend to escape notice.)

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  78. Re:Nothing more to see here. Move along. by Anonymous Coward · · Score: 0

    Bad habits can be carried along in one's career. You are never too old or experienced to learn and hone your basics. Don't assume that because you are aware of something that everyone else is. The biggest mistake is to become arrogant and assume that you are too experienced to have any flaws.

  79. Re:Design patterns and Lisp by plumby · · Score: 1

    I think you are missing the point of what a "pattern" is. It's nothing more than good practice to solve a particular problem. If, given a particular problem, there are two or more ways of solving it, then there's a good chance that one or other is better in a given situation. Patterns are just ways of describing what forces may lead you to use one or the other.

    The phrase That kind of flexibility suggests that there is often more than one way of doing things in Lisp. How do you decide which one to pick? When is it a good idea to use macros etc?

    Just because most of the patterns in the book "Design Patterns" may not apply to your language, don't think that the principle doesn't.

    I've not used Lisp, but I've applied patterns in everything from x-86 assembler to unix shell scripts to SQL. The patterns vary per language (knowing when it is best to use an inner join in SQL is not much use in x-86), but each language quite clearly has its own "design patterns".

    I would not want to work with any developer who seriously believes that patterns don't apply to his/her language of choice.

  80. Re:Design patterns and Lisp by 56ker · · Score: 2

    Yes but whatever the differences between languages are the choice of language depends upon what program you want to write.

  81. Re:Design patterns and Lisp by Anonymous Coward · · Score: 1, Informative

    "his" is gender-neutral in this context.

    Much like in spanish, where a plural containing at least one male uses the masculine form.

  82. Re:Design patterns and Lisp by Quixadhal · · Score: 1

    Let me start by saying that I like lisp, so I'm not intentionally out to lisp-bash... but...

    Having worked with C for many years, and having worked with perl for a few now, I have to say that I really miss typed-variables. Nothing catches a mistake faster than a type mismatch, and almost nothing is harder to track down than a bug where the compiler/interpreter happily turned a string into a number for you.

    Consider: print "ha" if 2 > "ha";

    Yeah, the compiler knows how to convert "ha" into the numnber 0, but should it? Not always, and I claim not without my explicit type-casting. If I put an (int) type there, then I think I know what I'm doing, otherwise I'd rather it error.

    My only other complaint with modern programming techniques, is this simple observation:

    I can build a lighthouse out of legos in 15 minutes.. it will look kinda lego-ish, but it would function as a lighthouse (provided I have a light to mount in it).

    To do the same thing in clay would take several hours (probably days for me!), and yes.. it would look much better, but when you're a little ways away, and it's dark... they'll look the same.

    I like lisp for the simplicity of its syntax, and in any language, I'd like to have untyped variables AVAILABLE for use... but sometimes I know I always want a 16-bit integer, and if something else gets in there, it's a bug -- then I want the language to catch it as early as possible so I don't have to sit and stare at it in the debugger trying to figure out why -11726 is the current number of records!

  83. Re:OO and functional by jolshefsky · · Score: 1
    (think I
    (as a C++ programmer)
    (lies "people's fear of Lisp" in the convoluted-seeming structures
    ("were taught" they in computer science classes)
    )
    )

    C__Programmer::IsSeeminglyBizarre(LispCodingStyle) ;

    --
    --- Jason Olshefsky

    Karma: Poser (mostly affected by adding this line long after everyone else did)

  84. Re:Design patterns and Lisp by Sir+Tristam · · Score: 1
    In pursuit of gender-neutral language:
    ln -s /usr/bin/man /usr/bin/person
    Anything we can do to help.

    Chris Beckenbach

  85. LISP and CLOS by epepke · · Score: 1, Flamebait

    Somebody has to say it. I'm a LISP junkie, indoctrinated at MIT in the late 1970's. I write LISP and Scheme systems for fun. Even when I write C code, about half the time I start off by implementing a mini-LISP. Its great for memory management and debugging.

    However, I'm also an object junkie. CLOS is a joke. It's about as object-oriented as Ada, which isn't much. Not only is Paul Graham right that you can do it, this is what you should do if you want a real O-O system rather than something that basically just uses the word "object" in the documentation.

  86. Comp Sci degree == bad code by TheLastUser · · Score: 1

    I have run accross a disturbing trend in young coders. The only way I can explain it is that they are being taught strange ideas in university.

    This trend is that they create structure for no reason at all. My belief is that, every time I split functionality into a new class, the application has to benefit from this split in some concrete way. If it doesn't then the code just ends up slow and difficult to maintain.

    I had a guy working for me that had a cs degree and a couple years of software development experience. A bright guy, I gave him a small project to complete.

    Eventually I had to maintain his code and what I found, chilled me to the bone. He had about 5 pages of code split up into 15 classes!

    As you might imagine, it is pretty difficult to maintain something with more structure than code. I just gave up and rewrote the thing.

    So what did all his attemts at ood create? What was the point of thinking like Bootch on this one? Not every project is "The Great Software System", most of the time its simple little hacks that run for a year and then need some attention.

    Maybe ood == unmaintainable?

    1. Re:Comp Sci degree == bad code by Anonymous Coward · · Score: 0

      Yes. It's when they give people Software Engineering modules, and lots of fun diagramming rules. Then projects that require those rules and diagrams and penalise for single-class code and tightness.

      Personally, I've been coding since I was ten and finished a degree last year. Did I take onboard much of what they had to say? Nope. But then, Queens and Towers of Hanoi are all there is to understanding programming; the largest problem you will ever face is indexing a database of DVDs, or writing an online board game, and the Sun comes out of Java's arse, not the other way around. C++... What's that?

      I program in a way that annoys the entire lot of them, I have to say. Plenty of it is experience, and I have to say that my code is OOP/procedural hybrid, although I honestly fail to see the massive distinction from procedural code written in a function-based way, for the most part. Taking OOP to its structural absolute is neither efficient, nor easy to read and further develop.

      Yes, I do develop large and complex systems, but to be honest, I predict the code, choose the right language for the task and structure it as seems logical from past experience and understanding of the problem at a point in time. The real issues I face are of languages limiting my abilities to complete a task, and having to redesign around issues. Java's documentation, bad method/class naming and functional similarity are big problems. I don't care if they have some grand 'framework' behind a class, because if every class has a different framework, written at a different time, and even classes in the same framework act differently and don't possess similar methods for similar tasks, and then the entire lot gets 'depracated' in the next release, in favour of another framework, it's a waste of my time. It's honestly faster to write the entire lot from basic code myself. That is a tragedy, to be honest.

      I've been told that C# is better for that sort of thing, and I'm afraid that Microsoft may have actually done something good finally... It's going to be hard to respond to. Will I use it? I just don't know... but Java is a pain for complex coding that doesn't include writing a typical banking system or whatever that EJB and J2EE were designed for.

    2. Re:Comp Sci degree == bad code by lkaos · · Score: 2

      In my sociology class, I wrote a paper on the effectiveness of a computer science degree. My observations were pretty obvious: academic experience is almost useless in writing good programs in the absense of practical experience.

      Something that is commonly overlooked though, is that academic experience has a significant benefit when combined with practical experience. Having one, but not the other, has a whole host of problems.

      It's not meaningless to have a comp sci degree, but having a comp sci degree does not, in any way, make one a programmer.

      --
      int func(int a);
      func((b += 3, b));
  87. Usenet link by Anonymous Coward · · Score: 0
    .. can be found here

    It was much funnier the first time I read it.

    1. Re:Usenet link by Anonymous Coward · · Score: 0

      The funniest part is looking at which groups this was targeted at. comp.lang.c, comp.lang.c++, comp.lang.smalltalk, alt.comp.lang.learn.c-c++, alt.religion.scientology Whoever wrote the original had a wicked sense of humour. Seems like he/she was both out to piss the serious ones off, and make everyone else laugh.

  88. old school by presearch · · Score: 1

    Reading this thread (but not the book), this is one of the first times
    I've seen others touching on my approach to software development.
    OOP is interesting, a good IDE is impressive if it's pulled off, write once
    and deploy everywhere is a noble goal. But... nothing beats pure clean
    C written using vi and a CLI make. The stuff runs fast without surprises,
    the editing process is almost subconscious and if the coder is good,
    maintaining the code is economical and bugs are nearly nonexistent.
    Same thing goes for debugging, there's nothing like printfs to get to the
    heart of a problem. The real secret of programming is to have the ability
    to "be the computer", to load and run the code in your head.
    It's an old school attitude, but I think all that other stuff is a crutch.
    Sure I'll use those extra layers of cruft, sometimes options are limited
    or the platform or client demands it. But the overhead both at runtime and
    during development outweigh the benefits. -- K&R are dead, long live K&R.

    Bill Romanowski
    www.tqworld.com

  89. Sounds like DB normalization?? by geolane · · Score: 2, Interesting

    This review sounds exactly like database normalization- one does not end up with twenty tables each with two columns and expect wonderful performance- sometimes that repeated data that might (in a fully normalized database) speed performance by a significant amount. Joins in the database world cost cycles- I think the same thing holds in the OO world- don't normalize to the nth degree.

    1. Re:Sounds like DB normalization?? by Anonymous Coward · · Score: 0

      Sorry if this sounds a bit disjointed -- I've been running test cases for 12 hours, and my brain has turned to jello.

      It's similar, because the underlying concept is similar. Starting with a thorough model of the data passing through a process and then implementing the model as a database and as an application to put data into and out of that database, a "perfect" solution would have objects which corresponded exactly to the tables, and both of them would correspond to the entities in the original data model. However, the "perfect" model is only "perfect" in a theoretical, static sense.

      Where this may fall short is where the process manipulating the data understands the data differently from the structures which hold the data. What I mean by that is, for example, that a piece of data which in the strictly logical data model is a characteristic of a parent. If the user is not interested in the parent without the children or the children without the parent, denormalization to store parent characteristics in the table with the children might improve query performance on the way out. If the performance of reads is more important than the performance of updates, denormalize. If the performance of updates is more important, don't.

      With either a relational db or OOP, beginning with both a data model and a process model before any coding starts can bring about a clearer design and a more maintainable design. If it is established from the beginning exactly what the data is and how it is used, the decisions about how to implement the information system to support the process and move the data are only made after the most important questions have been answered. (You know what the heck you're building before you start sticking bricks together.) If the database and objects follow directly from the model, the person who has to learn the system can start by learning the model. The tester can test from the model. When requirements change, the model can be changed, and the effects on the system built from the model can be mapped through the model. If the entire system becomes undesirable at some point in the future (because technology has changed, etc.), the system can be completely rebuilt to do precisely what it did before in a better or different way by referring back to the model again. A clunky or arcane model will look clunky or arcane, and an elegant model will look elegant: errors or gaps in thinking will be exposed before coding starts, when it is lower in cost and aggravation to fix them.

  90. CLOS *isn't* OO? by alispguru · · Score: 3, Interesting

    I suspect you and I have different definitions of OO. The problem is that damn near everyone has a slightly different definition of OO. Go read this article by Johathan Rees, then come back and tell us what you mean by a "real OO system", and why you can't do it properly in CLOS.

    --

    To a Lisp hacker, XML is S-expressions in drag.
  91. Re:Design patterns and Lisp by Loundry · · Score: 2

    Other languages don't have this problem. Spanish, for instance, has su. As a bonus, it also doesn't have the "free" ambiguity.

    Spanish has its own inherent sexism. For instance, a musician is "el musico" (inherently masculine). The word for music is "la musica" (inherently feminine). So what do you call a female musician in Spanish? "El musico mujer" ("the (inherently-masculine) musician woman").

    I think it's a problem common to all romance languages. English has the benefit of not insisting that inanimate objects must have figurative penises or vaginas.

    --
    I don't make the rules. I just make fun of them.
  92. Re:Design patterns and Lisp by Anonymous Coward · · Score: 1, Informative

    Even better are "strict" type-inferencing languages. (O'Caml for example)

    The type is determined by its use and enforced. I wish C/C++ had similar facilities.

  93. Re:Design patterns and Lisp by Anonymous Coward · · Score: 1, Informative

    I have to say that I really miss typed-variables. Nothing catches a mistake faster than a type mismatch

    I don't miss typed variables at all. You can OPTIONALLY declare the types of variables using (declare ...). Lispers treat declarations as "hints to the compiler to make things fast" rather than strict contracts. If you want to enter into such contracts, you can...

    Or you can eschew functions and use methods exclusively. CLOS methods are really "multimethods" -- they dispatch on the types of as many of their arguments as you care to supply types for. Using methods instantly reveals when you've supplied an argument of the wrong type (since no applicable method will exist).

  94. Re:Design patterns and Lisp by cloudmaster · · Score: 1

    Thank you for pointing that out. Why do people take the time to overanalyze english grammar without taking a similar amount of time to learn how the language works? The sentence would've meant the same thing if the author had used "her" instead - the only rule when writing in a gender-neutral situation is to maintain the same pronoun when referring to the same subject. Given the smiley, I don't think that normiep was serious - but you just know that someone else was.

    Sigh. Stupid political correctness crap. :)

  95. Re:Design patterns and Lisp by Anonymous Coward · · Score: 0

    No kidding, come on people, this is 2002. His/her who gives a rats ass, that is not what this topic is about.

    We are not debating whether or not men can program LISP better than women. That's a different subject completely.

  96. Preach on! by DG · · Score: 2

    Lemme hear an "Amen!"

    And I'll go even farther than you, and state:

    "Properly written code is largely language independant - so the language you choose to program in does not affect system effectiveness"

    Or dumbed down:

    "If it works, and it was well-written, then it doesn't matter what language it was written in"

    The trick is that you-as-programmer have to assume that you are writing code that someone else will maintain, that this maintainer will be unfamilliar with the language, and that this code runs the system that pays your salary.

    You have to optimise your code for LEGIBILITY, so that when the downstream maintainer starts changing it, you give him the highest possible chance of understanding what is actually going on, making the change correctly, and not screwing up your paycheque.

    It's really not that hard to do, once you get into the swing of it, and very very rarely does it compromise the ultimate system performance. There usually is no downside.

    If you learn to do this, then you can let people work in their language of choice, which pays HUGE dividends in productivity and coder happiness.

    I wrote a huge user-management tool in my personal language of choice - perl. Perl maps well into the way I think (you might say I think in perl) Immediately after I wrote it, I moved to a new position in the company, and this massive codebase was dropped on three people who had zero experience with the language. But because the code was optimised for legibility, they picked up on it right away, and were able to greatly extend the functionality of the code with almost no delay and no loss of original functionality.

    Forcing coders to work in a particular language - or badmouthing a language because it isn't fashionable (like one moron of a consultant recently chose to do at a meeting I was at) is a sure sign of Not Getting It.

    DG

    --
    Want to learn about race cars? Read my Book
  97. Re:Design patterns and Lisp by Ed+Avis · · Score: 3, Informative

    I just fininished reading Modern C++ Design by Andrei Alexandrescu, which explains all sorts of cool hacks you can do with templates in C++. Or to put it in more sober language, how to implement reusable design patterns using C++'s templates and compile-time polymorphism.

    It's a great read and really demonstrates just how powerful C++'s templating system is. It shows how to do just what you say - create a general macro from a specific pattern instance - for example making reusable templates to efficiently implement multiple dispatch and the Visitor pattern. And C++'s template specialization happens at compile time, which with a good optimizing compiler gives you performance as good as handwritten code. I haven't used Common Lisp so I can't compare C++ templates to CL macros - but you shouldn't underestimate C++'s macro-ing and code reuse abilities. The syntax is horrible, but there do exist people who don't like Lisp syntax either...

    The fact that early C++ implementations were using the cfront preprocessor doesn't really say much about the language - just that it had an unwieldy first implementation. All current C++ compilers really do handle the language natively (g++ for one). You can find all sorts of reasons for saying C++ is unpleasant and ugly, but cfront is not one of them. OTOH, if you were saying that Lisp is more powerful than C because it is much easier to add objects to Lisp than to add them to C: well of course, everyone knew that already.

    --
    -- Ed Avis ed@membled.com
  98. Re:Design patterns and Lisp by alispguru · · Score: 4, Informative

    I think there seem to be fewer patterns in Lisp, because Lisp needs them less. Lispers tend to dismiss patterns because of presentations like this one by Peter Norvig, in which he shows that roughly two-thirds of the patterns in the Gang of Four book deal with techniques that are unnecessary in Common Lisp.

    Lisp does have patterns, but Lisp hackers tend to implement them as macros, automating their application rather than forcing everyone to know and re-enter them to use them. That's the difference between:

    // Please forgive any Java errors here
    // I don't use this pattern enough to get it right
    // without a compiler to check it...
    try {
    FileInputStream myfile = new FileInputStream(filename);
    // Mess with file...
    }
    finally {
    myfile.close();
    }

    and

    (with-open-file (myfile filename)
    ;; Mess with file...
    )

    They do the same thing - guarantee that myfile gets closed no matter what - but the Lisp way requires less typing and is less prone to errors.

    --

    To a Lisp hacker, XML is S-expressions in drag.
  99. Re:Antipatterns - Bizarro Patterns by monsterzero2002 · · Score: 1

    If you recall Superman comics the Bizarro Superman was the anti-character to Superman. Bizzaro Superman was from Bizzaro World.

    So if you ask me I would say the the correct term should be "Bizzaro Patterns".

    Anyhow, Java is overated. Anything that refers to "Enterprise" this or that is an obvious marketing hack, similar to all those Microsoft ads that have about 50 exclamation points in them ("Enhance Your Carreer! Web Services are for what's happening now!).

    It will someday be revealed that Java was just a wildly successful plot to sell Books.

  100. My Book Title by weston · · Score: 2

    I've always wanted to write a book called "Teach Yourself C Programming in 21 months, if you're lucky, and forget about C++".

    The syntax of a language? Easy to master in a short period of time. Usage in expressing ideas? Months. Years. It's amazing what people think they can get away with shortcutting.

  101. Re:C++ templates vs. Lisp macros by jaoswald · · Score: 3, Informative

    Lisp macros are also compile-time. And, because the transformations they perform end up producing "ordinary" Lisp code, all Lisp compilers get them correct. Also, since the macro language is the same as the base language, it is well-defined. In fact, a substantial portion of a Lisp compiler is likely to be written using Lisp macros.

    C++ templates share much of the power of Lisp macros, but they are somewhat more restricted in what they can do and express. They play an essential role in writing generic algorithms, which is a great thing. But once you've decided to write your C++ code using templates, you're committed to doing things in the template style. Lisp macros are completely transparent, in the sense that macro code and Lisp code look the same, and fit together.

    I concede that the STL folks and Blitz++ folks have done amazing things with the template system. But C++ compilers still have issues with getting the STL to work consistently.

    I think the way I would summarize it is that writing Lisp macros is continually improving the language, without narrowing the scope of your options. C++ templates feel to me like building a tower. Sure, each floor is higher than the one before, but soon, the only way to build is up. If you don't like the choices you made building the ground floor, you have to abandon the work built on top, as well.

  102. Re:OO and functional by jaoswald · · Score: 1

    That's an interesting example...Now that C has changed into C++, I find I can no longer understand the code analogies that people write. I always feel the need to check the .h files to see how things are defined.

    More lisp-like, I think, would be

    (let ((*student* (new-cs-major))
    (*Lisp-curriculum* 'outdated))
    (causes-irrational-fear? 'Lisp))

    --> T

  103. www.antipatterns.com by promo · · Score: 1

    If you're interested in antipatterns, check out (of course) http://www.antipatterns.com/.

  104. Thats funny... by Anonymous Coward · · Score: 0

    I just got a catalog the other day that has cobol AND fortran for .net CLI, created by third-party developers, not to mention a bunch of other modeling snap-ins.

  105. The Myth of the Employee Class by Shimmer · · Score: 1

    You have to destroy objects to change their state, for example when an employee changes to a manager, etc.

    What a perfect setup, thank you. I couldn't have asked for a better example of poor OO design.

    The correct way to model this is to realize that there is no such class as Employee or Manager. The correct class is Person. Employee is the role that a Person plays in a relationship with the Company class. You don't need to destroy the Person instance when someone gets promoted.

    This shows that the true problem is not with OO, but with poorly applied OO concepts. As with any tool, it is possible to use OO incorrectly.

    It happens that I've written an entire article on this topic here: The Myth of the Employee Class.

    -- Brian

    --
    The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    1. Re:The Myth of the Employee Class by Anonymous Coward · · Score: 0

      Yeah but now you've made exactly the same mistake with your person class, when the person turns into a dog...

    2. Re:The Myth of the Employee Class by Shimmer · · Score: 1

      I assume you're joking? People don't turn into dogs.

      -- Brian

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    3. Re:The Myth of the Employee Class by Tablizer · · Score: 2

      (* I assume you're joking? People don't turn into dogs. *)

      Perhaps you have not met my neighbor's ex-wife.

      Her poly reeeaaaaly morphed.

    4. Re:The Myth of the Employee Class by Tablizer · · Score: 2

      (* The correct way to model this is to realize that there is no such class as Employee or Manager. The correct class is Person. *)

      I would challenge this. "Employee" is usually a sufficient entity for biz apps.

      If you use Person, you might be tempted to put vendors or customers under it. However, vendors and customers can be *companies* and not necessarily persons.

      It often works to have a Contact class or entity, and to reference it as needed. Some OO fans want to put the Contact info in some "root" class, such as "BusinessParty". But, vendors and clients can end up having multiple contacts per company, such as a Billing_contact, Sales_contact, etc. HAS-A Contact is more flexible than IS-A contact in this regard. Your design will change less if you later go to 1-to-many Contacts.

      To model biz, you need a big graph(s), not a big tree(s), for the most part. Unfortunately, OO offers little or nothing that natively makes managing graphs and sets easier, that I see. OOP is optimized for trees and nested relatioships. Outside of these, it is not very contributory.

      BTW, "roles" can be modeled very nicely in non-OO ways.

    5. Re:The Myth of the Employee Class by Anonymous Coward · · Score: 0

      For this you use +1 posting bonus?

    6. Re:The Myth of the Employee Class by Shimmer · · Score: 1

      I'm not sure what point you're making. An Employee class might be "sufficient" for some apps, but that doesn't make it correct. It breaks quite easily, as described by the poster at the top of this thread.

      We typically model Person and Company as subclasses of BusinessEntity. You seem to think this is a "big tree", but it's actually quite small.

      Contact is a role of the BusinessEntity class, not a class itself. If you model it like this you have HAS-A Contact, not IS-A Contact. As you state, this more flexible. But you're helping my side of the argument here, not challenging it.

      OO does not require deep class hierarchies (a la Java or .NET). It handles graphs and sets just fine. Can you post an example of something in this areana that it doesn't do well?

      -- Brian

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    7. Re:The Myth of the Employee Class by Tablizer · · Score: 2

      (* An Employee class might be "sufficient" for some apps, but that doesn't make it correct. It breaks quite easily, as described by the poster at the top of this thread. *)

      Which "break" are you talking about? I didn't see any breakage in my approach.

      (* We typically model Person and Company as subclasses of BusinessEntity. You seem to think this is a "big tree", but it's actually quite small. *)

      Yes, but I see no purpose in this. A customer is a customer. They might start out as a small single-person business and then grow to a company. My approach would only require flipping an attribute somewhere, and not *converting* from one class to another. IOW, more "change-friendly". The reald is not a tree, and modeling that using trees will tend to be fragile. End of story.

      The company may even not bother tracking whether a customer is an individual or a company as long as they pay their bills. You are hard-dividing simply out of OO doctrine, and not a real biz need.

      (* Contact is a role of the BusinessEntity class, not a class itself. If you model it like this you have HAS-A Contact, not IS-A Contact. As you state, this more flexible. But you're helping my side of the argument here, not challenging it. *)

      "Contact" is a "role"??? I am not getting this.

      (* It handles graphs and sets just fine. Can you post an example of something in this areana that it doesn't do well? *)

      It does not handle multi-aspect orthogonal divisions well. See:

      http://geocities.com/tablizer/subtypes.htm

      and

      http://geocities.com/tablizer/aspects.htm

      (Yahoo is undergoing maintenance right now, so you may have to wait until Sunday to read 'em.)

      At the very most, OOP is not superior. It is simply an overhyped alternative.

    8. Re:The Myth of the Employee Class by Shimmer · · Score: 1

      >> An Employee class breaks quite easily, as described by the
      >> poster at the top of this thread.

      > Which "break" are you talking about? I didn't see any breakage
      > in my approach.

      Employee breaks as a class because it doesn't handle other relevant roles that a person might play (e.g. stockholder, customer, account owner). In order to handle this, you end up with multiple inheritance (e.g. EmployeeStockholder), multiple instances for the same person, or other hacks.

      >> We typically model Person and Company as subclasses of
      >> BusinessEntity.

      > Yes, but I see no purpose in this. A customer is a customer.

      No, a customer might also be an employee, a stockholder, a vendor, an astronaut, a mother, a policeman, a manager, etc. If you can't grasp this, you're missing a fundamental OO concept.

      > They might start out as a small single-person business and then grow
      > to a company.

      Are you trying to say that a person turns into a company!? I hope not.

      > My approach would only require flipping an attribute somewhere, and not
      > *converting* from one class to another.

      Who the heck would convert from one class to another? Once again, you're arguing my side of the point for me. An instance of the Person class is *always* an instance of the Person class. Ditto for the Company class. That's why we make them classes (and why Employee is not a class).

      > The company may even not bother tracking whether a customer is an individual or
      > a company as long as they pay their bills.

      But Person and Company have completely different attributes. There's no need to "track" anything. The two classes are as different as night and day (although they have a common superclass).

      > "Contact" is a "role"??? I am not getting this.

      No, you're certainly not. Contact is a role played by the BusinessEntity class. It's not a class of its own.

      > It does not handle multi-aspect orthogonal divisions well.

      I am reading your "OO is bad" site now and I'll let you know what I think afterwards.

      -- Brian

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    9. Re:The Myth of the Employee Class by Tablizer · · Score: 2

      (* Employee breaks as a class because it doesn't handle other relevant roles that a person might play (e.g. stockholder, customer, account owner). *)

      Why not? Anything can point to (reference) anything in the relational model.

      (* No, a customer might also be an employee, a stockholder, a vendor, an astronaut, a mother, a policeman, a manager, etc. If you can't grasp this, you're missing a fundamental OO concept. *)

      We probably need a looooong talk together.

      (* Are you trying to say that a person turns into a company!? I hope not. *)

      YES, I am.

      (* But Person and Company have completely different attributes. *)

      In most practical cases, a company is trying to model information about customers. They may not *know* whether that customer is an individual or a company. I am the owner of a company, BTW, and I have no employees (and almost no sales either :-) I sometimes do business as an individual, and sometimes as a company.

      What specific *relavant* attributes would be different?

  106. Re:Design patterns and Lisp by curri · · Score: 1

    actually, in spanish the male gender is ALSO the neutral. You would say 'la musica' for a female musician, 'el musico' for a male musician, and 'los musicos' for a set of musicians which may be male or female (you'd reserve 'las musicas' for a set of female musicians)

  107. Look for Krakatoa, East of Java by Anonymous Coward · · Score: 0
    .

    It's there. Saw it. 30 years ago. Volcano or something.

    .

  108. Re:C++ templates vs. Lisp macros by Anonymous Coward · · Score: 0

    In short, you do not understand how to use templates effectively.

  109. that's not power, that versatilititty by Anonymous Coward · · Score: 0
    .

    "Power" in a computer langauge is doing a lot with a little. ASM is versatile, it is not by any stretch of "powerful". By Bill, I know I'm right, having spent 10 years of my life doing assembly (and thinking it was good).

    .

  110. Modern C++ Design by Anonymous Coward · · Score: 1, Interesting

    Everyone involved in the C++ vs. X debates should read this book. It shows quite clearly everything that is good and evil about C++. The fact that there aren't ANY compilers which can actually run all the examples in that book is pretty telling in itself.

  111. My book series by horza · · Score: 2

    How about:

    Volume 1: The OO and the Imperative Approach
    Volume 2: Data Structures and Algorithms
    Volume 3: Learn C in 24hrs
    Volume 3a: Initialising Pointers and Stress Management
    Volume 3b: gdb
    Volume 4: Learn Java in 24hrs
    Volume 5: Bitter Java
    Volume 6: Software Engineering inc Source and Project Management
    Volume 7: Mythical Man Month
    Volume 8: How to Write a CV

    Preferably in that order. :-) Those working for smaller companies may wish to order:
    Volume 9: The DIY DBA

    Phillip.

  112. Re:Mistaken? Nope by Anonymous Coward · · Score: 0

    Whether or not they have anything to do with "patterns" is not relevant; you are complaining about the word "antipattern", not their usefulness. Highlighting common design problems is useful in any framework, no matter what you call it.

  113. Re:Nothing more to see here. Move along. by Anonymous Coward · · Score: 0

    You're not a grizzled veteran, you're an egomaniacal asshole. There's a difference.

  114. It was a joke you cement head. by Anonymous Coward · · Score: 0

    how much more obvious need it be made?????

  115. Re:Design patterns and Lisp by qeL3-i · · Score: 1
    That kind of flexibility, which allows the programmer to mold the language to fit his (and his tasks) needs, is really what makes Lisp great to work with.

    It's just that English is deficient. There's no genderless pronoun that suits.

    How about:
    That kind of flexibility, which allows programmers to mold the language to fit their needs (and their tasks' needs), is really what makes Lisp great to work with.

    Oh look, English can handle it.
  116. Re:Design patterns and Lisp by Anonymous Coward · · Score: 0

    Well said...the more I use Java, the more I miss C++ and templates. Casting Objects starts reminding me of casting void* back in the day when I was doing C. Doing StringBuffer.append ten times in a row because it's faster than concatenating String objects seems clunky. What's up with String.equals() anyway? Why can't I just use the stupid "=" operator? Ugh. It just feels like a big hack.

    I think C++ is like a sharp knife - it's a great tool when you know how to use it, but you have to be careful. A lot of people use it, cut themselves, and go back to Java. Plus, the language has been around long enough to get a set of toolkits and libraries that's arguably richer than Java's.

  117. When you were born, by Anonymous Coward · · Score: 0

    did they forget to hand you your sense of humor?

  118. So, in other words, you agree with me by Bigboote66 · · Score: 1

    As I said, the &lt&lt is atomically safe. If you insist on using multiple &lt&lt operators and want your text to remain contiguous, you'll need to do this:

    {
    stream_locker guard(cout, stream_locker::lock_defer);
    if (cout.test_safe_flag())
    {
    guard.lock();
    }
    std::cout &lt&lt "foo" &lt&lt "bar" &lt&lt std::endl;
    }

  119. Buy PDF Online... by petee+moobaa · · Score: 1
    Hey, I'm karma whoring, but you can do your bit to reduce the number of dead trees by purchasing the PDF online for $17.

    We should all applaud a small publisher like Manning for doing this.

  120. Lisp is great. Where is Lisp? by Anonymous Coward · · Score: 1, Interesting
    Lisp is great - it is very flexible. But the problem of Lisp is in its flexibility: it's too flexible. As a result, there are lots of Lisp dialects. They are compatible by skills, but it is difficult to create portable Lisp applications. There is no portability - there is no popularity in OSS community.

    Most of Lispers are coding with commercial implementations, while there are very few of great Lisp applications based on free/OSS implementations. Emacs is the best of them, but it is dying. TeXmacs is upcoming, but will it succeed So, there are lots of Lisp dialects, but it is even worse - most of (good) imlementations are commercial.

    Today we are living in the time of XML. But most of popular XML applications are written on Java, Python and even Perl - but not on Lisp. Why? Theoretically Lisp is the best candidate for XML processing/transformation, why not to use it? I'll tell you why - because there is no such thing as Lisp - instead, there are too many of Lisp dialects. Thus, for most of programmers it is uncertain, which Lisp to use. And that's why programmers prefer to use Java, C, Python or Perl.

    Now see what you are saying about Lisp patterns. It is less important which pattern to use when you don't know which dialect to use. Give Lisp to masses and you will be surprised how many patterns people will use with Lisp. Academical thinking dislike patterns, practical thinking cannot live without patterns.

    1. Re:Lisp is great. Where is Lisp? by Anonymous Coward · · Score: 0

      No, there are not a lot of Lisp dialects. There were several, at one time, but there are approximately one Lisp dialects in use nowadays: ANSI standard Common Lisp. There are some specific single-implementation dialects used as scripting languages in particular programs (Emacs, AutoCAD), but you wouldn't want to use those for general programming.

    2. Re:Lisp is great. Where is Lisp? by cstacy · · Score: 1

      Common Lisp is an ANSI standard language with many compatible implementations and is available on all the popular operating systems and processors. Some of those implementations are free and/or open-source, if that's important to you. So I would tend to disagree with your statement, "There is no portability". If someone just says "Lisp", they are generally assumed to be referring to ANSI Common Lisp. There are several other dialects of Lisp in popular use, such as GNU Emacs Lisp, and AutoLISP (AutoCAD), but those are not compatible with Common Lisp. Those particular dialects are application extension languages, not intended for general-purpose programming. There is also Scheme, which was originally conceived as a dialect of Lisp (over two decades ago) but which is arguably not really a Lisp. Anyway, it is quite different from Common Lisp. Your explanation that since most XML applications are written in Java, Python, or Perl -- Lisp must not be standard or portable -- doesn't seem logical to me. For one thing, most applications in general (XML or not) are not written in Lisp, but that does not mean that "there is no such thing as Lisp" as you put it. By the way, what happened to C++ in that list? I can't actually find anything in your message that makes any sense at all.

    3. Re:Lisp is great. Where is Lisp? by Anonymous Coward · · Score: 0
      There are some specific single-implementation dialects used as scripting languages in particular programs (Emacs, AutoCAD), but you wouldn't want to use those for general programming.

      It's exactly my point: the greatest and the most known lisp-based application is Emacs, and it's written on dialect. Where is the programming result of several decades of ANSI standard Common Lisp? Where is the result of general programming on it? Why Emacs is the only known Lisp based application between general programmers?

    4. Re:Lisp is great. Where is Lisp? by DroningDromedary · · Score: 1

      > Today we are living in the time of XML. But most
      > of popular XML applications are written on Java,
      > Python and even Perl - but not on Lisp. Why?

      Because Lisp has S-Expressions, which are every bit
      as powerful as XML and then some, not to mention
      considerably less verbose. XML is a totally
      braindead technology in the eyes of most Lisp
      programmers, and of limited usefulness to them,
      except perhaps to inter-operate with systems that use it.

      I've yet to see an XML application that comes close
      to fulfilling all the hype, let alone one that
      comes close to achieving everything that's possible
      with Common Lisp.

      It has nothing whatsoever to do with Lisp dialects.

    5. Re:Lisp is great. Where is Lisp? by jaoswald · · Score: 2

      To clarify, and to hopefully cut off this hydra's head of an argument/troll, when I (and most Lisp programmers) say "Lisp" I mean "ANSI Common Lisp" as in the first object-oriented programming language to have an ANSI standard associated with it.

      The multiplicity of Lisp dialects was a problem that went away in the mid-1980's, whether you realized it or not.

      The only possible source of confusion I can imagine that would make this an honest post, rather than a troll, is Scheme. So the choice is "Common Lisp" or "Scheme." Which to me are as different as C++ and Java.

  121. Re:Design patterns and Lisp by johnnyb · · Score: 2

    Although the template solutions in that book were pretty clever, they generally pointed to deficiencies in the language itself. For example, look at how difficult the command pattern is to implement in C++! In better languages, it is simply a lambda expression.

    In addition, a lot of the stuff in that book is pretty useless for what programmers do day-in and day-out, and the compile-time benefits are only really benefits if you have extremely time-critical code.

    The stuff is good for computer languages theory, but for practice, C++ is way too complex for day-to-day efficient work.

  122. It's always nice to be validated.... by whitroth · · Score: 1

    Sounds like stuff I've been saying for *years*.

    The Newest, Greatest [db system|programming language| methodolgy] is the Silver Bullet(tm).

    Management, and students, and academics: THERE IS NO SILVER BULLET. Deal with it!

    I took a course in OOPs and GUI, back in '94. (I know, sounds like someone dropping an egg.) What I decided was that OOD looked interesting, but the closer you got to actually *coding*, the *fuzzier* it looked. Folks, we get one instruction executed at a time (even if we're multiprocessor, we're doing multiples of the same instruction). When you get down to it, you need to be able to deal with ->sequential instructions-.

    I see a lot of younger folks who *didn't* have the serious intro I had - assembler, o/s, etc...and the result is that they have no *clue* what's going on inside the physical machine.

    In fact, what I finally decided about OOP is that it is doing nothing other than:
    a) trying to enforce all the structured coding and good code practices
    that they were teaching for 20
    years by *compiler*, and
    b) the compilers, and their libraries, became so huge, because they tried to create every function ever needed for every program that will ever be written.

    *sigh*

    Management, however, almost never wants to pay for quality, they want to find a formula for it.

    mark, who'se good, and experienced,
    and still looking for a job
    during this "recovery"

  123. Re:Design patterns and Lisp by porkchop_d_clown · · Score: 2, Insightful

    I think there seem to be fewer patterns in Lisp, because Lisp needs them less.

    I'm sorry, but I have to reply - a lot of people are making statements like this and it only shows that they misunderstand what a design pattern is.

    A proper design pattern applies to all languages equally - because it's about design not about coding.

    Saying that Lisp doesn't need design patterns is like saying BMWs don't need drivers.

    A design pattern is something like "isolate all the hardware dependent stuff in one portion of the application" or "use a special class as a filter for translating object oriented data into SQL statements". Your examples are anything but "design patterns".

  124. Re:Design patterns and Lisp by Paradise+Pete · · Score: 1
    Oh look, English can handle it.

    Sheesh - I didn't say the idea couldn't possibly be expressed. Do you really dispute that it would be better to have genderless pronoun? A carpenter is only as good as his tools, after all... oh wait, I mean a carpenter is only as good as the tools owned by said carpenter. There - that's much better.

  125. 150 secs vs. 5 secs: I Know The Story by Not+The+Real+Me · · Score: 1

    I went through a similar object oriented problem. I created a credit card validation and approval system that in theory would only require a customized backend to integrate with any mechant account.

    The results? It took 2 1/2 minutes on average to get the authorization code from the credit card service. The stripped down (1:1) code only took 5 seconds. Yes--150 seconds for an object oriented vendor independent abstracted version versus 5 seconds for a flat direct to their API version. This was on a test RedHat 7.2 Linux machine with 768megs of RAM and dual 533's with no users. I tried a different machine, RedHat 6.2, 640megs, dual 533's, no users, same results.

    I played around with memory allocation for Resin, Apache, etc. No improvements.

  126. My paradigm is better than yours, neener neener by Tablizer · · Score: 2

    (* To address the original issue, functional designs tend to be much more "factored" than procedural designs, because things are designed to use functional abstraction rather than interactions between different bits of code and variables. This tends to make them much more robust and maintainable. *)

    The problem is that there is no objective way to measure that paradigm/language B is better than A.

    Computer Science is sorely lacking in the metrics and objective comparison department.

    It is more intellectually honest (and safer) to say, "Paradigm X fits closer to the way I think and work", rather than "X is better than Y".

    Note that strong-typed languages tend to be more verbose than dynamic ones, however, fans of them say that the compiler protection is worth it.

    It is sort of like the fighter plane design issue of deciding whether keep the plane light and nimble to outmeanouver the enemy, or heavily armored so that it can take more hits without failing.

    There are complex strategic tradeoffs in paradigm and language design such that it is hard to say that one is clearly better. It often depends on the skillset and personality of the pilot.

  127. Re:Design patterns and Lisp by Anonymous Coward · · Score: 0

    // Please forgive any Java errors here
    // I don't use this pattern enough to get it right
    // without a compiler to check it...
    try {
    FileInputStream myfile = new FileInputStream(filename);
    // Mess with file...
    }
    finally {
    myfile.close();
    }

    I do use it a lot. Enough to tell you that "FileInputStream myfile" needs to be declared outside of the try block. As written above, myfile's scope is limited to the try block, so it is not valid within the finally block.

  128. Einstein Oriented Programming by Tablizer · · Score: 2

    (* This review sounds exactly like database normalization- one does not end up with twenty tables each with two columns and expect wonderful performance- sometimes that repeated data that might (in a fully normalized database) speed performance by a significant amount. Joins in the database world cost cycles- I think the same thing holds in the OO world- don't normalize to the nth degree. *)

    There is another set of messages descussing this very same issue around here somewhere.

    "Normalization" seems to involve two different (probably orthogonal) things. One is to remove duplication, and the other is to "group related" things into separate chunks/tables/objects.

    Duplication removal is hard to argue against, except maybe where the duplication may be temporary.

    The "grouping" issue is the more controversial one. It is better IMO to have "virtual chunks" rather than physical, or "hide-wired" chunks if possible; because the chunking needs may change or need to be different per section or algorithm.

    IOW, Einstein had it right: It is all relative.

  129. Re:Design patterns and Lisp by ahde · · Score: 2

    funny, in English the male gender is ALSO the neutral. Except you're wrong about la musica.

  130. Re:Design patterns and Lisp by ahde · · Score: 1, Troll

    If you've ever used functions in Excel you're three quarters of the way to being a Lisp guru. The other bit mostly involves getting used to a slower runtime than Excel.

  131. Re:Design patterns and Lisp by Anonymous Coward · · Score: 0
    Gender is a grammatical feature; it has nothing to do with sex.

    If you think saying "he" is sexist, it's you who are deficient.

  132. Bitter is the tastebud of the beholder by Taco+Cowboy · · Score: 2



    Some people like their coffee black, no sugar.

    They enjoy the aroma.

    Others hate such type of coffee, and can't understand why anyone will want to drink bitter coffee.

    One can be bitter about ANYTHING, just that, when you are bitter about one thing, think of the other qualities of that thing.

    Besides bitterness, the thing may have a good aroma, or it looks good, or it is useful in chasing away pests, and so on, and so forth ...

    --
    Muchas Gracias, Señor Edward Snowden !
  133. Use the right tools: multi-paradigm programming by Anonymous Coward · · Score: 0

    Using OO for everything might well be overkill. Have a look at
    Teaching Programming as an engeneering discipline. Here is a statement showing some of their goals:

    The current trend in computer science education is to restrict the student to one or two models. The most extreme case is where a single rather complex model and language, namely object-oriented programming in Java, is used as a general-purpose approach with which all problems should be solved. This trend is driven by market forces and has no scientific basis. One goal of the book is to be a counterweight to this trend. In addition to giving the student a deep insight, this has immediate practical benefits. Many problems that are hard to solve in Java become simple when viewed in the proper computation model. For example, both concurrent programming and user interface design are difficult in Java. The book shows how these two areas can be much simplified.

    Good, read, even if you don't accept it's standpoint.

  134. Re:Design patterns and Lisp by Rysc · · Score: 1
    Better yet:
    alias man='person'
    .

    I suppose it would depend on ones definition of 'better', though.

    --
    I want my Cowboyneal
  135. I thought it was like.. by Anonymous Coward · · Score: 0

    Keep it simple AND stupid?

  136. Patterns don't just go away by tarmo · · Score: 1, Interesting

    Hey, design patterns are just generally applicable ways of designing things (like software) that usually (through prior experiences) produce good designs that are robust, flexible, or whatever is wanted.

    Everything that has to do with designing and is (relatively) commonly used and works is a design pattern.

    Procedures are a pattern, just like OO. But when your implementation environment directly supports that pattern, then it becomes just a mundane tool.

    Many GoF patterns are for C++ and Smalltalk, because those were the languages that the GoF had experience in. The patterns were meant to produce better designs for those languages. Because the implementation isn't supported by the language, a specific pattern must be enforced on the programmer.

    Lisp doesn't need most of the GoF patterns due to its superior features, but that doesn't mean the patterns aren't there - they're just easier to implement. But if you don't use them, then your design won't be any better just due to your selection of language. And using a language or an environment that provides these basic patterns for you allows you to concentrate on even higher level patterns.

    Or have you seen anyone implementing class inheritance using assembly? I haven't. It's a bit easier when the language handles stuff like named variables, scopes, functions and type checking, just to name a few very commonly used design and implementation patterns that help implementing an OO system.

    --
    Tarmo

  137. Design pattern vs. implementation pattern by tarmo · · Score: 0

    Yep, this example is an example of an implementation pattern - a good way of doing a specific task, in this case, reading a file and making sure it's closed.

    This has nothing to do with design patterns, although the point is valid - some languages will make implementing a specific implementation or design pattern easier than others.

    Btw, as to your Java example, Java has the GarbageCollector design pattern built-in. This means that you can just open the file and do what you want, then forget about it, since the file is closed automatically when the file object becomes unreferenced = when the myFile variable drops out of scope = you exit the current function.

    In this case a design pattern helped make a specific implementation pattern ridiculously easy to implement.

    1. Re:Design pattern vs. implementation pattern by alispguru · · Score: 2

      ... the file is closed automatically when the file object becomes unreferenced = when the myFile variable drops out of scope = you exit the current function.

      Yes on options two and three, but I wouldn't rely on option #1 if I were you. Consider the following:

      //filesToMung is a String[] array
      for (int i = 0; i < filesToMung.length; i++)
      processFile(new FileInputStream(filesToMung[i]);

      A new FileInputStream is created every time around the loop, passed to processFile(), and then becomes unreferenced. The compiler cannot immediately reclaim the stream (processFile might spin a thread to hold onto it), so it has to let the GC do it. If the GC is a reference counter, like vanilla Python's GC, this loop will work reliably. If it's anything more reliable or modern (mark-sweep, stop-and-copy, generation scavenging), this will fail randomly if filesToMung gets big enough, as unclosed, uncollected streams pile up between GC sweeps.

      There is a difference between finalizatiion and storage reclamation, and it's a real bad idea to mix the two.
      --

      To a Lisp hacker, XML is S-expressions in drag.
  138. Finally some sense on Java by lapointe · · Score: 1
    Java has been the source of incredibly hype among in the industry. It is finally nice to hear some sensible discussion about it.

    My department has quietly deprecated Java in favour of simpler building blocks (C for big real-time applications, Perl and VB for small apps). Our projects are always on-time and on-budget as a result. In comparison, hard-core OOP languages like C++ and Java have resulted in disasters ($$$$$).

    I'm not against them in principal, but the problem with Java (and to a lesser extent C++) is that OOP requires a fair bit of expertise to master. The issues are subtle and deep. These projects I would not something I would give to anyone under 5-10 years of programming experience which unfortunately seems to be the profile of your average Big-5 IT consultant.

    Java is still platform-sensitive and vulnerable to run-time errors. Its sole strength is database connectivity. You can implement some OOP concepts in C but structuring your program well. This usually gets you the results you want. OO Perl is very nice, but not for novices.

    A final comment - when I see a well made web site it seems like the scripts often end in .pl or .php. I'm starting to see good ones in .asp. Most often, the really pathetic ones end in .jsp. The results speak for themselves.

  139. Tate "stole" antipatterns. by BitterJava · · Score: 1
    I freely admit to stealing the term antipatterns. A co-author of Antipatterns wrote the forward...Skip McCormick III. (Enjoyable book, by the way.)

    I like antipatterns because they capture the simplicity of patterns in a new context: literary descriptions of common traps that do damage.

  140. Re:Design patterns and Lisp by alispguru · · Score: 2

    As written above, myfile's scope is limited to the try block, so it is not valid within the finally block.

    Thank you. I originally wrote the code with myfile above the try block, but thought that the Java designers might have made it convenient for a catch/finally clause to get at local variables in the try block. They already made a "convenient" decision that the scope of exception object bindings goes beyond the catch statement:

    try {
    ...
    }
    catch (Exception e) {
    ...
    }
    ...

    try {
    ...
    }
    catch (Exception e) {
    ...
    }

    The compiler will spit at the second catch - the first declaration of Exception e is still in scope. Bleah!
    --

    To a Lisp hacker, XML is S-expressions in drag.
  141. Re:Design patterns and Lisp by alispguru · · Score: 2

    A proper design pattern applies to all languages equally - because it's about design not about coding.

    I believe we are actually in agreement. What I thought I was saying was that most of the stuff promoted as "patterns" is actually canonical ways of getting around limitations in Java/C++.

    For example, the Visitor pattern is the canonical way of dealing with the belief/requirement in most OO langauges that writing a method that can dispatch on a published type somehow violates that type's encapsulation. In CLOS, you just write another generic function, which ends up being more efficient than the Visitor pattern (one dispatch versus two per visitation).

    The claim in the presentation I referenced is that two-thirds of the patterns presented in the original Gang of Four book have this nature. They don't apply to all languages equally, because they're unnecessary in CLOS. Patterns would be more interesting to Lisp people (and more intellectually interesting in general) if they weren't primarily used to help people get things done despite using Java/C++.
    --

    To a Lisp hacker, XML is S-expressions in drag.
  142. Re:Design patterns and Lisp by Anonymous Coward · · Score: 0

    Lisp doesn't need design patterns because most of the classic design pattersn are trivial to do in Lisp. In other words, Lisp programmers use design patterns without having to read the design pattern literature, because the ideas are already built into the language features.

    When programming in weaker languages like Java or C++, you need to make more of a conscious efforts to use high-level design. My view of the design pattern movement (whose founders seem to have a background in Smalltalk) is that they are trying to find ways to use high-level features in languages which support them only weakly. This is a good thing, but it is mostly irrelevant for Lisp programmers.

  143. .NET not quite the solution you imagine by Tablizer · · Score: 2

    (* Even C# with .net is better - it allow people to use whatever language they want on the same CLI... *)

    Only languages that closely resemble the structure of the CLI framework will have slick performance. The less it fits CLI profile, the slower it will be because the less that can be emulated "natively" by CLI and must be custom simulated.

    I don't really know what is so bad about native EXE's making OS API calls anyhow for server-based apps? If the memory is properly managed by the OS or processor, one app should not clobber another no matter what anyhow.

    It just seems like a machine language on top of machine language. I don't get it. Swapping machine brands without recompiling is not that common a need anyhow. Use an interpreter if you need that. Python and Perl have been doing that for years.

    I don't get it. These run-time-engine thingies seem like a fad. Anybody wish to fill us in?

  144. Question re: "graphics context" by Tablizer · · Score: 2

    (* Only once did my code not work on other platforms. I was writing some charting software on an NT box. This requires getting a graphics context from the OS and using that to render the images. *)

    This sounds like a contradiction. If you want it cross-platform, then why does the OS's "graphics context" matter? Isn't it the client's graphics context that matters?

    If you are using standard GIF, PNG, JPEG etc, even that shouldn't matter. Rendering vectors, for example, is not even a "graphics" operation really. I envision it like a pipe:

    vector_list --> renderer --> output_file

  145. Carpenters are only as good as their tools by Anonymous Coward · · Score: 0

    "Carpenters are only as good as their tools". You said "English is deficient. There is no genderless pronoun which suits."

    English is NOT deficient. "Them" is a genderless pronoun. It can be used to express these ideas in a genderless way. Your mistake is trying to narrow it down to the individual and then finding that there is no suitable genderless singular pronoun. However, you are talking about a group of people or an indvidual drawn from a larger group, where the individual could be male or female. For example, a carpenter can be male or female. The group of all carpenters is neither male nor female, so can be referred to as "them". If you make your statements in the plural, you don't need to worry if the individual is male or female. The gender-inclusiveness of "them" takes care of it for you.

    English is not deficient. There is a genderless pronoun which suits. QED. Sheesh.

    1. Re:Carpenters are only as good as their tools by Paradise+Pete · · Score: 1

      Don't you find it silly that to avoid the problem you have to change the message? If there were a singular genderless pronoun that wouldn't be necessary. There is not. English is deficient. QED.

  146. Another Review .... by pgrote · · Score: 2

    Opening paragraph:

    "This book discusses some design patterns and their issues and solutions for Java programming. The author uses VisualAge for Java, Websphere and DB2 as his tools, but the principles can be applied to any Java project. The codes are developed with JDK 1.2.2. Some, but not all, of them have been compiled, but not tested, in JDK 1.3.1. The author uses the term "antipattern" for a flaw in design. In addition, he attempts to have a unique descriptive term for each antipattern. If you jump from one chapter to another without specific order, you might be puzzled by all the new terms. Fortunately, the book has a good index on the keywords and the pages they are described."

    URL: Bitter Java Review

  147. Re:Design patterns and Lisp by Paradise+Pete · · Score: 1
    So what do you call a female musician in Spanish? "El musico mujer"

    Technically, la musico is correct. Same for any previously male-dominated profession, such as la presidente. The noun stays the same, but with la instead of el.

    However, this is a bit "snooty" among the common folk, and so in casual speech la musica tends to be used.

  148. WORA Worked For My App! by Bytenik · · Score: 1

    I have written a complete PDF viewer in Java 1.4 with a very customized Swing user interface. The development was all done under Windows 2000.

    I just installed it under Red Hat 7.3 the other day, and every feature worked the same as it did on Windows. All the graphics were drawn the properly, font rendering was correct. File IO, parsing, search logic, internet connections, custom Swing components, etc. all worked.

    I know that's how it's supposed to work, but I was still blown away that it all ran the very first time.

    --

    "Scientists prove we were never here."
    -- Devo