# Feelings about object orientation.



## Alain De Vos (Feb 1, 2020)

There was a time object orientation was important. The development of smalltalk, C++. But reading c++ code can be very painful, not to speak about bad implemented destructors of classes eating up your memory until even your OS dies. And smalltalk died, i don't know even why. Which language will survive and why ? Even in python or java, this or self everywhere , isn't that very  ugly ? In ada i have problems with scope,visibility. People think go and rust are the future. And even a relational database is not fit for an object so we need ORM. Many thing around us are a circle object but the API's force us many times to put it into a square. So ?


----------



## Hakaba (Feb 1, 2020)

I like eiffel langage.
But eiffel is not very used, sadly.


----------



## kpedersen (Feb 1, 2020)

I personally like OOP. I find that it does have a lot of benefits for the kinds of projects I work on.
However, for other types of projects, i.e where you deal with data as it is passed in (like a network stream), then building up large object hierarchies only to tear them down again shortly after is wasteful.

OOP doesn't dictate the language. For example these days I primarily write code in C and even that works perfectly in an object manner. Arguably in some ways it is more suited towards it than C++ because you get PIMPL built in for free.

As for lifespan. Go back 20 years and look at what languages existed then, have a look at what languages we have today. Now, try to match the past languages to the modern equivalent (in terms of technical merit, marketing, community) and you will get a fairly good idea of what will happen.

(Usually this is where I say, don't worry too much about the language. They come and go but the concepts that they all share remain... but no... Pick the right one now and build up a massive fsck(8)ing codebase / portfolio of reusable code and modules.
That way you can rely on it for future projects without having to deal with anyone else's crap or hundreds of stupid short sighted dependencies from PIP/NPM/CPAN/etc. If you simply flitter around with different languages for each project then you will be left with nothing but memories.)


----------



## drhowarddrfine (Feb 2, 2020)

Through all the tension filled, diarrhea fueled causing talk, the top languages are Java and C/C++ and have been for decades. 


kpedersen said:


> these days I primarily write code in C and even that works perfectly in an object manner.


If you were a woman, I'd marry you. I do the same and have for decades.

Sometimes I get tense and think I should be learning something new. I read about another language and think to myself, "I do it like this in C now so why am I bothering?".

And now people say JavaScript needs to be sped up and made more flexible by interfacing to other languages. So which language was the first (and exclusive) for the new Web Assembly? 

C

If you're working for some company that uses some language, that's the language to use. If someone is starting up a new project, and they have the time while becoming discouraged with their current language, that's the time to try the new language. If you have no significant reason for using a language then there is no reason to change languages.

Never, EVER learn Rust because you saw some reddit headline saying you MUST learn it cause it's taking over the world. Go hasn't taken over the world. Java and C still occupies those positions and probably will for the next 10 years or more.


----------



## rigoletto@ (Feb 2, 2020)

drhowarddrfine said:


> Never, EVER learn Rust because you saw some reddit headline saying you MUST learn it cause it's taking over the world. Go hasn't taken over the world. Java and C still occupies those positions and probably will for the next 10 years or more.



A funny fact is Rust was originally written in OCaml until they switch to Rust.



Alain De Vos said:


> In ada i have problems with scope,visibility.



One difference between Ada and the others is that is an ISO Standard. The discussions probably are still open to the upcoming Ada202x (International Standard ISO/IEC 8652:202x) and anyone can participate. Also, #ada at Freenode is a good place to ask about it. 

Ada Rapporteur Group


----------



## Nicola Mingotti (Feb 2, 2020)

my 5 cents:

Alain De Vos , Smalltalk is not dead, in France there is a lot of work in a Smalltalk fork called *Pharo*. If you like Smalltalk you may take a look. Personally, I like *Squeak*. 

I have red several of your comments, you talk about C and Java. 6 months ago I would have agreed with you all. Now, I would say, please, try *Smalltalk* (a classic one possibly, like Squeak, a little one like *Cuis*, or a wannabe-revolutionary like Pharo) . You will see a completely different world, where there are only objects and messages. At the beginning you will not even understand what you are supposed to do and what a program is. 

After a while you will see with other eyes code blocks like this:

```
for(i = 0; i < 5; i++) {
 if(i == 5) {
  printf("bla");
 } else {
  printf("blablacar");
 }
}
```

You will ask your self, where the heck are the objects?  It is just a farce, you are forcing them in, you are imperating-objects. After spending some time with Smalltalk I understood why the widespread lenguages are called "Object Oriented", and not like "Object Languages". 

Another nice laguange to see more objects than usual is *Ruby*, but still, if you want to see the real mind blowing s. you should definitely try Smalltalk.


----------



## rigoletto@ (Feb 2, 2020)

Btw, an OO language often told which do everything right is Simula67.


----------



## 20-100-2fe (Feb 2, 2020)

The advantage of OOD and OOP depend on what kind of software your write, whether you have to maintain them or not and the impact on your life of having trouble maintaining it if you have to.

For small pieces of software, C is perfect: easy to learn, concise, etc.
For larger pieces of software too, as long as they are close to hardware.

However, the closer your software gets to human beings and their activities, the more you appreciate the ease with which you can design a solution and implement it. Developing for human beings is closer to philosophy than to electronics.

A language such as Java is perfect for such applications : its syntax is as clean and elegant as C/C++'s and it comes with a comprehensive class library plus some nice features such as introspection. 

And because an object-oriented code is closer to the way we think about the application's purpose than procedural code, it is much easier to add functionalities and fix bugs.


----------



## Nicola Mingotti (Feb 2, 2020)

rigoletto@ said:


> Btw, an OO language often told which do everything right is Simula67.



I never tried Simula, but I am checking Wikipedia page, the code is not surprising at all, in retrospective, it seems Pascal with classes. This is not mind blowing try Squeak ! You will need time, or at least, I needed time to understand it.


----------



## Nicola Mingotti (Feb 2, 2020)

CAVEAT. I reccomend you try Squeak to see someting awesome and truly different from what we are used to everyday languages. It does not imply I reccomend it for production.


----------



## shkhln (Feb 2, 2020)

drhowarddrfine said:


> Never, EVER learn Rust because you saw some reddit headline saying you MUST learn it cause it's taking over the world.



Yep, learn it for borrow checker memes instead.


----------



## 20-100-2fe (Feb 3, 2020)

Alain De Vos said:


> Which language will survive and why ?



This question is not relevant.
Besides some occasional scripting, a developer never develops for himself/herself. As an individual, we don't _need_ software. We might fall in love with programming at some point in our life, but once we have reached a pretty good command of it, it becomes pointless.

Technology is only great when it can be used to solve complex problems, and complexity implies relationships. In other words, you only _need_ technology when you team with other people to solve problems affecting a human group (company, organization, community, etc).

The language you'll use to participate in building such a solution will be dictated by a number of criteria outside of the control of a single participant.

As an example, business continuity, time-to-market or TCO criteria will dictate choosing a popular language, so staffing the development team or training developers will not be an issue.

Here, in Luxembourg, several companies have tried and use Scala but have eventually given up because it was almost impossible to find developers already knowing it, as difficult to find trainings for developers already on the team, and Scala's learning curve was quite long. They finally preferred to migrate to Java 8, which addressed the points that had motivated their previous adoption of Scala.

These considerations apply not only to programming languages, but also to frameworks, libraries and tools, of course.


----------



## mark_j (Feb 3, 2020)

Alain De Vos said:


> There was a time object orientation was important. The development of smalltalk, C++. But reading c++ code can be very painful, not to speak about bad implemented destructors of classes eating up your memory until even your OS dies. And smalltalk died, i don't know even why. Which language will survive and why ? Even in python or java, this or self everywhere , isn't that very  ugly ? In ada i have problems with scope,visibility. People think go and rust are the future. And even a relational database is not fit for an object so we need ORM. Many thing around us are a circle object but the API's force us many times to put it into a square. So ?



The real problem with C++ is it's C with ++ added to it. 

It's not really, truly a designed from the ground up as an OOL. Even Java isn't; it takes more prompts from C++ than any other language.

What absolutely drives me crazy about OO languages like Java is the tremendous amount of long names used for everything. Talk about designed to get you RSI.

My language of choice is C, but I do use C++, Java and various BASIC derivatives. I used to love Pascal, but sadly it's lost its luster these days.

I'm not a keen fan of OO. I like some of its concepts but it's often implemented poorly. It's also bloated and slow and for my purposes, too often overkill. Having said that, when programming Qt, it's a must unfortunately (and fortunately I don't do that too often nowadays).

Languages are a dime a dozen these days. It's almost like a new language pops up every few months.

The future is C - you will eventually C that!


----------



## rigoletto@ (Feb 3, 2020)

There are economical reasons to C/C++ be around for very long time. Let's compare it with Ada (not ever geting into SPARK):


this inviable to write unmaintainable code in Ada. One really need to want to, to manage to write unmaintainable code in Ada;
the code is very portable, one of the easiest to port between platforms unless this is low level code - often just need to re-compile it. Same for new architectures/processors, you often just need a modern compiler to get stuff working;
you don't really need third party tooling because almost everything relevant is built in the language;
unless this a very large complex system there will have very few to no bugs, and usually just minor ones, and never plagues like buffer overflow and such.
How software companies would make money with maintenance contracts if they deliver a software which just works, and works robustly? And what would the tooling vendors do? They would have a pretty hard time to compete with AdaCore, btw.

What to do with this army of C/C++ developers when you can easily replace a bunch of them with just a few Ada experts? This is proven developing in Ada is often x3-10 faster than in C/C++. Have a look at Ravenports, Marino wrote the whole thing in about 7 months, alone!

No ready available Ada developers in the market is a no-brainier since this is well know an experienced C++ developer can get Ada pretty fast, and do actual useful things in about 2 weeks.

A lot of this is also true to OCaml but to a very different paradigm and users cases. Jane Street (trader) move 13 billion every day in their trading system, fully written in OCaml, almost pure OCaml.






Btw, you can also use OCaml dinamically, `ocamlrun`.


----------



## Lamia (Feb 3, 2020)

It will be good to read more support for OO meta-language, 
cross-platform multi-paradigm programming languages (with compiler). OCAML has done a good job with the introduction of Haxe and the likes. LISP and its derivatives should be thanked.


----------

