Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Another Pascal vs. C argument

  1. #11
    After all this is pascalgamedevelopment, right? So if we can't talk about our favourite language Pascal or Object Pascal here, where else? I can see no sense in comparing C++ and Pascal here, because it is a Pascal affine site. I thought Pascal programmers only talk about C++ because it only consists of comments {}
    Best regards,
    Cybermonkey

  2. #12
    Quote Originally Posted by Cybermonkey View Post
    After all this is pascalgamedevelopment, right? So if we can't talk about our favourite language Pascal or Object Pascal here, where else? I can see no sense in comparing C++ and Pascal here, because it is a Pascal affine site. I thought Pascal programmers only talk about C++ because it only consists of comments {}
    haha! good one
    I agree, we are Pascal-ers here
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  3. #13
    How much faster is C++ than FPC ? Can it be measured ? What is the bottleneck ?

  4. #14
    the difference is marginal and depends a lot on the compiler you use. overall, gcc produces slightly faster code than fpc, but as I said the difference is fairly small.

  5. #15
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Any good object pascal coder can do anything that a good C++ coder can do. Yes there are minor differences with various C++ compilers producing more optimized code but as Dan said, the difference is so negligible that the only time you'd make a choice based upon that metric alone is on a super computing cluster where such negligible differences can add up across many thousands of instances.

    And that said, the 32bit Delphi compiler has been known to beat out MSVC in various cases (thanks FastMM)

    I think the only arguments that should be made are for learning the language, what tools are available for constructing your patterns and how that effects time to market (how long it takes to finish the project, including in that sense how many people you need and the availability of those skills)

    Everybody knows pascal is easier to learn and it's for a pretty basic reason really : English words used instead of symbols, which were only chosen in C back in the early days to save memory, not keystrokes. Back then they also limited var names to 8 chars giving rise to retarded practices in code where all the vars are called things like Agr, syHbal, A, B, C etc

    It's also a strongly typed language which by design gives rise to far fewer bugs than C/C++. A good C/C++ programmer won't hit those bugs because they'll have a coding style that provides the same error reduction but that basically means they're manually following a process which pascal by it's very nature, enforces. A waste of effort for a new coder.

    C is also case sensitive, again an archaic throwback to the low memory days where they wanted to make better use of each byte hence making the distinction between lower and upper case so I can call one var c and the other C and they're two distinct vars.

    How on earth, in any sence, does case sensitivity help programmers? it simply does not, it makes code harder to read and introduces another avenue for mistakes and can lead to some really nasty bugs where you actually do have two vars of the same name but with different cases. In that instance you don't even get a warning, a simple typo causes a really hard to find bug. An experienced C coder would now argue that you avoid having the same words for vars so you don't run the risk of that happening - the response to that of course is obvious.

    And then there's C/C++ string handling which is NONE. C/C++ doesn't support stings, that's left to the libs instead, string classes and so on. But there's so many different ways of handling strings in C, so many different 'standard' libs, that it's always a problem when introducing large sections of code to one another. Pascal has native strings, even native unicode support on the later compilers. All the memory handling is done for you, scope etc.

    And the nice thing is that if I really wanted to, I could do strings just like any C/C++ lib does, all I have to do is process the data manually just like a C string class would do anyway.

    Oh and finally, C++ was C with ++ added as it was a kind of joke that C++ is an increment of C. (++ being the increment operator) but look at this example :

    int C = 5;
    int D = C++;

    What's now stored in D? 6? you'd think so wouldn't you? no, in fact it's 5, and C is now 6. C++ increments AFTER the var has been used, if you wanted 6 stored in D then you'd write :

    int C = 5;
    int D = ++C;

    What I demonstrate here is that C++, the supposed evolution of C is in fact no better than C, as what's displayed in the statement is still equal to C and the incremented value has yet to be used. Not to mention that C hasn't been declared or set yet.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  6. #16
    Here is some interesting article about an analysis of programer hapines one guy made:
    http://codeofrob.com/entries/evented...b-commits.html
    The most interesting are results. Based on his results Delphi developers are the most happy ones

  7. #17
    Quote Originally Posted by phibermon View Post
    Any good object pascal coder can do anything that a good C++ coder can do. Yes there are minor differences with various C++ compilers producing more optimized code but as Dan said, the difference is so negligible that the only time you'd make a choice based upon that metric alone is on a super computing cluster where such negligible differences can add up across many thousands of instances.
    True, but then again by that argument I could also say that any JavaScript programmer can do anything that a good C++ coder can do. Not that I'm beating on JavaScript, I actually quite like the language. The point is that you could substitute any language. Performance isn't everything. Java actually fixes quite a few problems discovered in C++ :-)

    Quote Originally Posted by phibermon View Post
    And that said, the 32bit Delphi compiler has been known to beat out MSVC in various cases (thanks FastMM)
    Microbenchmarks are pretty meaningless anyway, but MSVC is far from being the final word in compiler technology. Again, if performance were everything then I'd better go learn me some (more) Fortran.

    Quote Originally Posted by phibermon View Post
    I think the only arguments that should be made are for learning the language, what tools are available for constructing your patterns and how that effects time to market (how long it takes to finish the project, including in that sense how many people you need and the availability of those skills)
    Excellent, I was wondering when you'd move on to talking about SmallTalk! ;-)

    Quote Originally Posted by phibermon View Post
    Everybody knows pascal is easier to learn and it's for a pretty basic reason really : English words used instead of symbols, which were only chosen in C back in the early days to save memory, not keystrokes. Back then they also limited var names to 8 chars giving rise to retarded practices in code where all the vars are called things like Agr, syHbal, A, B, C etc
    *Ahem* I'm pretty sure "those" days that you refer to were quite a bit before your time! The world of computers was very different back then, I just can't see how this is a relevant point.

    Quote Originally Posted by phibermon View Post
    It's also a strongly typed language which by design gives rise to far fewer bugs than C/C++. A good C/C++ programmer won't hit those bugs because they'll have a coding style that provides the same error reduction but that basically means they're manually following a process which pascal by it's very nature, enforces. A waste of effort for a new coder.
    Well now if Pascal has a monopoly on bug free code I'm sure there's quite a lot of academics that would like to know more! Think of the defence industry and how much money they could save with bug free software!! More seriously, let's get real - Pascal's type system isn't revolutionary. It's good enough though, I'm not beating on it.

    Quote Originally Posted by phibermon View Post
    C is also case sensitive, again an archaic throwback to the low memory days where they wanted to make better use of each byte hence making the distinction between lower and upper case so I can call one var c and the other C and they're two distinct vars.
    There's quite a lot of case-sensitive languages ... I guess, programmers just find naming things hard?

    Quote Originally Posted by phibermon View Post
    How on earth, in any sence, does case sensitivity help programmers? it simply does not, it makes code harder to read and introduces another avenue for mistakes and can lead to some really nasty bugs where you actually do have two vars of the same name but with different cases. In that instance you don't even get a warning, a simple typo causes a really hard to find bug. An experienced C coder would now argue that you avoid having the same words for vars so you don't run the risk of that happening - the response to that of course is obvious.
    I can honestly say that I've never come across this kind of bug. Maybe it is a learned discipline, I don't really know, but I think you might be making a mountain out of a molehill.

    Quote Originally Posted by phibermon View Post
    And then there's C/C++ string handling which is NONE. C/C++ doesn't support stings, that's left to the libs instead, string classes and so on. But there's so many different ways of handling strings in C, so many different 'standard' libs, that it's always a problem when introducing large sections of code to one another. Pascal has native strings, even native unicode support on the later compilers. All the memory handling is done for you, scope etc.
    I'm not too sure about that, there's just the C standard library for strings, and the standard C++ string container. Also, C++11 has standard unicode string support (hooray!).

    Quote Originally Posted by phibermon View Post
    And the nice thing is that if I really wanted to, I could do strings just like any C/C++ lib does, all I have to do is process the data manually just like a C string class would do anyway.
    Why would you want to do that if C string handling is so bad?

    Quote Originally Posted by phibermon View Post
    Oh and finally, C++ was C with ++ added as it was a kind of joke that C++ is an increment of C. (++ being the increment operator) but look at this example :

    int C = 5;
    int D = C++;

    What's now stored in D? 6? you'd think so wouldn't you? no, in fact it's 5, and C is now 6. C++ increments AFTER the var has been used, if you wanted 6 stored in D then you'd write :

    int C = 5;
    int D = ++C;
    Aw come on that's kids stuff. Everyone knows pre-increment is write then read. If you really want to go down the rabbit hole (I know you don't) then you would have pointed out that two increments in the same statement is undefined behaviour.

    Quote Originally Posted by phibermon View Post
    What I demonstrate here is that C++, the supposed evolution of C is in fact no better than C, as what's displayed in the statement is still equal to C and the incremented value has yet to be used. Not to mention that C hasn't been declared or set yet.
    That's it, I'm going to learn me some Ada!

  8. #18
    @theglib Why are you resurrecting this old thread?

  9. #19
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Quote Originally Posted by SilverWarior View Post
    @theglib Why are you resurrecting this old thread?
    He's an old friend trying to goad me into a debate because he misses it as much as me

    Four and a half years ago - no longer relevant. Reading it back I'm fairly certain I wrote the references to the increment operator as tongue in cheek - a long standing joke that didn't originate with me.

    As for the other points? there are different considerations for a fledgling coder compared to a seasoned professional. Pascal was always the go-to language in academia for teaching programming techniques. Indeed the creator of the language - Niklaus Wirth - intended pascal to be used in this way. It has now widely been supplanted by Java in this role which is itself chosen over C++ for the same reasons OOP was before it : the idea is to teach programming - not syntax.

    The points taken in that context are valid. Comments such as "Aw come on that's kids stuff. Everyone knows pre-increment is write then read." are not helpful since we *do* teach a lot of kids here. We're not trying to demonstrate our knowledge - we're trying to share it.

    Ultimately you should choose whatever language you're most comfortable with that allows you to target the platforms you desire. You'll find communities out there to help you no matter what you choose.

    Me and @thegilb must now play tic-tac-toe where we will eventually discover that the only winning move is not to play.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  10. #20
    Quote Originally Posted by phibermon View Post
    Ultimately you should choose whatever language you're most comfortable with that allows you to target the platforms you desire. You'll find communities out there to help you no matter what you choose.
    I completely agree with that.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

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