<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'T-SQL Tuesday' and 'learning'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=T-SQL+Tuesday,learning&amp;orTags=0</link><description>Search results matching tags 'T-SQL Tuesday' and 'learning'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>T-SQL Tuesday #21 : Crap Code</title><link>http://sqlblog.com/blogs/aaron_bertrand/archive/2011/08/10/t-sql-tuesday-21-crap-code.aspx</link><pubDate>Wed, 10 Aug 2011 17:42:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:37716</guid><dc:creator>AaronBertrand</dc:creator><description>
&lt;p&gt;
&lt;a href="http://sqlblog.com/blogs/adam_machanic/archive/2011/08/03/t-sql-tuesday-21-a-day-late-and-totally-full-of-it.aspx" title="http://sqlblog.com/blogs/adam_machanic/archive/2011/08/03/t-sql-tuesday-21-a-day-late-and-totally-full-of-it.aspx" target="_blank"&gt;&lt;img src="http://sqlblog.com/blogs/adam_machanic/TSQLWednesday_thumb_578C7A06.jpg" align="right" border="0" height="180" hspace="20" width="180"&gt;&lt;/a&gt;
Yes, &lt;a href="http://sqlblog.com/blogs/adam_machanic/archive/2011/08/03/t-sql-tuesday-21-a-day-late-and-totally-full-of-it.aspx" title="http://sqlblog.com/blogs/adam_machanic/archive/2011/08/03/t-sql-tuesday-21-a-day-late-and-totally-full-of-it.aspx" target="_blank"&gt;Adam is right&lt;/a&gt;: we've all written &lt;b&gt;crap code&lt;/b&gt; (the topic of this month's T-SQL &lt;strike&gt;Tuesday&lt;/strike&gt; Wednesday. Usually we have an excuse: tight deadline, short shelf life of the code, or didn't know any better. I'm sure if I perused my career codebase I'd find tons and tons of examples that I'd write differently today, because back then it fell under one of these categories.&lt;/p&gt;

&lt;p&gt;I've developed a lot of habits over the years. Mainly, these habits are better for me, but they're not necessarily better for everyone. I have my reasons for shifting my coding style in various ways, and I've documented many of them right here (search for "&lt;a href="http://sqlblog.com/search/SearchResults.aspx?q=%22bad+habits+to+kick%22&amp;amp;s=18" title="http://sqlblog.com/search/SearchResults.aspx?q=%22bad+habits+to+kick%22&amp;amp;s=18" target="_blank"&gt;bad habits to kick&lt;/a&gt;" or see my &lt;a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2008/10/30/my-stored-procedure-best-practices-checklist.aspx" title="http://sqlblog.com/blogs/aaron_bertrand/archive/2008/10/30/my-stored-procedure-best-practices-checklist.aspx" target="_blank"&gt;stored procedure best practices checklist&lt;/a&gt;). Some of them revolve mostly around readability and maintainability, and I don't ever expect to convince everyone else that commas belong at the end of a line, not the beginning, or that &lt;code style="background-color:#eeeeee;"&gt;[column alias] = (expression)&lt;/code&gt; reads better than &lt;code style="background-color:#eeeeee;"&gt;(expression) AS [column alias]&lt;/code&gt;. A lot of these are just preferences - as I've preached many times in the past, the conventions you choose are not as important as how consistent you are in implementing them and whether they make sense to you and those around you.&lt;/p&gt;

&lt;p&gt;So when I look back at older code, I definitely see some things from my list of habits that have changed. Nothing important enough to go back and correct, but noticeable nonetheless. I see some dumb, wasteful things like this, where I'm building a ginormous dynamic SQL string and then either printing or executing the string depending on a flag. But then I add other junk to the end inside the conditional.&amp;nbsp;&lt;/p&gt;

&lt;blockquote&gt;
&lt;table bgcolor="#eeeeee" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre style="padding:10px 20px;font-size:12px;font-family:consolas,lucida console,courier new,courier;-moz-background-inline-policy:continuous;"&gt;&lt;font color="blue"&gt;IF &lt;/font&gt;&lt;font color="#434343"&gt;@debug = &lt;/font&gt;&lt;font color="black"&gt;1&lt;br&gt;&lt;/font&gt;&lt;font color="blue"&gt;BEGIN&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PRINT &lt;/font&gt;&lt;font color="#434343"&gt;@sql &lt;/font&gt;&lt;font color="gray"&gt;+ &lt;/font&gt;&lt;font color="red"&gt;' OPTION (MAXDOP 1);'&lt;/font&gt;&lt;font color="gray"&gt;;&lt;br&gt;&lt;/font&gt;&lt;font color="blue"&gt;END&lt;br&gt;ELSE&lt;br&gt;BEGIN&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;EXEC&lt;/font&gt;&lt;font color="gray"&gt;(&lt;/font&gt;&lt;font color="#434343"&gt;@sql &lt;/font&gt;&lt;font color="gray"&gt;+ &lt;/font&gt;&lt;font color="red"&gt;' OPTION (MAXDOP 1);'&lt;/font&gt;&lt;font color="gray"&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;PRINT &lt;/font&gt;&lt;font color="#ff00ff"&gt;@@ROWCOUNT&lt;/font&gt;&lt;font color="gray"&gt;;&lt;br&gt;&lt;/font&gt;&lt;font color="blue"&gt;END&lt;/font&gt;
&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/blockquote&gt;


&lt;p&gt;No, this kind of thing is not a big deal, and there are other things in there that I'm even more appalled at (one: not trying to remove the dynamic SQL in the first place, and two: using EXEC instead of sp_executeSQL). But I'm pretty particular about tidy code and this kind of redundant string-building just irks me to no end.&lt;/p&gt;

&lt;p&gt;Anyway, I don't want to focus on code, I just wanted to point out that you shouldn't be too hard on yourself for crap code that you've produced in the past. You probably had a good reason (or at least a lame excuse) for putting it out that way, and we all had to start somewhere. I only know a few people who think they've been an expert in their field since the day they were born; most of us will admit that we're always learning.&lt;/p&gt;

&lt;p&gt;&amp;nbsp; &lt;br&gt;&lt;/p&gt;</description></item><item><title>T-SQL Tuesday #008: How Learning Has Changed</title><link>http://sqlblog.com/blogs/aaron_bertrand/archive/2010/07/13/t-sql-tuesday-008-how-learning-has-changed.aspx</link><pubDate>Tue, 13 Jul 2010 22:36:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27013</guid><dc:creator>AaronBertrand</dc:creator><description>&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://www.sqlservercentral.com/blogs/robert_davis/archive/2010/07/04/T_2D00_SQL-Tuesday-008-Gettin-Schooled.aspx" target="_blank"&gt;&lt;img src="http://www.sqlservercentral.com/blogs/blogs/robert_davis/ximg/TSQL2sDay150x150.jpg" border="0"&gt;&lt;/a&gt;
&lt;/td&gt;

&lt;td&gt;
&lt;p&gt;When I started my technical career, the only way to learn about programming was from books and magazines.&amp;nbsp;  I remember writing my first HTML page and finding it quite similar to the Vic20 days, where you would transcribe code for hours; when you made a mistake, that meant it was time to start over.&amp;nbsp;
The Internet was around, but it wasn't really all that useful just yet -
 there certainly was no MSDN Library, never mind blogs like this site, or interactive communities like StackOverflow and Twitter.&amp;nbsp;  Oh 
sure, Usenet has been around forever, and in fact my career change was due largely in part to a technical mailing list where folks shared solutions to problems in the realm of HTML and JavaScript.&amp;nbsp; But they pale in comparison to the thriving communities and other online resources we have today.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;br&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;
&lt;p&gt;With the Internet comes 
responsibility, however; reading something online does not make it true.&amp;nbsp; This is why I prefer communities and interactive blogs (where you get more insight than from just one "author"), over paper books or passing some certification exam.&amp;nbsp; Those things have their merits of course; while I have never taken an MS cert exam, I still have a bookshelf -- and this isn't even the whole thing -- that represents a small forest, from which I glean tidbits all the time:&amp;nbsp; &lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://sqlblog.com/files/folders/27012/download.aspx" width="600" height="198"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In fact, just last week, I had three of these books out on my desk with about 20 new dog-eared pages.&lt;/p&gt;
&lt;p&gt;I also think that a lot can be said about being in an environment where there are other smart people to bounce ideas off of.&amp;nbsp; This morning, for example, I learned a boatload of stuff (in comparison to what I 
already knew) by sitting with a co-worker for 5 minutes and going over some C# code I was re-tooling.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;But in my opinion, the interactive nature of the growing SQL Server community is where people in our corner of the technical world can learn the most.&amp;nbsp; Having the perspective of so many great minds at your disposal can be an intoxicating thing... you just have to get over the nerves of asking questions of folks like, well, you know who you are.&amp;nbsp; (I don't want this to turn into an ass-kiss-fest, but there is an unprecedented number of smart folks bending over backwards to help this community.)&amp;nbsp; And it doesn't stop online ... there are also free events like &lt;a href="http://www.sqlsaturday.com/" title="http://www.sqlsaturday.com/" target="_blank"&gt;SQL Saturdays&lt;/a&gt;, paid resources such as the &lt;a href="http://www.sqlpass.org/summit/na2010/" title="http://www.sqlpass.org/summit/na2010/" target="_blank"&gt;PASS Summit&lt;/a&gt;, and training courses that, while not free, can be worth every penny (&lt;a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2010/03/31/the-pros-and-cons-of-learning.aspx" title="http://sqlblog.com/blogs/aaron_bertrand/archive/2010/03/31/the-pros-and-cons-of-learning.aspx" target="_blank"&gt;I wrote briefly about Paul and Kimberly's course earlier this year&lt;/a&gt;).&amp;nbsp; I don't think you can say any of this about the PHP, Oracle or Flash 
communities - at least not with a straight face.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;In the end, this installation of T-SQL Tuesday has me thinking of all the ways we learn, and how impressive it has been that the way we learn has evolved so much, even in my own relatively short career.&amp;nbsp; And with the caliber of folks donating their time, energy and brainpower into making the community better, it can only be -- as Radioactive Man would say -- Up and Atom!&lt;br&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</description></item><item><title>Better Late Than Never: T-SQL Tuesday #008 - Gettin' Schooled</title><link>http://sqlblog.com/blogs/adam_machanic/archive/2010/07/12/better-late-than-never-sql-saturday-008-gettin-schooled.aspx</link><pubDate>Mon, 12 Jul 2010 16:55:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:26948</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Apologies for the late reminder; tomorrow is T-SQL Tuesday. This month's event is hosted by &lt;a href="http://www.sqlservercentral.com/blogs/robert_davis/archive/2010/07/04/T_2D00_SQL-Tuesday-008-Gettin-Schooled.aspx"&gt;Robert Davis over at SQL Server Central&lt;/a&gt; and the theme is "Gettin' Schooled." &lt;/p&gt;&lt;p&gt;How do you learn? Or how do you teach? Have you learned anything interesting recently that you'd like to share? Post about it! For full details see Robert's blog.&lt;/p&gt;&lt;p&gt;By the way, you can always find the current T-SQL Tuesday post by going to &lt;a href="http://www.tsql2sday.com"&gt;http://www.tsql2sday.com&lt;/a&gt;. Big thanks to &lt;a href="http://sqlvariant.com/wordpress/"&gt;Aaron Nelson&lt;/a&gt; for starting and maintaining that link. &lt;br&gt;&lt;/p&gt;</description></item></channel></rss>