Liste des Groupes | Revenir à col misc |
On 29/09/2024 06:44, 186282@ud0s4.net wrote:I think of OO more as a design philosophy than a language feature. The early problem I saw with C++ was projects that implemented classes bottom up. If you saw they had written their own string class, you immediately knew the project was going to fail.
The only ones I came to HATEwere LISP/PROLOG and ADA - the latter being SO fascistWell yes, that what happens when you let computer scientists take over.
that, well, no WONDER govt projects take 20 years ....
I knew someone who ran a small company doing low level programming fir their custome hardware.
One day one of the coders said 'lets do the next one in C++'
So they did, and a year later realised that before you wrote C++ you have to sit down and write some or of spec to show what objects you are going to need to create etc etc.
In the same way I always write down a crude 'data dictionary' whenever I am implementing any sort of file based data system. And especially an SQL based oneIt maps fine. Most optimisation is about efficient algorithms, not about shaving micro-seconds off a loop in a crap or naive algorithm.
But they didn't. They tried to hack it and it was a disaster.
I hate OO.
It is a compsci invention that doesn't map well onto an actually CPU which is a procedural beast.
Most of its vaunted advantages can be attained by writing C in a structured way and others like operator overloading are just damned confusing.Yes, I could implement OO designs in C, and I would if I had to, but I would be borrowing what I learnt from C++ and other OO languages.
>
I don't WANT to use the same syntax to add two strings together as to add two numbers.Syntactic sugar can be nice, as long as it doesn't obscure what is really going on. Mainly I don't like it because it makes unfamiliar languages harder to understand.
I found that out in JavaScript where a comparison between a string "1" and a number 1 failed on IE but worked on Firefox.Oh, I can be unaware of what my code is really doing, in any language :-)
I had found an 'undefined' gap in the language.
In C you are absolutely aware at all times what type of object you are dealing with and if you move to another one it's via an explicit cast. Or if implicit, you normally get a compiler warning.
In C if you want to deallocate RAM you say so. It doesn't silently collect garbage under your feet and take a millisecond to do itAnd you can deallocate RAM many times, or not at all. I have a friend interested in music and he won't touch garbage collection, but I rarely cared about non deterministic short pauses. The benefits of not doing all the janitor stuff with memory was huge.
>
Javascript silently just does what it *thinks* you meant. And gets it wrong.Only with old codgers.
In short there is a layer of uncertainty built into modern languages that attempt to map abstract compsci concepts into actual procedural code.
Which is why C is probably still the most popular language.
>
Les messages affichés proviennent d'usenet.