Click here to Skip to main content
16,004,833 members
Home / Discussions / C#
   

C#

 
GeneralClass Generator Pin
Leyu24-Jun-05 6:22
Leyu24-Jun-05 6:22 
GeneralRe: Class Generator Pin
Steve Maier24-Jun-05 8:40
professionalSteve Maier24-Jun-05 8:40 
GeneralRe: Class Generator Pin
ChesterPoindexter24-Jun-05 13:36
professionalChesterPoindexter24-Jun-05 13:36 
Generalassignment to controls ( Label) Pin
pbsamson24-Jun-05 5:49
pbsamson24-Jun-05 5:49 
GeneralRe: assignment to controls ( Label) Pin
Marc Clifton24-Jun-05 6:20
mvaMarc Clifton24-Jun-05 6:20 
GeneralRe: assignment to controls ( Label) Pin
pbsamson24-Jun-05 6:27
pbsamson24-Jun-05 6:27 
GeneralLine Width Pin
Leslie Sanford24-Jun-05 5:43
Leslie Sanford24-Jun-05 5:43 
GeneralRe: Line Width Pin
Judah Gabriel Himango24-Jun-05 5:56
sponsorJudah Gabriel Himango24-Jun-05 5:56 
It's beeter to consider readability than line length or line count. Indenting improves readability.

If you need to use a shorthand version of a namespace or class, try out the using statement:

using d3d = Microsoft.DirectX.Direct3d;

As an aside, it isn't recommened you make classes thread-safe by default. Making classes thread-safe comes at the expense of performance; everything has to acquire a lock, which is inefficient and can lead to deadlocks and locking of the UI thread. Rather, if you need a thread-safe class, make a wrapper around your class that uses locks, or have the calling code do the locking.

And an FYI, line lengths are only going to get longer with generics in .NET 2.0, where generic methods must have type argument supplied to them, further lengthening some method calls. Additionally, using foreach over some generic list or dictionary looks pretty long:

foreach(KeyValuePair<tstring, bool> pair in myStringBoolDictionary)
{
}


That alone is 72 characters; the main thing to worry about is readability, IMO.

Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango


QuestionHow to use windows ping utility in C#? Pin
Mohamed El Gohary24-Jun-05 5:39
Mohamed El Gohary24-Jun-05 5:39 
AnswerRe: How to use windows ping utility in C#? Pin
Judah Gabriel Himango24-Jun-05 5:52
sponsorJudah Gabriel Himango24-Jun-05 5:52 
AnswerRe: How to use windows ping utility in C#? Pin
Mike Dimmick24-Jun-05 6:08
Mike Dimmick24-Jun-05 6:08 
Generalsearch ip address Pin
amarsumanth24-Jun-05 5:36
amarsumanth24-Jun-05 5:36 
GeneralRe: search ip address Pin
Judah Gabriel Himango24-Jun-05 5:50
sponsorJudah Gabriel Himango24-Jun-05 5:50 
GeneralRe: search ip address Pin
amarsumanth24-Jun-05 7:41
amarsumanth24-Jun-05 7:41 
GeneralRe: search ip address Pin
Dave Kreskowiak24-Jun-05 8:06
mveDave Kreskowiak24-Jun-05 8:06 
Generalping Pin
amarsumanth24-Jun-05 8:55
amarsumanth24-Jun-05 8:55 
GeneralRe: ping Pin
Dave Kreskowiak24-Jun-05 9:32
mveDave Kreskowiak24-Jun-05 9:32 
GeneralNaN Pin
hain24-Jun-05 5:23
hain24-Jun-05 5:23 
GeneralRe: NaN Pin
Richard Deeming24-Jun-05 8:04
mveRichard Deeming24-Jun-05 8:04 
Generaladmin password Pin
amarsumanth24-Jun-05 5:10
amarsumanth24-Jun-05 5:10 
GeneralRe: admin password Pin
Judah Gabriel Himango24-Jun-05 5:13
sponsorJudah Gabriel Himango24-Jun-05 5:13 
GeneralRe: admin password Pin
Dave Kreskowiak24-Jun-05 8:04
mveDave Kreskowiak24-Jun-05 8:04 
QuestionPocket PC virtual keyboard? Pin
george ivanov24-Jun-05 4:33
george ivanov24-Jun-05 4:33 
AnswerRe: Pocket PC virtual keyboard? Pin
Mike Dimmick24-Jun-05 5:52
Mike Dimmick24-Jun-05 5:52 
Generalgdi+ slow Pin
bwagz24-Jun-05 4:28
bwagz24-Jun-05 4:28 

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.