Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Advantages of learning Pascal?

  1. #1

    Advantages of learning Pascal?

    Hey guys... I am new here and I am really wanting to delve deeper in to game development. I have always like pascal, and I do have some C++ experience. Which would you recommend pursuing and why?

    Thanks in advance!

  2. #2

    Advantages of learning Pascal?

    Both are good languages. I have found that pascal tends to be easier to read and maintain, it is also a more forgiving languages (case insensitive, very strick syntax etc), it's good language to start to learn programming with, but it also has enough features to keep an experiened programmer going.

    C++ is also a good language, but I personally find it messy, much of the code you find in the web can be hard to follow due to either bad coding style by the author or as a result of the flexability the language provides (inline variable declarations, and functions, compiler macros etc).

    hope this helps

    Dean
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  3. #3

    Advantages of learning Pascal?

    As you asked your question in a PascalGameDevelopment I’ll be surprised if you’ll get any other answer then Pascal

    I just want to inforce technomage answer, some may say the C++ language is more “powerful” has it allows more freedom to the programmer. But that freedom comes has a cost, the code is a lot harder to read and to debug. Infact, that extra freedom requires you to create your own set of typing conventions in order to keep everything maintainable/readable.

    The only advantage in C++ is its popularity, meaning more code, more libs, more support.
    [size=9px]BEGIN GEEK CODE BLOCK
    <br />d s-- : a24 GB GCS GTW GE C++ P L+ W++ N+ K- w++++ M- PS+ PE+ Y- t+ 5+++ X+ R*
    <br />tv b+ DI++ D+ e++ h+ G-
    <br />END GEEK CODE BLOCK[/size]
    <br />Create your own GeekCode block at: <a href="">...</a>

  4. #4

    Advantages of learning Pascal?

    Has C++ really more freedoms?

    Can someone name any freedom you have in C++ you don't have in Pascal.

    What I mean is this in C++ you can do:
    Code:
    *int a;
    a=2;
    ... while in Pascal you would write:

    Code:
    var a&#58;Plongint;
    
    begin
      a&#58;=Plongint&#40;2&#41;
      ...
    Ok, you need a typecast. But the the requirement of a typecast a limitation of your freedoms?

  5. #5

    Advantages of learning Pascal?

    I'll describe a few things that remind me why I chose pascal.

    C/C++ makes extensive use of macros, so much that almost half of all code isn't code but is actually a macro. Then I look at a language like Lisp, and say these macros are utterly worthless. I'd love to be able to use a Lisp-style macro to rewrite my code, but no such luck. When it comes to discussing pascal versus C, the only thing that matters to them is how good they are at C and their measure of arrogance in that. I have only met a handful of exceptions to this. As said before the languages are quite well balanced.

    Everyone who says Pascal is a keyword heavy language, Linus Torvalds included, is dead wrong. Try studying Lisp for a while and you'll see why they have such a tiny core to the language! Everything else was added in as functions or macros, but are indistinguishable from keywords due to the S-Expression programming method. In pascal there are 63 keywords and all of them are standard English; in my time of using pascal I have barely scraped even half that number.

    You'll find a world more tutorials and resources for C/C++ simply because more people will be there providing those things. But in the grand scheme of things you'll notice that unless you are the world's best programmer that you are really just some sort of person on the sidelines of a community. When it comes to working with pascal every last person in a community counts, because we all share the same love for pascal. I haven't told my boss that everything he wants me to do I can do in half the time with Pascal because the whole company uses ANSI C ... and are paranoid of the addition of another language. They've fought PHP every step of the way because they're all C engineers. I can only imagine what they'd say to pascal. I haven't even mentioned it.

    Quote Originally Posted by dmantoine
    ... while in Pascal you would write:
    Code:
    var a&#58;Plongint;
    
    begin
      a&#58;=Plongint&#40;2&#41;
      ...
    Turbo Delphi, dunno about FPC, will let you write:
    Code:
    var a&#58;Plongint;
    
    begin
      a^&#58;=2;
      ...
    Because the caret dereferences the pointer to the actual value, and the compiler is smart enough to know what it is pointing to.

  6. #6

    Advantages of learning Pascal?

    I think the difference is that, if you want to do something potentially dangerous in pascal, you tell the compiler that you're doing something using explicit syntax, not something you could accidentally type..

    in C++, it's much too easy to get confused with the pointer references/dereferences.. and write something which looks OK, but in fact is a pile of tripe... moreover, it appears to work for a while then the uninitialized pointer gets a different value assigned to it and the system goes haywire. (I've actually done this and wiped my Bios ops: )

    It is possible to write very clean code in C++, but due to it's power and ease of misuse, it all too easily leads to bad code..
    A good programmer will write good code because he/she knows what they're doing and treats the dangerous/powerful features with the respect they deserve.


    Consider this:

    C++ : Doomsday machine has a big red button on the top saying "Press me" The user unwittingly presses it and destroys the world. or, more likely, the user trips over his dog, hits the button with his forehead and destroys the world.

    Pascal : Doomsday machine has a big red button on the top saying "Press me" but it's protected under a glass case requiring a key. the user tries to press it, but unless they have the key, they can't. Also, when their dog gets in the way, they trip over and hit the glass case.. the world is safe from accidental destruction.

    Both are capable of making doomsday devices, both will do just as good a job as the other, it's just that with Pascal, if you destroy the world, it's because it's what you really wanted to do.

    I think that too many beginners with C++ have given it a bad reputation as a hard and unforgiving language to learn. Which is a shame really. 'cos with a little discipline, it's not hard at all.


    As for games development? 6 and 2 threes really. Both compile to fast code, both have access to rendering and physics libs.. it depends on what you're after.

    if you want to write for a major games company, you're probably looking at C++.. just because for some reason, it's the industry standard.

    If you're doing it for yourself or for your own firm, it's your choice.
    Pascal can do almost everything C++ can do, it's just another language. You may find that you get your game up and running faster with Pascal if you like the language as you'll probably make fewer pointer mistakes, but then C++ does have the support advantage, something we're trying to address here... and have made significant progress with.

    You just have to look at some of the games written using Pascal to appreciate it's power and the lack of limitations.

    In the end, it's your call. But learning Pascal made me into a better programmer in other languages... including C++.

  7. #7

    Advantages of learning Pascal?

    Quote Originally Posted by Robert Kosek
    Turbo Delphi, dunno about FPC, will let you write:
    You didn't understand the point. The point was C lets you do dangerous things without complaining, like assigning numbers to pointers. Pascal requires you to do a typecast first.

    Is such a requirement really an actual limitation of my freedom as programmer?

    I disagree with that. I have all the freedom I need in Pascal, and I will not tell people that you have more freedom in C, as that simply isn't true.

  8. #8

    Advantages of learning Pascal?

    C/C++ let you do some really stupid things and sometimes it takes ages to find bugs that are caused by a simple typing error, like

    Code:
    if &#40;this = that&#41; &#123;
    // Do something
    &#125;
    I've never understood why C-compilers let you do that, what's the point?

    Who'd like to do similar thing in Pascal?
    [pascal]
    if (this := that) then
    // Do something
    [/pascal]

    More on topic, I've been coding in Pascal for almost 20 years, it was the first language (with x86 assembly of course) I learned when I moved to PC from C64. To me Pascal has very clean syntax and one of it's strenghts is the strict forcing of things, silly typos don't cause that huge problems.

    Sure I've learned some C/C++ too (along with about 20 other programming/scripting languages), but I've never used it to actually code my stuff, just wrote some exercises and such, to me Pascal is the superior language for the serious stuff when you need to get things done.
    If you develop an idiot proof system, the nature develops better idiots.

  9. #9

    Advantages of learning Pascal?

    Well, the assignment vs comparison thing is a powerful tool for some circumstances.

    Consider.

    Code:
    if &#40; myVar = SomeFunction &#41;
    &#123;
      DoSomethingWithMyVar&#40; myVar &#41;;
    &#125;
    with this, if myVar evaluates to true, or a non-zero value, you can immediately do something with it.. So it's doing an assignment and a boolean test at the same time.

    the alternative would be
    Code:
    myVar = SomeFunction&#40;&#41;;
    if&#40; myVar > 0 &#41;
    &#123;
      DoSomethingWithMyVar&#40; myVar &#41;;
    &#125;

    But the number of valid uses for this is small compared to the number of bugs it creates by its use by unwitting coders.

  10. #10

    Re: Advantages of learning Pascal?

    Quote Originally Posted by Chris
    Hey guys... I am new here and I am really wanting to delve deeper in to game development. I have always like pascal, and I do have some C++ experience. Which would you recommend pursuing and why?
    If you wanted to get weak arguments for your question in the best case or a flamewar in the worst, it's ok. However, it is the same as saying: "I want to write a book, what language should I learn? English or Spanish?"

    The best case for you should be to learn both (or all) of them. If you really want to become a professional developer, a particular programming language should be the least important factor for you. If you just want to keep the game development as a hobby, then it doesn't matter what language you pick, there are communities for you to participate for both.

Page 1 of 3 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
  •