Subject: Re: Newbie questions
From: Erik Naggum <erik@naggum.no>
Date: 1999/05/05
Newsgroups: comp.ai,comp.lang.lisp
Message-ID: <3134853317084191_-_@naggum.no>

* joshs@removethisbeforesending.cetasoft.com (Joshua Scholar)
| The overall point is that type checking saves you from tons and tons of
| late night typos and logic errors.

  well, type checking is necessary, but it appears that you don't know the
  difference between compile-time and run-time type checking, and assume
  that without compile-time type checking, there wouldn't be any.  _that_
  would be a source of tons and tons of typos and logic errors.  however,
  the ridiculously simple-minded static type checking in C++ restrict you
  to a single line of inheritance, has no universal supertype, and offers
  no way to know the type of an object at run-time except by embedding it
  in a class and using RTTI.  that is sufficiently inconvenient that the
  customary way to deal with multiple types of return values is to use an
  "invalid value", like the infamous NULL pointer.

| Passing the wrong parameter, parameters in the wrong order, the wrong
| subfield etc. are common typos and often caught by the compiler -
| especially if you design your class interfaces to catch as much as
| possible.  In code that rarely runs or isn't expected to run under normal
| conditions, this sort of correctness checking is very important.

  it sounds like you think you're telling people something new.  why?  this
  is so obvious it's been taken care of in much better than to require the
  programmer to declare the types of _all_ objects _explicitly_, which is,
  unsurprisingly, a major source of typos and logic errors, not to mention
  recompilation and header file (interface) changes that need to propagate
  to other team members.

  oh, by the way, since I see your favorite argument coming: knowing C++ is
  part of growing up.  discarding C++ is a matter of course once you have
  grown up.  explicit type declarations is useful for new programmers the
  same way bicycles for kids have support wheels.  few kids argue against
  their removal.

#:Erik