36 Chambers – The Legendary Journeys: Execution to the max!

March 28, 2013

Do You Need That Trigger?

Filed under: Database Administration, Programming & Work — Kevin Feasel @ 6:00 pm

Merrill Aldrich has a wonderful flow chart pertaining to database triggers.  The short answer is “No.”

At one place I have worked, the primary production database had over 200 triggers, mostly to handle auditing and logging.  Why couldn’t they do something like Service Broker or change tracking or some asynchronous mechanism to keep things up to date without triggers everywhere?  Good question…

March 18, 2013

Telecommuting

Filed under: Programming & Work — Kevin Feasel @ 6:00 pm

This is a little old, but no more telecommuting at Yahoo.  Suzanne Lucas was not happy with this idea, nor is Tim Ford (who knows a thing or two about telecommuting).  She also has an interesting post on whether telecommuting hurts your career.

Telecommuting has grown on me over the past few years.  Even if it’s just occasionally—once or twice a week—it’s a great non-monetary benefit for employees you trust to get the job done.  And given that we have easy videoconferencing solutions available, there’s little reason for people in IT to have to come into the office each day unless they want to get out of the house.

February 15, 2013

Formal Formatting Standards Are Overrated

Filed under: Database Administration, Programming & Work — Kevin Feasel @ 6:00 pm

Grant Fritchey has a blog post about naming standards, including an excerable tblDdltbl.  The comments thread then becomes people defending their particular naming and formatting standards.

Let me explain my standard:  I try to be consistent, except when I’m not.  Anything more than that runs the risk of hitting rationalist stupidity, like tblDdltbl.

So what does this mean?  Well, I have a particular naming format for tables:  give the table a clear, unambiguous name that describes the entity this table implements.  Anything more than that is unnecessary cruft, and if I ever have to look at a chart to translate a table name, I know I’ve failed.  We get 128 characters for our names, so even very long names work, and auto-complete saves your precious fingertips so you can spend more time chatting on Facebook.

Okay, so what about stored procedures?  Well, name them in a way that makes sense.  I like Grant’s [Object][Action] combination, but be consistent…except when it makes sense not to be consistent.  Sometimes, [Object][Action][Predicate] is necessary, but that doesn’t mean you have to re-name all of those [Object][Action] procedures.  And if you want to use [Action][Object] instead, that’s fine:  just be consistent.

With database objects out of the way, what about formatting?  I could write an MLA-length document on precise formatting of SQL code, but what’s the benefit?  Is there any point in indenting here versus there, commas here versus there, or splitting out into lines here versus there?  Maybe.  But here’s the problem:  we don’t really have any solid metrics on this, so all of this comes down to stylistic preferences.  You may see your preferred formatting pattern as the pattrern, but that’s little more than an opinion based on the relatively small sample of formatting styles to which you have been exposed.  Furthermore, even if you write up a long style guide, chances are you’ll either hit the shoals of stupidity (tblDdltbl) or have gaping holes that you never thought about, thereby requiring actual independent thought and the risk of non-consistent code styles.

Let’s give an example of that now.  There are certain things which I believe make SQL code easier to read:  columns on separate lines, primary clauses (e.g., SELECT, FROM) outdented and the only thing on the line, subqueries following consistent indentation patterns, etc.  When I write a procedure or view, I tend to do that, except when I don’t:  for example, trivial NOT EXISTS subqueries might end up on one line rather than broken out.  But what constitutes a trivial NOT EXISTS clause?  Just a SELECT and FROM?  SELECT and FROM with one element in the WHERE clause?  Maybe an INNER JOIN somewhere?  Would splitting this out into several lines make that particular procedure significantly more difficult to read?  And if not, why should I put much mental effort into following The One True System?

I get the notion of trying to have a single coding style which everybody can follow to try to make it easier to read other developers’ code, but we live in the world of auto-formatting.  If you don’t like the format, it’s trivial to reformat code to your preference.  Or, better yet, get over it:  the interpreter doesn’t really care how you format your code, so if it makes sense to you, go for it.  Just don’t pretend that what makes sense to you is scientifically superior (unless you have the studies to back this up) or even makes sense to everybody else.

February 9, 2013

Windows 8 Office Hours

Filed under: Computinating, Programming & Work — Kevin Feasel @ 6:00 pm

Jeff Blankenburg is introducing office hours for assistance with your Windows 8-based apps.  That’s a great use of a Microsoft evangelist’s time, and if you’re developing on that platform and in the Columbus area, hit him up.

December 30, 2012

OAuth Providers

Filed under: (In)Security, Programming & Work — Kevin Feasel @ 6:00 pm

Ben Foster has a nice roundup of how to set up OAuth with some of the biggest providers (Google, Facebook, Twitter, LinkedIn, and Microsoft).

December 2, 2012

Sentence Of The Week

Filed under: Our Favorites, Programming & Work — Kevin Feasel @ 7:00 pm

I am reading a paper on HIPAA compliance in the cloud (hat tip to Jeremiah Peschka).  On the first page is this wonderful sentence:  “If you are considering storing protected health information (“PHI”) with a cloud provider, they should be knowledgeable about HIPAA (ideally, they should even spell the term correctly). “

I know far too many people in the health care industry who cannot spell HIPPA…err, I mean HIPAA…

November 3, 2012

99 Lifehacks

Filed under: Programming & Work — Kevin Feasel @ 6:00 pm

Via the Brent Ozar Unlimited mailing list, 99 lifehacks.

Some of them are pretty good.  I’m using binder clips on my broken keyboard at work.  It’s not ideal, but better than a flat keyboard.

By the way, the Brent Ozar Unlimited website update is definitely an improvement.  Granted, I’m almost always coming in through the RSS feed, but now it looks like a consulting firm with a blog rather than a blog with a consulting firm.  One of these days, I will have to steal their ideas…

Well, not really steal.  But I’m already (slowly) trying to follow their lead:  give presentations, answer questions, (slowly) build up my brand, and give away enough content to get people to pay me large amounts of money.

October 21, 2012

Index Comparison Made Slightly Easier

Filed under: Database Administration, Programming & Work — Kevin Feasel @ 10:00 am

I released a new application last night:  the Index Comparer.  There are a few working parts to it, most importantly a core library and a WPF application which sits on top of that.

The WPF application is available as a direct download, as is the business library DLL.  Both are available from the link above.  The code is also available in a Github repo, so that should help anybody who wants to extend it.

Right now, I’m looking at adding a quick bit of functionality to automate comparisons, likely using Powershell.  The upside is that you could then automatically generate the comparisons at regular intervals, centralizing all of this data into one server without using linked servers or OPENQUERY.  The downside is that Powershell users wouldn’t get the spinning ball while the process is running…

Incidentally, Michelle Ufford just recently released a very similar tool.  Her tool is a T-SQL script which you can then feed into a table and perform comparisons, so go check it out as well.  I just started working on my version just a few days before she released hers, so I think we’re both hitting on something that isn’t readily available to most people using Management Studio or even comparison tools like those built into Visual Studio.

October 20, 2012

Rotating An Image In WPF

Filed under: Programming & Work — Kevin Feasel @ 6:00 pm

I’m working on a WPF application that I’ll make available soon. As part of the application, I have a relatively expensive thread call and I wanted to display a little spinning image to show the user that yes, life is still good.

The single best demonstration I found was at WPFSharp.  It’s all-XAML, intuitive, and complete (which is very helpful for somebody who knows little about WPF but can read code).

Speaking of multithreading, I also wanted to point out a very helpful article I found on multithreading in WPF.  The concept is rather simple (at least for an example with just one additional thread).

October 2, 2012

Presenting

Filed under: (In)Security, Programming & Work — Kevin Feasel @ 6:15 pm

I will be presenting on Saturday, October 13th at Columbus Code Camp, a small conference aimed at developers getting together and learning from one another.  My talk is entitled Understanding and Preventing SQL Injection.  I’m going to crib some of it from my series, but will try to have at least one new trick for the live audience.

It looks like tickets are currently sold out, but there is a waiting list.  There look to be a few good talks, and there were some good people who presented last year.

Older Posts »

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 43 other followers