« first day (1620 days earlier)      last day (2529 days later) » 

8:02 PM
ValueConverterSample, flame it. @Maverik I dumbed it and added it outside the subgroup.
Not sure about this, perhaps better in a branch
could be confusing to do the same in two ways
 
user7442629
Johan, are Collapsed FrameworkElement(s) still rendered and loaded in memory?
 
iirc no
hidden should be, not 100% sure though
have you used ValueConverters?
 
@Maverik 'nite mav
 
user7442629
No value converters, just some textboxes that only appear rearly
 
then check out the new sample
 
user7442629
8:15 PM
Don't want to be losing performance (even if performance loss is minimal)
 
and report back if it is clear
 
user7442629
Speaking of the new sample
Would you mind quickly explaining what the top of the window is with all this stuff:
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 
user7442629
I understand that it is some kind of link with classes or something in it
 
user7442629
and xmlns:x is setting variable x
 
user7442629
But what are the links actually doing
 
8:18 PM
It creates xml aliases for namespaces
do you have resharper?
 
user7442629
Yeah new sample is great dude that is the kind of stuff I would have loved to see one week ago :D
 
user7442629
I understand it now anyways, but it makes perfect sense when you see it in code
 
If so you don't need to learn about it, r# will generate all that stuff for you
 
user7442629
This is a great project
 
user7442629
No I don't know what that is
 
8:19 PM
It is an extension for visual studio, jetbrains.com/resharper
 
R# == Resharper
 
expensive but pretty good
 
user7442629
Wow that looks pretty good, I would love to make something like it in the future
 
user7442629
In the sense that it's interesting a project to work on
 
8:35 PM
Collapsed are loaded into memory but not included in render or layout passes IIRC
Hidden are just not included in the render pass
And VS is (slowly) getting better about xmlns intellisense
fair warning on R#, it is still a pretty big resource hog to my knowledge
 
user7442629
Not a problem on gaming machines I guess
But makes sense, it's quite a lot of features so must be constantly compiling your code to gain awareness
 
yeah, it slows things down, especially if there are many warnings
if warnings are zero it is not that bad
it is easily enabled/disabled and offers lots of configuration options
but you don't buy it to have it disabled
if you write f# it must be disabled
 
user7442629
Well this explains the confusion from earlier
 
user7442629
That's really bad on my side
 
don't worry, being a beginner is not a crime
 
user7442629
8:45 PM
I didn't know that class functions can operate directly on the class instances like extension methods accidental deletion
 
user7442629
Sure feels like one :D
 
lol, I read gaming machine and thought "slot machine"
remember that class methods get an implicit this pointer (true in most OOP languages)
extension methods the this pointer is explicit
Johan, you know if Resharper is going to start using Roslyn features any time soon?
I would think that would make it faster
Also, its worth learning about xml namespaces just so you can use the if you every run into it
for example, DataContractSerializer will use them
and so if (heaven forbid) you want to handcraft some XML to be consumed by one, you need to be able to generate them
 
@BradleyDotNET All I have heard is that they will not.
 
that's too bad
seems like a good synergy
 
I think they are moving in the other direction, decoupling r# from vs
Using it in rider etc.
 
8:54 PM
yeah, seems to be a JetBrains answer to MS implementing some refactoring features in MSVS
 
Also I suspect that they will not invest heavily in r# any more.
Roslyn will kill r# over time.
 
user7442629
Well I would love to know what Roslyn is but I've learned too much today so I'll go to sleep instead
 
Better money to be made in typescript support probably
 
user7442629
Thanks a lot guys have a nice day! :)
 
I don't know, seems like MS will do a Roslyn for TS at some point as well
but at least temporarily, sure
 
8:58 PM
OTOH I think Resharper for C++ will live for a long, long time
 
It looks like jetbrains & m$ are not good friends any more
m$ steals feature by feature and don't even bother to change icons
@milleniumbug is it any good?
 
as far as you can call a C++ tool "good", then yes
MSVS + R# for C++ seemed to work better than other IDEs
 
maybe the c++ guys are perf sensitive killing the business?
but they are used to slow compiles so perhaps not
 
it's mostly about bugs in features. I'd say it would take at least 5 years for the refactoring tools to work on a comparable level of reliability as ReSharper for C# does
and then a new revision the language would show up and you'd get yet another 5 years
so if you get a dedicated team of people who are paid, it's likely they'll implement it faster than the unpaid community of open source developers
OTOH JetBrains also has a C++ IDE so they too have a backup plan
 
9:07 PM
jetbrains are good ime
They tend to get things right
they also have bugs that does not get fixed
like the testrunner, been diffrent kinds of broken for a long time
 
not a big fan of their IDEs. they have lots of cool features, but also they feel a bit sluggish
 
@BradleyDotNET did you check the converter sample?
 
I'll look sure
where is the link?
 
I'm not sure what is best to return there in the sample.
That is what I usually do, that or return some debug info
If it is a converter that converts to brush I return Brushes.HotPink so the error will be visible without crashing the app
Throwing is an option of course
 
9:16 PM
Debug.Assert is perhaps good there
 
does is actually work with value types?
 
yeah, that is a nice thing with c#7
 
ah, new feature
so I'm not crazy :)
 
is WPF actually recognising you returned the same value
 
was nasty pre 7 with value types
ref types were bearable with as cast + nullcheck, still noisy
 
9:18 PM
yeah, I'd do what you did; conversion failed so you return the original
ref types you were supposed to use as
oh, obviously that would be the null check :)
 
the new syntax is nice as it can be used for both
also fewer moving parts now
no was to as cast and nullcheck something else and stuff like that
 
wait obj is int didn't work previously? didn't notice
 
so besides is working for value types, what else changed?
 
or is check and cast to something else for value types
 
on the casting I mean
 
9:20 PM
they added local functions, pattern matching & inline outs
 
right, I know those
just curious if the standard as/null or is/cast patterns changed
thought you indicated they had
 
@BradleyDotNET I don't understand
you can still as/null but I will refactor away from it
 
to what?
 
prefer the new style
 
which is....
 
9:22 PM
if (value is string text)
{
    // work with text here
}
before it would have been
var text = value as string;
if (text != null)
{
    // work with text here
}
 
ah, that is much nicer
those two are equivalent? or is it doing is/cast under the hood?
 
yeah cleaner and fewer ways to make mistakes
guess it is the same thing
 
ok, cool
 
@BradleyDotNET I have not checked IL but assume they compile to something similar
 
sure, just curious
since I know as is technically faster
though if that is the bottleneck you are doing pretty good :)
 
9:25 PM
yeah, also good at profiling :)
as it is a language feature I would not expect it to compile to horrible il
 
and even if it is readability wins
 
about the sample, no detail is too small to flame
 
9:45 PM
The other option I've done on converter failure is return Binding.DoNothing
I haven't seen the static variable pattern before
but its kind of neat
obviously doesn't work for parameterized converters
 
I usually crash and burn by throwing an exception in case the input is totally wrong (for example a wrong type is passed)
 
maybe you want to introduce that later so you can show the "normal" way of doing things first (assuming this is the first one)
Crashing and burning isn't usually an allowed result in production
especially on unattended systems
all failure must be graceful
 
yes but there's wrong and wrong
NRE and friends count as bugs to me
and accessing null references is very similar to passing the values of a wrong type
sure if you can handle this gracefully then more power to you
 
I'm just saying truly crashing and burning doesn't fly. Throw up a giant descriptive error message, at least log it, but just coring to Windows is a big problem
and I really try to avoid hitting windows :)
looks weird on kiosk-style software
 
@milleniumbug throwing is def an option, depends
perhaps the best option and the default
converter is almost the only place where I don't validate input and insta throw
@BradleyDotNET yeah, hesitated when adding it
 
9:56 PM
for example a StringToBooleanConverter I'd throw if I get an int, but if I get a string "lolz" then I'd probably return a new Nullable<bool>() (yeah, this wouldn't be a "ToBoolean" converter, but meh)
 
IIRC throwing in converters doesn't crash an app anyways
just pointing out that "This program has stopped working" is not a great way of handling error :)
 
maybe you are right, I don't remember
 
@BradleyDotNET yeah, I can agree with that
 
I think the runtime catches it and puts it in the output window
 
we need Reed's advice on this :)
 

« first day (1620 days earlier)      last day (2529 days later) »