Until I met the Oberon-2 language, I shied away from all OOP languages.
Well, Oberon-2 is (imho) superior to C++ because it is well designed. Anyway, learning OOP from Oberon-2 is very straightforward. The Mossenbock's book about OOP with Oberon-2 is the clearest one I've read.
I had a notion that I should learn C, as it seems that just about everything is written in C (or one of its derivatives).
I was a C programmer, some years later I switched to Ada and now I code mostly in Oberon-2 for my personal projects (I still use Ada). With these ones I learnt a lot about security and software engineering in general. Now I'm not able to think how C can be used today! I feel the emergency that all C projects should be converted to a sane language to make the world better.
With a sane language 70% of security bugs could be avoided.
Cons of C:
- No modularity.
- No strong typing.
- No knowledge of type range (char a = 1000; is legal).
- No boolean type.
- No true concept of array.
- No direct support for bounds checking.
- No safe type-casting.
- No safe union.
- No separation of unsafe code.
- No by reference parameter passing (simulated with pointers).
- No set type (C programmers use the unreadable bitwise operators for simple stuff).
- No nested procedures (useful for error recovery).
- Dangling else.
- Ternary operator.
- Broken include preprocessor (you have to use an include guard to avoid double inclusion!)
- Pointer arithmetic.
- Ability to mix expressions and statements (the most DANGEROUS and NON-SENSE feature! I've spent a lot of months for an unrevealed error in an IF expression with a = b instead of a == b. I'm still furious with it!)
- Awful and inconsistent standard library (character functions use integer parameter as character because it is also used for error reporting !!)
- ... and others omitted just to keep the list short ;-)
I don't see any pros in C, I cannot help you in this, sorry.
I got to wondering if Oberon-2 et al , can do everything that C can, and then some - OOP capabilities notwithstanding.
Oberon is also an operating system, then you can do everything. Oberon, compared to C, is less flexible and restricted. The real question is: is this flexibility really needed during programming? My answer is: No, it doesn't. The world need rules to avoid chaos.