Quantcast
Channel: Planet Object Pascal
Viewing all articles
Browse latest Browse all 1725

See Different: What is the feature of Pascal ?

$
0
0

Borland created the name Object Pascal as a marketing way to sell Delphi, and set a boundary between Borland Pascal and Delphi.

Even though that Pascal constantly changing, and started so, not so long after it first released at 1968, only real developers learned the difference, and know what is going on.

Since then we see huge leap foreword with technology and with the language itself. For example the language itself support thread based programming, the object oriented syntax that was added by Apple in 1982 constantly expanding, and even creating support for thing that languages such as Java or C# lack of.

Pascal today is the only programming language that on one hand offer a very low level support for development – Yes! even lower level then with C, but support also very high level development that is closer to dynamic languages – such as mixin, string management, iteration syntax, and much much more…

Pascal today is also the only true multi-platform language, that can provide rich applications to desktop, web and smartphones/tablet platform with the same code base, and run native there. Yes, that includes iOS, Android with JVM/Dalvik.

Things looks good from far away, but closely there are more then few issues with the modern Pascal (and with some of the, I blame Embarcadero):

  • There are way too many dialects (FPC, Delphi, Delphi.NET, Oxygen, GNU Pascal [ISO Pascal] etc …)
  • There is some sort of vendor lock due to the dialect variation (Usually either Delphi or FPC to choose from)
  • Some of the syntax that is added to the language, well it's not longer Pascal, but closer to Java/C#/Ruby/D …
  • There are additions to closures – such as lambda, anonymous functions, generics and more, that not always implemented properly
  • There are support for dependency injection, extended namespace and much more
  • Not a single real standard, and lack of cooperation between Delphi developers and the true FOSS FPC project (due to Embarcadero side)

The problem with the code additions that I wrote, is that things are created not in the Pascal way, but looks more like the way c++ implemented stuff -> set V to say "I have this technology".

For example, You have now mixin for data types, so I can create for an Integer a function that will translate it into string like so:

...
type
  TIntegerConvertHelper = type helper for integer
    function to_string : string;
  end;
...
1000.to_string
...

Yeap, It's cool, but it's not Pascal ! Neither than this code:

...
type TMyDynArray = array of integer;
...
var MyDynArray : TMyDynArray;
...
begin
  ...
  MyDynArray := TMyDynArray.create(100, -1, 500, another_value);
  ...
end;
...

We call the above example "Array constructor". If you'll see this in the code, you'll have hard time to understand that TMyDynArray is not a class, but a dynamic array. Even if you do know that it exists in the language itself, it is less readable – not more.

And this less readable code of both examples, creates not only un Pascalish like syntax, but, make your code much harder to read and maintain.

You no longer can look at the code and guess what is TMyDynArray, you actually need to check it out, and it makes it so much harder to understand the code you are reading – the exact opposite of Pascal development, where most people complain that it's too readable for them, and they wish to work harder on that :)

Even though that I mainly focusing on FPC here, the problem is actually even worse with Delphi, where you can write a symbol name in a native language such as Russian, Arabic and Hebrew for example (just like with most Dynamic languages that I know), making your code a lot less readable, maintainable, and open a whole new set of problems that never existed in the first place.

I sent a question about it at the FPC mailing list, that explains my way of thinking, and seems like others as well. Feel free to read the whole discussions there about it, I find then very interesting.


Filed under: Delphi, FPC, Object Pascal, אירגונים וחברות, חברה, טכנולוגיה, פיתוח, קוד פתוח, תוכנה, תקנים Tagged: object pascal

Viewing all articles
Browse latest Browse all 1725

Trending Articles