Best Practice for strings in C# [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 months ago.
Improve this question
I am a junior developer. Is this the best practice to initialize and call methods on a string in one line? I find it unreadable but not sure if there is any advantage to doing so.
public static string something = "ABC".toLower();

Related

Why do Microsoft docs state "DO NOT use Enum.IsDefined for enum range checks."? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
In a document Microsoft published here discussing parameter design conventions/best practices, it's stated:
❌ DO NOT use Enum.IsDefined for enum range checks.
Why do they discourage/advise against this and what's the preferred alternative?

AJAX functionality in WinForms [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am looking for approach and not any code here - What is the best method to implement ajax like content fetch (from DB) in WinForms ?
AJAX is a web term. Retrieve your data via an API.

C#: Singleton using a Singleton [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have a curious question here. Is it wise to have a singleton class use or call another singleton class? The project the i'm currently working does this a quite a bit. The good and bad tidbits of this convention would be most helpful.
There is no point about it. Each singelton stands for itself and call the other or not. It's not good or bad.
It depens on your goal, if the singeltons themself are a good decission.

Why is it legal to declare nested public types inside an internal type? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Shouldn't it be forbidden to declare a nested type that is more accessible than the parent?
To expand on why i asked this is why

What is the naming convention for AutoResetEvent objects? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What is the naming convention for AutoResetEvents so that
A programmer intuitively knows that it is an AutoResetEvent
A programmer knows specifically what it is for
Say I have a method to refresh things which can only be called by one thread at a time
I find something like "resfreshThingAutoResetEvent" to be cumbersome, but it is the only way I can think to name it so that it meets the goals above.

Categories