|
HoboMan posted:having the fattest of fingers, i personally find the visual studio feature of copying the line you are on whenever you press ctrl+c extremely annoying when i meant to press ctrl+v and now i have lost what was in the clipboard HoboMan posted:e: oh wait this is the internet, i mean: WHO THE gently caress DESIGNED THIS STUPID USELESS poo poo? gently caress, visual studio is an active dumpster fire and the .NET stack can suck my sack
|
# ? Jul 16, 2016 06:07 |
|
|
# ? May 25, 2024 18:52 |
|
NihilCredo posted:c# doesn't have option types, so no (the only flatMap in c# is SelectMany which works for collections), although in this particular case you're parsing a value type so you could in principle define the same rules using nullable<T> i write scala nearly every day and i still don't understand why List() ++ None is legal or good
|
# ? Jul 16, 2016 06:17 |
|
the talent deficit posted:i write scala nearly every day and i still don't understand why List() ++ None is legal or good it is? christ
|
# ? Jul 16, 2016 06:34 |
|
LeftistMuslimObama posted:the one advantage i can think of is that its harder to carelessly use a null return value with the bool + out version. ooooooopppptttiiiiioooonnnnnn tttyyyypppppepeeeeesss
|
# ? Jul 16, 2016 06:34 |
|
gonadic io posted:ooooooopppptttiiiiioooonnnnnn tttyyyypppppepeeeeesss
|
# ? Jul 16, 2016 10:11 |
|
mainstream language intransigence on sum types has caused a lot of real world harm hoare's 'billion dollar mistake' is probably an understatement
|
# ? Jul 16, 2016 10:12 |
|
gonadic io posted:ooooooopppptttiiiiioooonnnnnn tttyyyypppppepeeeeesss epic thissery
|
# ? Jul 16, 2016 10:21 |
|
back of the envelope calculation googling shows there are ~10 million (10^7) working professional software developers right now for each programmer, having to worry about null and having bugs created by null has probably caused at least $1,000 (10^3) of lost productivity over their career (I think this is a very conservative estimate) this would make the economic damage at least around $10 billion.
|
# ? Jul 16, 2016 10:30 |
|
gonadic io posted:so you're left with two methods that both fail to use the type system to encode invariants. i really want to like f# but having all of the legacy of c# libraries and all of the legacy of the ocaml language seems to be p annoying at times if the parse fails the return Thing will be the default for that value type, fpr numerals that's 0 the reason it's not a string -> Thing option is because it's not a f# specific wrapper, rather the f# compiler automatically converts c#'s out parameters to additional (tupled) return values, which is awesome in general but i agree is suboptimal in this particular case (imo it should be rewritten in f# style, in the same way that many System.String functions got functional wrappers) so yeah while can't just Seq.choose to ignore the successful results, the idea is that you can still quickly pattern match on it code:
NihilCredo fucked around with this message at 13:21 on Jul 16, 2016 |
# ? Jul 16, 2016 10:43 |
|
oh hey it's nullchat i'm working with a commercial library at the moment that deliberately goes out of its way to return nulls anywhere you might have expected it to return an empty collection. except sometimes it returns a null instead of a single-element collection when you can calculate what the element would have been yourself. and sometimes it surprises itself with nulls, so some methods throw null pointer exceptions unless you manually call other methods first and do the null checks for it. none of this is documented, it's trial and error all the way! and we don't have source, naturally. intellij's built-in java decompiler is proving handy although the code is, of course, obfuscated. gently caress everything.
|
# ? Jul 16, 2016 11:51 |
|
one of my pet peeves is when someone does a check for if a collection is empty before doing some logic but that logic just consists of processing or iterating a collection and it would've been a no-op for an empty list anyways
|
# ? Jul 16, 2016 11:54 |
|
code:
~Coxy fucked around with this message at 13:08 on Jul 16, 2016 |
# ? Jul 16, 2016 12:02 |
|
not using parameterized queries is in general a bad idea even if that particular use case might not be a sql injection attack
|
# ? Jul 16, 2016 12:04 |
|
new coworker insists on writing if (!(a == b)) instead of if (a != b), does this justify homicide? e: I think I just found an instance of if (!(a == b)) { /* do nothing */ } else { code } Soricidus fucked around with this message at 14:01 on Jul 16, 2016 |
# ? Jul 16, 2016 13:58 |
|
Soricidus posted:new coworker insists on writing if (!(a == b)) instead of if (a != b), does this justify homicide? rather than algorithms and data structures, poo poo like this is what interviews should check for
|
# ? Jul 16, 2016 14:04 |
|
Soricidus posted:new coworker insists on writing if (!(a == b)) instead of if (a != b), does this justify homicide? no big deal, just fail the code review until he starts aligning to your place's coding custom.
|
# ? Jul 16, 2016 14:12 |
|
for example, we just hired somebody who was pretty adamant in his interview that tests were bad and slowed down good programmers - his fundamentals and code was p great otherwise though. it was made very clear to him that if he accepted the offer then he'd have to change his habits and align to our style. he accepted. we'll see how long it takes to get him into the habits.
|
# ? Jul 16, 2016 14:13 |
|
Soricidus posted:e: I think I just found an instance of if (!(a == b)) { /* do nothing */ } else { code } that is a thing of beauty. buy him an account
|
# ? Jul 16, 2016 14:19 |
|
today's project is back face culling Thankfully this one is simple, all we need to do is figure out the sign of the dot product of the triangle's surface normal and a vector from the viewer to the one of the vertices of the triangle Luigi Thirty fucked around with this message at 14:43 on Jul 16, 2016 |
# ? Jul 16, 2016 14:31 |
|
gonadic io posted:ooooooopppptttiiiiioooonnnnnn tttyyyypppppepeeeeesss ... which are nullable
|
# ? Jul 16, 2016 16:30 |
|
Progressive JPEG posted:... which are nullable https://medium.com/@bgourlie/java-8-s-new-optional-type-is-worthless-448a00fa672d#.k7ww2oh0n https://developer.atlassian.com/blog/2015/08/optional-broken/ to be fair, you can't really add in a sane option type after you've already designed your language with nullable references. your entire library ecosystem and applications return null everywhere and you'd have to wrap everything
|
# ? Jul 16, 2016 16:44 |
Are there languages where !(a == b) is not always equivalent to (a != b)? Or common libraries which overload the equality operators in that way? I'm trying to understand what would put someone in that habit.
|
|
# ? Jul 16, 2016 18:12 |
|
VikingofRock posted:Are there languages where !(a == b) is not always equivalent to (a != b)? Or common libraries which overload the equality operators in that way? I'm trying to understand what would put someone in that habit. wouldn't this go against the most basic of logical principles? so, probably php
|
# ? Jul 16, 2016 18:20 |
GameCube posted:wouldn't this go against the most basic of logical principles? You'd think so, but you'd also think that == would be transitive and I'm pretty sure loads of languages have 1 == true, 2 == true, but 1 != 2.
|
|
# ? Jul 16, 2016 18:32 |
|
VikingofRock posted:You'd think so, but you'd also think that == would be transitive and I'm pretty sure loads of languages have 1 == true, 2 == true, but 1 != 2. loads of languages have 0 == false and 1 == true and treat anything else as true when evaluating a boolean expression, but most of them don't actually have 2 == true if you try to spell it out that way
|
# ? Jul 16, 2016 18:50 |
Soricidus posted:loads of languages have 0 == false and 1 == true and treat anything else as true when evaluating a boolean expression, but most of them don't actually have 2 == true if you try to spell it out that way Ooh actually yeah that was a bad example. I should have gone with something like JavaScript where 0 == '' and 0 == '0' but '' != '0'.
|
|
# ? Jul 16, 2016 19:02 |
|
VikingofRock posted:Are there languages where !(a == b) is not always equivalent to (a != b)? Or common libraries which overload the equality operators in that way? I'm trying to understand what would put someone in that habit.
|
# ? Jul 16, 2016 19:08 |
|
I don't know of a single programming language where !(a == b) does not equal a != b I want to say that nobody is that crazy
|
# ? Jul 16, 2016 19:11 |
|
In sql if either a or b is null, then you have null != b which is false for all b, but !(null == b) would be !false i.e. true for all b
|
# ? Jul 16, 2016 19:24 |
|
qntm posted:I don't know of a single programming language where !(a == b) does not equal a != b the answer is always php
|
# ? Jul 16, 2016 19:25 |
|
JewKiller 3000 posted:In sql if either a or b is null, then you have null != b which is false for all b, but !(null == b) would be !false i.e. true for all b so comparisons to null are always false? what like it becomes some sorta NaN like bullshit?
|
# ? Jul 16, 2016 19:33 |
|
yeah sql does some weird poo poo with null
|
# ? Jul 16, 2016 19:36 |
|
Bloody posted:so comparisons to null are always false? what the only predicate about a NULL column that is true is "X IS NULL", every other statement is false the reason for this is so that WHERE and JOIN work as expected, if "NULL <> @unwantedvalue" were true then some queries would return a ton of useless rows because non-INNER JOINs use NULLs to represent missing matches (which is the actual horror) NihilCredo fucked around with this message at 19:48 on Jul 16, 2016 |
# ? Jul 16, 2016 19:41 |
Bloody posted:so comparisons to null are always false? what Even for NaN, NaN != NaN is true.
|
|
# ? Jul 16, 2016 19:44 |
maybe it's like that not all infinities are equal type of thing
|
|
# ? Jul 16, 2016 19:48 |
|
turns out basic back face culling takes about 15 seconds to implement once you look at the formula and the math is super simple lol
|
# ? Jul 16, 2016 20:03 |
|
I took database class in undergrad and the one of the main tips i remember our professor going on about was to watch out for sql nulls. if you don't pay attention you can start relying on some idiosyncratic or undefined behavior, and then you'll introduce a change that breaks everything in mysterious ways
|
# ? Jul 16, 2016 20:45 |
|
Lutha Mahtin posted:I took database class in undergrad and the one of the main tips i remember our professor going on about was to watch out for sql nulls. if you don't pay attention you can start relying on some idiosyncratic or undefined behavior, and then you'll introduce a change that breaks everything in mysterious ways one of the few legitimately good practices my boss had put in place was to forbid intentional NULLs in all database structures. always define and enforce default values for all columns
|
# ? Jul 16, 2016 21:13 |
|
null in a database is okay and is like an option type. nullable types obviously can still be abused if you model the problem improperly, of course. the problem with it in most programming language is that the programming language gives you no explicit choice and you are forced to possibly have null in your reference whether you like it or not the equivalent problem in a database would be if a database made all your columns nullable and there was no way to prevent it
|
# ? Jul 16, 2016 21:19 |
|
|
# ? May 25, 2024 18:52 |
|
really suffering from paralysis here the idea of my project was to do the data structures in rust and then use unity for the game engine. this is working okay, i've got rust plugins running in unity just fine. the question is what do i do now? working in unity (and c#) is kinda balls, but i can't do much more in rust without rendering and having mouse interaction. i guess i could start trying to start a f# project that calls the c# api so i can write the game logic in f#? but then maybe i'll switch to cryengine, but that doesn't have a mac editor and ahhhh
|
# ? Jul 16, 2016 21:40 |