oop is one pararadigm. the other is funcfional. Both together. So oopme up with scala or fsharp running on a virtual machine.
No, it's a book: small, bound, available in book stores. But you made me look in the high energy physics search engine (now known as INSPIRE, it used to be SPIRES), and while I find lots of publications about related topics (SPEAR, SSRL, accelerator control, control system programming ...), none about objects, and none with a name that rings a bell. And I know that I was never a co-author on any paper with the author of the book ... one of the things that ended my career at SLAC was that I had no interest in what is called "machine physics", the art and science of building and operating accelerators. I was always an instrumentation and data analysis person.1) May be it is a SLAC report?
That’s what Ivan Čukić is preachingoop is one pararadigm. the other is funcfional. Both together.
At the lowest level, isn't OOP functional? Object methods that implement something like read a register, increment a value, I think is fundamentally "functional".That’s what Ivan Čukić is preaching![]()
Solitaire was AI back in the day....What I am saying is that C++ is not an object-oriented language anymore.
I've found it depends highly on the problem you are solving.I’m such a dinosaur.
I use a class for encapsulation but never used inheritance. No need.
Same problem. Timer X is an interface that uses methods start() and stop(). Timer Y uses methods start() and stop(). If class A wants to "implement interfaces" X and Y, the resulting code will be difficult to read, since every time start() or stop() are used it needs to be disambiguated.There are interfaces to avoid mulitple inherintance.
Same problem. Timer X is an interface that uses methods start() and stop(). Timer Y uses methods start() and stop(). If class A wants to "implement interfaces" X and Y, the resulting code will be difficult to read, since every time start() or stop() are used it needs to be disambiguated.
In this case, it's just easier for class A to contain two timer objects, instead of inheriting from them, or implementing them.
For fun, object orientation with sbcl,
![]()
;; functions returned as messages
(define w1 100)
> (w1 . 100)
((w1 'withdraw) 50)
> (w1 . 50)
((w1 'withdraw) 75)
> "Insufficient funds"
;; functions only
(define w2 100)
> (w2 . 100)
(make-deposit 20 w2)
> (w2 . 120)
(make-withdraw 150 w2)
> "Insufficient funds"