71 Replies
VarriableStorage.cs
Hooks.cs
Homepage.cs
In code highlight as
I can't understand why
And yeah I'm trying to steal react
I don't think you can do tuple deconstruction in a field
do you have a suggestion?
Not really
Set them in a constructor
As a side note,
can just be
I tried and seems worked
Ah, or that
Right... there's no
var
in fields, but if you type those explicitly, sure
I can see why it works
Nicevar set = val => storage.Set(val);
cause error but second works as I rememberyeah you'd have to specify the type of
val
It's really bad developer experience for what I want
Well, it will be
var set = (int val) => storage.Set(val);
You're trying to bring mechanisms from an untyped language to a typed one lol
There will be friction
I think I made a mistake before and now it works.
I love C#
I hate asp.net
I like JS
I love React Architecture
Why I'm not making my own csx? š
Or you could use React frontend with an ASP API backend ĀÆ\_(ć)_/ĀÆ
But sure, I guess this is a nice exercise as well
Just... use naming convention propert for C# please lol
Yeah I have my own library for that, which not require asp.net APIs
GitHub
GitHub - GroophyLifefor/ExpressNET
Contribute to GroophyLifefor/ExpressNET development by creating an account on GitHub.
Ah
So you reinvented Minimal APIs I see
I don't understand as well
Method names are
PascalCase
, for example
Not camelCase
Of course, at the time I didn't know there was such a thing, but it was a good experience and it works really well.
š„²
You can do this in ASP.NET
this is a working API
as In my experience camelCase really good in C# too
I don't reject it š
don't š use š camelCase š for š methods š in š c# š
As in the standard,
camelCase
no good in C#I don't understand why C# community hates camelCase
because C# uses PascalCase for methods
It's the standard. Every codebase follows it
(besides Unity)
It's not about loving or hating, it's about standardization
Just stop arguing and accept that this is how C# is
In js some devs use PascalCase
and I don't care
but if I use camelCase in c#
Because JS has fuck all for standards lmao
people get angry to me
JS is the definition of a free-for-all
No types, no standards, no core library
It's absurd
This should be developer preference
if you don't work in a company
If you want your code to be inconsistent with the rest of C#, then be my guest
Everything else in C# uses PascalCase, it's your choice to be the outlier in that case
Again, it ensures consistency
Will I really be ostracized for this choice?
Yes
Yes
Please don't go crazy, it's not that important
Standards are important. Otherwise we would see
PHP was struggling with it ā still is ā for the longest time
Also what's almost even worse is that you're inconsistent with naming in your own codebase. Some methods are PascalCase, some are camelCase.
Where some functions were
pascalCase()
while some were snake_case()
The reason for this was that I wanted to keep the ones in the user base in PascalCase, while the ones from the core in camelCase.
where I use snake_case?
Nowhere
I'm just talking about standards
Without them, you would have one codebase using
snake_case
, another camelCase
, another one kebab-case
uhm
And every project would just look like a mishmash of all sorts of styles
With standards, I know that
thing.Foo
is a property
Because it's PascalCase
d
And I know, that this.foo
is a field
Because it's camelCase
I know why and what the standards are, it just doesn't make sense.
With standards, every method is named the same
No matter whether it's my codebase or someone else's
_
It could be Microsoft's huge framework, it could be a 50-loc project with 0 GH stars
It's all consistent and standardized
It should be manufacturer's preference which charging port they use in their devices
That's how we had a different charger for every phone
Not just phone manufacturer, phone model
What about it doesn't make sense exactly?
Now it's standardized ā in the EU at least ā USB-C
That way you can be certain that no matter whose device you buy, the charging port is the same
Again, standardization
Having such a standard
As I said, a lot of things can be standard, but I think this is something that should be a developer choice.
But isn't
You do have a choice to contradict the standard
Your code will compile just fine
So either deal with it or be an outlier
Your choice
But people will criticize you for it
as now š
Also (idk what this thread is even about at this point), I'm looking through your code and am seeing you're using
async void
in a couple places. Don't do this, everything which is async
should return a Task
or Task<T>
.
Exactly lol
Thanks you I'll
Done
Maybe you are right, I will think about switching to PascalCase
You refactor your code quickly, if you managed to fix all occurences of
async void
this quickly, complete with await
ing all calls to those methods and all it's not hard
It's just my bad which 'Result<Thinker>' said and I gonna fixed