How to deserialize object with different serialVersionUID?

Are Pascal and Object Pascal (Delphi) two different languages?

  • Would a pascal code run under Object Pascal or Delphi? I need to work on a Delphi project, I am a java developer and completely new to Delphi. I read that Delphi originated from Object Pascal which was a new version of Pascal (or a new complete language maybe?) A friend of mine has a book called (Oh Pascal!), It looks ancient and I am not sure if reading it would be useful for my Delphi knowledge or not.. Could someone here explain and recommend any resources?

  • Answer:

    Well... Pascal is ancient and defined by Wirth in the 60s. Since then, Borland added some object-oriented features to the language back in its ver 5.5 of Turbo Pascal. After that, a more professional approach towards Pascal's OOP was taken, so Object Pascal appeared, with all the nice features like optimised handling of strings, class interfaces, RTTI, and some metaclass stuff. Object Pascal was defined by...Apple (surprise, eh?) and implemented by many, including Borland in its Delphi. After purchase of Borland by Embarcadero, further stuff was added to the language, like templates (generics) in Delphi 2010 (or 2009?). Now it's a fairly modern language as far as compilable languages could go. As of transiting from Java to Pascal, imagine that you dont have classloading and garbage collector, pretty everything else is in place and has an equivalent (although the syntax is different). I would strongly recommend you to make heavy use of the try..finally construct right away in your projects, so you free the allocated resources (objects and system handles, closing files etc) guaranteed, even if an exception occurs. In case of an exception, it executes the finally sections, then goes further up the call stack to handle the exception, exactly as in Java. Except that Java made programmers so lazy that they dont close files in finally sections, leaving it at the mercy of gc, so it's pretty common to see a Java program to hold a file open until you explicitly quit the program. :)

Vitalie Vrabie at Quora Visit the source

Was this solution helpful to you?

Other answers

another thing to add...Delphi is to Pascal as C++ is to C.  Check out this website for great beginner info http://delphi.about.com/

Rick Peterson

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.