Sunday, January 13, 2013

Can we rewire our brain?

Like instead of...

private int MaxVLAllowed { get; set; }


...we do this instead:

int MaxVLAllowed { get; set; }


Instead of convincing ourselves "there could" be a nullable primary key...
create table Person
(
PersonID int identity(1,1) not null primary key,
PersonName varchar(100) not null
);


...we believe there's only one form of truth, i.e. primary key cannot be nullable
create table Person
(
PersonID int identity(1,1) primary key,
PersonName varchar(100) not null
);



Instead of thinking that both of you and the computer are both OC buddies...
if ( (ans == 'Y') || (answer == 'y') )


...just believe you're the only person on earth who believes not putting parenthesis around a comparison expression is confusing:
if ( ans == 'Y' || answer == 'y' )


Instead of inner joining...
select *
from alpha
inner join beta on beta.alpha_id = alpha.alpha_id

...why not just join them? i.e. remove the noise keyword inner:
select *
from alpha 
join beta on beta.alpha_id = alpha.alpha_id


Instead of computing numbers like this...
+1 + +9 - +7 * +6


...it's in our conviction that a positive number is implied when we omit the positive sign:
1 + 9 - 7 * 6

No comments:

Post a Comment