Recent

Author Topic: Is Pascal suitable for Web Development?  (Read 9530 times)

giahung1997

  • Full Member
  • ***
  • Posts: 113
Is Pascal suitable for Web Development?
« on: June 07, 2019, 10:05:16 am »
I mean backend only. I'm learning backend web development with Java now. I'm not yet learn any framework. Thing like listen to a port, programming sockets and connect to database. Is Pascal suitable? I see the trend now is languages that code as short as possible, Pascal is too wordy, as bad as Java, will it unproductive when using Pascal? Java has many frameworks that do-it-for-you, somehow mitigated this. Tks  :)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Is Pascal suitable for Web Development?
« Reply #1 on: June 07, 2019, 10:14:16 am »
Yes, No.

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: Is Pascal suitable for Web Development?
« Reply #2 on: June 07, 2019, 10:47:11 am »
will it unproductive when using Pascal?
Unproductive is bugs as a result of a typing mistake such as "=" instead of "==" or "|" instead of "||"... and many of those.  Not only that is rather unproductive, it is a regrettable waste of time due to the outstanding built-in mediocrity of those more "succinct" languages.

It's much better to say it in 10 words and be right than to say it in 2 words and be wrong.  The latter is a very productive way of being unproductive.

(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: Is Pascal suitable for Web Development?
« Reply #3 on: June 07, 2019, 12:25:21 pm »
I have worked with a team of about 40 fte + 20+  testers on a website for 500.000+ customers that is fully written in Object Pascal, a tiny bit Java and Oracle (clustered) running on 40+ servers.
So, yes, and it even scales much better than some web oriented languages like PHP. https://www.alex.nl/
Many forum members know that.....
There are more examples....(e.g. coolblue.nl ) that are mostly written in Object Pascal.

These examples are not large scale, but huge scale.
Specialize a type, not a var.

Rainbow6

  • New Member
  • *
  • Posts: 25
Re: Is Pascal suitable for Web Development?
« Reply #4 on: June 07, 2019, 02:05:31 pm »
It's much better to say it in 10 words and be right than to say it in 2 words and be wrong.  The latter is a very productive way of being unproductive.

I couldn’t have said it any better.

And above this - Code it much more often read than written, so productive is, what’s good to read and understand. This is a question of philosophy - say “C-like vs. the rest of the world”.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Is Pascal suitable for Web Development?
« Reply #5 on: June 07, 2019, 02:25:29 pm »
I see the trend now is languages that code as short as possible, Pascal is too wordy, as bad as Java, will it unproductive when using Pascal?
Pascal was not designed to be trendy. Its slight verbosity and type-safety-by-design are not cool by standards of trendiness.
However, what is "productivity"? If it is just the ability to write code as quickly as possible, then Pascal is less productive than some other languages (though a good IDE minimises these differences in lots of clever ways).

If you take readability and maintainability into account, however, Pascal quickly shines brightly, even though it is not perfect.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Is Pascal suitable for Web Development?
« Reply #6 on: June 09, 2019, 04:19:37 am »
Is Pascal suitable?
Yes
will it unproductive when using Pascal?
No, verbosity won't make you unproductive, at least not as much as:
- runtime typing errors (commonly happened with dynamically typed languages)
- buffer overflow errors (commonly happened with unsafe languages)
- unmaintainability due to unreadability of overly short code that's difficult to understand

The first two can be helped by both the compiler and runtime system of Pascal, with the latter removeable as you wish (i.e. when it passes all kind of tests that you have) for higher performance. Only the last one is up to your ability to write well written code.

Last but not least, when you count every single character, Pascal code often ends up more compact because a lot of functionality has been available as library entities. For instance, Process.RunCommandInDir is often translated to multiple method calls in other languages, some also enforces the use of threads/asynchronous call to handle reading the stdout, which is very error prone. This single function call gives you both stdout content and exit code in one call and even the internal implementation doesn't use threads/asynchronous call. Not just shorter, but also more lightweight.

Kristof

  • Newbie
  • Posts: 1
Re: Is Pascal suitable for Web Development?
« Reply #7 on: June 14, 2019, 01:14:58 pm »
I have worked with a team of about 40 fte + 20+  testers on a website for 500.000+ customers that is fully written in Object Pascal, a tiny bit Java and Oracle (clustered) running on 40+ servers. (...)
There are more examples....(e.g. coolblue.nl ) that are mostly written in Object Pascal.
These examples are not large scale, but huge scale.

Hi Thaddy, it is very interesting! Can you explain what technology was used: Delphi or Free Pascal?
And what kind of solution you recommend for small pascal backend: fcl-web/embedded server, fastcgi or mormot?

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: Is Pascal suitable for Web Development?
« Reply #8 on: June 14, 2019, 03:37:40 pm »
Delphi was used. We did not use any third party libraries, everything was developed in-house with a minimum of components used. Actually the back end and middle ware was completely without components, just classes and code-generators. Because the team is large and very talented, that gave us much, much better results. All have at least a b.sc in computer science.
« Last Edit: June 14, 2019, 03:56:04 pm by Thaddy »
Specialize a type, not a var.

smitty

  • New Member
  • *
  • Posts: 16
Re: Is Pascal suitable for Web Development?
« Reply #9 on: June 16, 2021, 02:58:27 am »
I realize it has been two years since this topic was last updated, but while searching for Pascal Web development, a Google search led me here.

The website (coolblue.nl) listed is really nice and responsive, but my question is about the front-end.  Was it also done in Delphi and transpiled to JavaScript, or was React or Vue or something else used for the front-end?


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Is Pascal suitable for Web Development?
« Reply #10 on: June 16, 2021, 09:11:04 am »
I realize it has been two years since this topic was last updated, but while searching for Pascal Web development, a Google search led me here.

The website (coolblue.nl) listed is really nice and responsive, but my question is about the front-end.  Was it also done in Delphi and transpiled to JavaScript, or was React or Vue or something else used for the front-end?

Afaik originally (12 years ago or so) it was PHP. That might have changed though, they have grown quite a bit since.
« Last Edit: June 16, 2021, 10:18:00 am by marcov »

Blade

  • Full Member
  • ***
  • Posts: 177
Re: Is Pascal suitable for Web Development?
« Reply #11 on: June 27, 2021, 02:49:27 pm »
I mean backend only. I'm learning backend web development with Java now. I'm not yet learn any framework. Thing like listen to a port, programming sockets and connect to database. Is Pascal suitable? I see the trend now is languages that code as short as possible, Pascal is too wordy, as bad as Java, will it unproductive when using Pascal? Java has many frameworks that do-it-for-you, somehow mitigated this. Tks  :)

There are other variants of Object Pascal.  One of them is Smart Pascal (https://en.wikipedia.org/wiki/Smart_Pascal), and there is a payware product that comes from it.  It's comparable to pas2js (which Free Pascal has), but they have their own unrelated transpiler.

I'm surprised that pas2js is not getting more attention, because of its potential.
« Last Edit: June 27, 2021, 02:56:01 pm by Blade »

 

TinyPortal © 2005-2018