Recent

Author Topic: Object Pascal decline?  (Read 155679 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Object Pascal decline?
« Reply #30 on: November 28, 2013, 03:43:25 pm »
Shift + Ctrl + C over a variable should do the job on Lazarus code editor.
« Last Edit: November 28, 2013, 03:50:07 pm by typo »

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Object Pascal decline?
« Reply #31 on: November 28, 2013, 04:05:22 pm »
Thanks typo, I didn't know about that one.  That will save some time.
Lazarus Trunk / fpc 2.6.2 / Win32

Edson

  • Hero Member
  • *****
  • Posts: 1321
Re: Object Pascal decline?
« Reply #32 on: November 28, 2013, 06:27:40 pm »
Well, I think we need to modernize the language too.  (Object )Pascal is getting Old.

While some other language do:
Code: [Select]
s='hello
world'

we do:
Code: [Select]
s:='hello'#13#10+
    'world';

While some other language do:
Code: [Select]
if 1=0
   //some code
elsif 1=1
   //some code
end;

we do:
Code: [Select]
if 1=0 then
  begin  //WARNING: If use more than a sentence, you need BEGIN-END
   //some code
  end  //DANGER: Don't put semicolon!!!!!
else if 1=1 then
  begin  //WARNING: the same before.
   //some code
  end     //WHAT A FOOL, you  forget the semicolon;

While some other language do:
Code: [Select]
MsgBox "Mensaje", vbExclamation

we do:
Code: [Select]
uses ... Forms, LCLType;
...
Application.MessageBox('Mensaje','Título de ventana',
                   MB_ICONEXCLAMATION);

While some other language do:
 
Code: [Select]
try:
    //something   
except:
    print 'Bad'
else:
    print 'OK'
finally:
    print 'End'

We do:
I don't know  :-\

« Last Edit: November 28, 2013, 06:33:21 pm by Edson »
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Nebula

  • Jr. Member
  • **
  • Posts: 88
Re: Object Pascal decline?
« Reply #33 on: November 28, 2013, 06:44:58 pm »
Just have a new option to make it accept { } code blocks instead of begin / end, that would keep the lazy curly brace fans happy and make Pascal acceptable :D
Newbie testing Lazarus v1.0 - very impressed
Win 7 at work, XP and Linux Mint at home.
It all started with a ZX80 on a b/w telly........
Code: [Select]
Uses Smiles, GoodHumour, WantsToHelp;
{ never liked C - curly brackets are for comments! }

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Object Pascal decline?
« Reply #34 on: November 28, 2013, 06:49:46 pm »
We do:
I don't know  :-\
:D if you don't know what it is why would need it?

but let me continue your list

While some other language do:
Code: [Select]
{
  ... some code
}
we do
Code: [Select]
begin
  ... some code
end;

While some other language do:
Code: [Select]
    ''=~(        '(?{'        .('`'        |'%')        .('['        ^'-')
    .('`'        |'!')        .('`'        |',')        .'"'.        '\\$'
    .'=='        .('['        ^'+')        .('`'        |'/')        .('['
    ^'+')        .'||'        .(';'        &'=')        .(';'        &'=')
    .';-'        .'-'.        '\\$'        .'=;'        .('['        ^'(')
    .('['        ^'.')        .('`'        |'"')        .('!'        ^'+')
   .'_\\{'      .'(\\$'      .';=('.      '\\$=|'      ."\|".(      '`'^'.'
  ).(('`')|    '/').').'    .'\\"'.+(    '{'^'[').    ('`'|'"')    .('`'|'/'
 ).('['^'/')  .('['^'/').  ('`'|',').(  '`'|('%')).  '\\".\\"'.(  '['^('(')).
 '\\"'.('['^  '#').'!!--'  .'\\$=.\\"'  .('{'^'[').  ('`'|'/').(  '`'|"\&").(
 '{'^"\[").(  '`'|"\"").(  '`'|"\%").(  '`'|"\%").(  '['^(')')).  '\\").\\"'.
 ('{'^'[').(  '`'|"\/").(  '`'|"\.").(  '{'^"\[").(  '['^"\/").(  '`'|"\(").(
 '`'|"\%").(  '{'^"\[").(  '['^"\,").(  '`'|"\!").(  '`'|"\,").(  '`'|(',')).
 '\\"\\}'.+(  '['^"\+").(  '['^"\)").(  '`'|"\)").(  '`'|"\.").(  '['^('/')).
 '+_,\\",'.(  '{'^('[')).  ('\\$;!').(  '!'^"\+").(  '{'^"\/").(  '`'|"\!").(
 '`'|"\+").(  '`'|"\%").(  '{'^"\[").(  '`'|"\/").(  '`'|"\.").(  '`'|"\%").(
 '{'^"\[").(  '`'|"\$").(  '`'|"\/").(  '['^"\,").(  '`'|('.')).  ','.(('{')^
 '[').("\["^  '+').("\`"|  '!').("\["^  '(').("\["^  '(').("\{"^  '[').("\`"|
 ')').("\["^  '/').("\{"^  '[').("\`"|  '!').("\["^  ')').("\`"|  '/').("\["^
 '.').("\`"|  '.').("\`"|  '$')."\,".(  '!'^('+')).  '\\",_,\\"'  .'!'.("\!"^
 '+').("\!"^  '+').'\\"'.  ('['^',').(  '`'|"\(").(  '`'|"\)").(  '`'|"\,").(
 '`'|('%')).  '++\\$="})'  );$:=('.')^  '~';$~='@'|  '(';$^=')'^  '[';$/='`';
we do
Code: [Select]
Program Bottles;

Var i : Integer;

Begin
i := 99;
Repeat
Writeln(i, ' bottles of beer on the wall, ', i, ' bottles of beer');
Writeln('Take one down and pass it around');
i := i-1;
Writeln(i, ' bottles of beer on the wall.');
Until i = 0;
Writeln('No more bottles of beer on the wall, no more bottles of beer');
Writeln('Go to the store and buy some more, 99 bottles of beer on the wall');
End.

« Last Edit: November 28, 2013, 06:51:27 pm by skalogryz »

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Object Pascal decline?
« Reply #35 on: November 28, 2013, 06:51:22 pm »
Haha! 2 points for Nebula!
Lazarus Trunk / fpc 2.6.2 / Win32

vicot

  • Full Member
  • ***
  • Posts: 114
Re: Object Pascal decline?
« Reply #36 on: November 28, 2013, 06:57:22 pm »
Well, I think we need to modernize the language too.

I agree. That's with every language.

Quote
While some other language do:
Code: [Select]
s='hello
world'

we do:
Code: [Select]
s:='hello'#13#10+
    'world';

This seems a bit too cumbersome, I agree.

Quote
While some other language do:
Code: [Select]
if 1=0
   //some code
elsif 1=1
   //some code
end;

we do:
Code: [Select]
if 1=0 then
  begin  //WARNING: If use more than a sentence, you need BEGIN-END
   //some code
  end  //DANGER: Don't put semicolon!!!!!
else if 1=1 then
  begin  //WARNING: the same before.
   //some code
  end     //WHAT A FOOL, you  forget the semicolon;

I don't agree with this criticism. I don't have any problem with the way Pascal does this. After all, begin-end blocks are a main feature of Pascal, and help to maintain a certain structural order.

Quote
While some other language do:
Code: [Select]
MsgBox "Mensaje", vbExclamation

we do:
Code: [Select]
uses ... Forms, LCLType;
...
Application.MessageBox('Mensaje','Título de ventana',
                   MB_ICONEXCLAMATION);

I agree. By the way, is there a way in Pascal to define an alias for a procedure, so that instead of Application.MessageBox I may arbitrarily set the alias proc1():=Application.MessageBox()? Some languages have that, and it is really useful with annoying long procedure names.

« Last Edit: November 28, 2013, 06:58:57 pm by vicot »

vicot

  • Full Member
  • ***
  • Posts: 114
Re: Object Pascal decline?
« Reply #37 on: November 28, 2013, 07:00:24 pm »
Just have a new option to make it accept { } code blocks instead of begin / end, that would keep the lazy curly brace fans happy and make Pascal acceptable :D

I hate curly braces.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Object Pascal decline?
« Reply #38 on: November 28, 2013, 07:00:48 pm »
Well, I think we need to modernize the language too.

I agree. That's with every language.

Quote
While some other language do:
Code: [Select]
s='hello
world'

we do:
Code: [Select]
s:='hello'#13#10+
    'world';

This seems a bit too cumbersome, I agree.

But it's predictable, like a rest of Pascal syntax.
I hope we realize that even line break can be different on different systems. #10 vs #13#10 .. and even #13.

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Object Pascal decline?
« Reply #39 on: November 28, 2013, 07:08:33 pm »
Lazarus actually has a defined Line End that is cross platform.  I think it is LineEnding, but you should check that.  'Hello'+LineEnding+'World' or something like that. 
« Last Edit: November 28, 2013, 07:23:59 pm by Avishai »
Lazarus Trunk / fpc 2.6.2 / Win32

vicot

  • Full Member
  • ***
  • Posts: 114
Re: Object Pascal decline?
« Reply #40 on: November 28, 2013, 07:15:27 pm »
Even then, the 'LineEnding' option cannot remotely compare to the simplicity and straightfowardness of:

Code: [Select]
s='hello
world'

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Object Pascal decline?
« Reply #41 on: November 28, 2013, 07:18:16 pm »
I think you're forgetting that Lazarus supports folding lines in the code editor.  Your syntax could lead to some surprises.
« Last Edit: November 28, 2013, 07:23:33 pm by Avishai »
Lazarus Trunk / fpc 2.6.2 / Win32

hinst

  • Sr. Member
  • ****
  • Posts: 303
Re: Object Pascal decline?
« Reply #42 on: November 28, 2013, 07:23:31 pm »
I think that Object Pascal is in decline indeed.
I still use it, but I can see already that it won't last long. And honestly I see little point in introducing multiline string consts, ifelse operator and things like this. Maybe people should leave Object Pascal like it is and let it go.....
Too late to escape fate

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Object Pascal decline?
« Reply #43 on: November 28, 2013, 07:31:51 pm »
I think that Object Pascal is in decline indeed.
I still use it, but I can see already that it won't last long. And honestly I see little point in introducing multiline string consts, ifelse operator and things like this. Maybe people should leave Object Pascal like it is and let it go.....
Think of them as beautiful tombstone  :D
...this is awful!

vicot

  • Full Member
  • ***
  • Posts: 114
Re: Object Pascal decline?
« Reply #44 on: November 28, 2013, 07:37:10 pm »
I think that Object Pascal is in decline indeed.
I still use it, but I can see already that it won't last long. And honestly I see little point in introducing multiline string consts, ifelse operator and things like this. Maybe people should leave Object Pascal like it is and let it go.....

Could you please explain why you are so pessimistic? (unless you are trolling...)

 

TinyPortal © 2005-2018