Re: Index a #define string

From: Paul Mensonides (leavings_at_comcast.net)
Date: 04/19/04


Date: Sun, 18 Apr 2004 15:27:07 -0700

Ioannis Vranos wrote:
> "Paul Mensonides" <leavings@comcast.net> wrote in message

> Macros must be avoided where possible. In an effort to not hurt your
> feelings we can rephrase that "Use macros only when needed".

You're not hurting my feelings, you're simply wrong and extremely naive.

> Choose
> whatever fits you better, they are both the same.

No, they are not. You simply have no concept of the things that I am talking
about because they are so far above your level of expertise in the fields in
which they apply.

> And C++ is not C,
> you may have been a C programmer for some long time and have done a
> lot of real and excellent work with macros, but C++ is not C and in
> most cases the language provides superior alternatives.

No, in *many* cases the language provides superior alternatives. What's amazing
here is your complete lack of willingness to accept that you don't know
everything. You think that you know what I'm talking about, but apparently you
have no idea. Otherwise, you wouldn't be saying that the functionality can be
replicated with, e.g., templates, because they can't.

> On the other hand, if you *still* program in C and you use macros,
> then what we discuss here does not apply.

I'm not talking about C, and the context that applies to what I'm saying applies
far more in C++ (though it still does in C).

>> As an aside, the core language is no more protected from name
>> clashes than the preprocessor. Namespaces serve to classify and
>> organize names, but they do not, at a language level, protect them.
>> The only things that stop name collision are
>
>
> Namespaces do not exist to protect from name collisions. Namespaces
> are the implementation of the modular programming paradigm

Which is exactly what I said, believe me, I know what namespaces are.

Regards,
Paul Mensonides



Relevant Pages

  • Re: Nested classes in PHP?
    ... language better suited for a task. ... archive, and namespaces have been seriously considered, and apparently ... > another to do with connecting to a MySQL database. ... An editor supporting namespaces/modules would do the same (like Java ...
    (comp.lang.php)
  • Re: PHP global namespace clogged up
    ... Stop blaming the language for your inability to organise your ... PHP is not fully objected oriented and has never claimed to be. ... but it does give access to features ... As for namespaces, according to the Gura ...
    (comp.lang.php)
  • Re: UDTs (as was vb6)
    ... which makes Option Strict Off in fact not so much needed anymore. ... you will understand why namespaces make a lot of sense. ... VB is a multi-purpose language that implements ... No Printer object here, right? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: trouble creating array of objects
    ... >> You are coming at this via a limited programming universe lending ... >> Both are in the language, and both are language basics. ... >> One can only conclude then that you don't understand namespaces. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: [PHP] Class privacy and variable identifiers
    ... David Morse wrote: ... the manual and working with the language for a few months: ... as an aside there *may* be namespaces in php ... Does PHP 5 ...
    (php.general)