5 ms·
My favorite programming language remains Pascal, I wonder that that says about me? I've been described as slow but reliable.
by mikewarot 5y ago
My favorite programming language remains Pascal, I wonder that that says about me? I've been described as slow but reliable.
- WalterBright 5y agoIt says you like typing BEGIN and END over and over and over ...
- caslon 5y agoIs there a single-word descriptor for languages that depend on so much syntax just to get going? Pascal, C, ALGOL, D, etc. Verbose, maybe, but that's not as fun as some of the catchy words there are to insult languages that aren't.
- jakear 5y agoBoilermaker language. As in: you make a bunch of boilerplate. And also you get your beer but you’re liable to get a shot in the foot with it. (This is all off the top of my head)
- zelphirkalt 5y agoMaybe ad-hoc, as in "not planned ahead well at the time of designing and thus needing lots of fixes for edge cases" or perhaps inelegant as in "requiring many concepts as opposed to something like Smalltalk, which fits on a post card".
- deleted 5y ago[deleted]
- pjmlp 5y agoWhat about endless typing attributes that the language should infer for itself and instead forces everyone to write templates to work around such matters?
- deleted 5y ago[deleted]
- mikewarot 5y agoIt would be interesting if you could have a hybrid somewhere between Pascal and Python, where you could start just naming variables, and the compiler could fill the types in once the code was complete, then you could iterate and tweak. You'd end up with fast greenfield code to get your prototype working, but then could tighten it up to run faster, and clear out bad type assumptions as the discipline level goes up.
- goodpoint 5y agoYou are looking for Nim
- pjmlp 5y agoNot quite what you mean, but still, you might find interesting the talks on how to approach coding in languages like Idris, where the compiler is able to support the editor in type suggestions. https://www.youtube.com/watch?v=DRq2NgeFcO0 https://www.youtube.com/watch?v=DRq2NgeFcO0
- rz2k 5y agoSomething like OCaml?
- Zababa 5y agoTo expand a bit on the sibling post, this is basically OCaml's niche. The type inference is great, so you usually don't have to write any types (not even in functions signatures like Rust). The language has support for functional, modular, imperative and object-oriented programming. Usually you start with functional code, that's plenty fast (especially compared to Python) since it compiles to binaries, but still optimized for readability. You also have a fast bytecode compiler for a faster development loop. When needed, you can switch over to imperative code and mutable variable for performance, OO for GUI work for example, and modules when defining interfaces between parts of your program. You can also do the opposite of what you suggest: start by writing the interface file (which has the functions and types that you will expose), and then write the implementation the way you want. This allows you to cleanly separates the API from the implementation, and also gives you fast compilation times. There may be a slight difference compared to what you suggest, as everything is statically typed, but you can start a program with permissive types and gradually move on to stricted typed. For example, replace a string that can be anything with an enum (called variant types in OCaml). If you don't need the native compilation/want the C# ecosystem, F# is a close cousin. Scala is a different beast, but shares some origins. It relies more on objects.
- Tozen 5y agoBut, not everybody likes the eye strain of overly symbolic almost hieroglyphics and unreadable chicken scratch code. A lot is to be said for readability and maintainability. And any repetitive words can be handled by IDEs, editors, and macros.
- wruza 5y agoYou trade questionable readability with readability window size though (also questionable).
- lmm 5y ago> And any repetitive words can be handled by IDEs, editors, and macros. An IDE or editor may be able to write code for you but it can't read or understand it for you, and that's what takes most of the time on nontrivial projects. Macros undermine your tooling and mean the reader has to learn your dialect before understanding your code - they work best when you have a few common ones that are used across every codebase and supported in your tools, but at that point you're better off having them included in the language itself.
- MarcusE1W 5y agoI always wonder how developers work where it makes a difference if I type } or END. I appreciate with regards to readability it comes a lot down to what you are used to, but I never understood the argument that you safe something by typing a bit less. From my experience the design planning and just thinking about programs takes so much more time than the typing in that I sometimes wonder if I do something wrong. What is the advantage of a less verbose language if let’s say the language capabilities are similar?
- WalterBright 5y agoI also never liked BEGIN and END and other Pascal keywords BEING in ALL CAPS. It JUST made it ANNOYING to read THE code, like BEGIN and END were the MOST IMPORTANT things in THE code.
- badsectoracula 5y agoFWIW in Lazarus i rarely type begin or end, i type b and press ctrl+j with the IDE adding "begin", "end" and placing the cursor right between them at the proper indentation. Similarly i rarely update the var section manually, i just press F9 to compile, the IDE moves the cursor right at the missing variable (the compiler is fast enough to make this almost instant), i press Ctrl+Shift+C and the IDE adds the variable. Same for the interface and implementation sections (think header and source files in C but at the same source code): i write the declaration for the classes, procedures functions, etc, press Ctrl+Shift+C and the IDE creates the bodies for their definitions automatically. Using Ctrl+Shift+Up/Down arrow i can move quickly between the declaration (in interface section) and definition (in implementation section) for each entry, allowing for quick filling in the code. There are other shortcut keys, etc in Lazarus and i never really feel like having to type boilerplate code myself - but i still get the benefit of the more readable Pascal code (i have decades of active C and Pascal experience and i always find Pascal to be the more readable of the two, especially when looking at other people's code).
- deleted 5y ago[deleted]