OOP is TRWTF
-
@dkf said in OOP is TRWTF:
Just been dealing with a student who doesn't understand the difference between float and unsigned int.
You mean, after you explained it? How is that even possible?
Do you have a neuroscience department which could study this curiosity?
-
@DogsB said in OOP is TRWTF:
A man that is a bit too fond of his factories but otherwise solid advice.
Hmmm....does this guy have an account here?
const fruits = [ { type: 'apple', price: 1.99 }, { type: 'orange', price: 2.99 }, { type: 'grape', price: 44.95 } ];
-
@dfdub said in OOP is TRWTF:
You mean, after you explained it? How is that even possible?
Well, he's good at not listening quite as well to what people are saying to him as everyone thinks he is.
Do you have a neuroscience department which could study this curiosity?
Better yet, he's trying to write AI code…
-
@dkf said in OOP is TRWTF:
Better yet, he's trying to write AI code…
In case anyone is looking for me during the upcoming SkyNet apocalypse, I've just decided to relocate to my nuclear bunker.
-
@Gąska said in OOP is TRWTF:
Like iostream library in C++ - I don't experience any problems with it because I've switched completely to cstdio.
I went to fmtlib.
-
@dfdub You're safe. He found addition to be at about his level of competence.
…
OK, that's matrix addition in a tensor flow network running on non-standard hardware. It's not quite as trivial as it sounds at first glance.
-
@dkf said in OOP is TRWTF:
Just been dealing with a student who doesn't understand the difference between float and unsigned int.
double W = 0.0; var Q = (*(ulong*)&W); // But they're both zero!
Programming confession: yes, this is from production code. By me. Except it contains actual data. Hey now! Careful with that cluebat!
-
@Applied-Mediocrity That's effectively what we do, except we wrap it in functions to make it slightly less vomit-inducing, and the student was having problems figuring out whether to use
float_to_int()
orint_to_float()
despite the clues being right there in the types and the function names.
-
@dfdub said in OOP is TRWTF:
@error said in OOP is TRWTF:
"The computer does exactly what you tell it to do, no more and no less," is both the easiest and the hardest thing for users to grasp.
In the case of AI, it's more like "you better pray you trained the computer to do what you think you trained it to do".
LOL! Same thing goes when training dogs. Are you sure you're rewarding the behavior you think you're rewarding? (No, you're late. You just rewarded the behavior you don't want!)
-
@boomzilla said in OOP is TRWTF:
I'm sure it will work just as well as using natural language to communicate system requirements from business users to developers does!
+∞
It also works so well when talking to neighbors... (oh wait, that thread is )
-
@mott555 said in OOP is TRWTF:
@dfdub said in OOP is TRWTF:
@mott555
So, as always, programmers who don't understand low-level details like memory locations and calling conventions are TRWTF andstruct
works just fine.75% of the programmers I've ever met don't even understand basic programming fundamentals.
That's certainly true. The number of people who struggle with understanding such a simple concept like a pointer to a value vs. a value is mind-boggling.
Which makes it even more ironic that this thread is about how easy all this category-theory stuff is.Toss structs at them and their computer will spontaneously combust, so the safest thing to say in C# land is "Structs are weird, don't use them unless you really have a compelling case."
Still, sounds like structs work fine (@Gąska's performance problems aside). If you don't understand that value types are copied, or that you can't keep a reference to a stack variable around (because GC is magic and you don't understand anything) then you're and .
-
@topspin Back to the original point, (I don't even remember who made it),
.Equals()
/==
is slow on structs that don't override those because the runtime has to use Reflection to discover all fields and do a memberwise equality check. Somehow, people found this surprising, when anyone who understands why "C# structs are different" ought not be surprised by this...which of course fell into a bunch of nearly-unrelated pissing contests over whether or not structs are weird.
-
@mott555 said in OOP is TRWTF:
@topspin Back to the original point, (I don't even remember who made it),
.Equals()
/==
is slow on structs that don't override those because the runtime has to use Reflection to discover all fields and do a memberwise equality check. Somehow, people found this surprising, when anyone who understands why "C# structs are different" ought not be surprised by this...which of course fell into a bunch of nearly-unrelated pissing contests over whether or not structs are weird.A lot of the crowd around here assumes everyone should be as much of a language standards nerd as they are. Or that they have a degree in programming.
-
@dfdub said in OOP is TRWTF:
If your B.Sc. courses for Computer Science don't require at least one of those, you're studying at WTF-U.
Very few coworkers took computer science, most took a system analyst course that is much lighter on the programming. It's argued that the worse errors are caused by misunderstandings on the requirements.
-
@dkf said in OOP is TRWTF:
@dfdub You're safe. He found addition to be at about his level of competence.
…
OK, that's matrix addition in a tensor flow network running on non-standard hardware. It's not quite as trivial as it sounds at first glance.
Assuming (without evidence) that tensor flow does all the hard work for him, it’s still as trivial as it sounds.
-
@boomzilla Yeah, but there’s a spectrum here. This thread started out with the FP crowd assuming everyone has a math PhD, but now we’re talking about people who couldn’t code their way out of a wet paper back.
-
@topspin said in OOP is TRWTF:
@boomzilla Yeah, but there’s a spectrum here. This thread started out with the FP crowd assuming everyone has a math PhD, but now we’re talking about people who couldn’t code their way out of a wet paper back.
I don't think that's a fair description of not knowing all the ins and outs of structs in C#. I had no idea about them in large part probably due to the fact that I have rarely used the language. But that's not to say that I wouldn't need to use it at some point and could easily get tripped up by something like that.
But yes, we all know people like you described, and they get tripped up by stuff like that in every language.
-
@boomzilla said in OOP is TRWTF:
@topspin said in OOP is TRWTF:
@boomzilla Yeah, but there’s a spectrum here. This thread started out with the FP crowd assuming everyone has a math PhD, but now we’re talking about people who couldn’t code their way out of a wet paper back.
I don't think that's a fair description of not knowing all the ins and outs of structs in C#. I had no idea about them in large part probably due to the fact that I have rarely used the language.
That’s not what I meant. I’ve never even touched C#.
But that's not to say that I wouldn't need to use it at some point and could easily get tripped up by something like that.
But you’d understand it once you’ve read the explanation.
But yes, we all know people like you described, and they get tripped up by stuff like that in every language.
Yeah.
-
@Carnage said in OOP is TRWTF:
coherent SpecateSwamp
-
@boomzilla said in OOP is TRWTF:
But that's not to say that I wouldn't need to use it at some point and could easily get tripped up by something like that.
Most of those surprises can usually be avoided by taking a quick glance at the documentation. If you're not , that is.
-
@dfdub said in OOP is TRWTF:
@boomzilla said in OOP is TRWTF:
But that's not to say that I wouldn't need to use it at some point and could easily get tripped up by something like that.
Most of those surprises can usually be avoided by taking a quick glance at the documentation. If you're not , that is.
Do you really read the whole of it before writing anything? I like to read the rules of a board game before I play, but I realize that some of it probably won't really make sense until I get to that point in the game. And it's usually a page or two. But no fucking way I'd do that with a language standard!
No one would ever get anything done by that standard.
-
@topspin said in OOP is TRWTF:
Assuming (without evidence) that tensor flow does all the hard work for him, it’s still as trivial as it sounds.
I'm still of the opinion (actually, more convinced, after recently talking to a machine learning "expert"), that Tensorflow et al. should have a captcha that involves you demonstrating that you could write a simple perceptron or something similarly simple from scratch, before you're allowed to use Tensorflow for anything.
-
@HardwareGeek said in OOP is TRWTF:
@Carnage said in OOP is TRWTF:
coherent SpecateSwamp
He could be coherent, but still rambling about tobacco UFOs and what not. 😄
-
@boomzilla Yeah, seriously...
A pro should read just enough to get a running start. And have enough experience to know when to read more.
-
@boomzilla said in OOP is TRWTF:
Do you really read the whole of it before writing anything?
Obviously not, only the intro (if I'm completely unfamiliar with the technology) and the documentation for the parts I'm currently using. That's why I qualified my statement with the word "most". And I usually wouldn't read the language specification, but some tutorial.
Side note: The C# language specification is actually surprisingly easy-to-read and I'd recommend doing so: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/structs#class-and-struct-differences
-
@dfdub said in OOP is TRWTF:
The C# language specification is actually surprisingly easy-to-read and I'd recommend doing so:
Thanks, I'll bookmark this for the next time I'm having trouble getting to sleep.
-
@boomzilla said in OOP is TRWTF:
@dfdub said in OOP is TRWTF:
The C# language specification is actually surprisingly easy-to-read and I'd recommend doing so:
Thanks, I'll bookmark this for the next time I'm having trouble getting to sleep.
Oh come on, you could have at least clicked the link before replying. It's a very short paragraph which is very relevant to this thread.
-
@dfdub said in OOP is TRWTF:
Oh come on, you could have at least clicked the link before replying.
YMBNH
-
@boomzilla said in OOP is TRWTF:
@dfdub said in OOP is TRWTF:
Oh come on, you could have at least clicked the link before replying.
YMBNH
Young man, don't you get snippy with me! And now get off my lawn!
-
-
@dcon said in OOP is TRWTF:
@Gąska said in OOP is TRWTF:
Like iostream library in C++ - I don't experience any problems with it because I've switched completely to cstdio.
I went to fmtlib.
looks fine, thanks
-
@boomzilla said in OOP is TRWTF:
for the next time I'm having trouble getting to sleep.
Here, have this.
Still want to read that at some point but .
-
@topspin yeah. Rust, unlike Haskell, is something I'd like to try at some point.
-
@topspin said in OOP is TRWTF:
Assuming (without evidence) that tensor flow does all the hard work for him
His project is on moving the tensorflow stuff to a new hardware platform. He's not interested in the machine learning stuff as such, but rather in non-standard (and massively parallel) computing substrates. He actually has to poke his nose inside stuff that most users of tensorflow ignore. (His goal is to produce a simple proof of concept; he definitely doesn't have time to do the whole job.)
If only he was a stronger student.
-
@Captain said in OOP is TRWTF:
A pro should read just enough to get a running start.
Most programming languages can be learnt pretty quickly, at least to journeyman level. It's the libraries (including standard libraries) and implications that can take a lot to comprehend.
-
@dkf That and the bundle of WTFs you were unlucky enough to step into...
-
@dfdub said in OOP is TRWTF:
@boomzilla said in OOP is TRWTF:
But that's not to say that I wouldn't need to use it at some point and could easily get tripped up by something like that.
Most of those surprises can usually be avoided by taking a quick glance at the documentation.
The problem with documentation is that it's way too thick and disorganized to read everything cover to cover, and there's no way to know whether a given page will contain extremely important warnings before reading the page (and even that is based on a rather uncertain assumption that you're already aware that the given page even exists).
-
@dfdub said in OOP is TRWTF:
Side note: The C# language specification is actually surprisingly easy-to-read and I'd recommend doing so: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/structs#class-and-struct-differences
But if you want to know that
==
has piss poor performance on structs by default, you have to read this HOWTO page from C# programming guide, hidden under section "Statements, expressions, and operators", subsection "Equality and equality comparisons". How long would it take you to figure out that's where you have to look without googling? Remember, in this scenario, you don't know or even suspect that there's anything wrong with it yet.
-
I think how people do OOP changed a lot in the last 20 years. Maybe not the theory, I dunno, but what I observed people doing changed a lot.
-
@Gąska said in OOP is TRWTF:
But if you want to know that == has piss poor performance on structs by default, you have to read this HOWTO page from C# programming guide
I never claimed that RTFM is a reasonable solution to every single problem, but I seem to have agitated a lot of shoulder aliens with my remark. I'll just assume that's because you all know that you're being too lazy and I've hit a nerve.
-
@dfdub said in OOP is TRWTF:
I never claimed that RTFM is a reasonable solution to every single problem
But you did seem to suggest it's a reasonable solution to learning how to write decent C#. Which it isn't.
-
@Gąska
Here's what I actually said:Most of those surprises can usually be avoided by taking a quick glance at the documentation.
I highlighted the important parts for you. The topic of the conversations were structs in C# and I proved that searching for "struct" in the official documentation, which is what I would do if I had no clue what they are, tells you almost everything you need to know.
Then the shoulder aliens started having a rage party.
-
@dfdub said in OOP is TRWTF:
the shoulder aliens started having a rage party.
This should be the byline for TDWTF Forums.
-
@dfdub said in OOP is TRWTF:
I proved that searching for "struct" in the official documentation, which is what I would do if I had no clue what they are,
The problem is when you don't know you have no clue. Structs seem simple enough that I guess most people won't feel they need to look at that.
-
@dfdub said in OOP is TRWTF:
Here's what I actually said:
And here's what I said: "decent C#".
One would think avoiding most surprises would be enough for decent C#...
The topic of the conversations were structs in C# and I proved that searching for "struct" in the official documentation, which is what I would do if I had no clue what they are, tells you almost everything you need to know.
Except for the actually important part that's only to be found somewhere else entirely.
-
@dfdub said in OOP is TRWTF:
which is what I would do if I had no clue what they are,
But...I've used structs in other languages. I have a clue what they are.
Then the shoulder aliens started having a rage party.
No, you just assumed we'd never heard of a struct before, apparently.
-
@mott555 said in OOP is TRWTF:
@topspin Back to the original point, (I don't even remember who made it),
.Equals()
/==
is slow on structs that don't override those because the runtime has to use Reflection to discover all fields and do a memberwise equality check. Somehow, people found this surprising, when anyone who understands why "C# structs are different" ought not be surprised by this...which of course fell into a bunch of nearly-unrelated pissing contests over whether or not structs are weird.I would say it's surprising. I guess it's a reasonable default in ValueType.Equals. I'd expect the C# compiler to autogen an Equals method that does per-field checks when the code doesn't specify one.
-
@boomzilla said in OOP is TRWTF:
which is what I would do if I had no clue what they are,
But...I've used structs in other languages. I have a clue what they are.
Assuming that keywords mean exactly the same in different languages is not the best idea in general.
volatile
has completely different guarantees in C++ and Java, for example.
-
@dfdub said in OOP is TRWTF:
@boomzilla said in OOP is TRWTF:
which is what I would do if I had no clue what they are,
But...I've used structs in other languages. I have a clue what they are.
Assuming that keywords mean exactly the same in different languages is not the best idea in general.
volatile
has completely different guarantees in C++ and Java, for example.Yeah, that one I've not really used in either language so I probably would look it up if I encountered it.
-
@dfdub said in OOP is TRWTF:
Assuming that keywords mean exactly the same in different languages is not the best idea in general.
const
in JS is equivalent toreadonly
|final
|val
(C#, Java, Kotlin) and notably signifies neither immutability nor a JIT-time constant value.
Filed under: And JS is a good language.