Earlier quoted context omitted.
> PHP in theory has namespaces, but the standard libraries are just dumped in global. Modern PHP development almost exclusively uses Composer libraries rather than the standard libraries, which overwhelmingly use namespaces in Vendor\Project format. There's going to be a push to clean up the standard library in the coming years. The plan is to introduce a namespaced alternative to the standard library in the global n…
Namespaces by 2020? That'd be nice. The \ syntax still makes my eyes bleed a bit, when most others use . or :
Why I use Object Pascal
201–210 of 235 posts
Re: Why I use Object Pascal
#202Earlier quoted context omitted.
C has no classes, and everything's in one global namespace. Scheme & LISP have no built-in classes, and one can argue that CLOS isn't what we normally describe as OOP. Both normally have a global namespace. Inheritance in JavaScript is possible but very hard to implement correctly before ES6. Node has namespaces (sort of) but client-side JavaScript generally doesn't. PHP in theory has namespaces, but the standard lib…
> PHP in theory has namespaces, but the standard libraries are just dumped in global. Modern PHP development almost exclusively uses Composer libraries rather than the standard libraries, which overwhelmingly use namespaces in Vendor\Project format. There's going to be a push to clean up the standard library in the coming years. The plan is to introduce a namespaced alternative to the standard library in the global n…
Re: Why I use Object Pascal
#203Earlier quoted context omitted.
I'm not saying these are features provided by every modern programming language - obviously eg. there are FP languages that are not object-oriented, as you pointed out. Still, the selection of languages that do is so vast that such reasons hardly answer the question "why Pascal, of all the options".
There are only a few "popular" languages that have both, many that don't; those are not mandatory features for everyone. I care about performance (ruling out any GC language), multi-platform native binaries, language readability, dev community, and a bundle of other factors. Pascal turns out to hit most of my needs and not annoy me too much. Of the thousands of more obscure languages, I'm sure there's one that'd be p…
[Citation needed]
Re: Why I use Object Pascal
#204Yeah I've written compilers for Swift, C#, Java, JavaScript and Pascal and agree Pascal is the cleanest and nicest language, both on the parsing side and writing in.
Pascal language has a LL(1) grammar, typical for Wirth and other 1980s work. LL(1) grammars are of great practical interest, as parsers for these grammars are easy to construct, and many computer languages are designed to be LL(1) for this reason.
Re: Why I use Object Pascal
#205Re: Why I use Object Pascal
#206My dad still runs his business on a software I wrote in 1998 in Delphi. I haven't touched it since then but it is the only code I have that still works 19 years later.
Does it runs on modern Windows or is it running on a VM?
Re: Why I use Object Pascal
#207Earlier 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.
Re: Why I use Object Pascal
#208What caused pascal to lose out to C? Seems like it was a good language that had developer uptake.
- Internet rapidly became increasingly ubiquitous. And it was largely aligned with the Unix philosophy of plaintext formats.
- Computers became fast enough and powerful enough to make interpreted languages (and VM-based languages) usable.
- Open source took off.
- This produced explosion of new, free scripting languages that were really good at working with strings, dynamic data structures, and plaintext formats.
- Visual Studio and Delphi both still cost thousands of dollars. Not something you could download and evaluate or try out. Not something you'd decide to learn on a whim. And not something with a big community of open-source developers sharing things for free. Delphi made the business decision to price out the small shops and individuals that were its customers in hopes of going after an enterprise market.
- Except in some areas (games, embedded, etc.) the industry shifted toward making things with open-source scripting languages or java for the business stuff. Those who remained in desktop and didn't switch to java switched to visual studio.
- The creator of Delphi left and went to Microsoft and created C# to compete with java.
The static languages were also somewhat slow to adapt to plaintext data formats. They typically used proprietary binary formats and those were easy to work with (they could basically directly load and dump to/from RAM/disk). But serializing and unserializing and marshaling and unmarshaling to/from plaintext formats was a pain. Eventually they got generics and templates and macros and things to make it less painful, but it's still nowhere near as simple as in the typical interpreted dynamic language. (I recently modified an old 80s-90s era C program to output JSON and did some work on getting a Pascal program to read it.)
Re: Why I use Object Pascal
#209My dad still runs his business on a software I wrote in 1998 in Delphi. I haven't touched it since then but it is the only code I have that still works 19 years later.
Re: Why I use Object Pascal
#210Earlier quoted context omitted.
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…
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 is a joke as well, given that in 2017 still doesn't have a way to handle unicode in spite of wchar_t.
The whole point of unsafe code being hard to reach for, is to force people to think instead of producing yet another artifact to hang on the CVE list.
Finally, if we are no longer discussing pure C then Pascal also has libraries and extensions, nothing special about C here.
In any case, there is no need for C when we have C++, other than keeping UNIX kernel devs happy, and legacy code.