Wednesday, March 1, 2017

Delphi...


Back in 2013, Marco Cantu wrote this blog post:

http://blog.marcocantu.com/blog/strings_immutability_cow_ansistrings.html

Simon Kissel, a very active and respected member of the old Delphi community posted a comment which I find very relevant and I want to emphasize here. If you are interested in Simon's Delphi story, you can read his alternative (and controversial) Delphi roadmap, here:

http://delphiroadmap.untergrund.net

Marco also commented on Simon's roadmap, here:

http://blog.marcocantu.com/blog/alternative_delphi_roadmap.html

I don't recall all the details right now, but this roadmap did some very loud noise at that time... You can google for it and find lots of stuff....

Anyway, here is Simon's comment about Marco's take on string immutability, among other things (abominations) like, AnsiString removal/deprecation. I think Simon's comments are *more relevant than ever*.

Of Strings, Immutability, COW, and AnsiStrings

Excuse me, but you are not "adding features". You are breaking compatibility of 100% of all Object Pascal code existing today, without any benefit at all. The decision for 0-based strings would have needed be done 20 years ago. Today it's plain silly. Mutability, copy-on-write and the excellent string performance always has been one of the very few actual language advantages over pretty much all the competition. This is easy to learn, easy to remember, clean and nice, and produces fast code: s1 := s1 + ' ' + s2; This is hard to learn, hard to remember, dead ugly, and produces slow code: s1 := TStringBuilder.create(s1).append(' ').append(s2).ToString; Also, "help maintaing code on very old version of Delphi" - that's also completely off. Check the Delphi version survey. A large chunk of users still is using Delphi 7 - for example me, because I need Linux compatibility. Do you want to give them an incentive to finally move to your current offerings and pay you money, or do you want to give them an incentive to drop Delphi and move elsewhere? And: It is about time for Embarcadero that they are no longer the market leader in the Object Pascal field, which already is a niché due to how Delphi and the language got handled the recent years. There are other players, which have stopped copying most of the not-so-clever language extensions of the past years. If you make yourself incompatible with other Object Pascal compilers, you will no longer hurt the competition, you will only hurt yourself. It's a guarantee you'll never get back any users from FreePascal/Lazarus anymore. The "we want to attract new users by making our language look more modern"-stuff doesn't work either. You are a Delphi book author. You very well know that *all* of all available literature on Delphi and Object Pascal in the world teach Delphi Strings. Whoever is new to the language will learn something to then find out that you've broken it. This is a terrible new user experience. Long story short: In the great tradition of the recent years, what you guys do *simply does not make sense business-wise*. You are fractioning the ecosphere you live in. That's an insane strategy. You should revert it. And finally a rant about the implementation aspect: Delphi strings can be implemented in LLVM without any problems and with good performance. Others have done it. There is no technical reason for all this. Whoever is writing your NextGen compiler must either incompetent, lazy, underfunded or very new to the object pascal language. Sorry for the harsh words, but LLVM takes 90% of the work a compiler engineer has to do. If you fail on the remaing 10%, you should not be a compiler engineer.