Timeless Lessons from Greybeards, or, Get Off My Lawn!
-
I found this article today:
http://www.javaworld.com/article/2894748/core-java/7-timeless-lessons-of-programming-graybeards.htmlAlas, the whippersnappers aren't always the best solution. While their brains are full of details about the latest, trendiest architectures, frameworks, and stacks, they lack fundamental experience with how software really works and doesn't. These experiences come only after many lost weeks of frustration borne of weird and inexplicable bugs.
-
many lost weeks of frustration borne of weird and inexplicable bugs.
They're Discourse users?
-
Ew, compiler bugs. Never run into one, or maybe I have. Wouldn't even occur to me as a possibility.
-
reads the article
re-reads the first section
grabs popcorn
-
I've read this a week ago. Found it sort of boring and predictable.
-
they lack fundamental experience with how software really works and doesn't.
http://www.javaworld.com/
Riiight...
-
Found it sort of boring and predictable.
I don't disagree, but I enjoyed reading it as I stroked my gray beard.
-
Ew, compiler bugs. Never run into one, or maybe I have. Wouldn't even occur to me as a possibility.
Compiler bugs I know about in an abstract way -- most of them take fairly weird code to hit, unless you're using some obscurely atrocious toolchain.
Now, debugger bugs, on the other hand, I've had firsthand experience with, and they are
PAINFUL
-
Ew, compiler bugs
Not as common as years ago, but still occur. The real fun in the old days were cpu bugs as well as subtle malfunctions of hardware that could take hours/days to track down using low level diagnostics, then going in (soldering iron, wirewrap, et. al.) and fixing the cpu.Strangest one I ever encountered was a failure to do a carry from bit 5 to bit 6 (12 bit word) under very specific conditions. Turned out to be a bit of (partially conductive) dust on the backplane.
-
TIL about the word
schadenfraude
.My best guess is it means bribing someone into having bad luck.
-
Nah, it's taking joy in the pain of others. So basically this whole forum.
-
My best guess is it means bribing someone into having bad luck
No, taking pleasure in another's misery
-
Nah, it's taking joy in the pain of others
@Jaloopa said:taking pleasure in another's misery
That's schadenfreude, which is not the word the author used.
-
..so it is!
Then it must be defrauding someone for the sheer joy of it.
-
schaden
is damage, the pleasure part of the word isfreude
.Schadenfraude
would be...damage fraud? Hurting yourself for an insurance payout?
-
I can't get
fraude
to translate… so no idea
-
Yeah, I don't think it's actually a german word. Fraud makes as much sense as anything else for a pidgin translation
-
-
Ew, compiler bugs.
I've run into a couple things in the C# compiler that I consider a compiler error, but they're always of the form "you can't do X but I think you should be able to".
Like:
IList<bar> foo = allFoos.where( foo is bar ).ToList();
being a type-error. Because C# didn't go the extra mile to determine that that LINQ
.where
statement will always return only the type bar.
-
schaden is damage, the pleasure part of the word is freude. Schadenfraude would be...damage fraud? Hurting yourself for an insurance payout?
Wow you guys are slowly figuring out OffByOne's joke. Another 4-5 posts of analysis and you might chuckle a bit.
-
FYI, that was quite funny
-
I still can't imagine it being doable without reengineering the language.
First, you need a mechanism to have methods called on the same base class and taking the same parameters return different types. Then, you need to actually prove that the boolean predicate you got passed will actually make the result all match the derived/implementing class.
First might be possible, but would be a heavy language change. Second is plain impossible in general case - not just "really hard" impossible, but Halting Problem-impossible.
-
You could already do this by reimplementing linq using a different collection interface that uses
in T
, I believe. It's a bad idea, though.
-
It is Dutch though:
And yes, it means fraud
Hence my explanation:
bribing someone into having bad luck
Bribery is a kind of fraud, not?
Maybe I should have put a little more effort in my snark
-
FYI, that was quite funny
Yes, it was. I think Blakey is having a bit of slowenfreude at @Jaloopa's expense.
-
I still can't imagine it being doable without reengineering the language.
Don't optimizing compilers do this sort of thing all the time? Obviously, you could come up with a complex condition that it couldn't prove (maybe because it isn't actually guaranteed), but I don't see how this is something beyond the ken of a modern compiler.
-
...because you're supposed to use:
IList<bar> foo = allFoos.OfType<bar>().ToList();
instead, which does exactly that?
-
I know that now, I did not know "OfType" existed when I wrote the code originally.
In any case, since the two are equivalent, the compiler should be able to figure out they're equivalent and stop giving me type errors.
NOTE TO STUPID PEOPLE: THAT LAST SENTENCE USED THE WORD "SHOULD". PLEASE LOOK UP THE WORD "SHOULD" IN A DICTIONARY BEFORE REPLYING. THANK YOU.
-
Things<SuperBar>
is equivalent toThings<in Bar>
, but not toThings<Bar>
. This is exactly the way it should be. This protects the general case, while allowing for a special (very easy to get horribly wrong) case.
-
Can you explain why that's relevant to what blakey is saying? I understand that it's what the compiler is doing, because it's ignoring the stuff inside the
where
, but that's blakey's point, that the compiler shouldn't be ignoring it.
-
Where<T>
returns anIEnumerable<T>
, whereT
is the type of the collection you use it on. He's getting every item that can be cast to a specific type, but not doing any casting, and then trying to shove it into anIList<Bar>
. IfIList<T>
was insteadIList<in T>
, that would be fine, because it accepts that types can be converted to their subtypes. This is not the default behavior, because of all the problems it can create if you misuse it, but it's available.
-
Because Where is typed as:
public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate);
It's lambda takes a method that returns a bool. There's no provision for the compiler to notice that you're lambda is checking the type of the input and magically cast the return collection to a IEnumerable of something else. How is it to know that that's actually what you want to do?
Annoying? Maybe, but that's how things work in a language with strong types. You could always work with a more dynamic language instead. Or just start sprinkling C# dynamic everywhere. But please don't.
-
Or, like I said, use the correct existing mechanism for modifying variance? Seriously, this is C#. You can use whatever kind of variance you want.
-
Why does every thread has to end up with some discussion about C#?
BOOOOORING!
-
Because there's always someone around who'll misunderstand a feature, not use it, and blame the language.
-
Fine, let's talk about rockets or something.
http://i.space.com/images/i/000/011/013/i02/soyuz-rocket-globalstar-launch-071311-2.jpg?1310799371
-
Because there's always someone around who'll misunderstand a feature, not use it, and blame the language.
Someone with white fur, whiskers, large incisors, and a hairless tail?
-
Frequently, but it's definitely not only him. Not that I blame him in this case, since variance isn't something you come up against all that frequently, and when you do, you normally have
.OfType<T>
to deal with it. It's an important but obscure concept. Just like how most people don't know how to useasync
andawait
, or that MEF exists, despite them not really being new features.
-
I've run into a couple things in the C# compiler that I consider a compiler error, but they're always of the form "you can't do X but I think you should be able to".
The ones I've run into, at least recently, have been lax syntax/semantic checking. Coder writes something that should be a compile-time error, but instead the code compiles, runs and, by the grace of Compiler, does what the coder intended. Then a new version of the compiler is released that fixes this bug, and "Oh, noes!!1!1! The new version broke my code. Quick, go back to the previous version!"
-
Why does every thread has to end up with some discussion about C#?
Because it's the best programming language.
-
schadenfrau.de
A damaging woman
Alas, the domain is taken at there are no Schadefrauen there
-
The F??? I posted this to Song of the Day
We discovered this a while ago. The only way to do it without copy/pasting the quote is:
1- quote reply
2- navigate to the destination thread
4- click a new reply button
5- any extra typingIf you modify the post at all in between opening it and changing the topic you're replying to, you get the abandon post message, if you just move to a new thread without manually clicking a different reply you get it posted in the original thread
-
@Jaloopa - Last Day Without A Discourse Bug: null
-
I sang a song to an existing topic: 🎤 Song of the day 👂
-
And the linkage between the two topics is broken. Which is the whole Belgium Belgium Belgium Belgium Belgium point of the Belgium cross-posting; at least, it's broken in the case of the Jeffed post. ...
Hmmm. Ok, the links are there, but semi-hidden. The moved post has a right-pointing arrow in the quotation that links back to @OffByOne's post here, but there's no link in the right margin, and the right-arrow's destination is weird:
http://what.thedailywtf.com/t/via-quote/48764/13
instead of the expectedhttp://what.thedailywtf.com/t/timeless-lessons-from-greybeards-or-get-off-my-lawn/48764/13
. There is no obvious link from @OffByOne's post to the moved reply; it's only visible expanding the2 Replies
drop-down.
-
And the linkage between the two topics is broken. Which is the whole Belgium Belgium Belgium Belgium Belgium point of the Belgium cross-posting; at least, it's broken in the case of the Jeffed post. ...
You think you have it bad... Imagine my confusion:
- Yesterday evening I got an email that I have been mentioned. Thought "I don't feel like Discourse, it'll have to wait until tomorrow"
- This morning I open my notifications, see HardwareGeek Timeless Lessons from Greybeards, or, Get Off My Lawn!, click on it and get zapped to @boomzilla's yellow
jeffingsinging post - Scratch head, notice 🎤 Song of the day 👂, click that, get zapped to the first post in the Song of the day thread
- Decide to get coffee, because it was too soon for that kind of discoursistency
There is no obvious link from @OffByOne's post to the moved reply; it's only visible expanding the
2 Replies
drop-down.I didn't notice that, thanks.