|
That's a load-bearing performance hit.
|
# ? Nov 12, 2021 04:13 |
|
|
# ? May 26, 2024 16:44 |
Today's highlights for a c# developer we hired with "10 years of c# experience" includes a pull request with the followingcode:
code:
|
|
# ? Nov 12, 2021 16:47 |
|
Why is that bad? I could tell defining a variable withouth type is fishy. Ignoring user-case is a read flag. Do this language give "and" and "&&" a different use? Is that a float? Maybe is 10 years of experience alone, writing some awnful stuff all by himself for himself.
|
# ? Nov 12, 2021 16:56 |
|
Tei posted:Why is that bad? Neither of those compile. C# (before 9.0, where it's used in a completely different place) doesn't even have an and keyword.
|
# ? Nov 12, 2021 17:00 |
|
raminasi posted:Neither of those compile. C# (before 9.0, where it's used in a completely different place) doesn't even have an and keyword. Oh, then this guy was a PHP developer, or had a "learn PHP in 10 hours" course, because both "var" and "and" are syntactically correct (sorta) in PHP*.... but would still raise many eyebrows. He lied about the C# experience. *I think, I have not used var in attributes in many years. Maybe is only a js thing? Tei fucked around with this message at 17:23 on Nov 12, 2021 |
# ? Nov 12, 2021 17:20 |
|
Tei posted:Oh, then this guy was a PHP developer, or had a "learn PHP in 10 hours" course, because both "var" and "and" are syntactically correct (sorta) in PHP*.... but would still raise many eyebrows. I think javascript ides will yell at you if you don't use const and let
|
# ? Nov 12, 2021 20:07 |
|
In addition to the syntax problems, does payrate1 != 0 && payRate1 != null not crash in C#? IIRC, it would in Java, assuming it has type Integer. EDIT: assuming the implied lack of precondition rjmccall fucked around with this message at 20:36 on Nov 12, 2021 |
# ? Nov 12, 2021 20:33 |
|
rjmccall posted:In addition to the syntax problems, does payrate1 != 0 && payRate1 != null not crash in C#? IIRC, it would in Java, assuming it has type Integer. code:
code:
|
# ? Nov 12, 2021 20:57 |
|
rjmccall posted:In addition to the syntax problems, does payrate1 != 0 && payRate1 != null not crash in C#? IIRC, it would in Java, assuming it has type Integer. It will work fine if payrate1 is a Nullable<int>, which is a value type with an overloaded == that behaves sensibly in both of those situations. (Although you can definitely write that conjunction less confusingly - I'd personally probably do payRate1.HasValue && payRate1 != 0.) If payrate1 is just an int or something it will always not be equal to null, which I actually did not realize until I just checked right now. raminasi fucked around with this message at 21:27 on Nov 12, 2021 |
# ? Nov 12, 2021 21:25 |
|
Okay, it sounds like C# never does implicit unboxing the way Java does. In Java, payrate1 != 0 (when payrate1 is of type Integer) is exactly equivalent to payrate1.intValue() != 0, and so can throw if payrate1 is null (making the second half of the && meaningless). C# apparently wouldn’t have this problem because it wouldn’t let this code compile in the first place unless you used something like Nullable.
|
# ? Nov 12, 2021 21:55 |
|
Well the fact that neither line can even compile means they are a bad developer in any language because they don’t test their code.
|
# ? Nov 12, 2021 22:59 |
|
that's what the pull request CI integration is for! but also seriously, that is what it's for
|
# ? Nov 13, 2021 02:15 |
|
take boat posted:that's what the pull request CI integration is for! I mean, that is what it's for, but ideally you feed it to CI and see if it falls over before you send it for code review
|
# ? Nov 13, 2021 04:21 |
|
ToxicFrog posted:I mean, that is what it's for, but ideally you feed it to CI and see if it falls over before you send it for code review Let he who never forgot to cast the first rollback.
|
# ? Nov 13, 2021 05:34 |
|
ToxicFrog posted:I mean, that is what it's for, but ideally you feed it to CI and see if it falls over before you send it for code review I definitely agree with you there, I just mean it's an automated way to enforce the social contract of not merging broken code. and if someone is opening failing PRs, you can tell them to fix it before they get approval
|
# ? Nov 13, 2021 07:09 |
|
rjmccall posted:Okay, it sounds like C# never does implicit unboxing the way Java does. In Java, payrate1 != 0 (when payrate1 is of type Integer) is exactly equivalent to payrate1.intValue() != 0, and so can throw if payrate1 is null (making the second half of the && meaningless). C# apparently wouldn’t have this problem because it wouldn’t let this code compile in the first place unless you used something like Nullable. If I understand boxing correctly, there’s no box in the first place. You’d never get a NullReferenceException because there’s no reference to be null.
|
# ? Nov 13, 2021 16:29 |
|
C# does have a form of boxing where you can convert value types to various types which are defined to be reference types, like System.Object or System.ValueType. But the unified model in the language largely hides this from you in e.g. the dynamic type of the reference; it’s only formally exposed by things like ReferenceEquals.
|
# ? Nov 13, 2021 17:01 |
|
rjmccall posted:C# does have a form of boxing where you can convert value types to various types which are defined to be reference types, like System.Object or System.ValueType. But the unified model in the language largely hides this from you in e.g. the dynamic type of the reference; it’s only formally exposed by things like ReferenceEquals. Ok, I should have been more specific - boxes are not usually necessary or even common, so reading an isolated line of code like that, I wouldn't assume boxing is happening. But when it is, you are correct, C# does not implicitly unbox.
|
# ? Nov 13, 2021 17:22 |
|
OddObserver posted:Let he who never forgot to cast the first rollback. I've been spoiled working at a place where attempting to send something for review automatically runs CI on it and refuses to notify the review until it passes.
|
# ? Nov 13, 2021 18:50 |
|
That must be so nice. I had to work with a system where the only way I could compile my changes against the libraries that depended on them was to submit a PR, and it notified the entire team who owned that library on every build attempt.
|
# ? Nov 13, 2021 19:13 |
|
ToxicFrog posted:I've been spoiled working at a place where attempting to send something for review automatically runs CI on it and refuses to notify the review until it passes. Yeah, this is really quite nice. Targets are built and tests are run before another person is told it's ready. You can override that, but it's a fantastic way to find out that the "harmless" last minute change is busted before it goes out.
|
# ? Nov 13, 2021 20:56 |
|
ToxicFrog posted:I've been spoiled working at a place where attempting to send something for review automatically runs CI on it and refuses to notify the review until it passes. I had this at my old job which was a C# shop but they had quite a bit of legacy code that would just randomly break your build for no reason so you might have to queue your CI 2-3 times to have it finally go through. I think they finally cut that flaky legacy poo poo out this year from what I've heard from friends who still work there, so that's good at least.
|
# ? Nov 13, 2021 21:04 |
|
I have plans to do some game engine programming with Quake. So I rebuilded a old computer, installed a SSD and the last versions of windows and compilers. A observation is compiling speed don't feel any faster since 2005 / 2002. The UI to choose things like output target and stuff is still a mess and with zero usability. Fortunally making this old codebase to work again was simple. I just had to disable some SAFEsomething flag, and blacklist LIBC.lib from the list of libraries. I had first to install some extra compability layers because this Visual Studio thing did not supported any of the the 3 the proyect already had (I believe that was sln). Since the original game is from 1996 don't really support a 16x9 monitor and defaults to fullscreen. Going back and from the game is horrible. If the debugger trigger in the middle of the game, with the resolution different than the desktop one, I had to use the task manager to return to the debugger (arggh) and it was in 640x400 resolution. Debuggers and IDE's are not any smarter than in 2005. I am surprised with how littel has changed. One of the first thing I will have to do is to force this game to run in window-borderless mode. Will probably be smoother to debug that way. Bethesda has released a new version of Quake this year, but they don't seems interested in releasing the source code (they have not reason to, but would be nice). John Carmack have asked them to do so, but they just ignored him.
|
# ? Nov 19, 2021 17:47 |
|
Protocol7 posted:I had this at my old job which was a C# shop but they had quite a bit of legacy code that would just randomly break your build for no reason so you might have to queue your CI 2-3 times to have it finally go through. One of the many really nice things about the setup we have here is that it maintains some history for each test, so it can report not just the results of your test run but how that compares to previous runs, and even make an educated guess about flakiness (e.g. "if this test got run multiple times on the same commit and passed only some of the time, it's flaky") So a CI run will group the results into "passing", "used to be broken but you fixed it", "used to be passing but you broke it", "still broken", and "flaky", and you can focus on the "you broke it" results; there's even an option to automatically rerun flaky tests a few times and report back what proportion of runs passed!
|
# ? Nov 22, 2021 18:41 |
|
Tei posted:I have plans to do some game engine programming with Quake. So I rebuilded a old computer, installed a SSD and the last versions of windows and compilers.
|
# ? Nov 23, 2021 16:08 |
|
F4rt5 posted:This... This must be a joke right? wh-why should it b-b-b-be a j-joke?
|
# ? Nov 23, 2021 16:15 |
|
It's Tei, I still don't know if they are gimmick posting or not.
|
# ? Nov 23, 2021 16:40 |
|
Sounds pretty real and familiar to me (I've been working on the Homeworld source lately lol) It does compile faster though, enable multiprocessor compilation Tei!
|
# ? Nov 23, 2021 16:57 |
|
Debugging true exclusive full screen games is still a pain in the rear end last I checked, but I wouldn’t blame the debugger or IDE for it. It’s really more of a OS or possibly display mode switching standard thing.
|
# ? Nov 23, 2021 17:25 |
|
Remote debugging?
|
# ? Nov 23, 2021 17:54 |
|
Spatial posted:Sounds pretty real and familiar to me (I've been working on the Homeworld source lately lol) Oh, cool. It did not had sound when it got released. But I imagine somebody added fmod or something to it. Is a sweet game and cool engine. Hope you have fun with it. I will check the multiprocessor thing. I don't really have to rebuild everything often, is generally only one C file, but I am surprised is not much faster. Moving around code is also kind of slow... compared to the vscode build around atom. After posting that I was able to use fullscreen, it works and is smooth
|
# ? Nov 23, 2021 23:55 |
|
quote:The password rules are as follows: 🤔
|
# ? Nov 25, 2021 20:00 |
|
*proceeds to silently truncate the password in some situations anyway*
|
# ? Nov 27, 2021 21:22 |
|
Falcorum posted:*proceeds to silently truncate the password in some situations anyway* Hi {username}, Thank you for registering! Your login details are Username: will@storedintheballs.com Password: p33p33p33p33 Your password will expire in 90 days, after which you’ll need to choose a new password. If you do not pick a new password within 7 days, your account will be frozen until you speak to one of our site admins to reset your password. Regards, Admin team
|
# ? Nov 28, 2021 18:41 |
|
"is there a way we can run all the tests but skip the failures" - a senior dev
|
# ? Nov 30, 2021 18:37 |
|
...well, is there?
|
# ? Dec 2, 2021 01:01 |
|
And if there is, let's turn it off!
|
# ? Dec 2, 2021 01:09 |
|
why not both? https://github.com/auchenberg/volkswagen
|
# ? Dec 2, 2021 04:39 |
|
https://twitter.com/d_feldman/status/1466248315029409798
|
# ? Dec 2, 2021 04:44 |
|
|
# ? May 26, 2024 16:44 |
|
Rubellavator posted:"is there a way we can run all the tests but skip the failures" - a senior dev ./unit-tests 2>/dev/null
|
# ? Dec 2, 2021 08:54 |