Recent

Author Topic: [CLOSED] Midnight trolling: Don't take everything serious!  (Read 9751 times)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Midnight trolling: Don't take everything serious!
« Reply #30 on: January 07, 2020, 08:30:12 pm »
The most powerful feature of Pascal that C# did not inherit is Units (aka Modules)
(neither Java has the feature).

Modules do allow the following things:
0) clear "interface" section of unit. (what you can use of it)
Where C#/Java/C++ once has to travel across the entire unit to figure out "public" parts of each class.

1) module specific variables isolation. (just hide stuff in the implementation section)
Which could be achieved using "private class variables" in C# and Java.

2) independent initialization on program start and automatic clean up on finish.
Cannot be implemented in either C# or Java, where the class related variables will be initialized on the first time of the class use. (one has to make a call to a method explicitly)

3) Module structure provides a faster time compilation compared to C++

There are several years of attempt to introduce modules into C++. Yet C++ community themselves don't want to do that.
- module structure is not compatible with the current #include structure.
- the compilation speed drops, as they can no longer use parallel compilation.

Namespaces are not units. These are just the way to avoid name collisions.

Historical note: Units were not in the original Wirth's Pascal. Those were introduced in UCSD pascal, and later inherited in Turbo Pascal and Apple Pascal.
« Last Edit: January 07, 2020, 08:35:26 pm by skalogryz »

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Midnight trolling: Don't take everything serious!
« Reply #31 on: January 08, 2020, 01:10:45 am »
Delphi is a dying platform and it sucked hard.  ...   It's a dead language!

Your English was not really a problem.

But I will say this:  I find it interesting that a great percentage of the people that complain about a language are themselves incapable of designing or significantly altering said language (or any computing language).

Does this mean that I think that one can only evaluate and complain about things that one is personally proficient with?   No.  That's would be fair.

I'm not an auto mechanic, but I have expressed complaints about some cars.

(Frankly, I think we could all stand to do less complaining.  Evaluations and critical observations have their place, but we are far too free with complaints.)

My point is that the spirit in which observations are made have a significant bearing on how they will be received and possibly acted up.

Too many of these language complaints sound (from an attitude perspective) like they come from some skilled and proficient designer of programming languages.  But, when the comments are laid out with such passion and definitive statements, that are easily undermined by flawed logic, the ultimate goals of the post are lost (unless the goal was trolling).

A more measured tone, with less extreme and polarizing views, will likely obtain a much better response, and engender more respect, even if people don't agree with your points.
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Midnight trolling: Don't take everything serious!
« Reply #32 on: January 08, 2020, 01:14:53 am »
The fact is, their language sucks. C# is superior than Delphi, both for reading and writing.

Given your expressed feelings about Object Pascal, why do you bother to continue using it?

And if it has one or two features that you find desirable, why not go into the communities of these seemingly superior programming languages, and get them to adopt the one or two features of Object Pascal that you like?
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

dbannon

  • Hero Member
  • *****
  • Posts: 2802
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Midnight trolling: Don't take everything serious!
« Reply #33 on: January 08, 2020, 01:39:58 am »
You can download both Tomboy and tomboy-ng from github, here is the fact I promised, unzipped, the Tomboy source is 14 Meg, tomboy-ng is 5 Meg.

Your calculation is wrong. Lazarus is a RAD environment. Many people have done the heavy lifting for you and anything you have to do is just drag and drop and bind everything together using logic. Mono is not a RAD environment. Even though they have the Stetic GUI Designer, you pretty much have to write anything yourself. They have to deal with GTK# directly (which just is an C# OOP wrapper of GTK+), the LCL is much more high level than GTK#. My conclusion is: you can't compare the size of the two projects, as you can't know how much of LCL code your application has used. Anyway, choosing Lazarus for your project is a very wise decision.
Sorry, I must disagree !  You said -
Quote
.....Pascal is a very easy to read language, but very very inefficient to write because it's too wordy.  ....C# .....
Firstly, I just demonstrated that with that project required a third of the 'words' in Pascal/Lazarus/LCL compared to the version in C#.  How the respective tool kits came into being is irrelevant, what matters is what the developer need to write, in addition, to deliver a usable product.

Secondly, you apparently missed my remark about being able to read code easily is actually more important than being able to write it easily.  Far more developer's time goes into maintaining/ bug fixing etc than in the initial writing.

Interesting discussion !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: Midnight trolling: Don't take everything serious!
« Reply #34 on: January 08, 2020, 03:06:09 am »
a flamewar shooting range!

Good fun.

Why do I use Free Pascal/Lazarus? It does what I need to get done. Fast cross-platform programs, great IDE, and type-safe clear Pascal syntax. Sure, I have considered or used Fortran, java, C, C++, Python (even, ugh, Xojo). I spent at least a year evaluating my options before committing. I've worked thorough K&E and Stroustrup, and written a lot of C/C++ code, powerful without a doubt but, IMHO, juggling with razor blades. In Pascal I can get work done.

Wordiness or trouble typing? In Lazarus I type "b" and press enter, it gives me a full block ready to type code. Form design? Drag and drop, how easy is that?
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

440bx

  • Hero Member
  • *****
  • Posts: 4065
Re: Midnight trolling: Don't take everything serious!
« Reply #35 on: January 08, 2020, 05:18:44 am »
...themselves incapable of designing or significantly altering said language (or any computing language).
Yes, it's quite obvious that there are a lot of people who greatly underestimate how difficult it is to design a _good_ programming language.  It's no wonder that there are a lot of languages patterned after Pascal, it is somewhat of a wonder why there are a fair number of languages patterned after C.

I'm not an auto mechanic, but I have expressed complaints about some cars.
Of course.  It doesn't take knowing much about cars to know that when it doesn't start, something is wrong.  At the same, recognizing that something isn't quite right doesn't mean one knows how to fix it.  People who complain about Pascal are probably the kind that proceed to kick the cars tires, a time tested solution (demonstrated to be almost always ineffective.)

Secondly, you apparently missed my remark about being able to read code easily is actually more important than being able to write it easily.  Far more developer's time goes into maintaining/ bug fixing etc than in the initial writing.
It seems too many people miss that point. 

<snip>...  C/C++ code, powerful without a doubt but, IMHO, juggling with razor blades.
I like the analogy, it's particularly apt for pre-ANSI standard C.

Wordiness or trouble typing?
People who think Pascal is wordy should keep in mind that, it's better to say it in ten (10) words and be right than in 5 words and be wrong. 

It's really unfortunate that some programmers are averse to writing clean code because the result is too "wordy".  Those same programmers don't seem to see any problem in the compiler not reporting even a warning for unreachable code (which among other problems was the cause of Apple's SSL security hole.)  Who cares that someone may get crucial financial information, it's a lot more important to not having to type a few extra characters.  Good stuff!.

Got to love that the switch -Wall in GCC does _not_ cause the compiler to emit warnings for unreachable code (in C land, "all" doesn't mean what "all" means to every one else),   You want to get a warning for unreachable code, you got to use -Wunreachable-code. 
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Handoko

  • Hero Member
  • *****
  • Posts: 5158
  • My goal: build my own game engine using Lazarus
Re: Midnight trolling: Don't take everything serious!
« Reply #36 on: January 08, 2020, 07:59:25 am »
Secondly, you apparently missed my remark about being able to read code easily is actually more important than being able to write it easily.  Far more developer's time goes into maintaining/ bug fixing etc than in the initial writing.
It seems too many people miss that point. 

+1

I do not have much experience using other languages. Before I start using Pascal, I used BASIC. It's awesome, I can write simple games and I can code immediately without planning. But later I found the code becomes too hard to maintain. I got and tried Pascal. I wasn't happy with it. It is verbose but no problem for me because I can type fast. What I didn't like is I have to do planning before start coding. But I am now happy, the process to learn Pascal may be (a bit) hard but it's worth it. Maintaining and bug fixing is much easier. Thanks to the easy to read syntax and proper planning.

I think a good programmer should not have problem with the verbosity, he should able be to type fast.

Beginners like coding without planning, but a good programmer knows he should do planning before coding.
« Last Edit: January 08, 2020, 08:07:16 am by Handoko »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: Midnight trolling: Don't take everything serious!
« Reply #37 on: January 08, 2020, 08:14:29 am »
Moreover, characters are not equal. Typing theory that unshifted alphabetic characters are the easiest to type.

E.g. AND vs && might save one letters, but a & involves two keys that must be synchronized, so it is actually one key more(and more complicated synchronization/coordination).

And C is not always shorter.  I think = is much better than == :-)

That's another sign that the whole wordiness argument is an unresearched lower gut kind of sentiment.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5486
  • Compiler Developer
Re: Midnight trolling: Don't take everything serious!
« Reply #38 on: January 08, 2020, 09:53:19 am »
Code: Pascal  [Select][+][-]
  1. TMyList = specialize TFPGObjectList<TMyClass>;

You see, I think specialize is a spare keyword. Just like this is enough:

Code: Pascal  [Select][+][-]
  1. var MyArr = new ArrayList<String>();

This Java is unfamiliar, isn't it? It's Java 10. Language does improve over time.

The problem is not type declarations with specializations, but inline specializations ("|" denotes the parser's current position):

Code: Pascal  [Select][+][-]
  1. if TMyType<TSomeOtherType|, TWhatever>.CallFunction then ;
  2. // vs
  3. if TMyType<TSomeOtherType| then ;

If TMyType and TSomeOtherType are in scope as both a generic and a variable (yes, that can happen) then the parser can not decide right away whether it's dealing with a comparison or a specialization. That is ambiguous syntax! (any yes, that syntax is required for Delphi compatibility, but FPC currently can't handle it)
In contrast with specialize there is no disambiguity. Either the specialize is there (-> specialization) or not (-> comparison).

They're very wrong. C# in fact is the saving of Delphi heritage. By combining Object Pascal with Java syntax,
False. C# syntax was based on C, rather than Java. So, there's no "Object Pascal" in "Java syntax".

Do you see C# also use upper camel case like Delphi? If it's C it should be underscore case. If it's Java it should be lower camel case. C# also has very similar classes and API.

Code: Pascal  [Select][+][-]
  1. Application.Init();
  2. Application.Run();
  3. Application.Quit();

Does it sound familiar? Of course it is:

Code: Pascal  [Select][+][-]
  1. Application.Terminate;

Casing has nothing to do with language syntax. In C# and Java I'm as free as everywhere else to write my own functions in lowercase (of course other, existing functions need to be called in the correct case) or I can write my functions in Pascal as all UPPERCASE.

C# really make the very boring and inefficient to write in Delphi language to be something much more easier and comfort to write in.
False.
The biggest difference is that Pascal will likely ask you to release the allocated resource, file C# will do a garbage collection in runtime.
On the other hand, in C# system resources has to be explicitly disposed anyway (while in pascal, the system resource can be released together with the explicit release of the object).

I hate to call the Create constructor directly.

Code: Pascal  [Select][+][-]
  1. a := MyClass.Create('Pascal');

Why don't it just be like this:

Code: Pascal  [Select][+][-]
  1. a := MyClass('Pascal');

There is no requirement that the constructor is called Create. In fact in the compiler's sources there are classes with have a constructor named ppuload which is used when the definition or symbol is loaded from the PPU instead of being created by the parser.

Having to manually Free object is obviously inconvenient, because sometime we forget to Free it and it will leak memory.

There have been endless discussions on manual vs. automatic memory management. There are pros and cons for both. Object Pascal simply has manual memory management for classes. Deal with it.

You can download both Tomboy and tomboy-ng from github, here is the fact I promised, unzipped, the Tomboy source is 14 Meg, tomboy-ng is 5 Meg.

Davo


Your calculation is wrong. Lazarus is a RAD environment. Many people have done the heavy lifting for you and anything you have to do is just drag and drop and bind everything together using logic. Mono is not a RAD environment. Even though they have the Stetic GUI Designer, you pretty much have to write anything yourself. They have to deal with GTK# directly (which just is an C# OOP wrapper of GTK+), the LCL is much more high level than GTK#. My conclusion is: you can't compare the size of the two projects, as you can't know how much of LCL code your application has used. Anyway, choosing Lazarus for your project is a very wise decision.

RAD or not has nothing to do with this. Visual Studio has a GUI designer for C# as well. GTK and GTK# are rather high level as well (e.g. Lazarus uses GTK as one backend). And the difference of creating the components in code vs. having them created by some resource magic is not that big regarding the resulting code. The main code is still the "business code", e.g. the code inside the event handlers and such and that is there no matter if your UI is made using the RAD approach or not. Also looking at the app that was presented there most code should indeed be the business code as the static UI (thus the one created using RAD in Lazarus) is rather minimal.

Code: Pascal  [Select][+][-]
  1. TMyList = specialize TFPGObjectList<TMyClass>;

You see, I think specialize is a spare keyword. Just like this is enough:

Code: Pascal  [Select][+][-]
  1. var MyArr = new ArrayList<String>();
Pascal rule - declare first, then use. So at least you have to have
Code: Pascal  [Select][+][-]
  1. type
  2.   TMyList = TFPGObjectList<TMyClass>;
  3. var
  4.   MyArr : TMyList;
"specialize" can be omitted in Delphi syntax mode.
That really reminds me of 1979's article of "Why pascal is not my favorite language".
One of the reasons - you've to declare a type, prior to passing as a function/pascal argument.

3.2 and newer allow inline specializations also in non-Delphi modes. A side effect of implementing generic routines.

guest65109

  • Guest
Re: Midnight trolling: Don't take everything serious!
« Reply #39 on: January 08, 2020, 12:42:12 pm »
This is just bad C code. Why the Pascal devs ever want to import such thing like this?

Now I'm afraid that that /is/ bad English on your part: needs a verb. If you'd said

"Why did the Pascal devs ever want to import such thing like this?"

the answer would be "they didn't" since you'd implied it was something they'd done. But if you'd said

"Why would the Pascal devs ever want to import such thing like this?"

the answer would be "they don't" since you'd asked whether they were contemplating the possibility.

Or if you'd said "why should" it implies that somebody was attempting to coerce them, and so on.

However, I don't think I recall anybody seriously suggesting that Object Pascal should support ++ and -- . More to the point is that I've seen += etc. criticised as too C-like, and I think that it's that criticism that keeps them as optional features which have to be enabled by the -Sc command-line option. Same applies to the inline conditional implemented by ALGOL and C but not by Pascal, which /would/ be useful.

MarkMLl

I have a lot of trouble with ++i and i++ when I started with Java. But I like +=,-=,*=,/=, it shorten our code. For example:

Code: Pascal  [Select][+][-]
  1. Label1.Caption:= Label1.Caption + ' test'; // why we have duplicate Label1.Caption?
  2.  
  3. Label1.Caption += ' test'; // it's really time saving

Imagine, with `A := A + B;`, if A is very long you have to type again and again, it's wasting your time, don't tell me you could type very fast so this will not affect you, or you could use copy/paste!

I know the Free Pascal compiler already supports += but I don't know how to enable it  :(

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Midnight trolling: Don't take everything serious!
« Reply #40 on: January 08, 2020, 12:48:50 pm »
I know the Free Pascal compiler already supports += but I don't know how to enable it  :(
Project | Project Options...
Under the Compiler Options node click the Parsing node, and check the C style operators checkbox.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: Midnight trolling: Don't take everything serious!
« Reply #41 on: January 08, 2020, 12:51:05 pm »
I know the Free Pascal compiler already supports += but I don't know how to enable it  :(

Assuming you're using Lazarus:

Project -> Project Options -> Compiler Options -> Parsing -> Syntax options

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

guest65109

  • Guest
Re: Midnight trolling: Don't take everything serious!
« Reply #42 on: January 08, 2020, 12:51:12 pm »
The most powerful feature of Pascal that C# did not inherit is Units (aka Modules)
(neither Java has the feature).

C# namespace is superior to your Units! People on this forum have admitted this many time. If your Units is superior and you don't want namespace, why do you proposed it? Check this: https://wiki.lazarus.freepascal.org/Namespaces Admit it, you desperately want namespace! Units can't substitute namespace! Losers bash everything they don't have  8-)

C# also has partial class and partial method, it could perfectly substitute Units.

guest65109

  • Guest
Re: Midnight trolling: Don't take everything serious!
« Reply #43 on: January 08, 2020, 12:54:02 pm »
I know the Free Pascal compiler already supports += but I don't know how to enable it  :(
Project | Project Options...
Under the Compiler Options node click the Parsing node, and check the C style operators checkbox.

I know the Free Pascal compiler already supports += but I don't know how to enable it  :(

Assuming you're using Lazarus:

Project -> Project Options -> Compiler Options -> Parsing -> Syntax options

MarkMLl

Thanks both of you. Is there any way to set it globally or it has to be set per project?  :)

guest65109

  • Guest
Re: Midnight trolling: Don't take everything serious!
« Reply #44 on: January 08, 2020, 12:59:09 pm »
The fact is, their language sucks. C# is superior than Delphi, both for reading and writing.

Given your expressed feelings about Object Pascal, why do you bother to continue using it?


Object Pascal is poor man's C#! I need my program to compile and work across all platforms, including Windows, Linux, the BSDs, and HaikuOS. C# can't do this! Even though mono is available on the ports of all of the BSDs but it usually lagged many versions compared to the Linux version. You can't make binary target new .NET framework to run under older .NET framework!  :'( The only real alternative to Pascal is Java, but I have to stick with the old and wordy Java 8, no handy var type inference of newer Java versions!  :'( My programs are GUI application. Java Swing has font smoothing issue on Linux and some BSDs. You have to use a patched Java to got proper font smoothing, which not always available on the platforms you want your programs to run. Without smoothing, the font looks very ugly. Check this: https://forum.mxlinux.org/viewtopic.php?t=53835 and this: https://forum.mxlinux.org/viewtopic.php?t=53336

 

TinyPortal © 2005-2018