[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT - trivial programming language



On Sun, May 30, 2004 at 07:45:41PM -0700, Steve Lamb wrote:
| Kai Grossjohann wrote:
| > If you have more than one level, then you need to hit >> more often.
| > (At least if my understanding of >> does is right.)

Correct.

|     As I said, meaningful problem.

|     I certainly don't see this a problem

Same here.

|     as I could just prefix it with a count

Almost.  With << and >>, the numerical prefix is the number of lines
to operate on, not the number of times to repeat.  (I don't know why
it is different from all other commands)  Nonetheless, type >> once
and then, for example, 3. to repeat the command three more times.

| and I have found, from personal experience,
| that the problems it avoids far outweights an added keystroke here and there.

Let's not mention the time I spent far too many hours trying to debug
this piece of C++ code :
    while (item = list->next()) ;
        {
        cout << *item ;
        }

The list is empty the first time this piece of code is reached.  The
program crashes (SEGV) every time, on the line with the 'cout'
statement.  Can you see the problem?  The same typo in python would
result in a quickly-found syntax error.


In practice the "lack" of braces solves more problems than it creates.
If you want proof, then try it!  :-)

-D

PS. I don't remember the exact spelling for getting the next item
    from an STL list, but it is similar enough to what I wrote above.

PPS. The list returns NULL when trying to access elements beyond the
     end of the list.

-- 
If your life is a hard drive,
Christ can be your backup.
 
www: http://dman13.dyndns.org/~dman/            jabber: dman@dman13.dyndns.org

Attachment: signature.asc
Description: Digital signature


Reply to: