11 ms·
I never liked Pascal verbosity back in school but I loved C right away... Maybe it is just a matter of taste?
by pmelendez 13y ago
I never liked Pascal verbosity back in school but I loved C right away... Maybe it is just a matter of taste?
- lucian1900 13y agoPascal is a safer language overall, which I would argue is a good thing. C eskewed many safety features for slightly (but not significantly) more power.
- waps 13y agoHaving written TSR's in Pascal and C I have to disagree. C had significantly more power and was a lot simpler to get working for lower level stuff.
- pjmlp 13y agoOnly if you are comparing to standard Pascal. Turbo Pascal had all the capabilities of C as well. I can produce a one to one table, if you wish. Additionally after version 5.5, it also had support for OO.
- pjmlp 13y agoI never understood the complaints about verbosity in Pascal languages and the escape to C, Perl and friends. Why not use APL then? Programs are to be read, not to be write-only.
- 10098 13y agoVerbose programs are hard to read.
- pjmlp 13y agoMaybe to comic book readers
- 10098 13y ago> comic book readers You say that like reading comic books is an anti-intellectual crime. Getting to the point, look at these examples and tell me which one is better from the readability perspective. > for(std::vector<std::shared_ptr<MyClass> >::const_iterator it = v.begin(); it != v.end(); ++it) or > for(const auto &value : v) Even in the case when the "value" variable's inferred type isn't apparent from the context, we can use > for(const std::shared_ptr<MyClass> &value : v) which is still much more readable than the monstrosity in the first example.
- jk4930 13y agoTo make your comparison more useful (and on-topic), you should compare this to a Pascal or an Ada program. You won't find such a syntax massacre there. In fact some verbosity is a design feature that actually helps programers maintaining large, long-living sytems.
- 10098 13y ago> In fact some verbosity is a design feature that actually helps programers maintaining large, long-living sytems. I completely agree with that. For example, static typing adds verbosity, but it also documents the program and makes figuring out a large codebase a lot easier. The "noise" can even be reduced in languages with type inference like D, Haskell or C++11. The thing is, unnecessary verbosity only crowds the code and doesn't add any value. Most of the keywords in "if ... then begin ... end else begin ... end" serve no real purpose and could be replaced with a symbol, like a curly brace.
- vidarh 13y agoI have pretty much the exact opposite view: I find type signatures add noise I don't want, while I find {} to be suboptimal for large blocks. I prefer the Ruby approach, where what you described would usually be: if ... else ... end So it cuts down on the clutter vs. Pascal, but sticks to words rather than single character symbols
- lazyjones 13y ago"begin" isn't harder to read than "{", with each on its own line (arguably a very readable bracing/indentation style). Later Pascal/Delphi compilers had very useful syntax highlighting built in, so this is really not an issue - unless you prefer as much code as possible crammed onto a single "page" (IMO not really helpful for reading). {} are also somewhat harder (more strenuous) to type than begin/end, especially on german keyboards (it's Alt Gr + 7 / Alt Gr + 0) and even more so on german Apple keyboards ({} are not even printed on any keys there and they are on different key combinations than on PC keyboards).
- kaoD 13y agoPascal verbosity does not add information, but noise. As humans, we recognize symbols and structures better than words. {} as delimiters make much more sense than BEGIN/END.
- JasonFruit 13y agoI always thought there was a use for something like RATFOR for Pascal; maybe Ratscal? It could have left most of the verbosity in place, but replaced the BEGINs and ENDs with { and }, and that would have made it an almost perfect language from my point of view.
- telephonetemp 13y agoNimrod is a lot like a modernized Pascal with a Python-like syntax.
- pjmlp 13y agoLets all code in APL then. > {} as delimiters make much more sense than BEGIN/END. Sure {{{{{}}}}}}
- ret 13y agoIMHO it's a matter of experience. When I was young I believed that programming is about writing a lot of code that "just work". Now, after many private and commercial projects, I know that is about reading and understanding code. And about eliminating bugs. :)