|
lw@zi wrote: I drive in India and if you have been here, you would know that following rules and thinking of safety is absolutely optional here. Which is kind of secure in itself, because as you know that it is wild, then you pay a lot of attention.
If you drive in germany, people would not pay attention while following the rules and then complain because you did not do whatever the rule is.
One thing that helps me when switching is... always drive a local car, that means with the wheel in the same side than the others... then just think one thing:
- The danger is on the driver side.
I mean:
- The fast line is the one on the driver side.
- The cars in the other direction are on the side of the driver.
- The dangerous turn is the one to the side of the driver (where you have to give way, pay attention to coming cars...)
The worst thing IMO is to drive your own car in a country where people drive on the other side.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
It's pretty easy.
The gear shift is on the wrong side, however.
Avoid roundabouts, if at all possible.
If you accidentally go to the passenger door, instead of the driver door, open it an sit in there for a little while like that was your intention all along. Tilting the seat back and pulling out a paperback to read makes it more believable.
|
|
|
|
|
some_array[value];
[] is over ridden and is commented as // find element matching _Keyval or insert with default mapped
Which actually means 'insert it at the end of the list'.
Why not a function called 'add_to_map_at_end'?
Christ I hate C++ sometimes, it is so up its arse pointless at times.
|
|
|
|
|
It's not C++, it's the programmers. I use C++ and don't do that s**t.
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
And this 20 year old code base has evidently seen some right clowns have a go at it!
|
|
|
|
|
Any 20 years old code base saw its sharse of clowns, especially the self-taught enthusiast that follow any "guru" blindly.
I had such a colleague, luckily he went out slamming the door... unfortunately he had 10 years to make damages. I recently had to update some of his code and I was happy that he was no longer in my proxymity or I would be writing this from behind bars.
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
I have come across some right howlers in this code base.
Anyway, C++, of all the languages I have used, from ADA, to Prolog, through VB and Java, allows this kind of sillyness. So it is for that that I condemn it.
And personally I dont see that OO is a massive benefit over a procedural language except in specific instances. And in fact it is often worse. Particularly in control code, code that is not data centric, but process centric.
|
|
|
|
|
I beg to differ, there are always pieces of information in a process which are data-centric, and applying OO correctly will break up processes in subprocess objects that are easier to isolate, replicate, store, observe and even parallelize.
I do intermix procedural and OO because pure OOP more often than not introduces complexity trying to fit square pegs in round holes, but that's precisely why I like C++ and not the oter OOP languages: it's C, but with 100% OO support.
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
den2k88 wrote: there are always pieces of information in a process which are data-centric
Often not with drivers. In fact many are pure process and have no data of their own. They have states, flags, plenty of that, but no data.
|
|
|
|
|
Munchies_Matt wrote: Often not with drivers.
More like never, I concur. Drivers, firmware and heavy computing procedures get no benefit and mostly troubles at all from an internal OO implementation. As consumers of OOP (object as parameters), or external implementation (i.e. the driver is encapsulated in an object) they might get some benefits though.
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Probably why MSFT dont authorise C++ in the kernel, it isnt worth it.
OF course when I see classes with get/set functions I chuckle. Just what is the point of pretending it is OO?
|
|
|
|
|
If you had ever had the experience of building a large software project using non-OO code, you would sing a different tune.
|
|
|
|
|
You can build a large project from procedural code just as well, it all depends on the architecture you design. Look at the WIndows kernel. All built in C (with a bit of assembler in the HAL)
|
|
|
|
|
And have you, personally, built a million-line code-base in purely procedural code? In C, perhaps? If you have done so, and have done the same using an object-oriented language, then you have standing to dismiss object oriented programming as no better than procedural.
Merely asserting that it is possible is not a very strong claim. Pointing to 30-year-old code like the Windows Kernel, that was developed before the broad availability of OO languages is meaningless.
|
|
|
|
|
|
While I agree with your statement, std::map implements this very [] operator overload as described. Actually that comment is a nice addition. Would I implement something like that though? probably not.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Quite, this is in the map object. Obscene is isnt it, that such an abortion as this is used so widely.
|
|
|
|
|
You are pretty close to the perfect answer....
C++ is as sensible or as stupid and daft as you want it to be.
Unfortunately not helped by the C++ ISO bods adding more and more different ways to make it more complicated without adding very much to real C++ users. The idea of less is more is lost on them.
Could do with minimum C++ with a lot of the bad and new stuff removed.
As for the Template library - great functionality but let down by the ludicrous syntax etc.
|
|
|
|
|
Yes, I still keep the AT&T C++ book on my desk. A slim volume describing a nice language which was an (IMO) elegant OO extension to 'C'.
Now you can look at valid C++ syntax that looks like a cat walked across the keyboard. They seem to be trying to put every feature of every other language into C++ syntax and comprehensibility be damned.
|
|
|
|
|
Hey! You can do stupid things in any language, if you try hard.
Back in my FORTRAN days, I discovered you could write self modifying code with judicious misuse of COMMON ... you can't do it now, but back then? Handy... :cringe:
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: if you try hard.
And the lazies use VB.
|
|
|
|
|
I remember "PEEK(address)" and "POKE address, value" as dearly loved functions, but that was in the DOS days. If my memory is correct, it never made it into Visual Basic, though. (I guess it would be more or less meaningless, too, considering the memory management of Windows.)
|
|
|
|
|
OriginalGriff wrote: FORTRAN
OriginalGriff wrote: self modifying code
OriginalGriff wrote: misuse of COMMON What. The. .
Software Zen: delete this;
|
|
|
|
|
COMMON allowed you to share variables between different blocks of code: much like a C++ global variable being accessible from different classes.
But ... it wasn't type checked, so you could declare a float and then use COMMON to import it as a 7 dimensional array of BYTE values if you wanted. Because the array bounds checking worked on the data as declared in the COMMON statement with no actual reference back to the original variable, you could happily use it to access any location in your memory space. And because there was no physical separation between code and data segments (flat memory model in those days) your code was not in a "read only partition" as code is now. Provided you understood machine code you could revise your program while it was running ...
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Interesting times
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|