Showing posts with label best practices. Show all posts
Showing posts with label best practices. Show all posts

Sunday, February 24, 2008

Boise Code Camp 2008

Saturday, March 8th, 2008
At Boise State University in the
College of Business and Economics

Register today to attend free: www.BoiseCodeCamp.org

This free event for technical professionals is produced by the community, for the community.

Code Camp is bigger than ever this year featuring new and exciting technologies, training on fundamentals, a great party, and more.

  • 63 sessions from 45 amazing presenters
  • The best training value available anywhere
  • Fewer slides, more code and examples
  • Familiar names and local real-world coders side by side
  • An incredible amount of talent and information
  • Free lunch, dinner, swag, and giveaways
  • Held during non-work hours (we have jobs too)
  • Sessions for non-coders as well
  • Amazing after party in the BSU stadium Hall of Fame room

No matter whether you are a seasoned coder, a student, a business analysis in software, a project manager, or a hobbyist technologist, there is something at code camp for you. Invest in yourself and come prepared to learn about these things and more:

  • ASP.Net
  • Agile / Methodology
  • Architecture
  • Client Development
  • Databases and DB development
  • Delphi
  • Fundamentals
  • Games & Graphics
  • Google APIs
  • I.T. And Operations
  • Languages & Frameworks
  • Mobile
  • Security
  • Web Development
  • WCF, WF, WPF
  • Virtualization
  • XML and the Web
  • Java, .Net, SQL, Oracle

Register today at www.BoiseCodeCamp.org.

Tuesday, January 15, 2008

On-line backup hosts

OK, we all know we need to back up our data.  And we have all been told to have an off-line location for all of our data as well.  More than likely, the business we work at does just that.

But at home? Not a chance.

Heck, we are lucky to have a backup anywhere.  Maybe your lucky enough to have several computers with large hard drives and you can copy your data between them.  Or, if you are really geeky, you have an external hard drive that you can pass around. That's a good start -- but what about the off site part?  Could be that is just too much trouble. But there are answers.

Several web sites are now offering off-site backup for home users, and for not much money either. Here are some solutions:

Mozy (a user group favorite): 2 gig free, $5 a month for "Unlimited space".  Might not be unlimited, but still a good deal.

IDrive: also offers 2 gig free.  You can map a drive to it (Vista is not supported), and "Unlimited Space -- 150 gig" for $50 a year (slightly cheaper than Mozy).  IDrive also supports versioning.

Carbonite: No free space, but everything else is comparable.

Of course, this blog is mainly read by developers, we want to backup our code, and there are lots of options for that.

If you don't care if someone else sees your code, things are easy and free.  The hardest consideration is do you want to store your code in Subversion, CSV, or something else.

SourceForge: the original.  Uses CVS and Subversion

Google Code: a new kid on the block, but very popular with many open source .Net projects. Uses Subversion.

Tigris: these guys make Subversion -- and offer space.  They also list a number of hosting site.

CodePlex: Microsoft sponsored site for open source projects.  You will find the AJAX Toolkit, and the Patterns and Practices stuff there.  I believe they use Team Systems for source control. Interestingly, you will also see many other open source libraries with listings there, but the code is actually on Google Code (because CodePlex doesn't support Subversion).

Commercial Hosting.  Lots of options here as well, and lots of price ranges.  Just Google "subversion hosting" and you will see a ton of options.  Price is one consideration, but also look for bug tracking while you are there.  Here are a few options:

SvnRepository: Starts at $4 month, includes 500MB and Trac for bug reporting.

CVSDude: Starts at $5 month, includes 100MB.  They also have Trac and Bugzilla, but you have to pay more.

OK, there are a few options, but not a definitive list by any stretch.  If I left something out, please leave a comment and I'll update the post.

Wednesday, May 02, 2007

8 defensive programming best practices

This article is written for PHP, but at the high level these 8 practices apply everywhere. Here they are (with comments by me). The original article has more comments and PHP specific resources.

  1. Handle unexpected conditions - of course you cannot expect every unexpected condition, but you can write code to handle things when they don't happen as expected. Even if the code just raises an error.
  2. Process external systems data properly - Instead of just assuming all input and output is correct, validate it. Be sure you are getting what you are expecting, and that what your program produces is correct. This is especially an issue with SQL and HTML injection!
  3. Test your code - Hello McFly, anyone home? You need unit tests, regression tests, UI tests, user tests, etc. Then look at what you are not testing and test that. Especially if you are releasing to the public.
  4. Monitor your site errors and act upon them - Whatever kind of development you are doing, you need to log all errors (serious and minor) and if possible centralize them. Then analyze your error logs and do something about it. When you start seeing those exceptions you put in for #1 show up, that means the unexpected happened. Now that you know what it is, you can expect it and act on it.
  5. Do not disclose errors to the users -This is huge for websites. I don't know how many times I have been using a website and it breaks and I am presented with a beautiful debug screen with all sorts of juicy details that if I were a hacker I could make use of. This is the worst with ASP/ASP.NET sites. Remove debug messages when you release - same goes for non-web development.
  6. Damage control - Make sure your program fails gracefully. Save the users data often.
  7. Backup - This is another really obvious one. First of all, use a GOOD source control system so you are backed-up during the development process. Remember to backup your database and other non-source code bits too. Then backup your users data for them. Even if you can't force them to backup their data, at least make it easy.
  8. Do what you can as you can never get defensive enough - This is like Lather, Rinse, Repeat. Once you have done all the above, refactor your code, and go through the steps again. Just be aware that things break. This goes back to #6. What can you do to make sure they don't break to bad? That is a good start.

One other point it makes is "If anything can go wrong, it will." I would not say that every worst case scenario will play out. I will however say that the more possibility for malfunction you leave, the greater the chance. Also, the more users you have, and the more time the users spend using your application, the greater the odds of any errors showing up.

What are your defensive programming best practices?

Technorati Tags: [] [] [] [] []