Coding Blocks

We gather around the Festivus pole this holiday season and before we get into the Airing of Grievances, we discuss our favorite tools. No, not people. Actual tools. Srsly.

Direct download: coding-blocks-episode-21.mp3
Category:general -- posted at: 4:35pm EDT

We're Testing Your Patience...

I figured this title was appropriate considering it's been a month since our last episode.  We've all been incredibly busy so we hope you've been patient waiting and maybe, just maybe it was worth the wait!  We've crammed quite a bit into this episode which is all about testing.  Follow the more link to see the show notes for this particular episode and don't forget to click one of the share buttons there to let all your friends know about the podcast!In this episode we're primarily talking about Unit Testing.  While that's the focus of the podcast, we also touch on other types of testing so you'll get a basic understanding of the fundamental differences between the types of tests.  Just keep in mind - the testing we're talking about is writing code to test your code.  It's not someone going through and clicking on items in your UI to make sure they work.  We're talking about code testing code to preemptively find problems before they become big problems.

Fun Stuff

It's the holiday season and we would be remiss if we didn't mention our favorite games right now.

Call of Duty Advanced Warfare

Call of Duty Advanced Warfare
Call of Duty Advanced Warfare

 

Middle Earth: Shadow of Mordor

Middle Earth: Shadow of Mordor
Middle Earth: Shadow of Mordor

Vistor Pattern Re-Visited

@TrentApple and loldot both shared the ExpressionVisitor.
Click here to see an example of the ExpressionVisitor class

Mail from You

Ray wanted to try an anti-SQL database.  Ended up with db4o.  Unfortunately it looks like it may be dead.
Here's the link to db4o...
Maybe do a podcast on object to database storage.  Database mappers of various sorts.

Lewis wants us to create a list of our recommended tools.  Check back here in the future and we'll have a link to the post we create that lists out our favorite developer tools.  Everything from command line replacement tools, comparison tools, text editors, etc.
Favorite tools of 2014 Coming Soon!

Marcus wants to hear a podcast on Reactive Extensions.  We may be getting an expert on the show to speak about this stuff....

Testing

Testing in general

  • Testing as you go (you running through your app to make sure it works)
  • Automated testing (run from command line, build server, etc.)

Several types of testing (not an exhaustive list):

  • Unit testing - testing small pieces of code that have as few dependencies as possible
    • Usually fast running, smaller tests
  • Functional testing - testing how portions of an application work when hooked into its dependencies (databases, web services, etc)
  • UI testing
    • Selenium testing for web applications - fragile? difficult to maintain?
    • Record & Replay / Macro type testing
    • Take longer to run as it's stepping through an app like a user would
  • Regression testing - tests that ensure newer features haven't broken older features that should still function the way they did previously
  • Load testing - making sure a system can continue to function when put under high load
  • Performance testing - making sure your application performs up to some predetermined standard
  • Security testing - ensuring your application is as secure as possible given

Unit Testing
http://en.wikipedia.org/wiki/Unit_testing

For a single method that you want to test, you may create a dozen test methods to ensure that when you call that one method you always get your expected results.  So, speaking of unit tests, you're typically not writing ONE unit test to test an existing (or new) method, rather you're creating a number of small unit tests to be concise.

The Triple A Pattern:

  • Arrange - set up your variables
  • Act - call the method under test
  • Assert - did the method do what you expected it to do?

Why not just write functional tests as they test higher up?
http://www.jbrains.ca/permalink/not-just-slow-integration-tests-are-a-vortex-of-doom

Should the Singleton get blasted some more?!  Michael tries to defend his true love...

Unit tests should be able to run out of order - this "proves" that you don't have any bad dependencies lying around.

Testing Pyramid - Michael Cohn
http://martinfowler.com/bliki/TestPyramid.html

  • GUI Tests
  • Acceptance / Functional Tests
  • Unit Tests

Test Driven Development - TDD

Should you test first?

Why Test?

  • Fewer errors
  • Catch errors sooner
  • Living documentation?
  • Automatic regression harness
  • Forces looser coupling of code
  • SHORTER FEEDBACK LOOP - you'll find out if there's a problem quickly
  • You can AUTOMATE IT! - run on your box, on a build server, etc.

Javascript testing

Test Runners

These find your tests and runs them and tells you what succeeds and what fails, typically looking at classes that have been attributed as test classes.

.NET teseting frameworks:

Java's primary testing framework is JUnit
http://junit.org/

Why Does Testing Suck?

  • It's hard!
  • I already know it works!
  • Class / Interface / Code explosion
  • Dependencies - Injection / Mocking
  • What's your coverage?

Resources - Links to Other Things We Mention in the Show

Huge list of testing resources:
http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks

Code Complete - excellent guide on complete programming

Code Complete
Code Complete

Art of Unit Testing - Learn to unit test from the ground up

Art of Unit Testing
Art of Unit Testing

Structuring Your Unit Tests

Pluralsight - Test First Development

Pluralsight - Test First Development, Part 2

DotCover - JetBrains tool for seeing your code's test coverage

Tips of the Week

Joe found a new podcast he loves - http://www.defensivesecurity.org/

Michael loves DotCover from JetBrains - https://www.jetbrains.com/dotcover/

Allen has found his new keyboard fling, the Microsoft Sculpt Ergonomic

Microsoft Sculpt Ergonomic Keyboard
Microsoft Sculpt Ergonomic Keyboard

 

Direct download: CodingBlocks-Episode20.mp3
Category:testing -- posted at: 12:10am EDT

We’re back to the gang of four, continuing with another segment of design patterns. This time we’re talking about some of our favorite Behavioral Design Patterns: Observer, Chain of Responsibilities, Iterator patterns. Also, why the visitor pattern is weird and what it’s like to be raked over hot coals.

Direct download: coding-blocks-episode-19.mp3
Category:general -- posted at: 8:52pm EDT

We're excited about ASP.NET vNext, we might be Superman, a cute little ninja was MEAN to Allen, and we attempt to answer some questions.

Direct download: coding-blocks-episode-18.mp3
Category:general -- posted at: 11:00pm EDT

Got Any Hot Stacks?

In this episode, we have a discussion about what type of technology stack you should choose when you go to create your own project whether it be for profit or an open source type of deal.  As programmers, we often struggle with balancing our ADHD tendencies to code in every language known to man, or actually trying to accomplish something and create a finished product!  With that in mind, check out the show notes for Episode 17 to go see all the things we mentioned in the show.  

Site created by @TroyHunt to help you find out if your email has ever been compromised:
www.haveibeenpwned.com
- Hosted on Azure

The world’s greatest Azure demo
http://www.troyhunt.com/2014/03/the-worlds-greatest-azure-demo.html

Software Engineering Blogs

Instagram on Tumblr
http://instagram-engineering.tumblr.com/

Netflix Engineering Blog
http://blog.netflix.com/

High Scalability Blog
http://highscalability.com/

Best Practices for Storing Passwords:
https://crackstation.net/hashing-security.htm

Epic Scare Humor:
https://www.youtube.com/watch?v=tB8D2QZ9lA4

Today's Show - What Technology Stack to Use for Personal Development

What stacks to use when creating new software on your own…as a business or software as a service…

  • Linux - "free", fast, powerful
  • Windows - licensing costs, easier to use, familiarity
  • Xamarin - licensing costs can be prohibitive, truly cross platform for mobile
  • Azure - cloud services, relatively inexpensive for tinkering around, killer features, scalability
  • AWS - same as Azure
  • .NET - prohibitive up-front costs for IDE, plugins, etc.  Familiarity a plus (for us), nice integration with Azure, faster development times
  • PHP - hugely popular on the web - maybe you've heard of it?
  • Javascript - seems everything is headed that way in one form or another
  • NodeJS - just keeps growing in popularity - fast, free, small learning curve, ugly async nesting, all modules aren't mature
  • NoSQL - seems to be all the rage, but is it really right for you?
  • RDBMS - grandpa database...are you still relevant?

Takeaways

Programming Tips

Michael Outlaw: Delete a line in Visual Studio: SHIFT + DEL

Joe Zack: Album - Aphex Twin - Syro

Allen Underwood
SQL Server Query Hints - WITH NOLOCK, WITH ROWLOCK
Check out Episode 13 and Episode 14 for even more information about databases.

Shameless

Please do, go give us a review on iTunes or Stitcher, or wherever you consume our podcast.  We'd greatly appreciate it!

Direct download: CodingBlocks-Episode-17.mp3
Category:Software Development -- posted at: 11:46pm EDT

This week we’re following up on our episode about talking about Creational Design Patterns a few of our favorite behavioral patterns: Template. Strategy, and Null Object.

Also, pumpkin spice lattes, Mario’s pants, and a billion dollar mistake.

Direct download: coding-blocks-episode-16.mp3
Category:general -- posted at: 7:44pm EDT

This week we're discussing <a href="http://www.ndepend.com/">NDpend</a>, a static analysis tool for .NET.

 

Triage your biggest problems, Prioritize your refactoring, and CYA with real metrics and trend lines.

 

We also discuss hidden nuggets, Pintrest-envy, and we pour another one out for google reader.

Direct download: coding-blocks-episode-15.mp3
Category:Software Development -- posted at: 6:11pm EDT

Databases the SQL [see-kwuhl]

Welcome back for part 2 of the podcast about databases.  In this half, we discuss several of the things we believe that developers should know about databases.  From joins to unions, group by's and indexing, we try to touch on a lot of the items that most developers should at least be familiar with when working with database systems.  

News

Database Basics, and Maybe a TOUCH of Advanced Stuff

  • CROSS JOIN - cartesian product of two tables - every row in table 1 matched up with every row in table 2
    • Careful!  Doing this on large tables could crash your server!
  • INNER JOIN - where the only rows you get back is when the data in table 1 matches the data in table 2 on the join conditions
  • Outer Joins - LEFT OUTER, RIGHT OUTER, FULL OUTER
    • LEFT OUTER will return all records from the table on the left side of the join and any data that matches in the right table, otherwise the data in the right table will be nulled
    • RIGHT OUTER will return all records from the table on the right side of the join and any data that matches in the left table, otherwise the data in the left table will be nulled
    • FULL OUTER will return all data from both tables with the data that's common between the two tables fully filled in, otherwise, the data that's missing from each side will be nulled
  • Database Normalization
    http://en.wikipedia.org/wiki/Database_normalization
  • Checkout @SqlKris on Twitter - runs a database blog on learning SQL and very helpful in responding to questions on Twitter
    https://twitter.com/sqlkris
  • Refactoring databases can be very difficult - usually means refactoring a lot of application code, not to mention any stored procedures, views, etc that may live in the database
  • Outlaw is still 21....
  • Do you put your data interactions in a stored procedure or do you put that code in an application?
    • Pros would be that you've centralized your database "logic"
    • Where this doesn't work - if you need data from other systems and using linked servers is not an option
  • You can join tables across databases (at least in SQL Server)
  • Cardinality - one to one or one to many
  • To subtype or not to subtype a table?
    • If you decide to do this, you could have hundreds of tables and managing this through your application could be a major pain...but, the performance would be outstanding
    • If you don't do subtypes but you do the EAV route (Entity Attribute Value schema), it's easier to maintain but query performance wouldn't be as good as the subtyping
      http://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model
  • Set Operators
    • UNION - appends two recordsets together (and throws out duplicates)
    • UNION ALL - appends two recordsets together and keeps the duplicates
    • EXCEPT - returns all the rows in the first recordset unless it's in the second recordset
    • INTERSECT - returns all the rows that are common between the first recordset and the second recordset (similar to doing an INNER JOIN on every column being returned from the two tables being used)
  • Check out SQL Authority
    http://www.sqlauthority.com
  • Aggregating Data
    • Difference between a HAVING and a WHERE clause? - Interview question asked in every developer interview known to man!  :-)
    • GROUP BY - used to "group" or aggregate data based off the provided columns
      • Have to use a GROUP BY when doing an AVG (average) or a SUM or a MAX, MIN, etc.
      • Why no GROUP BY *????
    • DISTINCT or GROUP BY - can do similar things if you're trying to remove duplicate values
    • COUNT(DISTINCT...)
  • Row numbers - think paging - you want to get records between 100 and 120
    • Oracle - rownum
    • SQL Server 2005 and up - ROW_NUMBER()
    • mySQL - start drinking heavily
  • Windowed Functions in SQL Server - GLORIOUS
  • Is char...."char" as in you burnt our burgers, or is it "car" as in you drive it - PLEASE, leave your comment below!!!
  • nvarchar vs varchar - if you will EVER need to store UNICODE (international characters, etc.), then go nvarchar...if not, save the space and use varchar
  • To Guid or not to Guid?!  Why they suck as a primary key on your table (for performance)
  • Parameterized queries - USE THEM!
    OWASP in Episode 4
    https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet
  • What about SQL Developers who want to program?
    • PHP
    • Perl (similar to what database guys do with scrubbing data)
    • Javascript - simple language to learn out of the box - extremely powerful with things like NodeJS

Performance in Databases

  • Indexes
    • Clustered Indexes - stores the data sorted in the table (makes your table a clustered table)
    • Non-clustered indexes - stored outside the table but points back to the records in the main table storage
    • Can index temp tables!  Sometimes necessary
    • SQL Server 2008 (and up) - Filtered Indexes
    • Creating a ton of indexes is not always the right solution!
    • Understanding fill factors - leaving space for wiggle room on an index
    • CAN be a performance bottleneck on inserts / updates

Resources We Like

Tips of the Week

Direct download: Databases-Part-2.mp3
Category:Database -- posted at: 11:49pm EDT

All Your Database Are Belong to Us

Part one of our two part database podcast starts with choosing the RDBMS (Relational Database Management System) and what to do when you run into deficiencies in that particular database system.

First and foremost, what's with the title?!  Are these guys grammatically challenged?  If that was your first thought, then you should check out this link:
http://en.wikipedia.org/wiki/All_your_base_are_belong_to_us

Others who have been around a little while (longer than us three 21 year olds), we hope you got a kick out of the title.

Podcast News

Topics

Resources

Tips of the Week

Direct download: All_Your_Database_Are_Belong_to_Us_-_Episode_13.mp3
Category:Database -- posted at: 10:36pm EDT

"Water Cooler" episode talking about sweet sugary C# kisses, JavaScript as a first language, T-shaped developers, how to get addicted to drugs and...Where in the World is Carmen Sandiego?

Direct download: coding-blocks-episode-12.mp3
Category:general -- posted at: 7:39pm EDT

This week we're tackling the first section of seminal Design Patterns book: Creational Patterns.

 

We discuss factories of factories, "bullet hell" games, pathological liars, and Allen's lack of voice.

 

Big thanks to @rajsotweet for calling us out and getting us motivated to record!

 

Direct download: coding-blocks-episode-11.mp3
Category:Software Development -- posted at: 7:00am EDT

This week we're taking pot shots from the peanut gallery!

 

We talk about new features in C# 6. What we like, what we love...and binary literals.

 

We also struggle to define Roslyn and BONUS! poetry reading from Michael Outlaw!

Direct download: coding-blocks-episode-10.mp3
Category:Software Development -- posted at: 8:25pm EDT

You down with AOP? This week we're talking with Vlad Hrybok about his spectacular Aspect Oriented Programming Framework: Aspectacular.

 

Highlights include lots of Design Patterns, Acronyms, Buzzwords and...Duff Beer?

Direct download: coding-blocks-episode-9.mp3
Category:general -- posted at: 12:00am EDT

Q: What do developers love more than developing?

 

A: Expensive accessories!!!

 

This week we're talking about our Christmas in July lists. Dream keyboards, mouses, office furniture and tablets...oh my!

Direct download: coding-blocks-episode-8.mp3
Category:Software Development -- posted at: 8:30pm EDT

We discuss the 5 SOLID principles of writing maintainable code, with a focus on C# and .NET, Single Responsibility Principle, Open-Closed Principle, Liskov Substitution Principle, Interface Segregation Principle and Dependency Inversion.

Direct download: coding-blocks-episode-7.mp3
Category:Software Development -- posted at: 10:05pm EDT

This week we’re talking about LINQ, what’s so special about .NET, the differences IQueryable and IEnumerable, and another round of “Never Have I Ever”. Oh, and jokes!

Direct download: coding-blocks-episode-006.mp3
Category:Software Development -- posted at: 12:32am EDT

1