by pmelendez · 13y ago · 0 comments
Now, after many private and commercial projects, I know that is about reading and understanding code. And about eliminating bugs. :)
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.
Why not use APL then?
Programs are to be read, not to be write-only.
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).
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.