« first day (3688 days earlier)      last day (1482 days later) » 

01:55
chrome 87
was thunder
 
2 hours later…
 
1 hour later…
06:41
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' pleberinos!
07:30
Gooood moorniiiing CeeeeShaaaarp!! Have you felt stupid lately? Who am I kidding you're devs of course you have!
07:40
Good morning
When I want to do calculation in a Razor page (ASP.NET Core), do I have to use JavaScript or can I do it in C#? Is there any disadvantage in using C#?
I guess doing it in C# would mean it goes back to the server. So if it's a small calculation, the time it needs to travel back and forth might be longer than the time the calculation would need in JS.
Doing it in C# means it runs on the server, costing your server performance. Doing it in JS pushes it to the client browser, meaning no wasted performance, but possibly a lot slower.
Hmmmmm. But what is the real advantage of Razor then?
Thank you both for your help :)
Server-Rendering is faster than client-rendering
Also you can use C#
Of course rendering on the server will cost you perofrmance, while rendering on the client will just push it to the client. So if you don't have too many users or like, a server farm at your disposal you can just do it all on the server no sweat.
@Squirrelkiller I am no computer expert and thought the opposite is true. --> (Server-Rendering is faster than client-rendering) - Any hint were I can read more about this topic?
ahhhh
Rendering is the calculation right?
07:48
Server-rendering is faster because the server is 1) faster than the client 2) multi-threading capable 3) not javascirpt and therefore more efficient
A server has more computational power
Rendering is building the html on the server instead of the client. This usually includes all the calculations done to dynamically add stuff.
Interessting. So JS and C# have both their advantages dependent on the situation
Basically you could either do it like angular: Send a lot of javascript that then loads html templates and builds the whole stuff according to what the javascript says. Or like MVC: Make the templating/rendering on the server and then send (almost-) static html to the client.
Not necessarily; JS is very performant and building a SPA all but demands using it. And there are many upsides to a SPA. The UX of traditional request/response model cannot even compare to the UX of a good SPA. The downside? It's harder to write a good SPA.
07:50
How long does this server rendering roughly take.
?
@Hozuki Might I recommend Blazor? :D
Fuck Blazor.
2
@kame Not long.
||votekick Hozuki for blasphemy
@Squirrelkiller voted to kick @Hozuki
1-3s? maybe
07:51
@kame More like < 1 millisecond
And same for JS.
@kame For big pages only. LIke very big.
Really??????
wow
Computer are really, really fucking fast
unbelieveable
Yep, and rendering HTML is really not something that costs performance.
07:51
@nyconing can you port your bot to the discord?
@Hozuki but sending data through the net take much more than milliseconds I thought.
Well it does, but lets say your data needs 150ms to get through the web - that's so fast, a user won't even notice it. Think about news sites that need like 20 seconds to actually load all the ads and articles and shit.
@kame Sure, but you asked about server rendering ;-)
@kame Your database queries will likely also take more than 1ms but I'm not counting those either.
@Hozuki aaahhhhhh, but the whole process with sending data fore and back takes about 300ms then, correct?
which is also fast
Depends on your efficiency and distance from the server.
My company products take somewhere between 20-50ms per page hit or API
07:59
for me it is difficult to decide when to use C# and when to use JS.
I am at home and do further education.
Decide on your model. Are you doing a traditional request/response model? Use C# for anything you can do without requiring JS. If you're doing a SPA, just use C# for your APIs and nothing else.
Doesn't even depend on the language actually. The decision is between doing stuff on the server vs on the client.
Server: More raw power but network
Client: Standard power but no network
Yeh, you could also just use JS on the server and bypass that pesky C# bullshit.
No reason to get rude
Kick-wars, begun they have.
08:07
I wish one could add a message to the kick like "this is why you had to go"
:D
I am not used to JS. But maybe I have to learn it.
and Angular too
It's another beast to be sure
JS is super fun, if you like chaos.
:/
I must admit I am enjoying coersion m,ore than I should.
08:09
JS is definitely useful to know. Angular is a whole other level.
Yeah. It's a completely different experience. That said, you might be served better by React. Angular is... ehm... picky.
let x = this.getPerson();

if(x) {
  // do crud
}
JS is like...the perfect language for a hackathon.
And if you're going that route, look at TypeScript. It'll help.
okay. Today I learn JS, Angular, React, TypeScript and Bootstrap. :D
They are not the same correct? :D ;)
08:11
Bootstrap basically does CSS for you
How could I call all this languages?
Frontend languages?
It's called web development
learn... learn Kotlin
08:11
JS is not restricted to frontend anymore since NodeJS
ahhhh okay. Then I will read about overview over web languages first. :)
You're opening more and more cans of worms lol
@kame what are you trying to achieve?
hmm... that one is difficult
08:13
Pro-tip: Don't try to learn everything. It's not worth it at all. Use whatever you need to achieve your goals.
@Wietlol Richtum, Macht und Ruhm!
anyone here works with Azure with microservices?
Are we bannin geaother now?
Wondering how many free F1 WebApps you can spin up?
08:18
not really
@Squirrelintraining Just if they seriously propose using JS on the server
I was wondering what tech stack would be nice
for AWS, I use serverless
Just realised: Both Azure and GCP use "F1" for the smallest instance.
but since serverless has no support for Azure with Java, that is a 100% no-go
No wait GCP uses it for smallest VM, Azure for smallest web app
...Java?
||Java
08:19
That didn't make much sense. Did you mean C#?
so, then I tried to just follow the examples of how to make Azure Functions with Java, but so far no infrastructure as code, so a microservice arch would be a pain
@Squirrelkiller it needs to support Java, .net core and node.js
Why Java though?
because JABA
Jaba is love, Java is life
But C# is The Better Java™
H E R E S Y
08:21
...he said in the C# chat room
burn the heretic!
stabs Squirrelkiller repeatedly with a lighted torch
Uhhh...that's...not very sharp...
but it is not supposed to B#
but yea, what I am looking for is a good infrastructure as code option for Azure microservices
with support for Java, .net core and node.js
maybe ill try terraform
08:43
i am back
2 messages moved to Trash can
3
@Wietlol I want to achieve the following. I have a supermarkt simulation. There is a supplier. And I as the supermarket manager can order products. I have some standard products. Then I need a form field after every product were I can type the amount of the product to order. when I change the amount I want a recalculation of the overall sum. (was this understandable?)
You'll need at least a little bit of JS, but not much is required. You can keep your logic in C#.
I mean... that is a pretty general description of the business logic...
@Hozuki But in which case I would need JS?
08:47
but not really what you want to achieve
@kame Just to update the total sum on the form after an amount change.
you can write that in every language you know
heck even pure SQL can do that
@Wietlol Sorry I don't understand. I want to achieve "to update the total sum on the form after an amount change." :)
so, you already have a form?
No
08:49
@Wietlol SQL will not rewrite the DOM...
ahhh I see what you mean
@ntohl it wont be a website tho
@Wietlol I have some supermarket pages in Razor. With a page for adding customers. For adding employees (with CRUD). And so on.
Later the customers will buy products.
But at first I have to fill the stock.
@Wietlol "Then I will read about overview over web languages first"...
it's a website
the description didnt mention a website was necessary
could just as well be a win forms or wpf app
08:55
oh sorry
@Wietlol Its a project with ASP.NET Core Razor pages
 
1 hour later…
10:06
hmm... this might be interesting
either a singleton service will be created every time GetRequiredService is called, or the service provider has a bug...
mr5
mr5
how did you register it?
hmm... bugged, it seems
.AddSingleton
mr5
mr5
waw. is that you wiet? why are you doing c#?
I have to sometimes
but interestingly enough, a singleton service is only created when it is first requested from the service provider
when it is created, it will use that service provider to further create the required stuff for said service
but... a service provider can be scoped
so, a singleton service, can depend on scoped services which will be disposed when the scoped service provider is disposed
after that, the singleton service is using disposed services
mr5
mr5
why are you explicitly requesting the service also? why not just through injection?
10:14
above is using injection
mr5
mr5
@Wietlol but u said this
.AddSingleton<IService, Service>()
==
.AddSingleton<IService>(provider => new Service(provider.GetRequiredService<IDependentService>()))
but the provider that is passed, can be scoped
What do you mean a service provider can be scoped
mr5
mr5
@Wietlol I think those scoped service instances will still remain
will they?
10:16
The service provider has to be singleton
mr5
mr5
according to GC concept
Then when you try injecting a scoped service into a singleton, the DI will crash telling you that you can't inject a non-singleton service into a singleton, for exactly that reason: You can't scope a service when you have a dependent singleton.
GC has nothing to do with it
mr5
mr5
@Wietlol use the other signature: .AddSingleton<IService, Service>()?
Scoped services are disposed when their scope is disposed
they are not garbage collected yet tho
10:17
@mr5 While the instances remain until all references are gone, they would still get disposed by hte service provider.
@mr5 they are equivalent
(maybe GetService instead of GetRequiredService tho)
GetService instead of GetRequiredService jsut means it could provide a null instead of crash if the requested service isn't available.
mr5
mr5
@Wietlol you explicitly use new here. I don't think so.
they are equivalent, dang it!
@Squirrelkiller I am not actively trying to do so, but I just added the singleton and I was thinking about how it would work
They are indeed equivalent
10:21
I could understand that a scoped provider would provide scoped singletons instead of actual singletons
mr5
mr5
.AddSingleton<IService, Service>()
// later
var service = GetService<IService>() // first instance
// more later
.AddSingleton<IService>(...new Service(...)) // second instance
you wouldnt use both
mr5
mr5
@Squirrelkiller oh yeah. my bad
also, it is a lambda
the moment I do AddSingleton<>(_ => new Stuff()) the stuff is not yet created
it will only be created when I do GetService<IStuff>()
mr5
mr5
yeah that is correct
10:35
hmm... it works fine tho...
hmm... not as well as I thought it would
the provider that created the singleton just will never be disposed
so, the scoped services will never be disposed
hence why it works (the singleton service wont use disposed services)
AddSingleton<>(_ => new Stuff()) what's that? What for?
you want Lazy?
why you want to scope the Service?
iDunno
for whatever valid reason
Hello friends!
oooooh
[Captain Obvious] Botler back
[Captain Obvious] He was never dead
10:48
what does the new scheduler mean?
if he wasnt dead, why did he not wörk?
[Captain Obvious] But stack's shitty chat system dropped the websocket or something which means he couldnt see new messages arriving or send any
not in the mood?
[Captain Obvious] The discord side was working fine
^ ye, that is why I added the reconnecting stuff to my SO chat library :D
which caused a few problems
[mr5] @butler1233 I've made a PR
[Captain Obvious] Also the scheduler is the thing in the SharpExchange library that actually sends the nessages and deals with the antisoam and shit
[Captain Obvious] <@561582857949282355> great, I'm still lying in bed
[mr5] nice. you're late again 😛
[mr5] who's going to implement the reconnect thingy?
[Captain Obvious] I don't work Fridays remember
[mr5] oic. weird sched
[mr5] auto rejoin* my bad
[Squirrel in Training] Why u work on sunday but not friday?
[Squirrel in Training] Are you muslim?
[mr5] o.O
[Captain Obvious] No, it was a scheduling issue like 4 years ago and it hasn't changed because I like it
[Squirrel in Training] I can imagine.
[mr5] muslims don't work on friday too?
[Captain Obvious] Avner has the same schedule
\[**[Squirrel in Training](https://discord.gg/PNMq3pBSUe)**] Because Friday is the day off.
Like Sunday in most christian societies
[Squirrel in Training] Is Friday the holy day for Jews?
[mr5] can we remove the [bracket thing] in every message? it looks awful to me.
[Captain Obvious] No you're wrong
[mr5] /poll
[mr5] ahh now I want a poll
10:58
@mr5 prolly not until Cap decides to use Wietbot api
speaking of which, @CaptainObvious that might work
[mr5] Botler, learn poll <do the poll thing>
I can give you an app integration into Wietbot
then you can listen to messages from my message queue
which is managed by Wietbot, so you get the reconnect for free
[mr5] yes
[mr5] let's integrate it
you can also then invoke the "send message" function
[mr5] do PR please @Wietlol

« first day (3688 days earlier)      last day (1482 days later) »