Thread: How would I achieve this dynamic_cast?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    But yes, jni is in violation of these rules by defining global names starting with an underscore.

    So is the xorg code. So is the Linux kernel code, I believe. And I have no doubt that you'll quickly find dozens of other projects that have the same problem.

    That poor rule must be the most-ignored one in the C standard.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by CornedBee View Post
    That poor rule must be the most-ignored one in the C standard.
    To be fair, the actual rule allows names beginning with a single underscore followed by a lower-case letter. In C, at least -- I don't know about C++.

    Having said that, I find the rule almost tyrannical. They could have simply reserved all names beginning with a double underscore, and allowed everybody else to use the underscore just like they do -- to indicate that a name is part of internal implementation details.

    It seems like the motivation was entirely backwards. It gives the standard library creators an easy way to "protect" internal symbols and at the same time screws the actual users of the language into inventing goofy ways of doing the same thing. I hate it, honestly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 10-31-2008, 01:26 PM
  2. Best way to achieve this
    By cloudy in forum Networking/Device Communication
    Replies: 1
    Last Post: 09-06-2006, 07:23 PM
  3. Replies: 3
    Last Post: 09-11-2005, 10:13 AM
  4. The more intelligent risks you take in life, the more you'll achieve
    By Terrance in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 05-20-2003, 05:23 PM