Live data from Hacker News

Why I use Object Pascal

dubst3pp4.github.io

211–220 of 235 posts

Re: Why I use Object Pascal

#211

Some fun I had with free pascal in college was that you can $DEFINE almost anything to almost anything else: {$DEFINE (:=ab} {$DEFINE ):=ba} ...etc... Code becomes pretty ridiculous: WriteLn ab ab a + b ba * c ba If you define WriteLn, +, and * as other things too you can get horrific looking code. All keywords like program, if, then, and end can be redefined. I wrote a script that would take a regular source file an…

Wow, using pascal for 30 years and diddnt know this..

I am actually thankful its not that well known. Pascal is still readable where as #defines in C libraries give me terrible headaches decoding.

Re: Why I use Object Pascal

#212
post #59

Earlier quoted context omitted.

For absolute beginners, I still think Pascal, or Turbo Pascal is best to start. It has a syntax that doesn't scare people away, and very readable. Deploying is also 1 trillion times easier then what ever we have today, ( C , Python , Ruby , Node.js ... ) I would have picked Ruby if it could compiled into a single executable file, and if the Dev environment actually work on Windows. P.S: It does work on Windows, but n…

> Deploying is also 1 trillion times easier then what ever we have today, ( C , Python , Ruby , Node.js ... ) What makes it easier? Distributing an executable from C seems easy. And using package managers from others also seems easy.

Press F9 and you get a self contained exe which was not dependent on any libraries in about a second.. I think that was what the poster was getting at.

Re: Why I use Object Pascal

#213
post #210
post #196

Earlier quoted context omitted.

>Pascal knows the size of its types This really means it doesn’t permit variably-sized arrays without a hassle on pure language level, so you can’t fall from a bike because it’s wheels are buried in the basement. Manually-specialized Containers like TStringList still use GetMem() and align a pointer to an “infinite” array to that block, shy trick pretending to be safe until reinvented by mere mortal. Iirc, you had to…

There was no RAD in Turbo Pascal for MS-DOS, secondly I had the opportunity to live in a country where a CS degree or similar is pretty much a requirement to be hired on the field. Quite a few parallel programming research papers were done in Concurrent Pascal during the 70s. Besides UCSD Pascal, there were a few other OS CS research done in Pascal variants. Variable legth arrays were available. C string manipulation…

Good points mostly, but I can’t agree on the last one. The new language you mentioned has few drawbacks that can seriously impact the development/architecting cycles (and I experienced these), so for me it must be time-proven first to meet a conclusion.

Re: Why I use Object Pascal

#214
post #91

I know C# borrowed heavily from Pascal. (So much that a lot of its improvements over Java were overlooked.) What's the advantage of using Pascal over C# or Java? Is it that Pascal outputs true compiled programs instead of requiring a VM?

C# borrowed heavily from Delphi - i.e. the Object Pascal bits. Explicit virtual/override, properties, that sort of stuff. The class library, especially WinForms, also borrowed heavily from VCL.

But I don't think there are any notable borrowings from core Pascal.

Re: Why I use Object Pascal

#215
post #121

Earlier quoted context omitted.

I always felt it’s really strange that making a quick and dirty GUI application is still easier with Visual Basic 4.0 (circa 1995) than with most any modern tool.

I'd like to see what you think of https://anvil.works It's deliberately built in the Delphi/Visual Basic tradition, and trying to carry those virtues onto the modern web.

interesting, thanks for the tip!

Re: Why I use Object Pascal

#216
post #141
post #134

Earlier quoted context omitted.

But that article was not 21 years newer than the first version of TP that was released in 1983.

The first version of Turbo Pascal didn't have object system or modules.

If you read my comment in the context of the thread, your comment makes no sense. The original article was written by one of the authors of C, that had no proper modules or object system either.

Re: Why I use Object Pascal

#217
post #216
post #141

Earlier quoted context omitted.

The first version of Turbo Pascal didn't have object system or modules.

If you read my comment in the context of the thread, your comment makes no sense. The original article was written by one of the authors of C, that had no proper modules or object system either.

I take it you didn't read the article being discussed here, titled "Why I use Object Pascal". Delphi and UCSD Pascal (at the time of Kernighan's article) are related but not identical.

Anyway, my point was that 15 years old tool can't be dismissed as "ancient" when the critical write-up itself is 36 years old.

Re: Why I use Object Pascal

#218

Earlier quoted context omitted.

i'm 25 and my first high school programming class was taught in borland turbo pascal as well. we did one year of pascal, one year of C, one year of Java, and then a seminar course in python.

Which one did you think would be best for a first year language? I was taught Pascal first, then C++. Pascal really helped with learning the basics. I think jumping right into C++ or Java would have been confusing.

i am happy that i learned pascal first. the focus on types, as the linked article states, was healthy for me. we didn't get into pointer manipulation in pascal, though. i'm a bit glad we waited until C for that because the "everything is an int" mentality of C helped me understand storage classes.

Re: Why I use Object Pascal

#219

Earlier quoted context omitted.

We needed a app for branding. That login to a website. So it needed to do a POST request. I struggled with fp and google for 30 min, and dropped to the `RunCommand('curl',[' https://ifconfig.co' ],s, opt)` clutch with curl.exe(with licence file) bundled into my innosetup file... magic?!

libcurl (with examples) is bundled in the FreePascal distribution, as well as simpler alternatives like fphttp, fphttpclient, fphttpwebclient, etc.

Thanks will look into it.

It is hard to get the boss to allow you to write a mvp in non mainstream language.

So I had a quick swing at the libs and wondered about so/dll dependancies compiled against my exe; and just went for a bundled exe, yum and apt curl install script... under a day native win and ubuntu support?!:D I'm sure there is a TODO tag above my command for the junior that is going to hate me because he now needs to code in lazarus... ;)

Re: Why I use Object Pascal

#220

Earlier quoted context omitted.

We needed a app for branding. That login to a website. So it needed to do a POST request. I struggled with fp and google for 30 min, and dropped to the `RunCommand('curl',[' https://ifconfig.co' ],s, opt)` clutch with curl.exe(with licence file) bundled into my innosetup file... magic?!

FYI Free Pascal (and by extension, Lazarus) comes with fcl-web which contains, among others, an HTTP client. See: http://wiki.lazarus.freepascal.org/fphttpclient

Thanks this is the kind of info I needed. Only had a day in laz land and time was running out for my product. So had to cut corners. #TODO
Post reply on HN