Browse by Tags

single letter variable names
Published 01-08-2007 11:37 AM | jokiz
If j(i) < 1 Then m = m + j(i - 1) Else m = m + j(i - 1) - 1 Single letter variables are good for iterators, but if integer variables will involve coditions such as the statement above, better use a more descriptive variable or refactor the said line...
to derive or not to derive from ApplicationException
Published 06-27-2006 10:13 PM | jokiz
remember the rule to always derive custom exceptions from ApplicationException? so you thought that the CLR never throws an ApplicationException? Krzysztof Cwalina (co-author of Brad Adams in the famous Framework Design Guidelines book) blogs about the...
Filed under: ,
Do not call overridable methods in constructors
Published 05-25-2006 9:12 PM | jokiz
I noticed that Resharper 2.0 highlighted (meaning it is against a rule) a call to a virtual method in a constructor in one of my business objects. It gave me the following information information in msdn (
String Property construct
Published 04-18-2006 12:25 PM | jokiz
anybody who is also using this construct for string properties? we rarely want our string properties to be null and since it is a reference type, we have to have handling for it. can you see any disadvantage of such construct? [code language="C#"] public...
Filed under: ,
TDS Protocol
Published 02-26-2006 2:24 AM | jokiz
For most of you who have been using stored procedures and following the MS guidelines in .NET Application Development, you must have been using SET NOCOUNT ON as stated in Chapter 12 of the Improving .NET Application Performance and Scalability . Although...
Filed under: , ,
Naming Guidelines
Published 11-10-2005 12:16 AM | jokiz
In response to dehranph's comment on my previous post ( ), it reminded me of the naming guidelines in .NET. His comment was about the DeleteCustomer method which has a Customer...
Filed under: ,
OOP-Encapsulation issues
Published 11-08-2005 11:14 PM | jokiz
As I was refactoring some of our codes, what struck me was the idea of object oriented programming particularly encapsulation. For example, we have this Customer object which is distinct with its CustomerID property. We needed to have versioning for the...
Filed under: , ,
ArgumentNullException - API design hall of shame
Published 06-22-2005 9:21 AM | jokiz
I have read this before but just want to make a permanent reference to it in this blog. Brad Adams explains why the ArgumentNullException class violates the Design Guidelines here for not following the exception constructor patterns. http://blogs.msdn...
Filed under: ,
Designing .NET Class Libraries Series
Published 04-25-2005 6:30 PM | jokiz
I've seen a part of this (Brad Adams presentation on Naming) perhaps a month ago, I just discovered that it is a part of a good set of webcasts worth seeing. Can't wait to see Brian Pepin's presentation (design time guru).
Filed under: ,
Code Complete 1st edition
Published 04-21-2005 6:18 PM | jokiz
I was reading Steve McConnell's first edition of Code Complete and the book is highly recommended. Although the sample uses old languages like pascal and c, and some topics does not apply to current programming languages, I love the way he presents his...
Filed under: ,
Hungarian Notation
Published 03-29-2005 8:42 AM | jokiz
I started programming with C and used Hungarian notation since then. It was very helpful back then to instantly know what type the variable is from its name. When I started programming in .NET using Visual Studio, Intellisense made a major breakthrough...
Filed under: ,
Property Naming WTF
Published 03-18-2005 3:53 PM | jokiz
I got tired of seeing a common property of our controls (since it is part of an interface) and this week, I got fed up and can’t take it anymore seeing them. AlignmentInContainer You might suggest ContainerAlignment but layout properties obviously relates...
Rethrowing exceptions, the right way
Published 02-21-2005 3:04 PM | jokiz
I have read the Exception Handling Best Practices article in .NET in CodeProject and all this time I thought that rethrowing exceptions is this way: [code language="C#"] try { // Some code that throws an exception } catch (Exception ex) { // some code...