Difference between revisions of "Holywar"

From Lazarus wiki
m
m (Why do we use Pascal: Remove dead page link)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Holywar}}
 
{{Holywar}}
  
The page is dedicated to list all possible pros (mostly) and cons of Pascal language (all kinds of pascal included).  
+
The page is dedicated to list all possible pros (mostly) and cons of Pascal language (all kinds of pascal included).
  
Pascal has something of a stigma as an "educational, and therefore weak" language, but it has nothing in common with a real life.  
+
Pascal has something of a stigma as an "educational, and therefore weak" language, but it has nothing in common with a real life.
  
If you're Pascal developer being involved into a next flame about Pascal language, you're encouraged to use the page.  
+
If you're Pascal developer being involved into a next flame about Pascal language, you're encouraged to use the page.
  
 
== Why do we use Pascal ==
 
== Why do we use Pascal ==
Line 11: Line 11:
 
(if you don't use (Object) Pascal, please don't edit the section)
 
(if you don't use (Object) Pascal, please don't edit the section)
  
Often programmers are free to choose their tools, especially then coding as a hobby (rather than for their living).  
+
Often programmers are free to choose their tools, especially then coding as a hobby (rather than for their living).
 
Lots of Pascal programmers choose the language because of:
 
Lots of Pascal programmers choose the language because of:
 
* modern Object Pascal is simply one of the most productive languages and it can be used for almost everything.
 
* modern Object Pascal is simply one of the most productive languages and it can be used for almost everything.
** [[FPC_Applications/Projects_Gallery]]
+
** [[Projects using Lazarus]]
** [[Projects_using_Lazarus]]
+
** [https://delphi.wikia.com/wiki/Good_Quality_Applications_Built_With_Delphi Applications Build With Delphi]
** [http://delphi.wikia.com/wiki/Good_Quality_Applications_Built_With_Delphi Applications Build With Delphi]
 
 
* well structured modular language
 
* well structured modular language
 
* safe and clean syntax, great for team work
 
* safe and clean syntax, great for team work
Line 24: Line 23:
 
== Q&A ==
 
== Q&A ==
  
Q: Why there're so many limitations on what expressions i can use in "for" and "while" operators?  
+
Q: Why there're so many limitations on what expressions i can use in "for" and "while" operators?
  
 
A: to force you to create maintainable and readable code
 
A: to force you to create maintainable and readable code
Line 34: Line 33:
 
</c>
 
</c>
  
A: Has it any advantage to define no intermediate type?  
+
A: Has it any advantage to define no intermediate type?
<syntaxhighlight>
+
<syntaxhighlight lang=pascal>
 
type
 
type
   TFloatRetFunc = function : single;  
+
   TFloatRetFunc = function : single;
 
   TSomeArray = array [0..9] of function (a, b: Integer): TFloatRetFunc;
 
   TSomeArray = array [0..9] of function (a, b: Integer): TFloatRetFunc;
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 48: Line 47:
  
  
[[Category:Promotion/ru]]
+
== see also ==
 +
* [[Why use Pascal]]
 +
 
 +
[[Category:Promotion]]

Latest revision as of 01:43, 27 July 2020

English (en) русский (ru)

The page is dedicated to list all possible pros (mostly) and cons of Pascal language (all kinds of pascal included).

Pascal has something of a stigma as an "educational, and therefore weak" language, but it has nothing in common with a real life.

If you're Pascal developer being involved into a next flame about Pascal language, you're encouraged to use the page.

Why do we use Pascal

(if you don't use (Object) Pascal, please don't edit the section)

Often programmers are free to choose their tools, especially then coding as a hobby (rather than for their living). Lots of Pascal programmers choose the language because of:

  • modern Object Pascal is simply one of the most productive languages and it can be used for almost everything.
  • well structured modular language
  • safe and clean syntax, great for team work
  • fast compile-time
  • Object Pascal have really nice oop/interfaces implementation

Q&A

Q: Why there're so many limitations on what expressions i can use in "for" and "while" operators?

A: to force you to create maintainable and readable code


Q: Pascal doesn't allow to specify complex types without intermediate types. I.e. "an array of pointers to a function that accepts 2 ints and returns a pointer to function that returns a float" <c> float (*(*a[10])(int, int))() </c>

A: Has it any advantage to define no intermediate type?

type
  TFloatRetFunc = function : single;
  TSomeArray = array [0..9] of function (a, b: Integer): TFloatRetFunc;

Advantages over C/C++

  • no preprocessor (better code reading and understanding);
  • no hardly readable and poorly debugged STL;
  • compiler built-in string-type (string ShortString, AnsiString, WideString). As well as still available to use PChar;


see also