Skip to main content

Common Developing mistakes.. How to avoid !!

Alsalam alikom wa ra7mat Allah wa barakatoh

I've read a gr8 article in MSDN and I thought to share it... here r some quotes from it


- Load other forms in the background and populate controls with data before using the Show method.

- Use an off-screen bitmap. For an example, see How to: Draw Images Off-Screen.

- Override the OnKeyDown, OnKeyPress, and OnKeyUp methods on controls instead of adding key event handlers.

- Avoid using the ToString method of an enumeration because of the performance impact it incurs by searching metadata tables.

- Strings are immutable, so a new String object is created every time you modify the string. Consider using a StringBuilder when constructing a string that will be modified often.

- Use the ParseExact method for a DateTime if you know the exact format used for DateTime serialization. Otherwise, the DateTime parser will sequentially try to apply several culture-specific formats.

- Whenever possible, specify the size of your collection, because dynamic resizing can greatly increase excess storage.

- Use generic collections to avoid the boxing and unboxing overhead for value types. Defining your own optimized collection results in the best performance.

- Avoid virtual calls.

- Use fields instead of properties where possible.


And here is a link to the Article

Those points in bold attracted me...

Alsalam Alikom wa ra7mat Allah wa barakatoh

Comments

Post a Comment

Popular posts from this blog

Windows7 adds Math Input Panel

Alsalam alikom wa ra7mat Allah wa barakatoh… I was reading a windows team post about Input Panels improvements in Windows7 [ here ]. When at the end I saw a very interesting –intuitive if you wish- new thing… which is, as you guessed, the Math Input Panel… Yes, that crappy font is mine… I “drew” that by mouse as I don’t have a tablet pen/pc. You can then paste it directly into word and it’ll recognize it as an editable equation… During my tests, the output panel (the top part) hanged, but I liked that the drawing panel was still responsive and I could still write/erase… till the top one started to respond again… One other thing to know, after you click Insert (that button down there) it copies the equation in MathML [ Wikipedia link ] format.. which is a standard way of representing equations and hence any application that recognizes the format can insert it not as an image but as a nice editable equation… If you think it recognized something wrong, you can click “Sele...

What do you do? and how do you do it?

Alsalam alikom wa ra7mat Allah wa barakatoh I've remembered these two questions a couple of minutes ago, they were mentioned in a movie called "The Pursuit of Happyness" and as you see Happyness is written intentionally with 'y' but that's another story! The scene was that the hero who was a depressed poor guy was walking in the street then found a guy parking his very nice & expensive car, he stopped him and asked him "may I as you two questions..." "What do you do? and how do you do it?" Away from the scene and how things went on in the movie, the question that came to me was why don't I ask myself the same questions.. it's not that I'm successful or something but my point is to try to analyze what "were" my goals during my past life... and what did I do to reach the state I am in now -fail/success/progress...- I believe what brought this to my mind is watching -again- Steve Jobs's motivational speech when h...

Microsoft Web Platform Installer… coming near you

The Microsoft Web Platform Installer 2.0 (Web PI) is a free tool that makes it simple to download, install and keep up-to-date with the latest components of the Microsoft Web Platform, including Internet Information Services (IIS), SQL Server Express, .NET Framework and Visual Web Developer. In addition, install popular open source ASP.NET and PHP web apps with the Web PI. Here is the code snippet if you want to spread the word :) < a href ="http://go.microsoft.com/fwlink/?LinkId=146503" title=" Get the Microsoft Web Platform " > < img src ="http://www.microsoft.com/web/media/badge/get_microsoft_web_platform.png" alt ="Get the Microsoft Web Platform" border ="0" /> </ a >