« first day (3323 days earlier)      last day (1851 days later) » 

13:00
DBNull does indeed sound horrific as well
luckily for me, I dont have to deal with that layer of abstraction
The tool is definitely wrong, but industry regulations force me to use it, so ¯\_(ツ)_/¯
@Kevin if it's Resharper (still a static analysis tool), it will not complain after a if (optionalX != null & optionalX.HasValue) return;
the tool is probably ancient
circa 2014ish
null isnt bad, its depend api how to use it. For simple term just dont throw exception for null until critical.
userid = null, throwing is reasonable
userphone = null, throwing is hell
13:07
that is why you must make the distinction between nullable and not
userId: Int
userPhone: Int? (or Nullable<Int>)
perhaps even String? because phones arent really ints actually
userid not always is int
wait, phone also
can phone number stored as int?
do you have a better option
+60167123456 may it same like 0060167123456
!~>int.Parse("0060167123456")
@nyconing Value was either too large or too small for an Int32.
I spent a couple of weeks writing scala, and now suddenly I find myself missing built-in Option types in C#.
!~>long.Parse("0060167123456")
@nyconing The name 'int64' does not exist in the current context
13:13
@nyconing should be long.
@nyconing 60167123456
Phone numbers should not be stored as a numerical type.
Phone numbers shouldn't be stored as ints, because they're not ints. The're numerical strings.
NEVER SAVE A PHONE NUMBER AS AN INT
or any other numerical type
You don't need to increment or decrement them, divide or multiply. They're not numbers, they're strings comprised of (mostly) digit characters.
is it he is actually said 'kill it'
@AvnerShahar-Kashtan But if I can't increment my phone number, how will I find my number neighbor? :-P
squirrels are just acorn mice
13:22
Ah, fixed my TypeBuilder code and 18 unit tests are green again.
@AvnerShahar-Kashtan welcome, brother, to the C#-hate community :)
@nyconing he said "dewit", dont you read captions?
@Wietlol Hey, it's still my favorite language by far.
Even if I am apparently going to find myself writing a lot of C++ in the near future.
aw, you havent tried Wietlang then :D
Why did the programmer use Wietlang? Because he couldn't see sharp ;)
to be fair, C# also has its advantages
13:28
@Neil HGFAWELREHWUFUADHSHFASDCVASDLJKGHKRJHTRPASFOIDQHF
such as... uhm... hold on, its keming...
oh, I know... oh wait, that is bork
@AlRey What's up, man?
your joke
that is the funniest thing I eve heard
ikr?
I was gonna thinking of killing you this morning, but now I'm turned around.
So I'm not gonna kill you; I'm gonna kill myself
13:29
ok, the only thing I can come up with is that there are a lot of libraries and a good community for it
gonna punch myself to death
C# is a very good pragmatic/multi-paradigm language with a large ecosystem and community, responsive development and great tooling.
It's not the best, probably, at any one thing, but it's more than good enough at many, many things.
true, its enough to write good large scale software
and unlike Java, the guides on how to work with c# don't all contradict each other
13:32
as was cobol
mostly in Java you've just got a bunch of standard libraries which are obsolete and are trying to be slowly removed
Scala tooling, compared to C# tooling, are similar to Scala vs. C# itself - there are lots of things Scala does very well, and lots of things IntelliJ, for instance, does very well. But you have to go through a lot of crap that balances out the good parts. C# is at least pretty good in most places, and Visual Studio likewise.
so you get a lot of guides which use them and guides which don't
yeah cause Oracle doesn't care enough about Java to make sure everyone's up to date with it
yeah ._.
13:33
@Neil To be fair, though, you can find a lot of blog posts and SO questions for C# which predate async/await and Tasks, for instance, giving bad advice to newbies.
That could be said for any language, not specifically concerning async/await but proper usage in general
wait, not using async/await is bad?
@Wietlol Not necessarily, but there are many places where it's good, and not using it just makes for clunkier, less readable code.
that last bit, I am not so sure of
Task/async/await wrapping does not really make code more readable
or more maintainable
I dont want to Task<T> everything in the world
Meeting took 10 minutes
13:37
your meeting with the toilet ?
if you have one async call, then your interface must too, and all the users and their interfaces and everything
"Hello how are you, what are you doing, cool, kthxbye"
oh one of those meetings
@Wietlol It really, really does. It takes callback-based code and flattens it, so you have logical locality of code flow.
@HéctorÁlvarez It was a "let's pretend we're doing periodical meetings with the staff" meetings?
in my case, it doesnt matter at all, except when I want to paralellize stuff
13:38
if you can write it in more than one way, you can count on there being a guide which shows you the wrong way of going about it
@AvnerShahar-Kashtan So far it does.
but you assume you had callback based code in the first place
I mean he came with a lot of ideas and words, but I've heard those before. I'll believe when I see
if I see a comparison between async and non async, I rarely see callbacks as the non-async way
@Wietlol Yes, yes, you've complained about that before. I agree that having to encode asyncness in the method return call isn't the best solution, but given that in most applications I've written in the last couple of years I wanted all service calls to be async, that ship has sailed.
13:40
I still don't have much material: bag for my laptop, headset for calls / meetings, etc.
Now, given that we're working with async methods (Task/ValueTask/IAsyncEnumerable return values), the ability to use async/await and get a coherent logical call flow is invaluable
The trash 10 Mbps connection in the office came out loud and he was like "WTF why do these people have that crap"
@Wietlol I'm not talking about writing async/non-async code as concepts. I'm talking about the C# async/await keywords.
Ugh. I have a friend that's living in the US. He was here for a week, went to the airport last night to go back home, and discovered that due to a technicality, his US visa expired and he's stuck here, away from his family.
oh, asynchronous code is fine, just the approach in C# is something I dont fancy
I much rather have a language that doesnt need keywords or special types to make the standard usage of async/await in your code
Wietlang for example, is based on fibers on LLVM
Yes, but that means inventing new languages every time a new paradigm comes along. I guarantee that if you release Wietlang, you'll suddenly come across a new concept and want to add it to the language, and discover the magical power of backwards compatibility.
13:45
so what do you do when you want something to run synchronously/asynchronously?
code in C# such as var x = await getSomethingAsync(); in Wietlang is var x = getSomething()
you'd need a keyword or a different way of calling it
because I dont have to do code rewriting with a state machine and everything to get async functionality
@AvnerShahar-Kashtan backwards compatibility isnt much of an issue here
in fact, if you wrote the code like that before, I dont see why changing it to async is a big deal
@Neil if you really want tasks, then yes, you can wrap the call
@Wietlol How does async work in Wietlang, when you call getSomething()?
@FedericoFiaSare Heya.
13:47
value x: Task<T> = async { getSomething() }
value y: Task<T> = async { getSomethingElse() }
value x2 = x.await()
value y2 = y.await()
So the async keyword wraps the results of getSomething in a task?
so like returning a Promise in javascript
What's getSomething's return value?
@AvnerShahar-Kashtan when an async function gets called (such as doing a web request), the "stack" gets pushed aside and the processor that used that stack starts doing other things (other processes that were queued)
when the response comes, the "stack" is queued up again on the process queue
@Wietlol But what's an async function?
13:50
that is how I understood in a nutshel
@Wietlol That's pretty much how async/await works, yes. Regardless of whether it uses threads or fibers or whatever.
But how are you avoiding specifying the return type in the method signature?
because I dont change the code to callbacks
I dont do code rewriting to a state machine
I simply push the stack aside
the return types, call sites and everything remain the same
@Wietlol Wait, go back. is getSomething marked as async?
somehow?
no
function getSomething() -> String
is async and non async blurred?
13:52
blurred?
And how do I make an explicitly async method?
I need to catch exception for a number as string with comma as decimal separators
you dont, you only make an explicit async call site
all functions are indistinctable by definition
if your usage decides that you want to do two operations at the same time, then you choose to call them both asynchronously
13:53
what's the difference between a call site and a method here?
such as the code I wrote above
@Neil method declaration and method invocation?
ok so the call site is like the header in C++?
function getSomething() -> String { ... }
vs
value x = getSomething()
oh, nvm
I'm trying whit this decimal.TryParse(primero, NumberStyles.Any, CultureInfo.CurrentCulture, out p), the culture is en-US and decimal separator "." but when i send "10,5" result is 105
13:54
isnt call site a common term?
no, I misunderstood
thought that was like a technical term "call site"
you meant it like "place where it is called"
> In programming, a call site of a function or subroutine is the location (line of code) where the function is called (or may be called, through dynamic dispatch).
In programming, a call site of a function or subroutine is the location (line of code) where the function is called (or may be called, through dynamic dispatch). A call site is where zero or more arguments are passed to the function, and zero or more return values are received. == Example == // this is a function definition function sqr(x) { return x * x; } function foo() { // these are two call sites of function sqr in this function a = sqr(b); c = sqr(b); } == Assembler example == IBM/360 or Z/Architecture * (usually) external call.... R13 usually points to a save area for g...
@Wietlol well gee, look how wrong I was
glad we clarified that I was wrong
@FedericoFiaSare and that is unexpected?
I was wrong everybody! (in case there is still confusion about that)
4
13:56
decimal separator is dot, not comma
thanks Niel
perhaps we should remind everyone tomorrow :D
It wasn't a personal attack on you, you know..
I know
you're always quick to be defensive
am I?
yep
13:57
I mean, No I am not!
how dareth thee
anyway, im off for now
laytar
@FedericoFiaSare That makes sense. When you specify NumberStyles.Any, you're explicitly allowing the Thousands separator as well, which in en-US is the comma.
So "10,5" parses into "105" just like "1,000,000" parses into "1000000"
IDK what to make of this day
I'm legit bamboozled
@HéctorÁlvarez Of the meeting?
Nah the day in general. I was expecting when people make a 3h trip at least they look over and see what is going on.
@HéctorÁlvarez They came over, spent 10 minutes in meeting, exclaimed loudly about the network conditions, and left?
14:09
More or less, that's the event so far
they just came back from lunch break
but they are expected to leave soon
Is there a good piece of software for diagramming a project (or collection of projects)? Maybe something that will actually scan your code.
@Hypersapien Visual Studio has that feature, probably only in one of the pricier SKUs.
Right. I'm using 2019 Community
@Hypersapien I used Enterprised Architect last year. Good one, but old AF
can reverse engineer databases and extract the model
14:24
@Hypersapien It should still be available, actually.
Ah, no. There was a footnote: "Can open diagrams generated in other Visual Studio editions in read-only mode."
15:21
Still 1 hour to go home
I have nothing to do here
can't browse 9gag because too obvious
can't play games
maybe I'm gonna read some online magazines
I'm off home. Stayed later than I expected.
Then again, my wife is off in China, my mom is with my kids, my office is empty and I'm leaving this project in a month. *shrug*.
Well then
why are you doing extra time
anyway, cheers!
@HéctorÁlvarez can you take over my home project?
@HéctorÁlvarez overtime :)
extra time would be, like prison time or something
@Neil Righty, that's the word
Jay
Jay
15:27
what's the difference between
`SELECT tablename.columnname`,
`SELECT tablename.columnname columnname`, and
`SELECT tablename.columnname AS [columnname]`?
@ntohl I'm now a certified business automation engineer, I don't need to code any more (for now)
@Jay All 3 are the same in that example
@Jay in the first, you reference it by the column name, in the second you reference it as the alias that follows, and in the last, same as the second, except you can add characters which you wouldn't normally be able to use
fancy title for someone without a job (for now)
Jay
Jay
okay so you can alias without the AS
Is the second sql example even proper?
15:29
yes it's proper
I usually use the second
I know you can alias via select blah from tablename alias
same shit
Jay
Jay
@CaptainSquirrel that was my actual question, seeing a bunch of those in a stored procedure I need to update
huh
I thought you had to use AS to alias a column name
the first one will only force the full name if you have 2 tables in the FROM clause where they both have the same column name. The 2nd and 3rd ones are exactly the same because AS is optional in aliases for major RDBMS, I don't know any that wouldn't know how to parse an alias without AS
15:30
@CaptainSquirrel I used to think you always had to use "as" but I think it's a database-specific thing actually
for oracle at least, you can use either
Make a quick check, SELECT user.name FROM user will return the results and the column name will be "name" not "user.name"
Jay
Jay
so if it's literally typed like tablename.columnname columnname the 2nd columnname is kinda pointless?
Jay
Jay
15:32
even if they're verbatim the same?
@Jay if the alias and the column name are the same, yes, it's pointless
Look, aliases serve 2 purposes:
1. You don't want to write a long-ass name
Jay
Jay
@Neil that's what I'm trying to understand
2. resolve conflicts (or ambiguity)
you generally use aliases if column is computed (and therefore isn't an actual column) or if you want to shorten the column name in your query
15:34
this also applies when you display data to an end user that doesn't want to see user_id_for_item_sku_ltd but instead wants to see "Identifier"
34 secs ago, by Wietlol
2. resolve conflicts (or ambiguity)
Jay
Jay
I'm not arguing against using aliases
just trying to understand that particular syntax
though sometimes I'll use aliases if I think the column it represents might change
when you have 2 tables with the same column, e.g. user.name and product.name is the right naming convention, but if you join those 2 tables you'll end up having full table.column names which you may not want
So my program can continue to fetch "insert_date" when perhaps I retrieve that value in some other way by modifying the query
in that case, aliases will help you reference each field in a more readable fashion
Jay
Jay
15:36
@HéctorÁlvarez that makes sense
If your program refers to the name of the exact column, and that changes, you can still make it work by adding an alias, but using an alias with the name of an old column is confusing
sometimes it's simpler to add aliases from the start
otherwise you'll need to modify both the query and the program
@Neil I have to say while that's right, you should almost NEVER change your query to fit your app query, but instead do so the other way around.
The few cases that apply to that are usually a last resort and mostly legacy issues where you change a data source for a legacy app that nobody dares touch
@HéctorÁlvarez depends on whether or not it's in development or if it is already being used in production
I don't mind changing the program in the former case
Jay
Jay
@Neil I understand what aliases are used for, and Neil answered my actual question a few lines ago
15:41
I personally would prefer to avoid editing a query that's already working, even more so because it's easy to encapsulate selections into other selections without even refactoring, and adding aliases afterwards is painful to account for
like if you're doing SELECT name, surname, birth_date FROM person WHERE age BETWEEN 18 AND 24, later down the road someone will tell me "those users you've got there, I need to know what sports club have any of them registered", so instead of re-doing the query I might simply do SELECT name FROM club_registration WHERE id_registered_user IN (SELECT id FROM ( <copy-paste the previous query> ))
Pretty pointless on simple queries, but if the existing one is a monster it makes all the sense.
Jay
Jay
fair enough
16:07
Sick of microservices
@HéctorÁlvarez that's against scout boy rule
btw from those ctrl-c ctrl-v queries you can make views from them
@YousufHossain noooooo
we lost one of our brothers :(
:)
I don't see the point unless you have 100k concurrent api calls
I respect separation of concern but this is just too much
if it is too much, you probably didnt remove all the work
automatically create new projects ready for deployment
automatically deploy projects on commits/merges
automatically setup the environment based on the specifications by the project
etc
you need to do those things, otherwise you get a real lot of repetitive work
@ntohl Depends on your permissions, when I had to hack my way around some ancient PLs I just went for the least destructive way
which was assuming what was working was correct, so I would wrap my answer around the assumed right answer
we're talking about queties with 17 tables and over 10 UNION ALL
Oh right, if you UNION ALL you can mix data from different tables by using aliases
16:16
@HéctorÁlvarez which are the perfect candidates for 100 scout boys to clean up
 
1 hour later…
17:19
Jack, tumbleweed
....Come Again?
Jack, learn tumbleweed <>https://i.sstatic.net/3xqGt.jpg
I've learned the command tumbleweed
!Tumbleweed
17:59
me with the half-life vr announcement
I fully expect that game(?) to end with her meeting Gordon for the first time in the main game.
I don't care what it is
i'm buying it
oh shit
there's actually a trailer
oh man
oh man oh man
this looks good
GMAN
The half life vr?
Jay
Jay
yeah!
@Hypersapien it might!
So I guess I'm plugging my Vive back in
it's a full price, full length game that takes place between HL1 and HL2
I'm excited!
18:25
hells yea
though am I the only one who notices the different voice actors?
also I was worried this game would only work on Valve Index, but it looks like I won't have to shelve out $1100 after all
but fr should I get an HTC Vive or Valve Index?
wait, I've got it!: Half-Life Alyx for Nintendo Labo
19:09
lol
Think i'm going to try Diablo 1 on the switch tonight
whoa they have that?
19:32
Well you have to have a modded switch
but it's out
booooo
I've never actually played Diablo
Felling old
Jay
Jay
@juanvan if it makes you feel any better I played the original Metal Gear at launch
not Metal Gear Solid mind you, Metal Gear
19:48
@juanvan Actually I'm 46
Jay
Jay
I'm about to be
Is it similar to Torchlight?
Jay
Jay
yes
mr5
mr5
20:34
fuck I burned my chicken
That sucks
Well, I managed to write my first roslyn analyzer and codefix. that was fun
cool
I've been meaning to look at analyzers for ages
Is any part of Roslyn suitable for full-on code generation or does it only manipulate fragments of a code hierarchy that already exists?
I know of it for refactorings, and it seemed from the announcements that the syntax tree could represent everything, but I haven't seen it in use for big stuff
Is there a feature in C# where I have have a scoped block of code return a value for assignment without actually creating a function?
you can include a scope inside an existing scope
but I think the variable you set would have to be created outside it
20:48
Yeah, that's what I assumed.
so you could do
object obj;
{
//shit
obj = shit;
}
Oh, you mean just assign it inside the block instead of returning it.
yeah var obj = { //shit }; would be nice
If I try it, it thinks the curly braces are supposed to be array initializers
I'm actually a version or two behind on C# syntax
20:51
Probably less behind than I am
could you use a lambda
40
A: Execute lambda expression immediately after its definition?

TejsSure. new Action(() => { Console.WriteLine("Hello World"); })(); That should do the trick.

> int x = new Func<int>(() => { return 3 + 2; })();
> x
5
You see folks do basically this in C++land, set the thing up in a lambda that gets called immediately so you can have it be const from then on out.
@TomW Full on code generation is definitely possible.
21:07
@Grace that is exactly what I need. Thanks!
groan!
I thought "well I'm sure you know about lambdas..."
and didn't even bring it up
all's well that ends well
Admittedly, the way you have to do it in c# isn't quite obvious
you can't just do () => { return whatever; }();
I use lambdas all the time and I occasionally use Func<>s, but I've never used them in that way before.
Without a variable name and calling it immediately
yeah, you don't see them much in c#
you see them more in javascript (for scoping reasons) and c++ (for const reasons)
but this is the first time I've heard of it in c#
you might hear it called a "immediately invoked [lambda|lambda expression|function expression]"
You can always cast the lambda inline and then call it, but the compiler can't infer the type of a lambda.
21:17
@JonathonChase Can you give an example of what you mean?
Sure. It's disgusting, but I have it on hand.
Run this as a C# expression in linqpad
((Func<int,Func<int,Func<int,Action<Action<int>>>>>)(a => b => c => d => d(a * 2 + b * 2 + c * 2)))(6)(7)(8)(Console.WriteLine);
I think that code just gave me cancer
A more straightforward example would be ((Action<string>)(s => Console.WriteLine(s)))("Hello, world");
there's an example of casting the lambda in that SO answer, too
Then it has done it's duty.
21:20
the new() approach is probably somewhat slower, but it's easier to read
Or with a method group to delegate conversion, ((Action<string>)(Console.WriteLine))("Hello, world");
F# on the other hand has no problem just using whatever lambda you create without casting or assigning it. (fun x -> printfn "%s" x) "Hello, World"
 
2 hours later…
23:04
@JonathonChase oh you and your currying
Who doesn't love a good curry.
losers, that's who
unf
weird floating hand things
didn't work very well in what was it, Turok?
mr5
mr5
turok means inject in our language
the floating hand things is VR
I suppose it would be weirder to not see your hands
mr5
mr5
damn I need to buy Oculus

« first day (3323 days earlier)      last day (1851 days later) »