Click here to Skip to main content
15,891,704 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Localization, but how? Pin
Luc Pattyn6-Jul-07 0:48
sitebuilderLuc Pattyn6-Jul-07 0:48 
QuestionAssembly Pin
kankeyan5-Jul-07 21:53
kankeyan5-Jul-07 21:53 
AnswerRe: Assembly Pin
originSH5-Jul-07 22:17
originSH5-Jul-07 22:17 
AnswerRe: Assembly Pin
Ilya Verbitskiy8-Jul-07 1:00
Ilya Verbitskiy8-Jul-07 1:00 
QuestionGnerate a pdf file using c# without using a third party product???? Pin
Nithin Krishna5-Jul-07 21:50
Nithin Krishna5-Jul-07 21:50 
AnswerRe: Gnerate a pdf file using c# without using a third party product???? Pin
Christian Graus5-Jul-07 23:44
protectorChristian Graus5-Jul-07 23:44 
AnswerRe: Gnerate a pdf file using c# without using a third party product???? Pin
Vasudevan Deepak Kumar9-Jul-07 2:57
Vasudevan Deepak Kumar9-Jul-07 2:57 
QuestionGood practice or not? Defaulting member variables via properties Pin
AEternal5-Jul-07 8:00
AEternal5-Jul-07 8:00 
I've been wrestling with the idea of defaulting member variables, not necessarily in the constructor, but in their accessor properties. For example:
private string _name;

public string Name
{
    get
    {
        if (this._name == null) this._name = String.Empty;
        return this._name;
    }
    set { this._name = value; }
}

This way, I know that, no matter what, whenever I access MyObject.Name, I'll be getting a valid string object and never a null, so that when I go to do MyObject.Name.Trim(), I'll never get a null object exception. This saves me time and lines of code in my application.

My question is, is this good practice? Is it better to let the exception occur and check for null elsewhere?
AnswerRe: Good practice or not? Defaulting member variables via properties Pin
Scott Dorman5-Jul-07 8:13
professionalScott Dorman5-Jul-07 8:13 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
AEternal5-Jul-07 8:27
AEternal5-Jul-07 8:27 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
Scott Dorman5-Jul-07 8:39
professionalScott Dorman5-Jul-07 8:39 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
AEternal5-Jul-07 8:47
AEternal5-Jul-07 8:47 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
Scott Dorman5-Jul-07 9:02
professionalScott Dorman5-Jul-07 9:02 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
AEternal5-Jul-07 9:42
AEternal5-Jul-07 9:42 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
Scott Dorman5-Jul-07 9:49
professionalScott Dorman5-Jul-07 9:49 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
Not Active5-Jul-07 9:58
mentorNot Active5-Jul-07 9:58 
QuestionUnRegistering Assemblies from GAC on the basis of public key? Pin
Mushtaque Nizamani5-Jul-07 4:18
Mushtaque Nizamani5-Jul-07 4:18 
AnswerRe: UnRegistering Assemblies from GAC on the basis of public key? Pin
Ilya Verbitskiy8-Jul-07 1:07
Ilya Verbitskiy8-Jul-07 1:07 
QuestionProblem with .net Pin
koolprasad20034-Jul-07 19:21
professionalkoolprasad20034-Jul-07 19:21 
AnswerRe: Problem with .net Pin
Sathesh Sakthivel5-Jul-07 16:38
Sathesh Sakthivel5-Jul-07 16:38 
GeneralRe: Problem with .net Pin
Paul Conrad6-Jul-07 15:33
professionalPaul Conrad6-Jul-07 15:33 
GeneralRe: Problem with .net Pin
Sathesh Sakthivel6-Jul-07 15:48
Sathesh Sakthivel6-Jul-07 15:48 
GeneralRe: Problem with .net Pin
Paul Conrad6-Jul-07 17:24
professionalPaul Conrad6-Jul-07 17:24 
Questionneed help wit code snippet Pin
neodeaths4-Jul-07 16:29
neodeaths4-Jul-07 16:29 
AnswerRe: need help wit code snippet Pin
Christian Graus4-Jul-07 17:12
protectorChristian Graus4-Jul-07 17:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.