|
Scaramouche posted:Hah I remember inlining ASM into Turbo Pascal. Now that was a feature! It wasn't until I believe 2012 that I worked on a game that didn't have some inline assembly somewhere in the code, and that was because it was for iOS. It was really liberating to just drop code:
|
# ? Mar 19, 2019 23:47 |
|
|
# ? May 17, 2024 15:26 |
|
Hughlander posted:It wasn't until I believe 2012 that I worked on a game that didn't have some inline assembly somewhere in the code, and that was because it was for iOS. What’s the connection?
|
# ? Mar 20, 2019 03:51 |
|
pokeyman posted:What’s the connection? Most assembly was for graphics initialization, networking, or input. iOS just did it all in Objective-C. Even the 360 and PS3 titles I worked on had some Power PC to get to the title screen.
|
# ? Mar 20, 2019 06:48 |
|
Telerik
|
# ? Mar 20, 2019 12:02 |
|
Hughlander posted:Most assembly was for graphics initialization, networking, or input. iOS just did it all in Objective-C. Even the 360 and PS3 titles I worked on had some Power PC to get to the title screen. Cool. For some reason I was thinking "does iOS somehow co-opt inline assembly? Was it too annoying to deal with multiple architectures?" and it wasn’t making sense.
|
# ? Mar 20, 2019 12:26 |
|
Hammerite posted:Telerik My personal angst is towards Infragistics. Many colleagues loathe DevExpress. It begs the question : are there actually any good UI Component libraries out there?
|
# ? Mar 20, 2019 13:31 |
|
AppKit. UIKit.
|
# ? Mar 20, 2019 17:21 |
|
Found out today that one of our in-house libraries (not all that widely-used) contains a type T that implements IEquatable<T> and 1) the Equals(T other) method isn't transitive 2) it's possible for T t1 and T t2 to satisfy t1.Equals(t2) && t1.GetHashCode() != t2.GetHashCode() It's not clear whether anything is going to be broken if we just get rid of the implementation of IEquatable<>, so I am just adding ObsoleteAttribute to relevant methods, adding Debug.Assert(false) statements so uses get caught when code is run in debug, and making sure that the unit tests in the project I'm working on can run in debug without asserting... (This type has been this way since 2013)
|
# ? Mar 20, 2019 20:06 |
|
That's like when I noticed that a couple of our classes' equals() methods looked like this:code:
|
# ? Mar 20, 2019 21:46 |
|
We also have a shitload of equals() instances that are probably never used but everyone's scared to change, even when fields are added. There are quite a few "hasSameContents()" and the like floating around as a result.
|
# ? Mar 21, 2019 00:39 |
|
If there isn't a single and unambiguous possible definition of equals, you shouldn't be overriding equals. (And as a corollary, since identity is a reasonable definition for anything mutable, you should never override equals for a mutable type). Define an IEqualityComparer instead that people can use when they want this specific definition.
|
# ? Mar 21, 2019 00:53 |
|
Is there a good reason to overload equals instead of just defining a separate comparison function? Besides using an API that uses equals under the hood?
|
# ? Mar 21, 2019 00:53 |
|
Jabor posted:If there isn't a single and unambiguous possible definition of equals, you shouldn't be overriding equals. (And as a corollary, since identity is a reasonable definition for anything mutable, you should never override equals for a mutable type). Who is this aimed at? I'm aware of all this. The class should not have implemented IEquatable<T>. It should have had a NearEnough(T other, double tolerance).
|
# ? Mar 21, 2019 01:09 |
|
In other exciting news (I just discovered this): our unit tests were not assert-clean to start with! How enjoyable!
|
# ? Mar 21, 2019 01:20 |
|
Ugh digging through the app I've inherited and every. single. one. of the few hundred tests is a snapshot test. So if any tests are failing, I can just regenerate the snapshots and they magically all pass. And there is a handwritten copy of the model of the initial application state in the tests directory, rather than the tests using the actual model of the initial application state.
|
# ? Mar 21, 2019 13:53 |
|
RobertKerans posted:Ugh digging through the app I've inherited and every. single. one. of the few hundred tests is a snapshot test. So if any tests are failing, I can just regenerate the snapshots and they magically all pass. And there is a handwritten copy of the model of the initial application state in the tests directory, rather than the tests using the actual model of the initial application state. Snapshot tests are great. If you make a mistake when regenerating a failing snapshot, surely that will get caught in code review?
|
# ? Mar 21, 2019 15:47 |
|
sunaurus posted:Snapshot tests are great. If you make a mistake when regenerating a failing snapshot, surely that will get caught in code review? They're fantastic for smoke testing components, and I'm glad they're there for that. But the majority of them are for the Redux app. I just...ugh...that's not where I want them snapshots to be. We told the agency who were building the MVP of the app to add in tests, and this is the result. Each of those snapshots run against the root reducer, not the individual slices: that seems to have enabled them to just basically copy-paste the same snapshot test a couple hundred times and change the action going into it on each one. Then backed it with that mocked handwritten version of the initial state of the reducer rather than the actual initial state (which is a thing I want to know is correct! Why the gently caress would you make a pretend version of it)
|
# ? Mar 21, 2019 16:21 |
|
cmon people pleasephp:<? var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];?>
|
# ? Mar 22, 2019 20:21 |
|
What's a leap year anyway?
|
# ? Mar 22, 2019 20:27 |
|
streetlamp posted:cmon people please It should of course be php:<? var DAYS_IN_MONTHS_4_YEARS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];?>
|
# ? Mar 22, 2019 20:29 |
|
hey it works most years? at least?
|
# ? Mar 22, 2019 20:30 |
|
2100 is somebody else's problem
|
# ? Mar 22, 2019 20:46 |
|
Ola posted:It should of course be gonna need to spend a while writing out DAYS_IN_MONTHS_400_YEARS if you really want it to be correct though
|
# ? Mar 22, 2019 20:48 |
|
CPColin posted:2100 is somebody else's problem *sigh* php:<? var DAYS_IN_MONTHS_C_YEARS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, ];?> quote:...unless the year is divisible by 400... Fuuuuuuuuuuuuuuck. If only there was some way you could calculate this.
|
# ? Mar 22, 2019 20:51 |
|
nailed it, you got the job
|
# ? Mar 22, 2019 20:54 |
|
What actually happens when you store the correct sequence is that your code eventually starts it from the wrong place.
|
# ? Mar 22, 2019 20:59 |
|
Ola posted:What actually happens when you store the correct sequence is that your code eventually starts it from the wrong place. Arrays indexed by month should have a null value at the beginning so you can write `array[getCurrentMonth()]`, which everybody is going to write eventually anyway, but as a bug.
|
# ? Mar 22, 2019 21:47 |
|
Galaxy brain:PHP code:
|
# ? Mar 22, 2019 22:11 |
|
code:
code:
|
# ? Mar 22, 2019 22:21 |
|
CPColin posted:
Hahaha, knuckles should be a standard sequence unit.
|
# ? Mar 22, 2019 22:24 |
|
This last page is one of the reasons I love this thread and by extension, dead gay forum
|
# ? Mar 22, 2019 23:01 |
|
Scaramouche posted:This last page is one of the reasons I love this thread and by extension, dead gay forum it's all fun and games until someone complains that your product is reporting infant ages incorrectly and then you find a five hundred line long function that tries to calculate how many days are between two different dates.
|
# ? Mar 23, 2019 17:16 |
Bruegels Fuckbooks posted:it's all fun and games until someone complains that your product is reporting infant ages incorrectly and then you find a five hundred line long function that tries to calculate how many days are between two different dates. That's when you get to write one of those fun -500/+3 pull requests by replacing this all with a call to an appropriate datetime library.
|
|
# ? Mar 23, 2019 17:33 |
|
VikingofRock posted:That's when you get to write one of those fun -500/+3 pull requests by replacing this all with a call to an appropriate datetime library.
|
# ? Mar 23, 2019 17:48 |
|
I found this: https://zygoloid.github.io/cppcontest2018.html entertaining
|
# ? Mar 23, 2019 17:51 |
|
VikingofRock posted:That's when you get to write one of those fun -500/+3 pull requests by replacing this all with a call to an appropriate datetime library. yeah but it's medical software and there was pearl clutching about potential safety issues so that generated literally hundreds of emails for something that ended up being a three line fix.
|
# ? Mar 23, 2019 18:04 |
|
Today I discovered that there's no guarantee for constexpr to be actually computed at compile time and MSVC will just give up and compute it at runtime if it's too hard. No way to turn that into an error afaict though.
|
# ? Mar 23, 2019 18:19 |
|
Can I also request to the C++ guys for controls and hints for execution performance? If your dumb autovectorizer fails that should be a compile error rather than compiling to slower code.
|
# ? Mar 23, 2019 18:21 |
|
You're allowed to have a constexpr function that returns a compile-time constant if passed compile-time-constant arguments but just gets called normally if passed variable / runtime values. They up and added the consteval keyword to the language to do what constexpr sounds like it's *supposed* to do.
|
# ? Mar 23, 2019 18:26 |
|
|
# ? May 17, 2024 15:26 |
|
Suspicious Dish posted:Can I also request to the C++ guys for controls and hints for execution performance? If your dumb autovectorizer fails that should be a compile error rather than compiling to slower code. /Qvec-report:2 will tell you if things failed to autovectorize but I don't think that can be enabled just for specific loops that you're expecting to be vectorized. Suspicious Dish posted:Today I discovered that there's no guarantee for constexpr to be actually computed at compile time and MSVC will just give up and compute it at runtime if it's too hard. No way to turn that into an error afaict though. constexpr just means that it can be called in places which require a constant expression.
|
# ? Mar 24, 2019 03:30 |