r/programming • • Jan 22 '19

Pharo 7.0 released!

https://pharo.org/news/pharo7.0-released
378 Upvotes

137 comments sorted by

View all comments

Show parent comments

61

u/lelarentaka Jan 22 '19

Smalltalk was one of the birthplace of object oriented programming. The language is entirely made up of objects and message passing, extremely minimalistic, it is OOP before java made OOP mainstream. In terms of minimalism and elegance, it is on par with lisp. The people who loves bashing oop should try smalltalk to see how oop looks like in its original and purest form.

114

u/systemadvisory Jan 22 '19

C++ made OOP mainstream like a decade before Java was even made

91

u/kurav Jan 22 '19

C++ gave OOP bad reputation like a decade before Java was even made

FTFY 😉

39

u/systemadvisory Jan 22 '19

Whatever, C++ is dope, haters gonna hate :)

34

u/cyrusol Jan 22 '19

Someone has to say it: Rust is doper.

2

u/mechanicalgod Jan 22 '19

C++ templates > Rust generics/macros

4

u/cedrickc Jan 22 '19

More powerful, but also more dangerous.

12

u/Damtux_25 Jan 22 '19

With power come great responsibility - me

3

u/Marchesk Jan 23 '19

So, C++ is Peter Parker, Rust is Miles Morales, and Smalltalk is Hank Pym?

→ More replies (0)

1

u/brownej Jan 22 '19

With great power comes... lots of bloody toes

5

u/[deleted] Jan 22 '19

C++ is very useful, but it's awful to do OO in though.

5

u/Randolpho Jan 22 '19

C++ is a great language, but it would be a much better language if it would just abandon C already. I mean, sure, maintain the ability to bind to C libraries and other sorts of machine-code level integrations, just stop with backwards compatibility at the language level.

11

u/ObscureCulturalMeme Jan 22 '19 edited Jan 22 '19

So what change would you like to see that maintains...

I mean, sure, maintain the ability to bind to C libraries and other sorts of machine-code level integrations

...that degree of ABI compatibility, while...

just stop with backwards compatibility at the language level.

...somehow achieving this? What, exactly, would you like to drop?

A lot of people complain about C arrays being no more than pointers. Sure, that could be dropped from C++, but you no longer get to binary link against C libraries.

6

u/Randolpho Jan 22 '19

Mostly, I'd love to see header files and preprocessing macros go away.

I'd also love stronger typing -- C plays really loose with typing.

Basically I want C# from a general namespacing/scoping standpoint, but with C++ allocation semantics and runtime libraries, native compiliation by default, and functions as first class citizens.

4

u/[deleted] Jan 23 '19

[removed] — view removed comment

1

u/Randolpho Jan 23 '19

I'm aware that it would not be an easy change. It's just what I want.

3

u/ObscureCulturalMeme Jan 23 '19

Mostly, I'd love to see header files and preprocessing macros go away.

Okay, fair enough. Wouldn't break binary compatibility.

I'd also love stronger typing -- C plays really loose with typing.

C++ already has stronger typing than C. What, exactly, do you want changed about C++ in this regard? And how is it supposed to be binary compatible with C?

You've tossed out some very attractive buzzwords -- stronger typing! we all want stronger typing! -- but you've given no specific examples, nor indication that you understand that these are very nearly impossible to implement while also still linking against native C.

It's possible to bake a lot of information into name mangling, so it's very likely that stronger link-time analysis could be performed when linking C++ with other C++. That would be possible (with some trade-offs that not everyone would necessarily enjoy), and things like that already have been done, and continue to improve. But doing that when linking against C, nope.

The C++ standards people (who would also be the ones implementing the compilers and linkers and libraries) recognize that binary compatibility with C is simultaneously C++'s biggest strength and its biggest weakness. If they could have let you eat the cake and keep it too, it would have already been done. (I know this because I was one of those people for a time.)

Basically I want [a bunch of stuff that can't happen without breaking the ABI, and no suggestions as to how this would possibly happen].

You'd have to change C as well to get any of that. In fact, you'd have to change it so much that it wouldn't be binary compatible with older versions of itself. At that point, you might as well just do a new language yourself, implement what features you want, and name it after your favorite beer/taco/bourbon/moon.

Don't name it Beer Taco Bourbon Moon, though. That would be weird.

4

u/[deleted] Jan 23 '19

What binary compatibility?

C++ with its "every compiler use different name mangling" is the opposite of binary compatibility.

→ More replies (0)

1

u/fijt Jan 23 '19

What do you mean with C already? The big problem with C++ is the foothold it has with C, for instance all the crap that people have to program to get rid of all the C++ headers in C. The guy who organized that kind of organization to start with should have been "getting rid of" a long time ago. Here, why can a CPP program being called .cc or .cpp, but not .hh? Why does it still has to be called .h?

-10

u/farebord Jan 22 '19

C++ is crap. C is dope

→ More replies (1)
→ More replies (3)