Announcement

Collapse
No announcement yet.

John Carmack's Comments On C/C++

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • phoronix
    started a topic John Carmack's Comments On C/C++

    John Carmack's Comments On C/C++

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

    John Carmack, the veteran game programmer that co-founded id Software and was the lead developer on the id Tech engine and their most popular game titles, has shared some new opinions on C/C++ programming as it pertains to the id Tech game engine...

    http://www.phoronix.com/vr.php?view=MTI3NDQ

  • bioinfornatics
    replied
    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


    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

    Leave a comment:


  • dee.
    replied
    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.

    Leave a comment:


  • bioinfornatics
    replied
    John Carmack's applauds D language

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

    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.

    Leave a comment:


  • plonoma
    replied
    @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, 10:44 AM. Reason: added point about objects

    Leave a comment:


  • dee.
    replied
    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.

    Leave a comment:


  • LightBit
    replied
    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.

    Leave a comment:


  • Jarrod558
    replied
    This is why I like D. Compared to C++/C#/Java, D gets a lot of things right.

    Leave a comment:


  • droste
    replied
    Originally posted by dnebdal View Post
    Just adding a native unsigned 8-bit int type to java would make me happy.
    I don't understand why 'byte' is signed in the first place, but it wouldn't give you much if there was such type. Every integer operation where none of the operands is a long is done in 32bit.
    so it's byte + byte is converted to int + int and the result is converted back to byte.
    This means you would use a little bit less space but have a more expensive operation, which is probably the reason 'byte' is signed. so byte2int and int2byte is just adding and removing bits from/to one end.

    Leave a comment:


  • BlackStar
    replied
    Originally posted by Ancurio View Post
    So what does "unsigned byte" do then?
    Fail to compile.

    Leave a comment:

Working...
X