Recent

Author Topic: "The time has come," the Walrus said, to break old code.  (Read 18496 times)

cacofonix

  • Newbie
  • Posts: 1
"The time has come," the Walrus said, to break old code.
« on: April 16, 2014, 04:56:04 am »
Tired of fighting the limitations of Java in writing robust, efficient, large applications. I am coming back to Object Pascal (having left it at Delphi 3), hoping that the language folks at CodeGear (?? Embarcadero??) would bite the various bullets and positioned it to supplant or replace Java.

Some low-cost changes to allow Java users to migrate to  a refurbished Pascal.

1.   replace  brace comments -- { ..} and  (* .. *) with C/C++ style comments ..  //  and /*  .. */
2.   replace begin ... end  with  {.. }  blocks.
3.   abandon the semicolon separator  -- in favour of the terminator.
4.   standardize integer types to track closely C#/C++/C
5.   implement reference counting for all objects, classes, etc.
6.   . . .

Admittedly  this will break old code, but the adjustments are small (mainly cosmetic) --- but such a refurbished Object Pascal would be a formidable draw for the many frustrated Java programmers out in the wild. Hopefully we will gradually see the end of bulky, cumbersome, and error prone Java coding.

And we can end the talk of cabbages and kings
and whether or not ,pigs have wings.

JanRoza

  • Hero Member
  • *****
  • Posts: 672
    • http://www.silentwings.nl
Re: "The time has come," the Walrus said, to break old code.
« Reply #1 on: April 16, 2014, 08:34:48 am »
I disagree, since the changes as you say are so small it will be no problem for a Java programmer to get used to the differences in FreePascal.
Furthermore in FPC you already can use // for comments so no need for change there.

So why change the Pascal language to look more like Java and C? You program Pascal or you don't.
Coming from C or Java Pascal should present no big problem for a developer.
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
       Lazarus 3.2 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: "The time has come," the Walrus said, to break old code.
« Reply #2 on: April 16, 2014, 08:42:43 am »
Well, I would stop using Pascal, if some of the changes that you propose come.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

eny

  • Hero Member
  • *****
  • Posts: 1634
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: "The time has come," the Walrus said, to break old code.
« Reply #4 on: April 16, 2014, 09:09:43 am »
I agree, a veritable Troll.  Nicely educated though, slipping in that oyster metaphor...   If we changed our language to comply with C or Java, why, we'd be swallowed whole :-)
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

hinst

  • Sr. Member
  • ****
  • Posts: 303
Re: "The time has come," the Walrus said, to break old code.
« Reply #5 on: April 16, 2014, 09:10:59 am »
1. Useless
2. Useless
3. Legit
4. It's fine as it is;
5. Maybe
Too late to escape fate

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: "The time has come," the Walrus said, to break old code.
« Reply #6 on: April 16, 2014, 09:30:25 am »
1. Only /* */ is not supported and good for pascal what an ugly construct.
2. Not again, begin..end is the essence of the language which is STOP HIDING COMMANDS IN PLAIN SITE if you like { } and other C constructs pascal is probably not for you.
3. Well as long as I can write as many commands as I need in a single line I have no problem using or not using the ";"
4.there is a unit called ctypes I think for that purpose use it.
5. Hell no, I left delphi because if I have to re design my programs to work with an ARC methodology just to accommodate someone else then I'm going to be lazy and choose either a language that will give me more power or less work to convert or both in any case pascal is going to be left behind it is a non starter for today market and it seems that it will stay that way for the near future.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: "The time has come," the Walrus said, to break old code.
« Reply #7 on: April 16, 2014, 09:39:05 am »
Lewis Carrol was, amoung other things, a satirist.  He wrote about "The Walrus and the Carpenter" in...  "Through the looking glass" I think.   The Walrus and the Carpenter have the conversation about "cabbages and kings" while tricking a bunch of oysters into being eaten.  The conversation is NOT the point, the poem is really about the trap.   Continuing the conversation as started by Cacofonix is just falling for another kind of trap.   Another clue is in his name.  I doubt very much he just swiped that from the English translation of Asterix.    Thought was put into that user name.

Honestly @Cacofonix!   I'm impressed :-)
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: "The time has come," the Walrus said, to break old code.
« Reply #8 on: April 16, 2014, 09:39:14 am »
 %)
I do not believe, that points 2 or 3 will ever happen in Pascal

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: "The time has come," the Walrus said, to break old code.
« Reply #9 on: April 16, 2014, 09:40:06 am »
@cacofonix: Apart from (5) all the other points are irrelevant. Your cacofonix moniker is well earned.
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: "The time has come," the Walrus said, to break old code.
« Reply #10 on: April 16, 2014, 09:45:24 am »
such a refurbished Object Pascal would be a formidable draw for the many frustrated Java programmers out in the wild. Hopefully we will gradually see the end of bulky, cumbersome, and error prone Java coding.

I don't buy that at all. That is the classic "the hordes will come!" argument attached to nearly every proposed modification.

Anyway, since adopting curly braces is quite draconian and the benefits listed are doubtful, and it doesn't agree with the stated project goals, perhaps it is best this work is done and maintained by believers until this assumption is somewhat proven (or at least has some supporting evidence). See also e.g. http://www.freepascal.org/faq.var#extensionselect
 
It might be possible to implement the above behavior only in a language mode, which would remove the backwards compatibility problem. Still it will require fairly serious changes to the lexer probably.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: "The time has come," the Walrus said, to break old code.
« Reply #11 on: April 16, 2014, 09:45:40 am »
Just found the following:  http://www.jabberwocky.com/carroll/walrus.html

I'd forgotten that at the start of the poem, the Walrus and the Carpenter looked upon a beautiful beach and declared it to be a sorry sight.

Quote
"If this were only cleared away,"
They said, "it would be grand!"

This is so obviously a Troll :-)
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

JanRoza

  • Hero Member
  • *****
  • Posts: 672
    • http://www.silentwings.nl
Re: "The time has come," the Walrus said, to break old code.
« Reply #12 on: April 16, 2014, 10:30:32 am »
I think you're right, probably a troll. Lovely username though, well chosen.  :D
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
       Lazarus 3.2 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

vicot

  • Full Member
  • ***
  • Posts: 114
Re: "The time has come," the Walrus said, to break old code.
« Reply #13 on: April 16, 2014, 12:20:47 pm »
I disagree with the proposed changes. Please keep Pascal as it is.

Only, adding // as a comment marker might not be a bad idea (as an addition, not as a replacement)

JanRoza

  • Hero Member
  • *****
  • Posts: 672
    • http://www.silentwings.nl
Re: "The time has come," the Walrus said, to break old code.
« Reply #14 on: April 16, 2014, 12:24:56 pm »
// as comment is already there so nothing new.
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
       Lazarus 3.2 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

 

TinyPortal © 2005-2018