Recent

Author Topic: Why Pascal is Not My Favorite Programming Language , Hacker News discussion  (Read 27266 times)

mariuz

  • New Member
  • *
  • Posts: 41
    • http://flamerobin.org
Yet another "Why Pascal is Not My Favorite Programming Language 1981" Hacker News discussion with good replies


https://news.ycombinator.com/item?id=8260694
« Last Edit: September 03, 2014, 06:04:03 pm by mariuz »

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #1 on: September 03, 2014, 05:02:38 pm »
(1981) is missing in your title. More than 30 years, Pfffff.

I bet YOU did not read the article. Neither did I.

Rails

  • Guest
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #2 on: September 03, 2014, 05:19:17 pm »
(1981) is missing in your title. More than 30 years, Pfffff.

I bet YOU did not read the article. Neither did I.

Not to mention that it was written by Brian Kernighan, not exactly an unbiased source.

It's been around for, well, decades. It's certainly not "news."
« Last Edit: September 03, 2014, 09:04:31 pm by Rails »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2747
    • havefunsoft.com
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #3 on: September 03, 2014, 06:58:15 pm »
I wish someone would renew the article... some like Anders Hejlsberg maybe?
"Why Object Pascal is Not My Favorite Programming Language"
(where Object Pascal stands for the latest versions of Delphi/FPC)


skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2747
    • havefunsoft.com

Fred vS

  • Hero Member
  • *****
  • Posts: 2570
    • StrumPract is the musicians best friend
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #5 on: September 03, 2014, 08:13:54 pm »
Quote
flamewar reference

Look at that =>  https://news.ycombinator.com/threads?id=fredvs
« Last Edit: September 03, 2014, 08:24:01 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs

Edson

  • Hero Member
  • *****
  • Posts: 1233
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #6 on: September 03, 2014, 10:34:09 pm »
33 years later,

Code: [Select]
5.  Cosmetic Issues ...

is still valid.
Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

Blaazen

  • Hero Member
  • *****
  • Posts: 3037
  • POKE 54296,15
    • Eye-Candy Controls
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #7 on: September 03, 2014, 11:09:30 pm »
ad 5. Cosmetic issues
It is stupid example with those semicolons.
Code: [Select]
   if a then
             b;
     c;
Quote
But if something must be inserted before b, it no longer needs a semicolon, because it now precedes an 'end':
Code: [Select]
     if a then begin
             b0;
             b
     end;
     c;
3
There's no need to remove semicolon, "b" is the last element of block, semicolon can stay there.

And the article is from 1981.
On the other hand, when I week ago ported xxHash from C, benchmark printed 64-bit (unsigned integers) hexadecimals like this:
Code: [Select]
printf("0x%08X%08X\n", (U32)(h64>>32), (U32)(h64));I wouldn't like to use such language.
Lazarus 2.3.0 rmain-2_3-280-g5db1922e37 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

rvk

  • Hero Member
  • *****
  • Posts: 4677
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #8 on: September 03, 2014, 11:37:01 pm »
There's no need to remove semicolon, "b" is the last element of block, semicolon can stay there.
...
And the article is from 1981.
As you said... the article is from 1981.
And in 1981 it was probably not permitted to leave the semicolon after b because it precedes end. (I just answered a similar question a few days ago)

In early versions of Pascal it was not permitted to do a semicolon before end.
Quote
The presence of an extra semicolon was not permitted in early versions of Pascal.
(source)
(I take it, we can assume 33 years ago is "earlier"  :))

But you're right... it was a stupid example. The author just didn't realize that the semicolons are for separating statements between the begin and end. So a semicolon before end is not needed (and in earlier version not permitted). When understanding that, it makes perfect sense.
Quote
Pascal programs start with the program keyword with a list of external file descriptors as parameters[14] (not required in Turbo Pascal etc.); then follows the main block bracketed by the begin and end keywords. Semicolons separate statements, and the full stop (i.e., a period) ends the whole program (or unit). Letter case is ignored in Pascal source.

But nowadays:
Quote
Programmers usually include these extra semicolons out of habit, and to avoid changing the last line of a statement sequence when new code is appended.

Yeah... that article is really old.

Edson

  • Hero Member
  • *****
  • Posts: 1233
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #9 on: September 04, 2014, 12:26:56 am »
ad 5. Cosmetic issues
It is stupid example with those semicolons.
Code: [Select]
   if a then
             b;
     c;

No that example. This:

Code: [Select]
Now if we add an 'else', we must remove the semicolon on the 'end':

     if a then begin
             b0;
             b
     end
     else
             d;
     c;

And

Code: [Select]
C and Ratfor programmers find 'begin' and 'end' bulky compared to { and }.
 

http://forum.lazarus.freepascal.org/index.php/topic,22777.msg135091.html#msg135091
Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

Leledumbo

  • Hero Member
  • *****
  • Posts: 8421
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #10 on: September 04, 2014, 04:31:31 am »
Just a different programming habit from the language author.

You read multiple statements in Pascal as:
begin doA then doB then doC then doC end. Therefore besides the first statement when you want to add more statement is to first add the semicolon and only then add the new statement.
You can clearly see from the way Prof. Wirth writes his Pascal programs, and he never changed it even until Oberon-07, his latest language invention (and no change until the current 2014 revision).

While in semicolon terminated languages:
begin doA stop, doB stop, doC stop, end. Therefore to add new statement, you first add the new statement and then the semicolon.

Reverse way of writing and reading.

airpas

  • Full Member
  • ***
  • Posts: 179
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #11 on: September 04, 2014, 09:43:49 am »
some others don't like it because it is verbose and strict .

zeljko

  • Hero Member
  • *****
  • Posts: 1262
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #12 on: September 04, 2014, 10:22:53 am »
some others don't like it because it is verbose and strict .

"The C language has scoping rules for a reason.
If Iwanted a language that didn't allow me to do anything wrong, I'd be
using Pascal. As it is, it turns out that things that 'look' wrong on a
local level are often not wrong after all."

Linus Torvalds

chain_reaction

  • New Member
  • *
  • Posts: 22
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #13 on: September 04, 2014, 10:29:10 am »
IMHO, Pascal will never die. But it need to be extended for easier development, especially string expression.

For example:

Code: [Select]
{$EXTH+}

const
  HTML =
'<html>
<body>
<h1>%h1</h1>
</body>
</html>';
       

BeniBela

  • Hero Member
  • *****
  • Posts: 840
    • homepage
Re: Why Pascal is Not My Favorite Programming Language , Hacker News discussion
« Reply #14 on: September 04, 2014, 10:46:09 am »
IMHO, Pascal will never die. But it need to be extended for easier development, especially string expression.

For example:

Code: [Select]
{$EXTH+}

const
  HTML =
'<html>
<body>
<h1>%h1</h1>
</body>
</html>';
       

Ack

But that would be already outdated

In newer languages you can write


Code: [Select]
{$EXTH+}

const
  HTML =
<html>
<body>
<h1>%h1</h1>
</body>
</html>;
       
for html

 

TinyPortal © 2005-2018