忘记PascalABC.Net的几个原因

引言


古老而美好的帕斯卡时代已经过去。 现在是使用该语言的新开发环境的时候了。 这种语言的许多方言已经出现。 虽然他们都有共同点。 今天,我们将讨论PascalABC.Net方言,以及如果您真的想进行编程并认为这是您的未来,为什么应该放弃它。

初看


想象你是一个初学者。 即使不是。 想象一下,您是第一次进入编程领域,而首先要学习的就是Pascal。 他们说,当然要在PascalABC.Net环境中编写。 好吧,您坐下来开始慢慢学习语言本身。 您的技能不断提高,并且您越来越想学习新的东西。 现在,您不是刚开始的初学者,而是具有一般编程知识的人。 从这一刻开始-在PascalABC.Net中工作时,您会开始感到不适。 而且,对语言和.Net平台的研究越深入,您就会感到书写不是很方便。 您开始注意到IDE本身有些不稳定。 顺便说一句,当您按Ctrl + Z时,您可能已经遇到问题-尝试撤消操作时,PascalABC.Net本身崩溃了,此后就没有编辑代码的问题了。 这只是您必须解决的几个问题之一。

接下来呢?


然后乐趣就开始了。 您在工作时曾经使用过概括吗? 如果没有,那是值得做的,因为在这里您会遇到很多陷阱,并且可以肯定的是,这会将您对PascalABC.Net的积极看法反过来。 例如:

type
  ft = () -> integer;

begin
  var f: ft := () -> 0;
  var a := Arr(0).Select&<integer,  ft>(i -> f);
end.

ft, ( — ). Select . , a , sequence of ft, sequence of integer. Select , ft TResult ( ). IDE. ? .


, . , . . — C#, PascalABC.Net ( ). , () TA, T. — TB, - T2.

type
  TA<T> = auto class
    X: T;
  end;
  
  TB<T, T2> = class(TA<T>)
    Y: T2;
    constructor Create(x: T; y: T2) := (self.X, self.Y) := (x, y);
  end;

begin
end.

. . :
Internal compiler error in module [pabcnetc.exe] :'System.Exception: System.NullReferenceException: .
PascalABCCompiler.NETGenerator.ILConverter.ConvertCommonGenericInstanceTypeMembers(ICommonGenericTypeInstance value)
PascalABCCompiler.NETGenerator.ILConverter.ConvertFromTree(IProgramNode p, String TargetFileName, String SourceFileName, CompilerOptions options, String[] ResourceFiles)
PascalABCCompiler.Compiler.Compile()'
? . Issue. : .


, ? ? , , , PascalABC.Net. :

type
  TA = class
    property Prop1: real read 0 write begin end;
  end;

begin end.

Ctrl+Shift+F ( ) :

type
  TA = class
    property Prop1: real read function#GetGen2(real read 00write 
  
  procedure#SetGen1(valuereal read 0 write begin endbegin endproperty 
  
  Prop1: real read#GetGen2 0 write#SetGen1;
end;
  TA = class
    property Prop1: real read 0 write begin end;
  end;

begin end.

, — . . , Ctrl+Z, , .


-, . ? , , . , Ctrl+Z, — , - :
. .
. , . , ( ), . , .

, ?


— C#, Microsoft , PascalABC.Net .


, , , , PascalABC.Net C# — , ( , , IDE ).

P.S. , . ( ).

Source: https://habr.com/ru/post/zh-CN417229/


All Articles