Live data from Hacker News

Why I use Object Pascal

dubst3pp4.github.io

191–200 of 235 posts

Re: Why I use Object Pascal

#191

I've lately been trying out FreePascal for building my indie games (which have in the past been in C, Python, Java, Objective-C, and finally JavaScript), and it's going well enough. There's certainly room for improvement, and the Lazarus IDE is not at all to my taste, but it's likely to be my next-ten-years language. https://mdhughes.tech/2017/09/02/pascal/ and a couple of followup posts https://mdhughes.tech/categor…

I was a lot younger and got it working on delphi7 but look at glscene[0]. It really changed how I view OOP and GL, amazing framework for its time... [0]: http://wiki.lazarus.freepascal.org/GLScene

Also love GLScene, used it for building a 3D STL activex viewer control and that was not as hard as expected.

Re: Why I use Object Pascal

#192

Earlier quoted context omitted.

You must be 50... and you're still on HN! Are you still an engineer? If so, what stack are you using now?

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.

Re: Why I use Object Pascal

#193
post #147

Earlier quoted context omitted.

> Perl can do pretty much everything Python can, and it came significantly earlier. Yet people gravitated toward Python. I don't think syntax is the main culprit here, and Perl is only four years older than Python. For about 15 years Python tried, unsuccessfully, to compete with Perl as the premier language for shell scripting and sysadmin tasks. It wasn't until around 2005 that Python finally caught on, its rise coi…

I have long thought Perl can do anything Python can, and then some. I still use Perl one-liners to find/change strings in code bases: perl -pi -e 's/somestring/newstring/g' $(ag -l --python Foo) Does Python have an equivalent? I think the fabulous Python libraries for data science have really propelled the language to the top of the list, in terms of users.

You could have just used sed for that?

Re: Why I use Object Pascal

#194
post #25

I feel kind of sheepish to admit that "Why Pascal is not my favorite programming language" had a huge impact on me and caused me to avoid Pascal until I was forced to deal with it because a coworker quit and dropped maintenance of an in-house application in my lap. I was happy to realize that most of the criticism in that essay no longer applies to relatively recent versions of the language/IDE (Delphi 7 in my case).…

My High School programming class was taught in Pascal (Turbo Pascal version 3 IIRC). I remember liking it just fine, but when I went to the university I switched to C because everything interesting was written in C. Also, there were no Pascal compilers in the FreeBSD (2.0) ports tree back then. I had a notion that Pascal was a "toy teaching language" too, but for what I was doing that didn't really matter.

I had a similar experience: Pascal in high school, then switched to C by the time university rolled around (mostly because of it being a Unix environment). The big difference is that I did see Pascal as a serious language.

I almost laughed at a friend who decided to implement C in a compiler course. Having a preference for programming in a language is one thing. Trying to implement it is quite another. He should have realized that. We both had two page grammar that defined Pascal from our high school days.

Re: Why I use Object Pascal

#195

The Nim language [0] feels very inspired by Pascal while looking like Python. If you're interested in fast, compiled & typed languages, I suggest you also take a look at it. I personally love its readability. [0]: https://nim-lang.org/

I'm curious what's similar to pascal about it? It's garbage collected, it compiles to C or JavaScript, and its syntax is inspired by Python, so I just wonder what is left.

From https://nim-lang.org/features.html:

> Oberon-inspired visibility markers

> Pascal-inspired type sections for leaner definitions

While Oberon isn't Pascal, they're both Wirth languages that share many commonalities.

Re: Why I use Object Pascal

#196
post #133

Earlier quoted context omitted.

It's not like Pascal's memory management and pointer situation was that much better.

They actually are, because Pascal knows the size of its types, while C requires using a mix of sizeof and malloc, which many people still get wrong, specially with arrays.

>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 destroy ^properties in destructor by hand too.

Pascal only seemed easier because of three things: a) explicit pointers are hard, b) strings have explicit length of 8 or 16 or 32 bit, and that was also a mess, especially in C interfacing, where PChar worked as intended only half of the time, c) no CS-hard tasks were solved in Pascal by RAD-programmers.

Don’t let your fond memories trick you too much. You can get the same/better behavior and speed by using glib, apr, objc, etc and not using pure C arrays at all.

https://www.tutorialspoint.com/pascal/pascal_pointers.htm

Re: Why I use Object Pascal

#198

Earlier quoted context omitted.

I have long thought Perl can do anything Python can, and then some. I still use Perl one-liners to find/change strings in code bases: perl -pi -e 's/somestring/newstring/g' $(ag -l --python Foo) Does Python have an equivalent? I think the fabulous Python libraries for data science have really propelled the language to the top of the list, in terms of users.

You could have just used sed for that?

So Perl was built because Sed/Awk had "whipupitude", but fell short of being a real application language like C which was great and fast to run, but slow to develop in. Perl was the middle ground which took the power of Sed/Awk/Bash and made it faster and more respectable and added a huge module repository. Of course take this with a grain of salt.

Re: Why I use Object Pascal

#199

Earlier quoted context omitted.

My High School programming class was taught in Pascal (Turbo Pascal version 3 IIRC). I remember liking it just fine, but when I went to the university I switched to C because everything interesting was written in C. Also, there were no Pascal compilers in the FreeBSD (2.0) ports tree back then. I had a notion that Pascal was a "toy teaching language" too, but for what I was doing that didn't really matter.

You must be 50... and you're still on HN! Are you still an engineer? If so, what stack are you using now?

Over 40, sometimes engineer still. First job was Delphi 2, but moved quickly to Delphi 3.

My stack now is... diverse. Python, Spark, Java, React, Node, PyTorch, Scikit and occasionally R.

Re: Why I use Object Pascal

#200

Earlier quoted context omitted.

Despite that article being a venerated classic I felt kind of put off when I first read it because the part about arrays and strings having sizes seems... well, I guess it's aged poorly.

In the old versions of Pascal a function/porcedure only accepted an array of a fixed size (in fact you had to declare a type specifically for that size). for example if you had an array of 10 and an array of 100 you needed to write two functions to deal with it. I was taught turbo Pascal in highschool and it was so bad that even C felt less annoying.

Oh, I see. I can understand why that would be irritating.
Post reply on HN