Page 7 of 7 FirstFirst ... 567
Results 61 to 67 of 67

Thread: John Carmack's Comments On C/C++

  1. #61
    Join Date
    Mar 2010
    Location
    Slovenia
    Posts
    389

    Default

    Quote Originally Posted by BO$$ View Post
    Sometimes I wonder why don't more people use C# or Java especially since most don't write performance critical code. And since for high frequency trading some companies use Java I think that you can even choose it for performance critical code. So what's not to like? Faster development, less bugs, better debugging.... I think people choose C++ just to show off.
    There are many bad or/and lazy Java and C# programers, which write slow and buggy code. I think every programer should know some assembly and C.

  2. #62
    Join Date
    Jan 2013
    Posts
    1,346

    Default

    Quote Originally Posted by susikala View Post
    Overall, I believe the discussion about which programming language is better and specifically spending time on discussing to which extent constants or likewise should be used or not is pointless. Most programming languages are the same and the differences are mostly, in my opinion, a question of personal preference and a lot of ego.

    What I actually think one of the overlooked sides of many languages is intuitivity. If you're already designing a high-level language which is meant to be used by humans, why not do it right? Many languages are just horribly not intuitive in really bad and broken ways and that makes them bad languages. Of course, what is intuitive to one person may be completely arbitrary to someone else and that may be the reason why some languages have made such bad decisions, but take Java for example:

    Why should, when considering,
    String one, two;
    // User inputs two strings, both are "number"

    This evolve to false?
    one == two;

    In which cases does it make sense to check if two String objects are the same object? In which of the countless cases where a comparison of two strings of characters is involved would you not be interested in testing for character equality? Why should I be forced to use something so ugly as one.equals(two)? That makes absolutely no sense. Of course, if you treat Strings as non-scalars, and if you define the equal operator to work the same on all objects, you could claim you're only being consistent. But is that intuitive? Would someone who learned that 5 == 5 is true ever think that the above example with the strings should evaluate to false? What is the point in deciding to hide away the arraylike/char pointer nature of a C "string" in introducing a proper String object in java, but then keeping the old garbage by forcing you to use an object method for comparison? How dumb is that?

    There are similar examples in PHP for why intuitivity is so important, and why lack thereof makes a language so bad.
    I think the best way to do it would be this:

    if both string arguments are pooled (ie. immutable) --> compare by reference
    if either of the string arguments are not pooled --> compare by character equality

    Does any language do it like this, and if not, why? Comparing by reference obviously has a speed benefit, but it's useless when the strings (or one of them) aren't pooled. Conversely, comparing by characters is needless overhead when the strings are pooled. This would to me seem to be the obvious solution.

  3. #63
    Join Date
    Sep 2010
    Posts
    419

    Default

    @dee
    Don't put immutable with pooled.
    You might make someone think pooled means the same as immutable.

    (immutable strings can also exist not pooled)

    Your point of useless when strings are not pooled is the best point about the string equality checks debate I ever read.
    (Same counts for equality of objects though.)
    Last edited by plonoma; 01-17-2013 at 09:44 AM. Reason: added point about objects

  4. #64
    Join Date
    Aug 2010
    Location
    France
    Posts
    7

    Default John Carmack's applauds D language

    John Carmack as already said that D is a good language for new code as here:

    Quote Originally Posted by John Carmack's
    Using D for my daily work is not an option, but I applaud thier inclusion of a "pure" attribute.
    http://twitter.com/ID_AA_Carmack/sta...11220092682240

    But for old code like has John Carmack they are no way to move that is a little too big.

  5. #65
    Join Date
    Jan 2013
    Posts
    1,346

    Default

    Quote Originally Posted by plonoma View Post
    @dee
    Don't put immutable with pooled.
    You might make someone think pooled means the same as immutable.
    Yes, immutable is not necessarily pooled, I just meant that a pooled string usually is immutable.

  6. #66
    Join Date
    Aug 2010
    Location
    France
    Posts
    7

    Default

    As i already said D is better choice when starting a new code otherwise depend which size is your project.

    John Carmack's project are to big to move in another language


    Quote Originally Posted by John Carmack
    Using D for my daily work is not an option, but I applaud thier inclusion of a "pure" attribute.
    source https://twitter.com/ID_AA_Carmack/st...11220092682240

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •