Lance's Whiteboard

Random scribbling about C#, Javascript, Web Development, Architecture, and anything else that pops into my mind.

News


Creative Commons License
Lance's Whiteboard Blog by Lance Hunt is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Based on a work at weblogs.asp.net



Sponsored Ad
Sponsored Ad

Blogs I Read

May 2004 - Posts

DateTime woes and "The Pit of Failure"...

Having had my own struggles with DateTime parsing, I completely concur with the comments from my peers as they replied to Brad Abrams and the BCL team on the past, present, and future of DateTime processing in the .NET Framework.

The current situation is painful, and unfortunately the future plans for DateTime fail the test for good API design.  This sounds much more like designing for “The Pit of Failure“ than “The Pit of Success“ [quote from Rico Mariani via Brad's earlier post].   API's should be designed so that “developers just fall into doing the right thing”.

I think the best way to assure that the problems are rectified is to create a new DateTime struct or fix the current one (and break backwards compatibility).  Obviously the latter option is much less desireable.

The current plan for VisualStudio.NET 2005 “Whidbey“ is a poor compromise.  One that will only result in every developer creating a set of DateTime helper classes just to remove the pain from correct DateTime manipulation.  Anytime that happens, I consider it a failure of the BCL Team....perhaps harsh, but nonetheless I believe it is true. 

Do we really need to start work on a “DateTime Application Block“?

 

Update: C# Coding Standards v1.09

After receiving a few emails requesting a rules-summary, I made some changes this weekend.  Version 1.09 of the C# Coding Standards document is now available for download.

I like the simplifying nature of the new “Quick Summary” section, but would like to make the document more concise and useable so it doesnt need such redundancy.

As always, feedback is welcome...

Update: C# Coding Standards v1.08

I just published the latest version (v1.08)  of my C# Coding Standards.

The previous version got out of control once I added the .NET Framework Guidelines section.   Although it contained useful information, this section went well beyond my intended scope.  In the end, I decided to split this information into another document to be released later.  The latest document now states a more limited scope which is much more focused on C# Language usage.

Future Plans:

  • Add more code examples.
  • Expand upon Code Commenting to include per-file comments.
  • Break-up the Language Usage section into more digestable sections.
  • Expand Object Model Design section or consider removal.
  • Identify rules to include in custom FxCop Rules library.
  • Re-evaluate fonts, styles, and overall readability.

Please post your feedback here...

 

.TEXT Hacking....

While working on my blog's appearance, I ended-up doing quite a bit of hacking on the layout.  After receiving several posts, and emails asking how to make these changes, I figured I should post a few simple hacks to the .TEXT templates.  Most use CSS, but a few really bad hacks include some JavaScript.  Here are some examples:

Note: not all .TEXT templates have the same ID tags, or Html structure, so these statements may need to be modified.

Add background image to top via CSS:

#top {
       height : 100px;  /* adjust height to fit image */
       background-image : url(“http://myisp/mylogo.gif“);  /* url to your logo or image */
       background-repeat: no-repeat;  /* displays it as a non-repeating image */
}

Remove the “Contact” link via CSS:

#MyLinks1_ContactLink {
      position : absolute;
      left : -200px;  /* assumes link is on the left side */
}

Change the “My Links” heading text via JavaScript:

<script language="JavaScript">

     document.body.all["leftmenu"].all[0].innerText = "Weblog Info";

</script>

 

To implement these changes go to .TEXT Admin -> Options -> Configure

  • Copy/paste the CSS into the “Custom CSS Selectors” box.
  • Copy/paste the JavaScript into the “Static News/Announcements” box.

 

Obviously, any hacking can be dangerous to the health of your blog.  You have been warned!

 

Happy hacking!

 

MSIL.Gastropod anyone?

Symantec Antivirus deleted a zip file containing a .NET assembly today during my weekly scan.  It identified it as a “MSIL.Gastropod“ virus.  For now, I will omit the name of the file, since I feel that it comes from a reputable source. 

Does anyone have the 411 on this “MSIL.Gastropod“ virus?

Google is no help in this case... :(

 

 

Posted: May 17 2004, 12:39 PM by CodeSniper | with 5 comment(s)
Filed under:
CSS, Blogging, and WinForms...

After spending some time updating the UI for this blog, I have renewed my love for Cascading Syle Sheets(CSS).  

I havent done much ASP.NET in a while, so my DHTML and CSS skills have waned over the past two years.   Since this .TEXT weblog engine doesnt support uploadable skins, I decided to use the very powerful features offered by custom CSS.  The result is what you see on this blog.

None of this is rocket science, but I have to admit I enjoyed activating those dormant brain cells floating around in my grey matter. 

Having fought and lost many battles to design good looking Windows applications,  I look forward to the future of Longhorn when we will have similar capeabilities for WinForms.

[update]

For you .TEXT users, this layout uses the “Hover” template along with a good amount of custom CSS.  The CSS is inserted by adding styles to the “Custom CSS Selectors“ box from the “Configure” option on the “Options” tab of the admin site.

Admin -> Options -> Configure -> Custom CSS Selectors

API Useability article (pdf)
I found this Dr. Dobbs article on API Useability while reading the WindowsMobile Team blog.
C# Coding Standards

I recently started documenting my own C# Coding Standards and best practices.   The current document is very much a work-in-progress, but I am making it freely available for download.  Please reply with any comments, questions, or feedback on this blog entry.

Click Here, to download the PDF.
[ Updated to v1.13a]

 

Why yet another coding standard document?

There have been numerous attempts at document C# Coding Standards since the language was released, but I usually have disagreements with many of the guidelines and rules they contain.  This is my attempt to start from scratch and write a new standards document that represents my preferred style.  I'm sure that many of you will have just as many disagreements, but I am looking forward to the debate. :)

Enjoy!

 

1980's Flashback (16k and a Tape-drive)

This morning, I began having hallucinatory flashbacks, started regurgitating PET Basic code, and felt obsessive cravings for my old Commodore 64, 13" TV, 1541 Drive, and 300baud modem!  Don't even get me started on my old Vic 20 & Tape drive....  ;)

All because of this one little link sent from a friend.... 

For those of you who know what I'm talking about, enjoy the link!

More Posts