« first day (2546 days earlier)      last day (2401 days later) » 

8:00 PM
you can define your control
to separate file
and reference it without the local:
local should be used for styles and colors things tbh
also , if you need something on MvvM im ur guy
so, just bind them to a string
and 2 ints
also
 
You are right but what about the property names?
 
there is a trick to bind events like clicking to commands
 
Tiles="25" or whatever property
 
tilesspacing="Binding Numberofspaces"
you dont have to care about the name of the property
mvvm is all about not giving a fuck on what is going on on the view
 
you know what. You are right. To hell with dependency properties XD
im doing it that way
 
8:05 PM
also, do you use commands ?
Icommands?
 
indeed
relaycommands and some other custom stuff :D
love it
 
you use prism ?
 
Lol. Just realized I've been using MVCVM without really noticing. Yey for me?
 
what is the c there ?
 
controller
it's a mix of MVC and MVVM
 
8:10 PM
I feel stupid for asking this but I cannot seem to figure out a clean if/else patter to handle this type of case:

public static string LookupPerson(userID){

string personResult = string.empty;

If(string.isnullorwhitespace(userID)){return "person not found..."; } //fail fast

//Check source 1
//If Person found, personResult = source1.name
...

//If Source 1 fails, Check Source 2
//If Person found, personResult = source2.name
...

//If Source 2 fails, Check Source 3
//If Person found, personResult = source2.name
 
have u tried case switch @Michael
 
@GeorgeSarcasmGod I understand switch, but I dont see how that helps here
 
it helps making if chain simpler
 
because I want to keep checking the entire way down
I could see how a switch statement paired with GoTo would work. But I've always been told never to use GoTo
 
ok then use foreach
foreach( var per in Persons){}
 
8:15 PM
I suppose foreach + break; could work, but its not very clean with this case
 
its the cleanest you can get
what do you mean
you can call garbage collector in the end
if u are that concerned about clean
 
clean as far as readability and intuitiveness
 
foreach is the fastest loop
 
I think i neeed some kind of logic alternative to GoTo
 
when source 3 to fails you go back to source 2 ?
 
8:18 PM
@GeorgeSarcasmGod Going to just say usually.
 
@GeorgeSarcasmGod No that was a typo
oops
 
for real tho
for some reason foreach loop is like 1000 times faster than for
 
@GeorgeSarcasmGod I know but a loop isnt really necessary at all here
I'm not iterating through anything
 
What are the different sources? Is person the same class in each of the sources?
 
i think it is
 
8:20 PM
Each source is a different object
 
@GeorgeSarcasmGod Again, usually. It depends on how IEnumerable is implemented.
If the enumerator is slow then for might work better.
 
it was some big work on a million line excel file
 
Literally the best thing I can think of here is a goto
but that isn't reccomended ever
 
had to grab the cells and put them on a list i think
for loop did it on 2 minutes
foreach on 3 second
 
@Michael If you have a list of sources, wouldn't that just be FirstOrDefault?
 
8:22 PM
@Michael if it can be done with goto it can be done with something else
 
@Michael Does each source implement a similar interface or anything?
 
@GeorgeSarcasmGod It can definitely be done with a lot of things, just not cleanly
 
my professors also did that goto teasing
kids look at this command,
now you cant ever use it
 
@TylerStahlhuth I'm not worried about they sources, they just return objects with string based properties that I use
 
cuz its bad
so i ended up always wanting to use it
cuz it was naughty to do so
 
8:24 PM
@GeorgeSarcasmGod For loops have to check a value, run the closure, then increment a value. Foreach just calls Next on the enumerator. No checks required on the surface.
 
I don't see how this is a particularly tricky problem
 
@Michael Are the checks on all the sources different/
 
@KendallFrey I don't have a list of sources, I have 3 static sources that I'd like to use.
I should have named it like this:
Source1
Source2 //Backup if Source 1 fails
Source3 //Backup if Source1 and 2 fails
 
Then just use if/else
 
@KendallFrey I am
 
8:26 PM
your backup is the previous source ?
 
Then what's the problem?
 
If/Else doesnt really flow right with this type of case
 
Yeah, that's cleanest unless all your sources implement a common interface or something.
 
some hw question on a understanding barrier @KendallFrey
 
@Michael Why not? You've described it exactly like an if/else situation
 
8:27 PM
check this out yo
 
I described it as a bunch of If's actually
 
you make a second list to hold the backups
when you get an error you break and you return the second list
 
@GeorgeSarcasmGod They are static objects.
 
thats ur result
 
I mean the flow you described is just what if/else does
 
8:28 PM
How would you build the if/else try then?
 
dont use if else mang
be a smart boy and do it on a 3 line for each loop
 
@GeorgeSarcasmGod He can't, the sources are static objects.
 
if (<1 has it>)
{
    return <the value from 1>
}
else if (<2 has it>)
{
    return <the value from 2>
}
...
 
Different classes.
 
ok put ur objects inside a list that takes different types
 
8:30 PM
given that you're returning, else isn't strictly necessary
 
@KendallFrey in that logic you never did a check for if 2 has it
 
@GeorgeSarcasmGod And cast to what you want? No, that's more work that solves nothing.
 
what? yes I did
 
The checks might be different
 
else if (<2 has it>)
 
8:31 PM
thats just a conditional
 
@KendallFrey You don't need the elses.
 
@Michael Uh, yeah, because you want to return the value from 2 conditionally
1 min ago, by Kendall Frey
given that you're returning, else isn't strictly necessary
It's just a semantic thing
 
im sorry but i think michael just wants to sadomasochism him self
 
but we need to actually call source 2
 
so... do?
 
8:32 PM
just put ur objects on a list
and ur done
 
where??
 
wherever you need to
 
there is no place to call source 2 in that logic
 
and if they are different types make them derive the same base class
 
sure there is
after 1 fails
 
8:33 PM
I want to do it in stages. so that I'm only calling if the previous fails
 
its pretty simple
 
Okay, start from the top. Are your sources static objects? Do they share interfaces? Are all the checks the same?
 
@Michael That's what the else is for, or even the fact that you're returning early
you could even do
<check 1>
if (<1 has it>)
{
    return <value from 1>;
}
<check 2>
if (<2 has it>)
{
    return <value from 2>;
}
...
 
Add the actual source call to that if/else logic
okay now its only ifs
 
@Michael first make ur items derive the same base class then put them on a data stracture then use a for each loop and then ur done
gg
 
8:35 PM
and I have to do returns in each if
 
4 mins ago, by Kendall Frey
given that you're returning, else isn't strictly necessary
 
thanks for cmong
 
I cant use a clean if/elseif/else anymore
 
@Michael Why not?
 
8:35 PM
you can say clean and use if else boy
 
@Michael But... it is clean...
 
@KendallFrey because else wont apply that the ifs above
 
i hardly ever see ifs with more than one else
 
else will only now apply to the last if
 
That's the point of else?
 
8:36 PM
and when i do its some noob
just use case instead
 
@Michael I have no idea wtf you're talking about
 
@KendallFrey stop talking to him, he wants to selftorment him self
 
if(){}

if(){}

if()
else()
 
@GeorgeSarcasmGod switch cases can't be used when you don't know the object type and don't have static value to check.
 
@KendallFrey can you see now why are we chasing away people asking questions in the lounge? :P
 
8:37 PM
@Michael If you don't need the first elses, why would you need the last one?
 
the else, is only an else of the last if
 
I told you he can derivve the same class @TylerStahlhuth
 
@Michael no shit?
 
but he doesnt want to
 
there is no else, only zuul
 
8:38 PM
omfg lol
this is so hard to explain over chat
 
cuz he is a sadomacho
 
don't worry, it would be even harder for you to explain over SO or email
 
@Michael Especially if you don't give us any information to work with
 
I do
 
Here:

if (1)
   return
if (2)
   return
if (3)
   return
return
Well, the formatting got fucked.
 
8:39 PM
pinnacle of human thought
 
@TylerStahlhuth yeah that works only if you return in between
I might have to go that way
I was trying to stick to a single return
 
but y tho
 
@Michael lol
 
Just feels cleaner
 
hahahahahahahhahahahahahahahahahaha
...oh wait you were serious
let me laugh even harder
 
8:41 PM
tru
 
@TylerStahlhuth i suggest you stop talking to him, he doesnt know what deriving a base class is but still has the audacity to call code implementations clean or unclean
 
@GeorgeSarcasmGod I know plenty of that
It isn't related to what I was asking
 
yeah boy
it is very related
i can pretty much write this thing in one minute
one minute
 
Fine, do this:

var ret = null;
if (1)
   ret = val1;
if (2)
   ret = val2;
if (3)
   ret = val3;
if (ret == null)
   ret = error;
return ret;
 
i meant 30 seconds
 
8:42 PM
@Michael Please don't cargo cult program
 
im sorry its too dirty
dirtt code
 
It's stupid but has one return
 
it dont matter if its stupid or not
 
@TylerStahlhuth that last one doesn't work because you call each if all the way down
 
You aren't using C/C++. Don't worry about multiple returns. Even in C/C++ you shouldn't worry about that in most situations.
 
8:44 PM
!!quote get stupid
 
as long as its "clean" tm
 
yesterday, by mikeTheLiar
"If it's stupid and it works, it's isn't stupid."
 
Also, yeah. Dogmatic adherence to single-return is pretty stupid.
 
anyone know any free or cheap wildcard SSLs?
 
@TylerStahlhuth that's why I said it works only if you return each time
which is fine.. I'll just do that
 
8:44 PM
> it's isn't
kill me
!!quote forget stupid
 
bathe myself in dirty code :P
 
!!quote help
 
@Michael go my bird
fly away from us
dirty coders
 
@TylerStahlhuth It's risky in C because of allocation of external resources. C++ has RAII. Java has finally and try-with-resources. C# has finally and using statements.
 
@GeorgeSarcasmGod :P
I kid, I've just looked at too many patterns, sometimes they say to do this, sometimes they say to do that. now I feel like nothing is clean. My head is screwed up
 
8:47 PM
@Michael its ok
one day when you grow up and pass your freshman year you might understand
 
Don't be shitty.
 
past that buddy.
 
@milleniumbug Right. Still, he's using static objects in C# so it especially doesn't matter. It's a consideration that doesn't matter often in C#.
 
Michael's been around this chat a lot longer than you.
 
I'm not really a dev anymore anyways. trying to move into a different role
 
8:48 PM
michael sounds like a I need my homework done guy
so he dont matter
 
-_-
 
its true
you also dont want to learn
so its bad
 
I do, I have...
 
1 min ago, by mikeTheLiar
Don't be shitty.
 
@Michael You matter to me honey. :smooch:
 
8:49 PM
not shitty
just being TRUE
 
@GeorgeSarcasmGod I've been in your place trying to help people in this chat, daily
 
@GeorgeSarcasmGod Just because it's true doesn't mean it's not shitty.
 
It's ironic that the guy who fucked up 1,000 people's files by publishing the alpha version of his app is talking shit about whether or not other people are good developers.
 
@Michael by giving them code cleanness advices ?
 
I mean, I took a dump today. It's true and also shitty.
 
8:50 PM
@GeorgeSarcasmGod I never gave any advice, I just said it didn't feel clean to me.
 
i fucked up but im probably gon answer 1000 emails today
so its gucci
in any case
i just dont get how you can call a 5 line code piece not clean
gee
 
Don't you have an internship to be groveling for?
 
It depends on those checks I guess.
Also, I am still concerned with your readiness to throw static objects into a list.
 
@mikeTheLiar i need to maintain
if i work 12 hours a day
 
@Michael Why?
 
8:55 PM
i will flip eventually
 
@KendallFrey dirty, dirty code. Bad, naughty, dirty code.
 
cracks whip
 
as i said for a millionth time, guy could just derive all those static objects from the same base class
and then put them on the list
 
Can we get some Devo in here?
 
@KendallFrey I have no idea. I'm stupid
 
8:56 PM
!!giphy zip it
 
also you can simply put a bunch of data to static
and calll it clean
 
@GeorgeSarcasmGod Yeah... that's weird.
 
yeah thats defo freshman programmer
just my opinion
 
fucking finally my shipment is on the way
 
8:57 PM
dont mean to be offensive
 
watching the shipping tracker is torture
 
Sex bot?
 
@KendallFrey been there
where u ordering from>?
 
@GeorgeSarcasmGod location? oh, just 2 hours drive away
took them two days to actually get it to the shipper
ffs
 
Definitely sex bot.
 
9:02 PM
I agree, sex bot confirmed.
 
nvm i thought u where receiving some item
not sending
 
@mikeTheLiar It's 39" long and 6" in diameter
Don't tell your mom, it's a surprise
@GeorgeSarcasmGod I am
 
@KendallFrey Are you aiming for some kind of Guiness World record or something?
 
Nah, it's only a 1:110 scale model
 
i think he is getting a jello musk phony mars space craft
 

« first day (2546 days earlier)      last day (2401 days later) »