|
Unless you open thousands of files per second and thus have to bear the cost of generating thousands of stack traces per second. In that case, you're better off checking first (in addition to handling the exception).
|
# ? Aug 2, 2016 09:22 |
|
|
# ? May 25, 2024 08:46 |
|
VB.Netcode:
RegionalEngine.enUserGeoRegion is an enum. what
|
# ? Aug 2, 2016 10:50 |
|
Edison was a dick posted:What if it's gone by the time you open it? You need to handle the exception when that happens anyway, so you might be better off not checking first. No, you should probably check first.
|
# ? Aug 2, 2016 11:39 |
|
antpocas posted:VB.Net NihilCredo posted:as with nearly everything that's hosed up in VB.NET, the answer is "you didn't activate option strict in your project"
|
# ? Aug 2, 2016 12:37 |
|
NihilCredo posted:as with nearly everything that's hosed up in VB.NET, the answer is "you didn't activate option strict in your project" We're getting rid of everything that's VB.Net though. I also found this code:
|
# ? Aug 2, 2016 12:47 |
|
if (foo) { Bar(); Baz(); } else { Baz(); Bar(); } Had to spend 20 minutes making sure that there weren't side effects before nuking it. There was even a "wtf is this poo poo" comment, but I guess others aren't willing to delve into the madness.
|
# ? Aug 2, 2016 12:55 |
|
leper khan posted:if (foo) { I've seen this pattern before, and in my experience it has usually been using a shared field in multiple methods in such a way that the order of calling those methods is important. Something like this: code:
|
# ? Aug 2, 2016 14:55 |
|
Cuntpunch posted:I've seen this pattern before, and in my experience it has usually been using a shared field in multiple methods in such a way that the order of calling those methods is important. Something like this: Yes, that's why I had to spend 20 minutes reading the terrible code before ripping it out. The effects of Bar() and Baz() in this case were mutually exclusive. In other news one of my coworkers unironically prefers monodevelop to VS. Some things I know better than to delve into.
|
# ? Aug 2, 2016 15:28 |
|
leper khan posted:In other news one of my coworkers unironically prefers monodevelop to VS. Some things I know better than to delve into.
|
# ? Aug 2, 2016 15:34 |
|
antpocas posted:This is my 4th week it's not my project might as well admit defeito now.
|
# ? Aug 2, 2016 15:55 |
|
LeftistMuslimObama posted:might as well admit defeito now. speaking of which, my Portuguese is rudimentary but I'm pretty confident "defeito" means *fault*, not default
|
# ? Aug 2, 2016 19:45 |
|
NihilCredo posted:speaking of which, my Portuguese is rudimentary but I'm pretty confident "defeito" means *fault*, not default
|
# ? Aug 2, 2016 19:57 |
|
code:
|
# ? Aug 3, 2016 01:02 |
|
BlackMK4 posted:
Is this actually bad (the comments to not have spacing, rather than the repetition in the HTML itself)?
|
# ? Aug 3, 2016 21:04 |
|
It's one of the more ham-fisted ways I've come across for dealing with the way browsers handle whitespace in html. But it shouldn't be an issue in the era of css as no layout should be so rigid that an extra space breaks everything.
|
# ? Aug 3, 2016 21:09 |
|
Actually it's super annoying to work around.
|
# ? Aug 3, 2016 22:26 |
|
the real horror is html whitespace rules
|
# ? Aug 3, 2016 22:32 |
|
Is it bothering anybody else that the input tags aren't closed, and the divs aren't aligned?
|
# ? Aug 3, 2016 22:35 |
|
No, because input tags don't have closing tags (and including them is technically against spec even though any reasonable parser will do the right thing).
|
# ? Aug 3, 2016 22:38 |
|
xzzy posted:It's one of the more ham-fisted ways I've come across for dealing with the way browsers handle whitespace in html. BlackMK4 fucked around with this message at 02:43 on Aug 4, 2016 |
# ? Aug 3, 2016 23:58 |
|
Suspicious Dish posted:the real horror is html whitespace rules There are rules? I thought it was just every browser by itself in the wild, wild west.
|
# ? Aug 4, 2016 05:58 |
|
xzzy posted:It's one of the more ham-fisted ways I've come across for dealing with the way browsers handle whitespace in html. If you're trying to put multiple 'blocks' next to each other like this then having whitespace fucks up your design. Compare the top row vs the middle row. The usual fix I've seen is to set the font-size to 0 and then restore it in your children, like in the bottom row, but that's annoying and hacky.
|
# ? Aug 4, 2016 06:32 |
|
vOv posted:If you're trying to put multiple 'blocks' next to each other like this then having whitespace fucks up your design. Compare the top row vs the middle row. The usual fix I've seen is to set the font-size to 0 and then restore it in your children, like in the bottom row, but that's annoying and hacky. Who the gently caress thought that is sane behaviour?
|
# ? Aug 4, 2016 11:09 |
|
vOv posted:No, because input tags don't have closing tags (and including them is technically against spec even though any reasonable parser will do the right thing). HTML 5's must-not-have-an-end-tag tags are the real horror.
|
# ? Aug 4, 2016 11:34 |
|
Xarn posted:Who the gently caress thought that is sane behaviour? Suppose you're using HTML to write text. HTML code:
quote:Here is some bold textand some italicised text Or maybe even quote:Here is somebold textand some italicised text
|
# ? Aug 4, 2016 12:34 |
|
code:
|
# ? Aug 4, 2016 13:35 |
|
vOv posted:If you're trying to put multiple 'blocks' next to each other like this then having whitespace fucks up your design. Compare the top row vs the middle row. The usual fix I've seen is to set the font-size to 0 and then restore it in your children, like in the bottom row, but that's annoying and hacky. My suggestion is not using inline elements for making tabs. To be fair, I agree 100% that html's handling of whitespace is idiotic, but in general, it's super common for designers to create their own problems by using the wrong tools.
|
# ? Aug 4, 2016 13:37 |
|
xzzy posted:My suggestion is not using inline elements for making tabs. The code I was referencing above is used for this:
|
# ? Aug 4, 2016 16:14 |
|
qntm posted:Suppose you're using HTML to write text. Ok, after messing around with the fiddle it makes more sense, but still feels weird, ie HTML code:
Xarn fucked around with this message at 16:26 on Aug 4, 2016 |
# ? Aug 4, 2016 16:23 |
|
Cuntpunch posted:
we do i18n sorta this way in vb because theres not really a better way. we use a tool to find repeated strings and tokenize them for you, though. ive also seen people do this with strings that get typod in code a lot since then the intellisense helps you out, you just have to remember theres a constant to use instead of typing the string out. but without context im assuming this is dumber than either of those things.
|
# ? Aug 4, 2016 16:39 |
|
BlackMK4 posted:The code I was referencing above is used for this: Have you discovered flex boxes yet? They rocked my world. http://codepen.io/xzzy/pen/akRmwg Look at that crazy gives no shits about whitespace html! (prior to knowing about flex boxes I did this with inline list elements, css is uglier but it works on all browsers in the last 10 years) xzzy fucked around with this message at 16:43 on Aug 4, 2016 |
# ? Aug 4, 2016 16:40 |
|
LeftistMuslimObama posted:we do i18n sorta this way in vb because theres not really a better way. we use a tool to find repeated strings and tokenize them for you, though. Probably 90% of these Constants are only ever used in a single place in the entire application. And seem to be just dodging ToLower/ToUpper stuff. In some cases it's just a like...weird roundabout way to feed a string value into ConfigurationManager.AppSettings[Constants.SAVE_PATH] in a single place in the entire application. I can totally see this sort of lookup table or whatever being used for localization, sure! But one of our terrible offshore developers has an insane hardon that *anything* in the logic that requires a string should probably instead refer to a constant. Even if it's one-off, or something as insane as code:
|
# ? Aug 4, 2016 17:56 |
|
Cuntpunch posted:I can totally see this sort of lookup table or whatever being used for localization, sure! But one of our terrible offshore developers has an insane hardon that *anything* in the logic that requires a string should probably instead refer to a constant. Look, hardcoded values are bad, mkay? So you should always, always use a constant instead. Want to tell if a number is even? "if (n % 2)" is bad; "if (n % TWO)" is much safer!
|
# ? Aug 4, 2016 18:04 |
|
redleader posted:HTML 5's must-not-have-an-end-tag tags are the real horror. why?
|
# ? Aug 4, 2016 18:17 |
|
TooMuchAbstraction posted:Look, hardcoded values are bad, mkay? So you should always, always use a constant instead. Want to tell if a number is even? "if (n % 2)" is bad; "if (n % TWO)" is much safer! I've tried to suggest that the acronym "USA" is unlikely to change any time soon, but it falls on deaf ears. Constants.USA = "USA" it is.
|
# ? Aug 4, 2016 18:33 |
|
It complicates my HTML regex!
|
# ? Aug 4, 2016 18:51 |
|
Cuntpunch posted:I've tried to suggest that the acronym "USA" is unlikely to change any time soon, but it falls on deaf ears. Constants.USA = "USA" it is. Shouldn't it be I18N.ToLocale(Constants.CURRENT_LOCALE, Constants.USA); You know, to allow for USA vs 미국 or w/e.
|
# ? Aug 4, 2016 19:16 |
|
Even if they're never going to change, using constants for strings means that the compiler can catch typos.
|
# ? Aug 4, 2016 19:26 |
|
Plorkyeran posted:Even if they're never going to change, using constants for strings means that the compiler can catch typos. Unless the string only is used once in the code anyway.
|
# ? Aug 4, 2016 19:37 |
|
|
# ? May 25, 2024 08:46 |
|
Plorkyeran posted:Even if they're never going to change, using constants for strings means that the compiler can catch typos.
|
# ? Aug 4, 2016 20:35 |