Geez, chill out. I can't stand profanity.
Pot, kettle, black. Blasphemy is a subclass of profanity.
Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
61–70 of 113 posts
Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#62Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#63Earlier quoted context omitted.
Pot, kettle, black. Blasphemy is a subclass of profanity.
“Geez” is a minced oath designed specifically to avoid blasphemy—avoiding it by a millimeter, to be sure. Even some devout Christians say things like “gosh”, “darn”, and “geez”.
Or Miss Mary had a Steamboat. You know exactly what you’re doing and you ain’t foolin anyone.
Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#64Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#65Earlier quoted context omitted.
“Geez” is a minced oath designed specifically to avoid blasphemy—avoiding it by a millimeter, to be sure. Even some devout Christians say things like “gosh”, “darn”, and “geez”.
Yeah it’s gaming the system. Like children saying I was Born on a Pirate Ship while holding their tongue. Or Miss Mary had a Steamboat. You know exactly what you’re doing and you ain’t foolin anyone.
Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#66Earlier quoted context omitted.
Pot, kettle, black. Blasphemy is a subclass of profanity.
“Geez” is a minced oath designed specifically to avoid blasphemy—avoiding it by a millimeter, to be sure. Even some devout Christians say things like “gosh”, “darn”, and “geez”.
I once knew a baptist preacher who was a serious student of theology and moral philosophy. He liked to discuss the distinction between theology and law, particularly when framing behaviour as the imperative expression of faith, and not faith as the expression itself. Needless to say, the parishioners loathed him and he was hounded out for exposing their constant hypocrisy. Also possibly for declaiming in classical Greek on a Sunday morning; he was truly a latter-day Socrates.
My wife and I recently re-watched that unfortunately truncated classic, HBO/BBC/Rai's Rome, and were once again thoroughly entertained by the multitude of colourful epithets. Sadly, exclaiming "by Juno's cunt!" during a contentious meeting of the audit sub-committee or weekly retro would require more explanation than I'd care to give in context. And yet, a devout Christian should have no problem with this, at least on a theological level, since no scripture is violated.
Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#67Earlier quoted context omitted.
Not sure what you mean, exactly. Could you sketch a simple example with some types and typeclasses?
This is how it would be done in Java: class Parent { public void first() {}; public void second() {}; public void third() {}; } class Child extends Parent { @Override public void third() {}; //change implementation of third function, reusing the first two. }
Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#68Earlier quoted context omitted.
Not sure what you mean, exactly. Could you sketch a simple example with some types and typeclasses?
This is how it would be done in Java: class Parent { public void first() {}; public void second() {}; public void third() {}; } class Child extends Parent { @Override public void third() {}; //change implementation of third function, reusing the first two. }
module Parent {
let first = () => ();
let second = () => ();
let third = () => ();
};
module Child {
include Parent; //add parent funcs to namespace
//@Override
let third = () => ();
};
I make regular use of this pattern production.Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#69Earlier quoted context omitted.
These days I find composition via dependency injection (of interfaces, not concrete implementations) to be a much better way to solve #3.
I would argue you should inject concrete implementations until you need an interface. Why add unnecessary indirection?
If I start from a concrete 'FooDatabase' (and wait until later to interface it), I might start putting things like open(), close(), flush(), etc. into my logic code. Then when I interface it, it will just be unnecessary indirection.
If I start from the other end and think "I just need somewhere to put my Foos", then I'll pass in a Consumer and be done with it.
Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#70Earlier quoted context omitted.
And #3 is also an area where Functional Programming falls completely flat. There is simply no easy way in any FP language that I know to capture such a simple mechanism as: "Reuse 90% of this piece of code but alter just this 10%". Haskell’s typeclasses and OCaml modules solve this problem neatly. It is not as easy as in Java, because you need to spend a few minutes thinking how to abstractly specify the interface yo…
> Haskell’s typeclasses and OCaml modules solve this problem neatly. Neither do, really. Imagine you have an existing typeclass with three functions. How do you create your own typeclass that reuses two of these three functions but your own instance reimplements the third one? Try it. It's pretty much impossible, or at least not without a lot of boilerplate and forwarding.
> Reuse 90% of this piece of code but alter just this 10%
There is no general solution to this, in any programming language, without some foresight (unless you admit some crazy features like arbitrary code re-writing or source-level patches). If you have, say, a single function of 100 lines, and 10 lines need to be changed, you're going to have to edit that code to enable the change, and if that 100 lines is in a third-party library or code you otherwise don't control, you're going to have a hard time. However, if you control the code and are able to make changes to it to support new behaviors, FP languages give you plenty of power here, just as OOP languages do. There's not a lot of objective difference here in power and plenty of differences in taste and familiarity, so please be careful about repeating "you can't do X in language Y".