A few reasons to forget PascalABC.Net
Introduction
The times of the good old Pascal are over. The time has come for new development environments for this language. There are many dialects of this language. Although they all had something in common. Today we will talk about the PascalABC.Net dialect and why you should give it up if you seriously want to do programming and consider that this is your future.
First look
Imagine that you are new. Even if it is not. Imagine that you came to the world of programming for the first time and the first thing you are given to learn is the Pascal language. And they say, of course, to write precisely in the environment of PascalABC.Net. Well, you sit down and begin to slowly learn the language itself. Your skill rises and you want to learn something new more and more. And now you are not the kind of newcomer you were at the beginning, but a person with an average level of programming knowledge. And starting from this very moment you begin to feel some discomfort when working at PascalABC.Net. And the further the learning of the language and the .Net platform progresses, the stronger you feel that writing becomes not very convenient. You start to notice some instability of the IDE itself. By the way, you probably already encountered a problem when pressing Ctrl + Z - crashing errors in PascalABC itself. Net when trying to cancel some action, after which the code editing was out of the question. This is only one problem from
And what next?
And then the fun begins. Have you ever used when working generalizations? If not, then it is worth doing, since it is here that you will encounter many pitfalls, and, for sure, this will turn your positive opinion about PascalABC.Net to the opposite. For example:
type
ft = () -> integer;
begin
var f: ft := () -> 0;
var a := Arr(0).Select&<integer, ft>(i -> f);
end.
We have the type of the function ft, there is an array (from one element - zero). Here we call Select to convert each element of the array to a function. However, when hovering over a code analyzer instead of showing a sequence of ft , it shows a sequence of integer . And when you hover over Select, instead of showing, ft shows us the mysterious TResult (which says nothing). And this is the latest version of this IDE. Why? Further understand what.
Do not use generalizations.
Yes, this is exactly the title. Do not think that I am joking. I'm quite serious. If you want to use them, go and write in C #, because in PascalABC.Net they are implemented only for a tick (too poor quality). For example, we have a generic type (autoclass) TA, which has one template parameter T. Another class is inherited from it - TB, adding another template parameter-type T2.
type
TA<T> = auto class
X: T;
end;
TB<T, T2> = class(TA<T>)
Y: T2;
constructorCreate(x: T; y: T2) := (self.X, self.Y) := (x, y);
end;
beginend.
And all that. But this compilation fails. The compiler crashes with a terrifying error:
[Pabcnetc.exe]: System.Exception: System.NullReferenceException: The object reference does not indicate an object instance.Fine? I do not think. And here is the link to this Issue. You can immediately draw two conclusions: do not use autoclasses in this compiler with generalizations.
in PascalABCCompiler.NETGenerator.ILConverter.ConvertCommonGenericInstanceTypeMembers (ICommonGenericTypeInstance value)
in PascalABCCompiler.NETGenerator.ILConverter.ConvertFromTree (IProgramNode p, String TargetFileName, String SourceFileName, CompilerOptions options, String [] ResourceFiles)
in PascalABCCompiler.Compiler.Compile () '
Do not use formatting.
It sounds funny, but how can you not use the formatting code when writing programs? And why not? Yes, it sounds like this, but remember that we write in PascalABC.Net. And just an example why not:
type
TA = class
property Prop1: realread0writebeginend;
end;
beginend.
And now press Ctrl + Shift + F (format the code) and this will show off at the output:
type
TA = class
property Prop1: realreadfunction#GetGen2(realread00writeprocedure#SetGen1(valuereal read0writebegin endbegin endproperty
Prop1: realread#GetGen2 0write#SetGen1;
end;
TA = class
property Prop1: realread0writebeginend;
end;
beginend.
Now imagine that this project is something important for you and you have used these advanced properties more than once. And then they took everything and formatted it. Note that you should not forget about the error with Ctrl + Z, so it may turn out that you cannot cancel it anymore.
Not the best attitude of developers to users and their requests
Yes Yes exactly. Have you ever chatted with them on the forum? If not, then it’s worth a try, it’s not a fun sight to see. For example, how many I did not ask to fix the bug with Ctrl + Z, nothing has changed because of this - there was either a complete disregard or something like:
We can not do it. It is too hard.I did not quote. But the general meaning is that they are too lazy to do it. Excuse me, but you yourself wanted to make this environment (although this is not your main work), so please do it qualitatively. Such an attitude not only kills the desire to help developers fix bugs in the environment, but also to write generally in it.
And where to go if everything is so bad?
I will be brief - on C #, the guys from Microsoft have tried and made the language much better than the developers of PascalABC.Net.
Conclusion
Yes, I covered only a few of the problems that exist in this environment, but remember that although PascalABC.Net is drawn to C # it will never become to them - it will be easier to rewrite the environment than to fix an existing one (which developers don’t want to do although it is their fault that the IDE is in this state).
PS And here is an example of a bug that manifests itself when writing simple programs. And here's another (with arrays).