|
Absurd Alhazred posted:So in C++ if I define:
|
# ¿ Sep 26, 2022 19:19 |
|
|
# ¿ May 16, 2024 14:47 |
|
LOOK I AM A TURTLE posted:It does enforce nomimal typing for class objects, but not for "plain objects". edit:
|
# ¿ Sep 26, 2022 19:28 |
|
Absurd Alhazred posted:If TypeScript doesn't change its behavior if I change something then I'm going to call it "it doesn't see it".
|
# ¿ Sep 26, 2022 19:33 |
|
Absurd Alhazred posted:That's exactly it, though: I don't want my compiler/interpreter helpfully finding these underlying structures for me, I want it to raise the alarm that I passed something in that wasn't explicitly allowed. There are some ways to enforce nominal typing (for example) but I wouldn't say it would be desirable all the time.
|
# ¿ Sep 26, 2022 20:23 |
|
Absurd Alhazred posted:You keep using the word "explicit". I don't think it means what you think it means.
|
# ¿ Sep 26, 2022 20:46 |
|
Absurd Alhazred posted:But that's not what I'm doing. I'm saying "I accept SpecificallyThisObject", that happens to have a string in it. I don't want it to accept "ThatEntirelyDifferentObjectThatHappensToStartWithAString" without me explicitly enabling that behavior somehow because it detects that there's this structural similarity and just "helpfully" does that for me.
|
# ¿ Sep 26, 2022 21:06 |
|
It's incorrect because you can't pass JustAString in a place where AStringAndAnotherThing is expected. If it didn't see a difference between them, that would obviously not be the case. There's a big difference between "A and B are both acceptable" and "A and B are indistinguishable". edit: I think I misunderstood by what you meant by "these two". I thought you meant the types, not the two examples. I guess we're arguing for nothing.
|
# ¿ Sep 26, 2022 21:16 |
|
Absurd Alhazred posted:With all the stupid garbage they poured into C++20, it would have been nice if they had made * and & first class type modifiers instead of variable-attached type modifier.
|
# ¿ Sep 26, 2022 22:32 |
|
I frankly would prefer that the C++ ecosystem didn't get hard rebooted. I've had enough of that with .NET thank you.
|
# ¿ Sep 27, 2022 01:41 |
|
Xarn posted:The issue with all the changes around <=> and comparison reordering and stuff is that they can silently cause new and cool issues with previously valid code.
|
# ¿ Sep 27, 2022 16:25 |
|
Xarn posted:The output is different with C++17 and C++20. Strictly speaking the comparison operators on that type are broken even in C++17 though, since s1 < s2 is checking a fundamentally different thing than s2 > s1.
|
# ¿ Sep 27, 2022 18:48 |
|
Phobeste posted:Oh didn’t know, my bad. Wonder why I thought it was
|
# ¿ Sep 28, 2022 13:55 |
|
My CS degree was mostly “here’s the language we’re using in this course, here are some links to learn it if you don’t already know it”. We did do one C++ class but it was mostly about software design concepts and not the language itself.
|
# ¿ Sep 29, 2022 17:35 |
|
ultrafilter posted:You can't evaluate introductory courses just based on how well the students like them. That's a recipe for disaster. edit: No matter what the introduction is, the students are going to be learning bad habits and misconceptions that they need to break later, so you might as well start with the thing that gives them the least friction. I love strong static typing and very much dislike dynamic typing, but only because I went through a phase of loving dynamic typing, learning some hard lessons, and realizing how hard it is to architect a solid system that I'm confident in with dynamic types. At best if you teach students how great static types are to begin with, they're going to essentially be cargo culting it (or rebelling against it) for superficial reasons that they can't possibly understand intuitively. Experience is the only true teacher of these things - the best introduction is the one that makes students want to know more and keeps them interested. Volte fucked around with this message at 15:52 on Oct 24, 2022 |
# ¿ Oct 24, 2022 15:48 |
|
I've seen that template technique before in C, but it just used GNU M4 or whatever and didn't get cute with weird characters. I guess using valid identifier characters keeps the syntax highlighter happy but any kind of IDE or analysis tool is going to break anyway.
|
# ¿ Jan 8, 2023 15:35 |
|
There's nothing wrong with this And it's still a percentage. 0.1 and 10% are the same thing: 10/100.
|
# ¿ Jan 17, 2023 19:46 |
|
leper khan posted:percentage = .1 says very explicitly .1/100
|
# ¿ Jan 17, 2023 20:36 |
|
It's pretty simple: there's no place that you should ever see "percentage" and assume it should be an unadorned number between 0 and 100. There's nothing in life, programming, or mathematics that uses it that way. Not even everyday use of percentages in common language express percentages without the percent sign. Normally this wouldn't even come up, since you rarely need to specify "percentage" instead of something more general but since this is specifically designed to visually represent percentages, it makes sense to me that it should follow the definition of what a percentage actually is, and not what some people might mistakenly believe a percentage is.
|
# ¿ Jan 17, 2023 20:56 |
|
leper khan posted:Per Centum. Fraction of 100. It's literally the words meaning. 10 percent is 10/100. .1 percent is .1/100 pokeyman posted:It's pretty simple: my interpretation is obviously correct and you're all idiots.
|
# ¿ Jan 17, 2023 21:11 |
|
leper khan posted:percentage If the language had an actual % postfix operator that let you specify "50%" directly, what would you expect "printPercentage(50%)" to do? Hammerite posted:like, even if I agreed that "proportion" and "percentage" were terms that have absolutely 100% the same meaning and connotations (I don't agree, by the way) I still wouldn't name a variable that if it was meant to be an ordinary proportion; because I would know that the majority of people reading the code would not understand it to mean what I was trying to express, and if writing code is an act of communication with the computer and with other programmers, then that's a failure to communicate well cheetah7071 posted:this is absolutely wrong. Completely wrong. I see numeric values between 0 and 100, intended to be interpreted as percentages, constantly in my work. Volte fucked around with this message at 22:04 on Jan 17, 2023 |
# ¿ Jan 17, 2023 22:01 |
|
I think at best it shows that there needs to be some clarification on the range, which really there should be in any case, but I still don't think there's a better word for that function than "percentage" given what it does (maybe ratio but I think that tends to connotes a proportion of one thing to another). A lot of colloquial usage has implied information omitted in ways that you would (or should) never assume in a more rigorous setting like programming. "What's the temperature?" "31". In common parlance, this is probably a well understood sentence given all available context. In programming, it would be obviously underspecified - if it wasn't obvious otherwise, you'd have to go to the documentation to see what units are expected. If you see "percentage", maybe you do the same thing just to make sure because sometimes the meaning of words can be tricky, but I still say that if the documentation then tells you the number should be between 0 and 100, then it's a misnomer. In other words, if you assume "percentage" means anything other than "scalar multiplier of a whole", then you're just assuming that the library writer was wrong. Bury me on this hill
|
# ¿ Jan 17, 2023 22:32 |
|
The parameter should be called "n" so that you have to look up what the range is.
|
# ¿ Jan 17, 2023 22:43 |
|
Dijkstracula posted:this is all correct of course - though, the original method was written in Java and I've had cases where I wanted something along the lines of value numbering to be applied, but only the server compiler actually did it when I inspected the assembly. (maybe getPercentageRounds() is called often enough that it trips the recompilation threshold though )
|
# ¿ Jan 22, 2023 19:36 |
|
Athas posted:Why is it called libcef.dll and not something more descriptive? I am a big fan of terse names, but I don't get the point of terseness for things you will not regularly type, but which you might need to spot in lists.
|
# ¿ Mar 29, 2023 17:57 |
|
Athas posted:Maybe they should. There is nothing gained by calling it libcef.dll instead of libChromiumEmbedded.dll or whatever, and the latter saves you from having to look up what cef means. It's not like you type this name often while programming. I think I have found the obscure complaint that I will build my grave on.
|
# ¿ Mar 29, 2023 19:16 |
|
My favourite Windows start menu search behaviour (which thankfully seems to be fixed in Win11) was typing "VLC" and the first highlighted result was "VLC media player - reset preferences and cache files" instead of the main application.
|
# ¿ Mar 29, 2023 23:51 |
|
I like the drive letter system personally, and Windows supports mount points instead of drive letters for additional volumes if you really want that.
|
# ¿ Mar 31, 2023 17:27 |
|
Remulak posted:I love the Windows Store python setup, I can send our field support python scripts without spending a ton of time helping them gently caress around with paths and installers. The Bash vs Powershell fight is funny to me because they're both incomprehensible garbage as far as I'm concerned. I've had to write bash scripts on occasion for like 20+ years and I still have to consult a reference to figure out how to do basic control flow constructs.
|
# ¿ Apr 2, 2023 16:04 |
|
Jigsaw posted:If I can’t walk somewhere, I use a rocket ship.
|
# ¿ Apr 3, 2023 17:27 |
|
It seems like it's as simple as they did Prefs.Set(key, value) except without realizing that 'key' is different with every run. Unity is the thing that spams it into the registry. The idea that this is some absolute nuclear fuckup by the KSP devs and they should never be trusted to write code again is hilarious. It reminds me of when I used to work in a computer shop around 2008 doing tech support and someone had brought in a computer that didn't work properly, and the issue turned out to be that some Kodak photo printer software (if I remember correctly) was creating tiny files in a temp directory at a rate of several per second any time the computer was on. It had created so many junk files, we're talking like hundreds of millions of files, that Windows just didn't really work anymore. Now there's a flaw I could see getting upset over.
|
# ¿ Sep 26, 2023 13:12 |
|
Bruegels Fuckbooks posted:I can forgive a programmer missing this but no one in their QA noticed this? It's a combination of "run your game long enough and game doesn't work anymore" and "dumps thousands of mb of keys in the registry" - that kind of bug is a QA wet dream. If I had to point the finger at any one clear point of failure, it's Unity, because what the hell, why does it store user preferences in the registry??
|
# ¿ Sep 26, 2023 16:56 |
|
ExcessBLarg! posted:Unity is why a 850 MB pixel art game takes up 7.1 GB on Nintendo Switch. Absolute weird bullshit engine.
|
# ¿ Sep 26, 2023 18:41 |
|
Macichne Leainig posted:I mean, the evidence is that the original game is 850mb on disk. It's gotta be some asset packing fuckery to blow it up to almost 10x its size or some other weird poo poo. So I'm not sure I'd lay this directly at the feet of Unity. I would guess either whoever built the game didn't set the build up with compression enabled properly, or else it was determined that the Switch hardware didn't play nicely with on-the-fly decompression. Anyone know how big the PS4 version is? Volte fucked around with this message at 21:47 on Sep 26, 2023 |
# ¿ Sep 26, 2023 21:45 |
|
Macichne Leainig posted:I didn’t say it was all Unity’s fault but go on I guess edit: Looking back in the Steam depot history it seems that it was originally uncompressed on PC as well, and they switched to a compressed build shortly after release. So it could just be that the consoles never got that change. See: https://steamdb.info/depot/774362/history/?changeid=M:936010028863753902 Volte fucked around with this message at 22:00 on Sep 26, 2023 |
# ¿ Sep 26, 2023 21:47 |
|
leper khan posted:You shouldn't have a need for a null value type IMO. Though sure that's a real use case of something they do that's different.
|
# ¿ Dec 12, 2023 17:02 |
|
leper khan posted:Null is the absence of value. The concept isn't unique to pointers. leper khan posted:Horror from the thread and all, but I never understood the appeal of option types. Doesn't give any more information than a pointer.
|
# ¿ Dec 12, 2023 21:28 |
|
ExcessBLarg! posted:I'm struggling to think of a good example of having 100+ "else if" blocks even for generated code. Surely it could be converted to some kind of dispatch mechanism, or at least convert the conditional tests into a tree form. if (opcode == FOO) { ... } else if (opcode == BAR) { ... } else if ... Yes, it can be trivially converted to other forms that don't run up against the limit, but there's no inherent reason you'd start there when something as simple as this is the lowest hanging fruit and adding in a dispatch mechanism isn't necessarily going to be good for performance.
|
# ¿ Dec 18, 2023 17:35 |
|
ExcessBLarg! posted:This could trivially be written as switch/case even within a code generator.
|
# ¿ Dec 18, 2023 19:31 |
|
"VERY few engineers out there could write it from scratch" [citation needed] It's not even that complicated of a type. C++ programmers are writing similar things with template behemoths and SFINAE all the time (god help them and us all). They'd probably kill to have it as easy as just a bunch of nested type-level conditionals with clearly defined and understandable conditions.
|
# ¿ Mar 6, 2024 21:01 |
|
|
# ¿ May 16, 2024 14:47 |
|
I don't think there's anything that gross about it that's not also gross about any switch statement that uses fallthrough logic. The fact that it slices up the for-loop construct is kind of viscerally offputting but starting partway into the for loop isn't really conceptually any different than a do-while loop. It's what I would mildly classify as spaghetti code and not something I would ever do in general, but it's pretty clear what it does and how it works.
|
# ¿ Apr 10, 2024 17:47 |