« first day (3116 days earlier)      last day (2057 days later) » 

02:13
Is it possible to use a type variable as generic? I'm trying to do something like
Type dataClass = this.getDataClass(name);
data.ToObject<dataClass>(serializer);
Or is there a better way to do this?
02:27
Nevermind it looks like data.ToObject() has an overload that excepts a type
 
4 hours later…
V.7
V.7
06:03
Hey all
Long enough ...
Btw, does anyone use VSCode? github.com/Microsoft/vscode/issues/72939
 
2 hours later…
07:34
Heyhey kids
I have used VSCode, and do occasionally to resolve git conflicts but that's about it
07:45
Hello hello.
08:04
I had an absolutely horrendous week off and am thrilled to be back in work
I had an absolutely fantastic week off and am thrilled to stare groggily at the screen and try to remember what C# is.
08:27
Good morning
regarding this question
https://stackoverflow.com/questions/55888198/should-i-use-argumentexception-or-invalidenumargumentexception-for-an-enum-exten

why should we bother choosing between `Exception` classes, isn't the pure `Exception` class sufficient enough, I mean, in the end we set the message that tell the problem, what are cases we need to identify the accurate `Exception` classes?
For the same reason we don't just pass an object everywhere. Types give us information.
If you want to have different error handling for different exception types, use different exception types.
try
{
      var connection = ConnectToThingie(connectionString);
}
catch (HttpException http) when http.ReponseCode == HttpResponseCodes.404NotFound
{
      Notify("Thingie not found. Please check the URI and try again");
}
catch (NetworkException net)
{
    Notify("Network error. Will retry automatically in a second");
}
catch (Exception ex)
{
     Notify("Unexpected error");
}
I got it, that was quick to convince .. thanks
09:11
Also extensions of Exception might have context specific fields. Like SqlException could contain the SQL error code, FileNotFoundException could contain the file that wasn't found as a field
Yup. I actually showed that implicitly in my snippet without even thinking about it.
 
2 hours later…
10:55
when you make an exception with new fields... include the damned information into the ToString method
oh my god yes
there is no such horror as to not have sufficient information in the ToString, which requires you to write your own ToString method for that specific exception so you must know the entire structure of the type and its fields and their fields etc
then... there is polymorphism
you also have to do the exact same for all subtypes of that exception
Nah I ended up just jsonserialixing the entire exception and sending that
that also works
you could even do typed serialization
So now I get really long but quite detailed but also not particularly easy to read exception details
10:58
i suppose you get used to it after a while
first, make sure you have a json viewer
secondly, look for the message and type
then you mostly know what to do
i guess
Yeah it's easy enough
It's just less convienient than it used to be
But more convienient in that I actually get useful details
> See the LoaderException property for details.
> See the ValidationErrors property for details.
@Wietlol Corollary: if you make the information available in the ToString method, also include it as goddamn fields!
uhm...
Wietlol became confused
if you have important information that you include in the ToString... how can it not be in the fields?
There's an exception somewhere in our code - I think it's part of ASP.NET Core - which takes an error code in the constructor, and shows it in ToString, but there's absolutely no public fields that expose it.
11:01
or do you mean public fields/properties?
ah, yes, stuff that isnt public :)
If it's public enough to be in the ToString output, it's public enough to expose.
also, something I often do, when you write an exception, dont make the information static
for example, a NumberFormatException: "The input string was invalid."
or NumberFormatException: "The input string (\"Hello, World!\") was invalid."
The json starts getting a bit harder to read when there's serialised json already in the exception though
I guess its a bit more of a grey area and you can go full retart with the amount of information
but I think that if you have a message that is static (or constant or whatever), that should be a clear sign that you havent provided enough information
the only exception to this, afaik, is StackOverflowException
since its important information is in the stack trace
Depends. Sometimes you don't want to show PII in your exception traces.
11:05
Here's one of my automatic bug reports which came in on friday. Even harder to read when word wrap is on (thanks outlook). Obviously personal data ahs been remvoed etc
PII?
Personally Identifying Information.
The sort of things that GDPR, among other regulations, stipulate against logging.
StackOverflows aren't very helpful IIRC though. Because the stack is full you don't get any useful info in the exception. Or maybe that's OOMs, I'm not sure
One of them is very bare though]
SOE are pretty useful actually
they give you a long enough stack frame list to see a recurring pattern
with that, you can find out why shit has gone wrong
I genuinely can't remember the last time I got StackOverflow
I think I could count how many times I've created one on one hand
11:08
me neither, but a few weeks ago, a colleague of mine came to me with one
Yeah. SOEs give you the stack you can parse, while OOM are usually total crashes. They're similar in the sense that they're both exceptions you can't recover from - OOM because you don't have any memory to keep processing, and SOE because you've lost the ability to go back to the previous place in the stack.
he was dealing with spf records and someone had a recurring one
@CaptainObvious Probably because you avoid recursion and, especially, mutual recursion.
Though the most common cause is simply writing a property that accidentally calls itself instead of the backing field.
I do recursive stuff all the time, but I'm very aware of remembering to break out if something isn't happening
@AvnerShahar-Kashtan you could technically recover from an OOM, since all the memory you needed to allocate up to that point can be freed again
back down to the first catch
(i am not sure if runtimes can actually do that tho)
11:10
Nah you don't know what you can free, and you haven't got any free memory to work it out
the same with a SOE, you simply cant continue processing, but you can fall back to a catch
(same for this, im not sure runtimes could do it)
I suppose it depends how you caused it to happen really
var arr = new object[Int64.MaxValue];
(I know that the size is limited to 32 bit ints, but still)
even then... a new Object[Int32.MaxValue] would be 2 billion x 8 bytes (64-bit machine)
that'd be 16 GB
I suppose most people dont have that available
you'd need a 24GB or 32GB machine
wait, you have 4 slots?
11:16
Yeah because I'm using a real PC not a laptop
im jelly
You've seen my setup
Still not guaranteed to have 16GB of contiguous memory.
i know...
There's never been a laptop
11:17
now im double jelly
I mean I do have one, but I don't use it when I'm at my desktop
I use my laptop as my desktop
I went to our parent company's head office a couple of weeks ago and was blown away
why so?
Everyone uses a laptop plugged into a dick with 2 screens, keyboard, mouse, ethernet, etc
4
it's really weird
11:19
plugged into a what?
It's monumentally slow too
ah fuck
Dock
ah, plugged into a fuck
@CaptainObvious That's the standard here as well.
Simply because there's an expectation that people will be mobile, in meetings, WFH, etc.
I find it really weird. I mean sure, if you need to get up and go soomewhere they only unplug 1 cable and they're done, but still
With a desktop, you can't take it with you.
11:20
what we use is a laptop (all of us) with a keyboard (mostly different ones), a logitech master mx 2 mouse and an lg super wide monitor
When I'm using my laptop, I'm almost guaranteed to be remote desktoped to my desktop because it's just faster
I've seen desktops here only as lab machines and such. No-one uses a desktop.
Most company laptops are ThinkPad X1 Carbons, which are nice. The occasional MBP or SurfacePro.
Also my applications are not laptop friendly. That might be partly why laptops aren't a thing here. That and nobody really moves around apart from me and my colleauge who does the same thing as me
most machines at our place are chromeboxes
the only exceptions are the IT department and the managers
The app we're developing is designed for 3x24" monitors (or 3x60" TV screens), but we develop it on laptops just the same.
11:23
but we are a humble 20% + 10% of the company, so... most are still chromeboxes
That's a point too, at the head office all the laptop seemed to be relatively low spec machines, and people were expected to do DBA work, design, development, etc
i think it also depends on what you do
Hi guys where do I ask questions regarding C?
at google?
he knows most answers
@RaphX There's no C room? There's a C++ room, but they might get pissy if you assume that they can do C as well.
11:29
Negative, its about a specific code that I couldn't find there
@AvnerShahar-Kashtan there isnt?
Yeah I coulnd't find any C room

C

C stands for Control.
Actually there is but I want to know why my particular code is not working@Wietlol
Thanks @Wietlol
im confused rn tho
2 trusted sources say something different
something... contradicting
1, Avner Shahar-Kashtan
2, chat.stackoverflow.com
11:31
I didn't say there wasn't a C room. I was asking.
Wietlol snapped out of it's confusion
Wietlol used retreat
Wietlol escaped from battle
just in case anyone is interested, I am writing some documentation
https://htmlpreview.github.io/?https://bitbucket.org/Wietlol/wietlang/src/master/WietlangCompiler/Readme.html
https://htmlpreview.github.io/?https://bitbucket.org/Wietlol/wietlang/raw/19d01e969c8ed19e82655ca96f176c3d56a3eb9d/WietlangCompiler/Readme.html
I am open for suggestions what to write actually since I have no clue :)
hERE'S A SUGGESTION
OH CAPS
Here's a suggestion
Make the contents links work. You got them linked to anchors but it doesn't look like you actually made the anchors
omg why is the setter default parameter called it
11:49
THE CONTENT LINKS ARE SOMETHING I STILL NEED TO DO INDEED, PROLLY GOING TO NAME THAT IN THE TODO LIST
(oh crap, held shift the whole time)
I havent done it yet since I am not sure if I will keep the structure like this
same for the numbers...
you might notice I have 3x 1.1.6 and the one after that is 1.3.2
Not a terrible structure tbh. Too much content about different things on one page though
it was the first thing that came to my mind
it is also going to be the default parameter for lambdas
map { it -> it.toString() }
// or
map { it.toString() }
same with setters
As long as it's consistent who cares
set = field = it.stuff()
Have you considered writing the actual product before trying to document something that doesn't exist
11:52
too much content on the same page might be an issue
since... I try to fit everything on one page
might need to do a little collapsible trick sometimes
or... the table of content
There's nothing wrong with havign loads of content on one page, but it helps if it's all relevant to the same thing
I guess if that one is done, it makes it a bit more managable
Or make multiple pages
I wrote most of the compiler already tho
I want to be able to scroll from the top to the bottom and some random point in the middle and it be talking about broadly the same thing
11:54
it lexes, parses, links, validates and generates stuff
but it cant generate some bytecode yet
I tried learning LLVM, but its quite difficult
I wrote it, but it aint public yet
Also why not us MD for docs
Same pissing about with html tags all day
Jesus christ why is typign so hard today
its morning?
(not at my place, but...)
anyway, I tried MD... then said "duck it" and went with html
It's nearly 1pm. Probably I haven't done any extended typing in a week and a bit and I've got worse than usual
12:05
hi
ohai
Why's the compiler not public yet?
Also why bitbucket?
bitbucket because I am used to it
compiler not public because bitbucket defaults to private repositories
and I have not yet actually pressed the "public" button
Since you started your work in public now, why not make that one public too?
And: In what language is the compiler written?
And once you have the compiler, could you rewrite the compiler in Wietlang, compile it, and then have Wietlang compile itself?
1, because reasons
2, Kotlin
3, I could, but I cant use libraries like Antlr
so I would have to write an Antlr library or make something else
but currently, there is no compiler target yet, so it compiles to... nothing basically
12:20
I kinda feel like a compiler should use as few external resources as possible anyway.
you are free to try to make a lexer and a parser
but it is a pain
trust me
12:34
Now that MVA is going down, where do you refer beginners to? Where do you go for tutorials in MS tech?
MS Learn doesnt really offer what MVA offered, it's jsut a giant hill of "Here learn Azure, Azure rocks, here's how to get your boss to get Azure!"
MSLearn doesnt even have c# fundamnetals or software dev fundamentals
12:47
I call bs
Why would the compiler code not be in the language repo in the compiler folder?
I never really used MVA, tried it once or twice and seemed solid though
I created a new (public) repository.
old repo contains some stuff I dont want public
I will prolly copy the compiler code into this repo and commit that
I have no clue what MVA even is
Microsoft virtual academy
> Makelaarsvereniging Amsterdam
Free (and not bad) software development courses online
Covering all sorts of stuff. Except it dies on Tuesday
SD courses only on MS products? such as Visual Studio, C#/VB/etc, Azure, etc ?
I mean the SD fundamentals wasn't MS specific was it?
13:12
A quick LINQ question.. In a Listof objects, how can I get the object who's id property matches a given number? Only one such object will exist.
If you know only 1 will exist, List.Single(item => item.id == GIVEN_NUMBER) should do the trick. It will kick off if there's more than 1 entry which matches too
Thanks!
TIL kick off == throw an exception
Yeah it's a common saying around here. kick off (outside of sports contexts) usually means get angry and complainy
around here, kick off usually means stop doing something
or... starting something
kick off smoking
or kick off this process
13:22
Oh it can mean that too
But Specifically the starting. And it's usually related to the sports context
With the smoking one, not quite. People might say "I should kick my smoking habit because I like having functional lungs", but there's no "off" in that sentence
recently I also heard someone say "go bang"
> and when you do "1 divided by 0", the program goes bang
Reasonable depending on what context, what did they mean by that
Not the use case I was expecting but entirely valid. Goes bang => Breaks
it appears to be an F# thing
That one's quite flexible, replace bang with virtually any onomatopoeic word and it's good
5
A: What does the operator ! mean in F#

AVIIt's ! (bang) operator as msdn document says, Dereferences a reference cell. After a keyword, indicates a modified version of the keyword's behavior as controlled by a workflow.

oh nice, & is not a bitwise and
&&& is
13:58
Yeah SD on MVA isn't about MS stuff
Was a general "whats software and how to get there and why"
With DB overview too
really nice for the beginning
 
6 hours later…
20:08
Hello
public static void Main(string[] args)
        {
            int num1 = 20;
            int num2 = 30;
            num1 ^= num2 ^= num1 ^= num2;
            Console.WriteLine(num1 + ","+ num2);
        }
can somebody tell me what '^' is and how it operates. tried google and executed with different input. just dont understand it
result it 0,20
Ah, i fall into this operator and read about it (them), understood them after some practice, and never used them since then, it's likely that in our normal day-to-day work we will never need them
let me look for the article helped me get it
yeah bitwise operators are tricky
Thank you !!
you're welcome!
20:25
Can visual studio alert me to members that may be private yet? Or is that R#?
@Squirrelkiller sorry, I don't know
I'm trying to understand what Mr. Martin Fowler mean by a plugin to understand his thesis on Dependency Injection (look for: "we described this situation as a Plugin": simply what is a plugin is it a class or a situation)
I think the plugin is the act of plugging something into something else
His explanation confused me
so it's the whole situation? not just the class (the plugin thing)?
20:53
Well the...yeah the situation kinda. Like, when somebody hits someone with their car and drives away, it's a "hit and run". This is similar to what the plugin is here. When you plug something into something else, that's a "plugin".
That's what I meant by "the act of plugging it in". IMO a hit and run is the act of hitting someone and running away.
Migth be the situation too though.
Perspective I guess.
Time for some sleep, bye!
21:15
@Squirrelkiller thanks for the explanation, I've always understood the plugin as the thing that is installed in a system to extend its functionality. At the end it's a problem with my English :/

« first day (3116 days earlier)      last day (2057 days later) »