TMyList = specialize TFPGObjectList<TMyClass>;
You see, I think specialize is a spare keyword. Just like this is enough:
var MyArr = new ArrayList<String>();
This Java is unfamiliar, isn't it? It's Java 10. Language does improve over time.
The problem is not type declarations with specializations, but inline specializations ("|" denotes the parser's current position):
if TMyType<TSomeOtherType|, TWhatever>.CallFunction then ;
// vs
if TMyType<TSomeOtherType| then ;
If
TMyType and
TSomeOtherType are in scope as both a generic and a variable (yes, that
can happen) then the parser can not decide right away whether it's dealing with a comparison or a specialization. That is ambiguous syntax! (any yes, that syntax is required for Delphi compatibility, but FPC currently can't handle it)
In contrast with
specialize there is no disambiguity. Either the
specialize is there (-> specialization) or not (-> comparison).
They're very wrong. C# in fact is the saving of Delphi heritage. By combining Object Pascal with Java syntax,
False. C# syntax was based on C, rather than Java. So, there's no "Object Pascal" in "Java syntax".
Do you see C# also use upper camel case like Delphi? If it's C it should be underscore case. If it's Java it should be lower camel case. C# also has very similar classes and API.
Application.Init();
Application.Run();
Application.Quit();
Does it sound familiar? Of course it is:
Casing has nothing to do with language syntax. In C# and Java I'm as free as everywhere else to write my own functions in lowercase (of course other, existing functions need to be called in the correct case) or I can write my functions in Pascal as all UPPERCASE.
C# really make the very boring and inefficient to write in Delphi language to be something much more easier and comfort to write in.
False.
The biggest difference is that Pascal will likely ask you to release the allocated resource, file C# will do a garbage collection in runtime.
On the other hand, in C# system resources has to be explicitly disposed anyway (while in pascal, the system resource can be released together with the explicit release of the object).
I hate to call the Create constructor directly.
a := MyClass.Create('Pascal');
Why don't it just be like this:
There is no requirement that the
constructor is called
Create. In fact in the compiler's sources there are classes with have a constructor named
ppuload which is used when the definition or symbol is loaded from the PPU instead of being created by the parser.
Having to manually Free object is obviously inconvenient, because sometime we forget to Free it and it will leak memory.
There have been endless discussions on manual vs. automatic memory management. There are pros and cons for both. Object Pascal simply has manual memory management for classes. Deal with it.
You can download both Tomboy and tomboy-ng from github, here is the fact I promised, unzipped, the Tomboy source is 14 Meg, tomboy-ng is 5 Meg.
Davo
Your calculation is wrong. Lazarus is a RAD environment. Many people have done the heavy lifting for you and anything you have to do is just drag and drop and bind everything together using logic. Mono is not a RAD environment. Even though they have the Stetic GUI Designer, you pretty much have to write anything yourself. They have to deal with GTK# directly (which just is an C# OOP wrapper of GTK+), the LCL is much more high level than GTK#. My conclusion is: you can't compare the size of the two projects, as you can't know how much of LCL code your application has used. Anyway, choosing Lazarus for your project is a very wise decision.
RAD or not has nothing to do with this. Visual Studio has a GUI designer for C# as well. GTK and GTK# are rather high level as well (e.g. Lazarus uses GTK as one backend). And the difference of creating the components in code vs. having them created by some resource magic is not that big regarding the resulting code. The main code is still the "business code", e.g. the code inside the event handlers and such and that is there no matter if your UI is made using the RAD approach or not. Also looking at the app that was presented there most code should indeed be the business code as the static UI (thus the one created using RAD in Lazarus) is rather minimal.
TMyList = specialize TFPGObjectList<TMyClass>;
You see, I think specialize is a spare keyword. Just like this is enough:
var MyArr = new ArrayList<String>();
Pascal rule - declare first, then use. So at least you have to have
type
TMyList = TFPGObjectList<TMyClass>;
var
MyArr : TMyList;
"specialize" can be omitted in Delphi syntax mode.
That really reminds me of 1979's article of "Why pascal is not my favorite language".
One of the reasons - you've to declare a type, prior to passing as a function/pascal argument.
3.2 and newer allow inline specializations also in non-Delphi modes. A side effect of implementing generic routines.