5 ms·
>"Pascal is kind of a weird language" Pascal in Delphi / Lazarus in its current form is a full featured language that implements large amount of common concept
by FpUser 5y ago
>"Pascal is kind of a weird language"
Pascal in Delphi / Lazarus in its current form is a full featured language that implements large amount of common concepts expected from a modern language. I do not see anything weird in it.
- tomc1985 5y agoMy career took me to C-like languages and scripting environments like Ruby or Python. And (love it or hate it) most of the world thinks in JS nowadays. Some aspects of Pascal are really strange or awkward to me, like the rules for whether or not a statement in an `if` block needs to be surrounded by `begin`/`end`, or where the semicolons go in a particularly complicated, nested instance of said `if`. But I am not a master Pascal programmer by any means. You sound like an expert.
- Qem 5y agoOddly I can't remember any wirthian scripting language, like Ruby or Python. Was Wirth biased against dynamic languages?
- webmobdev 5y agoI don't think so - his focus was always on making compilation fast and the language simpler and easier. See Oberon (the latest language he created) - it's probably even simpler than Ruby or Python.
- FpUser 5y ago>"most of the world thinks in JS nowadays" I think in terms of fair amount of languages (including JS) so I do not get hung up on any particular one. My business is product development from scratch. I do it for clients or my own company. Because of that I could not care less about what "most of the world" prefers. I use what I think is most suitable given constraints for each particular project.
- twangist 5y agoPascal might not be weird but it is unpleasant. It has many inconveniences to offer the modern programmer. In its day, in comparison to C -- by programmers for programmers -- Pascal was derided by one computer scientist as "a police-state language" for its many strictures and missing affordances.
- FpUser 5y agoSome people loved it, some hated it. Some (this includes me) used it where it did offer advantage. I do not use Pascal to write servers (even though I could and did for some particular situations). I use maily C++ for it. But for developing lean and mean desktop GUI apps for multiple platform I find nothing better. Also I am not sure what pascal are you talking about. The one "derided by comp scientists" and current Delphi/FreePascal are one universe apart.
- davidhbolton 5y agoConfession. Learnt Pascal at Uni. Programmed in Compas Pascal 1984 (precursor to Turbo Pascal) then Turbo Pascal 3.0 from 1986-1993. Then from 1997 to the present day worked with Delphi (2,3,4,5,7, XE7 and XE 10.1). I wrote a 40,000 line Postal Game in 1989-1990 in TP 5.0 that still runs today. Original Pascal was dire at anything except learning Pascal. Strings were type alfa- 10 character strings. Turbo Pascal was the first decent implementation and whipped the pants off its rival UCSD-Pascal. Delphi has been dead though since about 2000 but there's a lot of legacy code around and I'm one of a team of four that look after (maintain and enhance) a 1.35 million Lines of code property management application. A business laptop from 2020 can compile all 1.35 millions lines in around 11 seconds. Unless you were an ace C++ Windows developer, Delphi was the next best programming language for using the Win32 API and doing low level COM stuff.
- FpUser 5y ago>"Delphi has been dead though since about 2000" It is and it is not. It is used in many industrial companies for example to write windows based desktop applications. I have couple of my own Windows based products that bring some money. Even though those are about 10 years old I keep them up to date with all new technologies that make sense and port to every new version of Delphi. This is actually very easy and does not require much time. There is also more than enough libraries and components to do just about anything. FFS I do interrupt based device control with the rate of 256 requests / s over USB. Still for servers / NO GUI I very much prefer C++.
- benibela 5y agoAll of it is weird They always implement some language feature, but then put some weird, arbitrary restriction on it. It is twice as weird in FreePascal, because the developers cannot decide if they want to make their own language or be Delphi compatible. Some weirdness examples: There is automated reference counting to get memory safety, but only for strings and arrays (and also interfaces but we get to that later) There is mutability xor aliasing, but only for strings There is a type to store sets of integers, but you cannot have more than 256 elements There is a type to store a slice of an array, but it can only be used during function calls, so no one ever uses it. Also it looks like it cannot be used with a slice of length 0, unless it is a slice of an array of length 0. Interfaces are a very common concept in OOP languages. They specify some methods, but not their implementation. Everyone here knows how they work and in Pascal they work in the same way. Except, in Pascal they are also COM interfaces and add automated reference counting to a class. It is weird in the reverse, too. You can have classes with ARC which are almost memory safe, but only if you use an interface. Array indices start with 0, string indices start with 1. It is already weird, but you can get used to it. But now they added OOP like string functions and it became weirder. Copy(Str, ...) becomes Str.Copy(..). And all the new methods use 0-based indices for strings.
- FpUser 5y agoEvery language has various peculiarities / weirdness, tons of it actually. If you use multiple languages you just get used to this. That is my case and I do not consider it weird. If you stick to 1 or 2 languages than sure - everything else seems weird. >"they added OOP like string functions" - not sure / forgot what is official name for it but it is not unique to pascal. Again we have totally different perspective on weirdness.