« first day (4002 days earlier)      last day (949 days later) » 

1:36 AM
 
 
1 hour later…
2:57 AM
| Caffé Americano: A shot of espresso combined with enough hot water to fill a six-ounce cup. The Americano was supposedly invented by European baristas for American soldiers during World War II to replicate Americans' preferred drip-style coffee. It's popular on its own after dinner in Italy.
Coffee after dinner? really?
 
 
2 hours later…
4:36 AM
@Squirrelkiller Ok, thanks for reply...
 
 
1 hour later…
5:39 AM
@nyconing It helps digestion
As does any...bittering agent. That sounds weird in english, I just let leo translate it.
Good morning btw
So yeah, in restaurants here you are usually offered an espresso or some kind of strong alcoholic beverage after your meal. LEO says the Absacker is translated as nightcap, but since it's slang I guess it's hard to translate. Basically it's to help your digestion.
 
6:04 AM
    :53129802 I tried to check the differences. i am able to modify value of X as below. So unable to find usage.

     Point3D point3D = new Point3D();
      point3D.X = 10;
      Console.WriteLine(point3D.X);


I modified getter code as below:

public double X
    {
        readonly get => _x+5;
        set => _x = value;
    }

now X is returning 15
 
mr5
6:19 AM
eh wat
you can add readonly modifier on get?
 
 
1 hour later…
7:22 AM
FirstOrDefault or SingleOrDefault ? What's the difference.
 
If there are three matches, FirstOrDefault will give you the first one, SingleOrDefault will throw because there is more than one
e.g. when I filter by ID, I usually use .Single, because there mustn't be more than one match with that ID.
 
Got it, thank you!
 
@Ravi still not a mutation though
 
8:26 AM
Mutation of x though
Maybe this one:
In an instance member declaration within a structure type, readonly indicates that an instance member doesn't modify the state of the structure. For more information, see the readonly instance members section of the Structure types article.
So just an indicator that the getter doesn't change the state of the struct?
 
8:53 AM
basically
    public struct S
    {
        private String _Text;

        public String Text
        {
            readonly get => Foo();
            set => _Text = value;
        }

        public String Foo()
        {
            _Text = "";
            return "";
        }
    }
this compiles though
 
 
3 hours later…
11:41 AM
If my guess is correct, that is some weak-ass static analysis.
 
11:53 AM
your guess is wrong
but it is still some weak-ass static analysis
 
So what does the modifier do?
Just seems very out of place on a getter
 
it ensures that you dont modify the properties of that specific struct
 
Wouldn't that be public readonly struct S though?
 
only if the entire struct is readonly
functions can also be readonly
public readonly void Foo() {}
 
11:56 AM
dat
C# loves to introduce keywords in every place
preferably the same keyword with different meaning
or the same meaning with a different keyword
and it should be a keyword especially if the same can also be achieved with attributes or functions
 
Hm doesn't work in C# interactive. Probably something in a higher language level.
 
C#8 iirc
also, those keywords preferably will result in conflict with other meaning (preferably of the same keyword) in the future of the language
if that happens, the C# devs hit a jackpot
also, it should definitely be redundant
 
So basically on a property getter it is redundant, but it lets the compiler optimize some things.
The compiler will treat all auto-implemented getters as readonly whether or not the readonly keyword is present.
 
also, it should definitely be inconsistent as well
 
This effectively causes the hidden this parameter to become in T instead of ref T.

This would allow the user to safely call said instance method without the compiler needing to make a copy.
 
12:18 PM
public readonly struct ReadonlyStruct // means that the struct is readonly and can only have readonly fields/properties
{
    // public String field1; // Error: Instance fields of 'readonly' structs must be 'readonly'
    public readonly String field2; // fields have to be re-declared as readonly even though the struct has already been declared readonly
    public String Property1 { get; } // properties do not have to be declared readonly because it is inferred
    public readonly String Property2 { get; }
fields can be readonly
properties can be readonly, but only when they are in a struct and not in a class
properties still have to declare their getter and setter therefor making the readonly modifier always redundant
property getters can be readonly but only if there is a setter present and only if the property is in a struct
methods can be readonly, but only when they are in a struct
structs can be readonly, and all their fields and properties will be required to be readonly. properties do not have to be declared readonly, fields do, which makes the readonly modifier redundant because the
readonly might be even worse than async
basic rules of good language features are
1. it should be unambiguous
2. it should be consistent
3. it should not be redundant
async only violates 2 of the 3
readonly violates all of them
 
Since we can use both snake_case and PascalCase in variable naming, is the underscore being allowed in names redundant?
IMO it's just another option
It is advised to use PascalCase, but they don't force you.
 
naming is rarely enforced
underscore is just one of the allowed characters in names
generally speaking, in C#, you'd use PascalCase for everything that is public or a type or a method
 
It is enforced to not use a number in the beginning of a name
 
and you use _underscoreLeadingCamelCase for private fields
 
12:33 PM
I do not
 
not a number at the beginning is not a naming format
just a syntactical limitation
in fact, it is _underscoreLeadingCamelCase for private fields, PascalCase for all components and camelCase for local variables (including parameters)
and considering fields are not really needed any more and in more modern projects everything is just properties, everything is basically PascalCase
because why use different naming conventions when you could have the ability for name clashes everywhere?
 
@Wietlol I tend to do that
 
I just dont use fields :D
life becomes so much simpler
 
mr5
1:14 PM
oh yeah
do you use private properties instead?
 
yep
it is what I did in Java and now in Kotlin
and Kodian
why should I do things differently in C#?
C# doesnt have a mentally disabled compiler that cannot figure out what simple things mean
oh wait, it does
 
theres not a lot wrong with roslyn
 
there is, but it is not their fault
the language designers are still to blame for desiging it so bad
 
1:30 PM
why do you hate c# so much
 
I hate everything :)
 
EdgeLion
 
edgelol
 
but C# in particular because I use it and have to experience my hate
 
In MySQL Triggers - instead of FOR EACH ROW How do you only do FIRST ROW ONLY?
 
1:39 PM
Can you just like, LIMIT 1 or something?
Or TOP(1) I don't know mysql syntax
 
Gracias :)
 
I'll take that as a yes^^
 
Jawohl
 
1:54 PM
[Captain Obvious] Afternoon
 
no
 
Juan M on September 30, 2021
Ten years on the internet is a long time. Let’s celebrate the Stack Exchange sites that, as of Q3, have hit that milestone.
 
2:57 PM
it's been almost 10 years since the arrow in the knee meme
and it felt out-of-date by the second week of its existence
 
man the days after the immediate initial launch of skyrim were GOAT
such a good game but has aged so badly
 
ahhh dam stack's certificate expired an hour ago
 
 
3 hours later…
5:52 PM
hey i am having trouble figuring out performance issue. I am making financial app so i like using decimal to store all values but Firebase supports double or string, so now i have performance question if it is better to parse to string when setting to firebase and parsing to decimal when getting from firebase, or should i use some other approach ? thanks in advance.
 

« first day (4002 days earlier)      last day (949 days later) »