Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34

Thread: Promoting Free Pascal in Schools

  1. #1
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Promoting Free Pascal in Schools

    Hmm... I wonder if there would be some validity to trying to rally support from schools and universities to adopt Pascal via FPC into their curriculum.

    I mean... Pascal used to be the defaco learning language, why not now? C sucks for trying to learn concepts and you pay a high price for even minor beginner mistakes. I remember my first C program froze up and rebooted the computer when I ran it. It had only a simple code block... no code! :lol:

    I'm sure there can be a strong case put together for the schools to pick it up. Many universities use GCC in their programs so why not another opensource compiler?

    And Pascal is just a better language to learn programming concepts in. Object Pascal is a great way to learn about OOP too! Rather than your messy C/C++ conventions Borland's rendition of Object management is great. Why else would the industry still use it?

    Borland teaches courses for Pascal for use with their Delphi so why can't Free Pascal have the same. It just needs support by some key universities and it's sure to catch on as an alternative to teaching Java or *gak* VB.

    Any takers on this idea? FPK? Synopsis? Lightning?
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #2

    Promoting Free Pascal in Schools

    When I went to school I got a 4 week Pascal course (as a introduction for the C course). I heard later that it was the last year they teached pascal, after that they replaced Pascal and C with Java. That was over 6 years ago, but I think its still the case.

  3. #3

    Promoting Free Pascal in Schools

    The main problem is that the companies don't use pascal. Delphi is an exception and it is regulary used in companies but I don't think Lazarus is an alternative as it is still under heavy development and it is not the best choise for database programming. Companies don't mind to spend money if they get quality for it.

    My opinion is that the GTK 1 interface is too ugly if you want to develop a commercial program. Lazarus should support the Windows gui and qt support would be very nice for both Open Source and commercial programmers.

  4. #4

    Promoting Free Pascal in Schools

    What I just don't understand, is why (game)companies in general don't use object pascal. I mean, we all know about how C++ came off of C when it was popular, and they had a huge userbase there, but why not use Object Pascal.

    Object Pascal is...
    -Clean
    -OOP
    -Faster to develop in
    -Easier to develop in
    -Powerful

    Those five elements are the same you see in C, with the exception of it being clean(I'd really just say Object Pascal is bit cleaner than C).

    Anyway...Object Pascal is a perfect candidate for learning. I kind of wish I'd have skipped BASIC(Not that basic is all that bad), and jumped into Pascal a few years ago.


  5. #5

    Promoting Free Pascal in Schools

    Pascal has the reputation of being an ancient language. C++ is the most popular programming language these days and if you want to write games for a console, I don't think there are compilers available for other languages. Or am I wrong?

  6. #6
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Promoting Free Pascal in Schools

    Well those based on ARM processors are close to getting a Free Pascal compiler. Well FPC 4 GBA pending... I beleive there is also a Visual Basic solution aswell. Then again... there is always the assemblers themselves, but I doubt anyone would make the next greatest console hit in pure assembly.


    I've found out some more information on licencing for consoles <u>here</u>.

    And <u>here</u> is the one that FPC 4 GBA promoters will take special interest in. I hope that future Pascal developers will be able to challange and get one of these bad boys some day.


    I think the key to Pascal's return to fame is the schools! It still has a reputation fobeing a teaching language so thats an in. And form there people will learn more about Pascal or namely the dilect of Object Pascal and learn of it's power, cleanliness, availability, stability and hopefully in the near future improved speed of it's compilers compiled & assembled code.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  7. #7

    Promoting Free Pascal in Schools

    I think Borland Pascal is taught at the local polytechnic before moving onto Delphi - i also think they teach game programming as part of the Bachelors degree..*i think*.

    What I just don't understand, is why (game)companies in general don't use object pascal. I mean, we all know about how C++ came off of C when it was popular, and they had a huge userbase there, but why not use Object Pascal.
    I dunno why C/C++ has been favoured by dev houses..maybe it's because the API's are released in those languages and no one wants to spend the time ( and no doubt money ) in using a 3rd party / in-house port..there's the issue of documentation, troubleshooting etc and ofcourse dont forget there are far more C/C++ game developers around than (Object) Pascal. I think Bioware ( Baldurs Gate, Neverwinter Nights, MDK2 etc ) uses Delphi to some extent for various tools and what not.

    I dunno about you guys, but writing something like Quake 3 and having to type BEGIN all the time would drive me nuts.

  8. #8

    Promoting Free Pascal in Schools

    As a professional game developer myself, I can answer with some authority on this. C++ is the standard in games development because every commercial and the vast majority of free libraries out there for games are written with C or C++ in mind. A lot of game development grew out of the hacker scene, and in that scene they mostly used C because it was a high level language that still allowed the programmer easy access to the low level metal of the PC.

    A lot of the stuff we do in game coding involves pointer manipulation, and as a long time Pascal and C programmer, I have to say that pointers are a whole lot easier to use in C.

    C++ offers templates. Pascal does not have anything to rival templates yet. C++ offers full support of operator overloading, which only just now FPC supports in a limited manner and Delphi is gaining even more limited support for operator overloading.

    Object Pascal may support classes, but the fact that every class inherits from TObject is one major drawback due to two things: every class instance incurs the cost of a pointer to the VMT because at least one method in TObject is declared virtual, and every class must be allocated individually. In C++, a class instance can be declared locally on the stack. Can't do that in Object Pascal. In C++, a class only incurs the cost of a VMT pointer if a method is declared virtual. Therefore
    Code:
    class TSimple
    &#123;
    public&#58;
      int member;
    &#125;;
    only costs four bytes. In Object Pascal
    Code:
    type
      TSimple = class
      public
        member&#58; Integer;
      end;
    is eight bytes in size. Plus you must allocate each class instance by calling Create, which calls several methods of TObject internally. Creating an instance of the same class for use within a function in C++ takes nothing more than just declaring a variable of type TSimple, which takes no more CPU time than it takes to decrement the stack pointer by four bytes.

    Say you want a function to create a given sized array of TSimple instances and initialise each array element to 1. The code for this in C would be
    Code:
    TSimple *AllocArray&#40;int size&#41;
    &#123;
      TSimple *pArray = &#40;TSimple *&#41;malloc&#40;size * sizeof&#40;TSimple&#41;&#41;;
      memset&#40;pArray, 1, size * sizeof&#40;TSimple&#41;&#41;;
    &#125;
    One memory allocation. One call to memset. Simple. Quick. Blindingly fast. Now for the equivalent in Object Pascal.
    Code:
    type
      PSimple = ^TSimple;
      PSimpleArray&#58; array &#91;0..High&#40;Integer&#41; div SizeOf&#40;TSimple&#41;&#93; of PSimple;
    
    function AllocArray&#40;size&#58; Integer&#41;&#58; PSimpleArray;
    var
      pArray&#58; PSimpleArray;
      i&#58; Integer;
    begin
      GetMem&#40;pArray, size * SizeOf&#40;PSimple&#41;&#41;;
      for i &#58;= 0 to size - 1 do
      begin
        pArray&#91;i&#93; &#58;= TSimple.Create;
        pArray&#91;i&#93;.member &#58;= 1;
      end;
    end;
    That was a lot more complex. We first have to declare a new type that is a pointer to the type we want. Then we have to declare an array of the largest possible size of that pointer type to handle the unknown array size. Allocate an array of pointers to the class instances, then allocate and initialise each class instance individually. Each call to Create calls other methods of TObject, which all takes time per instance. TObject even uses dynamic strings, which on a console system are a big no-no. You allocate once and never reallocate. Unfortunately, dynamic strings reallocate memory almost every time you so much as sneeze at them.

    I'll leave the cleaning up of the array to the reader. Hint: The C version is one statement.

    Another benefit for C++ is the huge support of tools such as development tools and debuggers. The debugger in Delphi, even in the latest version, is woeful and horribly inadequate when compared to the debugging tools we have access to with C++.

    This post may seem like it is bagging Pascal as a game development language. The intent was to point out some reasons why C and C++ is the preferred language in game development, and some of the reasons why. Pascal is a great language. Every language has its strong points and its bad points. In the world of professional game development, C and C++ have more benefits and a lot more support than Object Pascal could provide.

    P.S. Bioware used to use C++ Builder for their tools. After Neverwinter Nights, they are looking for alternatives (still using C++). Quotes from http://www.gamasutra.com/gdc2003/fea...kington_03.htm
    Last, but not least, we had problems with the toolset component of the project. The Aurora Toolset was built in Borland C++ Builder, based on the fact that we heard all sorts of rumors of a Linux and Macintosh version of Builder. However, this turned into a monstrous headache for development. C++ Builder would throw floating-point exceptions during the middle of the graphics engine, which would not show in the middle of the same library run through Visual C. We couldn't link the graphics library with Builder without going to a DLL, so we had to make the graphics library source tree work on C++ Builder as well. The Macintosh version of Builder vanished into the land of vaporware, and we were left holding the bag.
    So, we are trying to duplicate the rules code in both C++ Builder and Visual C for the most important components. We are investigating alternatives to C++ Builder for future projects.
    Even trying to maintain C++ code that compiles on both Visual C++ and C++ Builder is a major PITA. Believe me, I've been there and done that. Almost like trying to maintain code that compiles in Delphi and Free Pascal. That is a growing rift right there.

    Hint: If they had masked floating point exceptions, they would not have had those errors. This is a pity though that the Visual C++ runtime masks floating point exceptions by default and Borland's runtime does not. Direct3D and OpenGL throw floating point exceptions all over the place.

  9. #9

    Promoting Free Pascal in Schools

    Good points albeight a bit out of topic, question was pascal in schools.

    IMHO pascal will not return into the mainsteam but it may survive with a smaller userbase if FPC and most importantly Lazarus teams can get it right. (the former is basicly "there" the latter has a lot to do IMHO).

    Altho putting pascal into schools again might help it, it might also hurt it as it already did once. Most people don't remember the old school pascal days in a good way. Almost everyone switched to C or somesuch after school or at home because what's from school is not good.
    Feel the power of Open Source.
    <br />Feel the power of Free Pascal.

  10. #10
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Promoting Free Pascal in Schools

    Hmm... well I think the 'whats at school is not good' syndrome came from the fact that alot of schools or school institutions all typically run off of budgets, many of them in North America(Canada and US specifically) lately being reduced quite signifigantly. And as such, expensive compilers like Delphi at X-hundred a pop are out of the question. Turbo Pascal was alright because the pricing was a bit mor reasonable, but as things go, Pascal got less affordable.

    With the introduction of Free Pascal, it is possible that this situation with the schools can be averted. Now with GCC already having a rather strong hold in the Open Source 'market' people might argue that C is the better way to go, but if we all recall, Pascal was made a 'learning language'. Now it's come a long way in the many years, but if you sell it as a learning language to the schools with the key notes that it is;

    A) Better at teaching PROPER object oriented programming;

    B) Easier to read and understand; and

    C) a thousand times more friendlier as a language becasue of it's excellent debugging and error catching capabilities.

    These were the key points that teachers would talk about with utter glee in their voice when I asked about the C/Pascal question. And I've learned to believe it even today.

    C may be the way that the market goes today, but markets change! And like it did before, I believe it is highly possible that it can again. But it starts with the next generation and what good things that they are taught in school today.
    Jason McMillen
    Pascal Game Development
    Co-Founder





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