Re: isInstance problem

Discussion in 'Java' started by Ben Jessel, Jul 10, 2003.

  1. Ben Jessel

    Ben Jessel Guest

    O.k, o.k. I see your point.
    I first started using it after I got fed up of trying to debug code
    where class variables / argument variables and method variables had
    the same name. Bad practice, yes, but with java beans / injectors and
    selectors / other people's does happen.

    There's certainly merit in prefixing method argument variables with
    a_. You can trace how the variable is changed / interacted with quite
    easily through the method. It helps you spot side effects as well.

    I also try to use type prefixes for primitives. eg, a_s - argument
    String. Most time with object instances, it's pretty obvious by the
    name what they represent eg, userDetails, myResultSet, DBConn. So yes,
    type prefixes are

    I think it is good practice to use notation of some form. The trouble
    is, using it badly / incorrectly / inconsistently can be more damaging
    than not using it at all.

    Harald Hein <> wrote in message news:<Xns93A64390F1592hhtoken@>...
    > "Ben Jessel" wrote:
    > > Oh....what's wrong with my hungarian notation then?

    > Everything. It is made by idiots for idiots. For people who can't
    > remember for a second that their variable "name" contains a String and
    > not an integer, so they need to call it "sName". For people who don't
    > get the fact that in object-oriented programming you constantly create
    > new types when you define a new class - so you quickly run out of
    > prefix characters for your own classes. For people who don't get
    > polymorphism (it doesn't matter if if a method returns an object of
    > type X or Y, as long as the returned object is suitable for the task).
    > For people who don't get the fact that almost all variables in Java are
    > references to objects, not the objects (so in HN almost every variable
    > needs to be prefixed with something like an "r", giving you shit like
    > "rsName").
    > HN source code looks like someone just vomited in a bucket of
    > characters, shited on top of it, shaked the whole mess and poured it
    > over the monitor. I refuse to go near such brain farts.
    > HH
    Ben Jessel, Jul 10, 2003
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joona I Palaste

    Re: isInstance problem

    Joona I Palaste, Jul 1, 2003, in forum: Java
    George W. Cherry
    Jul 2, 2003
  2. Michal Vitecek

    isinstance() bug

    Michal Vitecek, Jan 28, 2004, in forum: Python
    Sidharth Kuruvila
    Jan 28, 2004
  3. Michal Vitecek

    Re: isinstance() bug

    Michal Vitecek, Jan 28, 2004, in forum: Python
    Rainer Deyke
    Jan 29, 2004
  4. Jordan Rastrick

    Is isinstance always "considered harmful"?

    Jordan Rastrick, May 15, 2005, in forum: Python
    Jordan Rastrick
    May 16, 2005
  5. Mac

    bug with isinstance() ?

    Mac, Jun 1, 2005, in forum: Python

Share This Page