It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not have universal support for this syntax and your comment will not render correctly on old reddit and most mobile apps.
For the benefit of people on old reddit, this link will take you to a correct rendering of the comment.
/u/altermeetax, it would be appreciated, but not required, if you could edit your comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
Can we not with this bot? Idk what the spread is for old/new reddit is, but I've never heard a single person complain about triple backticks, only this bot, which seems to frequently get downvoted. It's nothing but obnoxious for those on new reddit, and the message is really long for what it's trying to say.
It's still bad code if you're relying on !>= evaluating to true when NaN; better to write the NaN check out explicitly (or write a comment if the code is performance sensitive and you're not sure if the compiler can optimize).
The ! is a null-forgiving operator used at compile time to explicitly mark that a given object is not null. In addition to this, C# 8 also introduced the concept of nullable reference types to improve static analysis.
It’s stripped away at runtime hence the expression simply being ‘amount >= 0’
Don't know about C# in particular, but in most languages tokens are recognized by a scanner phase (sometimes just a glorified regex) that precedes the parsing phase, which treats the tokens as atoms. Backtracking usually refers to parsing, not scanning.
If the parsing is eager, this is how it would be parsed I think. And also, it seems that ! has very high operator precedence, while == has low precedence.
It is, but in being that, it steers clear of a lot of undefined behavior which makes it very powerful. If it makes sense in any way, it probably works that way.
To someone coming from C++ where undefined behavior is a little more on the programmer to handle, 'I don't know why it allowed me to do this' could be a very valid statement lol.
That being said, you can still do some pretty weird things in C# if you explicitly tell it that you want to.
any tips or anything for people interested in learning how to make games? >_<;; ive been interested in the idea for a while, never actually got around to doing anything but downloading unity lol
I use unity and my best advice for getting into it is don't use unity's tutorials, find someone on YouTube or something instead. I'd recommend brackey's tutorial series.
Gonna jump in and double suggest Brackeys. He has lots of good videos. I recommend picking a really small project and trying to make it. Here's one for ya. Make a clone of the Chrome Dino game. Good luck getting into Game Dev, it's lots of fun :)
If I'm reading this correctly, it's treating amount as a boolean, inverting it, and then ensuring that value is greater than or equal to zero (which should always evaluate to true).
I have removed my original post in protest of Reddit's admins's bullying behavior towards its mods and subreddits. Moderators are being threatened with removal for doing what they believe to be right, and what their communities have agreed is right. Subreddits are being forced to reopen against the will of their populus. Third-party apps are being pushed out and with them go those with disabilities that need those third-party apps. I cannot abide that sort of strongarming, fascistic, bullying garbage. So I have left, and I have taken all of my content with me.
We built these communities. Reddit provided the platform, but the work came from all of us. We created the subreddits and we moderated them. We met, fought, befriended each other, agreed and disagreed, reacted to the world and each other, weathered crises, shared losses and triumphs. We were a community of a million communities, where we could find each other and share. This site was special. I met a lot of people that are very important to me on Reddit. And I am so very sad that it is gone, that greed and control meant more to Reddit than the millions of us that have, in some small or large way, lived here.
If you also believe that what the admin are doing is wrong, come with us elsewhere. Take back your content, edit your posts, make your final message here meaningful.
When ever I’m debugging I always do shit like this. If I’m getting the opposite value I’ll just stick a ‘!’ In it and hope that fixes the issue. I say to myself “I’ll fix it later” but that never happens.
Just checked in Roslyn using LINQPad. Can confirm what someone else said the ! Is parsed as the suppress null warning expression, so functionally does nothing.
177
u/finitearth Jun 13 '21
If there only was a symbol to compress this Syntax by two chars...
390
u/the_stooge_nugget Jun 13 '21
Is that even possible? Pretty sure the compiler would be yelling "you fucken idiot!"
63
u/penguin13790 Jun 13 '21
"Day 2 of a 2 day game jam be like"
GMTK jam?
19
u/CaydendW Jun 13 '21
Let me guess. Gmtk?
3
u/GreenScreenSocks Jun 13 '21
GMTK with the amazing themes each year I'm guessing?
621
u/[deleted] Jun 13 '21
Why use < when you can use ... whatever this is
38
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Jun 13 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
4
u/red_riding_hoot Jun 13 '21
it's beautiful
4
u/cube2kids Jun 13 '21
You're doing GMTK game jam too ?
1
u/B0ltSn1per Jun 13 '21
how does this even execute lmao??? wouldnt it have to be !(amount >=)??
3
u/BLucky_RD Jun 13 '21
Damn, good luck on the jam. I burned out so 8'm not gonna submit my shit but best of luck to you
3
u/dreamsprite666 Jun 13 '21 edited Jun 27 '23
I have removed my original post in protest of Reddit's admins's bullying behavior towards its mods and subreddits. Moderators are being threatened with removal for doing what they believe to be right, and what their communities have agreed is right. Subreddits are being forced to reopen against the will of their populus. Third-party apps are being pushed out and with them go those with disabilities that need those third-party apps. I cannot abide that sort of strongarming, fascistic, bullying garbage. So I have left, and I have taken all of my content with me.
We built these communities. Reddit provided the platform, but the work came from all of us. We created the subreddits and we moderated them. We met, fought, befriended each other, agreed and disagreed, reacted to the world and each other, weathered crises, shared losses and triumphs. We were a community of a million communities, where we could find each other and share. This site was special. I met a lot of people that are very important to me on Reddit. And I am so very sad that it is gone, that greed and control meant more to Reddit than the millions of us that have, in some small or large way, lived here.
If you also believe that what the admin are doing is wrong, come with us elsewhere. Take back your content, edit your posts, make your final message here meaningful.
Be good to each other.
2
u/[deleted] Jun 13 '21
makes sense to me.
2
u/dfmaaa1 Jun 13 '21
visible confusion
2
u/ForArms Jun 13 '21
When ever I’m debugging I always do shit like this. If I’m getting the opposite value I’ll just stick a ‘!’ In it and hope that fixes the issue. I say to myself “I’ll fix it later” but that never happens.
2
u/[deleted] Jun 14 '21
it might improve readability?
1
u/Eluvatar_the_second Jun 14 '21
Just checked in Roslyn using LINQPad. Can confirm what someone else said the ! Is parsed as the suppress null warning expression, so functionally does nothing.
1
u/Sprixx_Dev evil Jun 13 '21
Good old times
1
u/Knuffya Jun 13 '21
does this even work?
1
u/Blackhaze84 Jun 13 '21
Does it work?
1
u/[deleted] Jun 13 '21
yesn't
1
u/cheesycheese24 Feb 03 '22
Technically u wasted only 1 symbol.
-1
u/BaccyConesCureCancer Jun 13 '21
Python coding be like