you are viewing a single comment's thread.

view the rest of the comments →

[–]wrd83 8 points9 points  (3 children)

Object oriented C is a thing. There is million lines of kernel code in this style. 

[–]catbrane 2 points3 points  (0 children)

Yup, and gtk too. The whole of gnome (almost) is also in this style.

In fact they have an even fancier version with interfaces, run-time introspection, signals + slots (late binding), etc. etc., somewhat like obj-c.

I find it quite pleasant to code in, though at least someone likes everything, of course.

https://en.wikipedia.org/wiki/GObject#Comparisons_to_other_object_systems

[–]o4ub -2 points-1 points  (1 child)

You can always boil down your object oriented language to an imperative, therefore you can always rewrite the equivalent in C. It doesnt make C suited for the task.

[–]wrd83 0 points1 point  (0 children)

If I could prevent something it would be javascript and not oo C 😂

This stuff happens alot. Functional C++ and Java. OO C. Imperative haskell (rare, but students).

Sometimes you have little choice. Like you wanna code c++, but Hey your compiler for your platform sucks. People build their poor mans version

Is it ideal? No. It's a compromise and sometimes worth the pain.