|
Like the "do not look through this hole..." mark?
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.
|
|
|
|
|
If a clown holds a door for you, is that a nice jester?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
How times have changed! It was the other way round in 2015[^]. But by September[^] it had switched. Then in 2017[^], it switched back.
Looks like you picked the wrong day to quit sniffing glue!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'm obviously re-running "the best of OriginalGriff" for the new year ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Oddly enough, you, too, have Leslied yourself: The Lounge[^]
I'm afraid it would be foolhardy to dig any deeper int this.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Hodor.
(Game of Thrones spoilers...but if you care at all about the show, then I'm not sure how you don't already know)
|
|
|
|
|
There's jest nothing I could makeup to answer that
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
My version of a survey - I'm interested in actual experience. I'd post this in SO, but there are so many anal retentive ivory tower type there... I digress. FWIW, this is a little bit of soul searching, so take it as an honest question/statement/search and hell, suggest a book for me to read?
I live mostly in the embedded world where things are tightly bound to hardware. It might be the problem. It might be that I'm trying to apply OOD to something that just doesn't warrant it. That said, i've been developing software (of all types) for 40 years, and at the application level, I have *yet* to see any significant code re-use other than copy/paste.
I'm a (was?) big believer in OO design. I believe in Abstraction, Encapsulation, Inheritance, and (not)Polymorphism has (had) hope. But I believe that it suffers badly from being too general for what we do as developers. In no particular order:
Abstraction - I like it. Hide the details. So far so good. The problem is that most make analogies to objects that don't have an elephanting to do with reality software development. It sounds good, it just doesn't work.
Encapsulation - I love it. Hide the details, avoid spaghetti code, methods work with a blob of data.
Inheritance - a plague, a virus, useless. Most examples are trivial. Give me one complex application example, and it all falls down.
Polymorphism - meh. It's cute. Sure, I can create multiple methods to work with different parameters, but at the application level it is not that groundbreaking.
----------------------------------------------------------
So, in my project I've just spent 3 days (and some nights) trying to make some code generic and OOD and what not, and it's not going to happen. The more I try to make the class behave in a couple of different situations, it's just a boondoggle - which triggered me at 4 am - just copy the code to another function and hard code everything. Hence the question.
fwiw, the code I am modifying has not changed in 10 years. So, why bother making it general? I spend a lot of time trying to make code flexible (thinking long term support, etc), and I think I'm wasting my time.
Sort of rambling here, I'd like some practical, pragmatic feedback.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Polymorphism isn't its own thing.
Polymorphism == Abstraction + Encapsulation + Inheritance
|
|
|
|
|
well yes, I understand. Are you from Stack Overflow
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
charlieg wrote: Are you from Stack Overflow
Since he did not ask you if you to first go get a CS degree before posting questions, he is probably not.
|
|
|
|
|
lol, true. I'm an EE, written lots of code but I've always wanted to take an algorithms class. Don't know why, well, at least my analyst asks me.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
I'm an EEE myself, and written a whole bunch of algorithms, but I've never seen an algorithms class. What would that teach? Some of my engineering textbooks included digital implementations of the math they taught. That sort of thing? Some of the ones I came up with in my youth actually got published as company standards - like my classic algorithm for generating code to filter out ambient noise in a factory environment at run time. It drove the QA types nuts, because every time the test application ran, it was different code executing; they hate that stuff. Today, I don't know of any language that gives an application to modify itself while it's running, so I could never duplicate that one. But it was fun!
Will Rogers never met me.
|
|
|
|
|
My initial reaction is to agree, but the term is nonetheless useful.
|
|
|
|
|
The embedded world lives mostly in C, and the most versatile environment I know of has deep reusability achieved through an insane amount of defines, to the point that finding references to specific symbols require often 4-5 indirections. I'm talking about AutoSAR specifically.
It really depends on where you sit: are you developing a platform or a product? If you work on the final product, keeping things flexible may actually hinder the developement, as either you spend a lot of time trying to perfectly model the product you're developing in order to have flexibility where needed or you end up applying a flexible model which is not adequate to the specific product and end up breaking the model to make it work.
If you're working on a platform, that's different. The final product will be, hopefully, shared between hundreds of completely different systems so the expense in finding the perfect model and maintaining it pays off.
GCS d--(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--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Product, and you just hammered my nail.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
den2k88 wrote: AutoSAR
Someone else on CP who knows Autosar !
|
|
|
|
|
Got thrown into it about a year and a half ago. It was bound to happen, working in a company that has 80% automotive contracts.
GCS d--(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--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
I work in the company that kind of created it, so avoiding it completely is not possible.
|
|
|
|
|
LOL so you probably know a friend of mine, he moved in Germany several years ago and he works there too
GCS d--(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--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Everybody in Germany knows someone who works there
|
|
|
|
|
I was almost thrown in a project where AutoSar was involved.
Luckily for me, another project started to burn down and I was sent there to extiguish the fire in the last moment and I could remain in my blessed ignorance.
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.
|
|
|
|
|
Inheritance is very useful: create a "base class" (abstract by preference) and derive the classes you actually use from that. I have base forms, usercontrols, and general classes and it can really save you from some mistakes - like forgetting to update one out of five classes to fix a bug. If it's part of the base class, you fix it in one place and it updates all the others.
Admittedly, it's been a long while since I did any embedded work (sob!) but if you can cope with the performance hit that the higher level language brings with it then the improvement in reliability and maintenance effort is well worth it.
I generally couldn't - I had low frequency processors and restricted RAM, plus I had to run 24/365 so heap allocation at run time was pretty much a no-no.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I did use it in a sortofembedded system that had to control several types of hardware, which could be of different makes and models with different communication systems. So the code would instance x generators, x sensors and use them through the generic interface, while the derived classes managed the gritty details of every model.
GCS d--(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--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Very similar to my situation, but in my case I have to produce a visual representation of said data (that varies wildly) and must be pushed to different display formats. I found the time to produce a class that could be inherited as not worth the effort. If the code never changes (note my comment - 10 years), why bother with the investment?
I like the idea of just being able to inherit from a base class, but it happens to rarely.....
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|