Coding Blocks (Software Development)

We begin to twitch as we review the first factor of Hasura’s 3factor app, Realtime GraphQL, while Allen gets distrac … SQUIRREL!, Michael might own some bell bottoms, and Joe is stuck with cobalt.

If you’re reading these notes via your podcast app, you can find this episode’s full show notes and join in on the conversation at https://www.codingblocks.net/episode115.

Sponsors

  • Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard.
  • O’Reilly Software Architecture Conference – Microservices, domain-driven design, and more. The O’Reilly Software Architecture Conference covers the skills and tools every software architect needs. Use the code BLOCKS during registration to get 20% off of most passes.
  • Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course.

Survey Says …

Would you be interested in doing a Coding Blocks Fantasy Football League?

Take the survey here: https://www.codingblocks.net/episode115.

News

  • To everyone that took a moment to leave us a review, thank you. We really appreciate it.
    • iTunes: Zj, Who farted? Not me., Markus Johansson, this jus10, siftycat, Runs-With-Scissors
    • Stitcher: wuddadid, unclescooter
  • Zach Ingbretsen gives us a Vim tutorial: RAW Vim Workshop/Tutorial (YouTube)

3factor app and the First Factor

3factor app

  • The 3factor app is a modern architecture for full stack applications, described by the folks at Hasura.
  • High feature velocity and scalability from the start:
    • Real time GraphQL
    • Reliable eventing
    • Async serverless
  • Kinda boils down to …
    • Have an API gateway (for them, GraphQL).
    • Store state in a (most likely distributed) store.
    • Have services interact with state via an event system.
  • Versus how did we used to do things using a REST API for each individual entity.
    • Let’s be honest though. We probably created a single very specialized REST API for a particular page all in the name of performance. But it was only used for that page.
  • Related technologies:
    • Web Sockets
    • Serverless
    • Lambda / Kappa – Types Streaming architectures
    • Event based architectures
    • Microservices

Factor 1 – Realtime GraphQL

Use Realtime GraphQL as the Data API Layer
  • Must be low-latency.
    • Less than 100 ms is ideal.
  • Must support subscriptions.
    • Allows the application to consume information from the GraphQL API in real-time.
Some Comparisons to Typical Backend API Calls
Traditional application 3factor application
Uses REST calls. Uses GraphQL API.
May require multiple calls to retrieve all data (customer, order, order details) – OR a complex purpose built call that will return all three in one call. Uses GraphQL query to return data needed in a single call defined by the caller.
Uses something like Swagger to generate API documentation. GraphQL will auto-generate entire schema and related documents.
For realtime you’ll set up WebSocket based APIs. Use GraphQL’s native subscriptions.
Continuously poll backend for updates. Use GraphQL’s event based subscriptions to receive updates.
Major Benefits of GraphQL
  • Massively accelerates front-end development speed because developers can get the data they want without any need to build additional APIs.
  • GraphQL APIs are strongly typed.
  • Don’t need to maintain additional documenting tools. Using a UI like GraphiQL, you can explore data by writing queries with an Intellisense like auto-complete experience.
  • Realtime built in natively.
  • Prevents over-fetching. Sorta. To the client, yes. Not necessarily so though on the server side.
A Little More About GraphQL
  • GraphQL is a Query Language for your API.
  • It isn’t tied to any particular database or storage engine.
  • It’s backed by your existing code and data.
  • Queries are all about asking for specific fields on objects.
  • The shape of your query will match the shape of the results.
  • Queries allow for traversing relationships, so you can get all the data you need in a single request.
    • Every field and nested object has its own set of arguments that can be passed.
      • Many types are supported, including enums.
  • Aliases
    • GraphQL has the ability to alias fields to return multiple results of the same type but with different return names (think of aliasing tables in a database query).
  • Fragments
    • Fragments allow you to save a set of query fields to retrieve, allowing you to later reuse those fragments in simpler queries. This allows you to create complex queries with a much smaller syntax.
    • There’s even the ability to use variables within the fragments for further queries requiring more flexibility.
  • Operations
    • Three types of operations are supported: query, mutation, and subscription.
    • Providing an operation name is not required, except for multi-operation documents, but is recommended to aid debugging and server side logging.
  • Variables
    • Queries are typically dynamic by way of variables.
    • Supported variable types are scalars, enums, and input object types.
      • Input object types must map to server defined objects.
    • Can be optional or required.
    • Default values are supported.
    • Using variables, you can shape the results of a query.
  • Mutations
    • Mutations allow for modifying data.
    • Nesting objects allows you to return data after the mutation occurs,
    • Mutations, unlike queries, run sequentially, meaning mutation1 will finish before mutation2 runs.
      • In contrast, queries run in parallel.
  • Meta fields
    • GraphQL also provides meta fields that you can use to inspect the schema that are part of the introspection system.
    • These meta fields are preceded by a double underscore, like __schema or __typename.
  • GraphQL schema language
    • Objects are the building blocks of a schema.
    • Fields are properties that are available on the object.
    • Field return types are defined as well – scalar, enum or objects.
      • Scalar types: Int, Float, String Boolean, ID (special use case), or User Defined – must specify serializer, deserializer and validator.
    • Fields can also be defined as non-nullable with an exclamation after the type like String!.
      • This can be done on array types as well after the square brackets to indicate that an array will always be returned, with zero or more elements, like [String]!.
    • Each field can have zero or more arguments and those arguments can have default values.
    • Lists are supported by using square brackets.
    • GraphQL’s type system supports interfaces.
    • Complex objects can also be passed as input types, however, they are defined as input rather than type.

Resources We Like

Tip of the Week

  • From Google’s Engineering Practices documentation: How to do a code review (GitHub.io).
    • This is part of the larger Google Engineering Practices Documentation (GitHub.io).
  • Use CTRL+SHIFT+V to access Visual Studio’s Clipboard Ring.
  • Take control of your tab usage in your browser with Workona.
  • Theme your Chrome DevTools!
Direct download: coding-blocks-episode-115.mp3
Category:Software Development -- posted at: 10:10pm EDT

We learn how to apply the concepts of The Pragmatic Programmer to teams while Michael uses his advertisement voice, Joe has a list, and Allen doesn't want anyone up in his Wheaties.

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

After 112 episodes, Michael can’t introduce the show, Allen pronounces it “ma-meee”, and don’t make Joe run your janky tests as The Pragmatic Programmer teaches us how we should use exceptions and program deliberately.

How are you reading this? If you answered via your podcast player, you can find this episode’s full show notes and join the conversation at https://www.codingblocks.net/episode113.

 

Sponsors

  • Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard.

Survey Says …

When you want to bring in a new technology or take a new approach when implementing something new or add to the tech stack, do you ...?

Take the survey here:
https://www.codingblocks.net/episode113

 

News

  • Thank you for taking a moment out of your day to leave us a review.
    • iTunes: MatteKarla, WinnerOfTheRaceCondition, michael_mancuso
    • Stitcher: rundevcycle, Canmichaelpronouncethis, WinnerOfTheRaceCondition, C_Flat_Fella, UncleBobsNephew, alexUnique
  • Autonomous ErgoChair 2 Review (YouTube)
  • Come see us Saturday, September 14, 2019 at the Atlanta Code Camp 2019 (atlantacodecamp.com)
  • Are they cakes, cookies, or biscuits? (Wikipedia)

Intentional Code

When to use Exceptions

  • In an earlier chapter, Dead Programs Tell No Lies, the book recommends:
    • Checking for every possible error.
    • Favor crashing your program over running into an inconsistent state.
  • This can get really ugly! Especially if you believe in the “one return at the bottom” methodology for your methods.
  • You can accomplish the same thing by just catching an exception for a block of code, and throwing your own with additional information.
  • This is nice, but it brings up the question? When should you return a failed status, and when should you throw an exception?
  • Do you tend to throw more exceptions in one layer more than another, such as throwing more in your C# layer than your JS layer?
  • The authors advise throwing exceptions for unexpected events.
  • Ask yourself, will the code still work if I remove the exception handlers? If you answered “no”, then maybe your throwing exceptions for non-exceptional circumstances.
Tip 34
  • Use exceptions for exceptional problems

Exceptions vs Error Handling

  • Should you throw an exception if you try to open a file, and it doesn’t exist?
    • If it should be there, i.e. a config, yes, throw the exception.
    • If it might be OK for it not to be there, i.e. you’re polling for a file to be created, then no, you should handle the error condition.
  • Is it dangerous to rely on implicit exception throwing, i.e. opening a file that isn’t there?
    • On the one hand, it’s cleaner without checking for the exceptions, but there’s no signaling to your co-coders that you did this intentionally.
    • Exceptions are a kind of coupling because they break the normal input/output contract.
  • Some languages / frameworks allow you to register error handlers that are outside the flow of the normal problem.
    • This is great for certain types of problems, like serialization problems, particularly when there is a prescribed flow, such as error pages, serialization, or SSL errors.

Programming by Coincidence

  • What does it mean to “program by coincidence”?
    • Getting lured into a false sense of security and then getting hit by what you were trying to avoid.
  • Avoid programming by coincidence and instead program deliberately. Don’t rely on being lucky.
  • Writing code and seeing that it works without fully understanding why is how you program by coincidence.
    • This really becomes a problem when something goes wrong and you can’t figure out why because you never knew why it worked to start off with.
  • We may not be innocent …
    • What if you write code that adheres to some other code that was done in error … if that code is eventually fixed, your own code may fail.
  • So if it’s working, why would you touch it?
    • It might not actually be working …
      • Maybe it doesn’t work with a different resolution.
      • Undocumented code might change, thus changing your “luck”.
      • Unnecessary method calls slow down the code.
      • Those extra calls increase the risk of bugs.
  • Write code that others implement with well documented code that adheres to a contract.

Accidents of Context

  • You can also make the mistake that you assume certain things are a given, such as that there’s a UI or that there’s a given language.

Implicit Assumptions

  • Don’t assume something, prove it.
  • Assumptions that aren’t based on fact become a major sticking point in many cases.
Tip 44
  • Don’t Program by Coincidence

How to Program Deliberately

  • Always be aware of what you’re doing.
  • Don’t code blindfolded, Make sure you understand what you’re programming in, both business domain related and programming language.
  • Code from a plan.
  • Rely on reliable things. Don’t code based on assumptions.
  • Document assumptions.
  • Test your code _and_ your assumptions.
  • Prioritize and spend time on the most important aspects first.
  • Don’t let old code dictate new code. Be prepared to refactor if necessary.

Resources We Like

  • The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)
  • The Pragmatic Bookshelf (pragprog.com)
  • Oh mother… | Family Feud (YouTube)
    • OMG! It’s here! Oh mother… the ON-AIR VERSION!!! | Family Feud (YouTube)
  • Thunder Talks (episode 87)
  • Spotify engineering culture (part 1) (labs.spotify.com)

Tip of the Week

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

We continue our dive into The Pragmatic Programmer and debate when is it text manipulation vs code generation as Joe can’t read his bill, Michael makes a painful recommendation, and Allen’s gaming lives up to Southern expectations.

In case you’re reading these show notes via your podcast player, you can find this episode’s full show notes at https://www.codingblocks.net/episode112 and join in on the conversation.

Sponsors

  • Clubhouse – The first project management platform for software development that brings everyone on every team together to build better products. Sign up for two free months of Clubhouse by visiting clubhouse.io/codingblocks.
  • Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard.

Survey Says …

What native language are you most interested in?

Take the survey here:
https://www.codingblocks.net/episode112

News

  • We really appreciate every review we get. Thank you for taking the time.
    • iTunes: AsIRoseOneMorn, MrBramme, MP7373, tbone189, BernieF1982, Davidwrpayne, mldennison
    • Stitcher: Ben T, moreginger, Tomski, Java Joe

Blurring the Text Manipulation Line

Text Manipulation

  • Programmers manipulate text the same way woodworkers shape wood.
    • Text manipulation tools are like routers: noisy, messy, brutish.
  • You can use text manipulation tools to trim the data into shape.
    • Once you master them, they can provide an impressive amount of finesse.
  • Alternative is to build a more polished tool, check it in, test it, etc.
Tip 28
  • Learn a Text Manipulation Language.

Code Generators

  • When you have a repetitive task, why not generate it?
  • The generated code takes away complexity and reduces errors.
  • And it’s reuse has little to no additional cost.
Tip 29
  • Write Code That Writes Code.

There are two types of code generators:

  1. Passive code generators are run once (scaffolding).
  2. Active code generators are used each time they are required.

Passive code generators save typing by automating…

  • New files from a template, i.e. the “File -> New” experience.
  • One off conversions (one language to another).
    • These don’t need to be completely perfect.
  • Producing lookup tables and other resources that are expensive to compute.
  • Full-fledged source file.

You get to pick how accurate you want the generators to be. Maybe it writes 80% of the code for you and you do the rest by hand.

Active code generators

  • Active code generators are necessary if you want to adhere to the DRY principle.
    • This form is not considered duplication because it’s generated as needed by taking a single representation and converting it to all of the forms you need.
  • Great for system boundaries (think databases or web services).
  • Great for keeping things in sync.
  • Recommend creating your own parser.

Why generate when you can just … program?

  • Scaffolding, so it’s a starting off point that you edit.
  • Performance.
  • System boundaries.
  • Some uses work best when built into your build pipeline.
    • Think about automatically generating code to match your DB at compile time, like a T4 generator for Entity Framework.
  • It’s often easier to express the code to be generated in a language neutral representation so that it can be output in multiple languages.
    • Something like System.CodeDom comes to mind.
  • These generators don’t need to be complex.
  • And the output doesn’t always need to be code. It could be XML, JSON, etc.

Resources We Like

Tip of the Week

  • Within Visual Studio Code, after you use CTRL+F to find some text in your current document, you can take it a step further by pressing ALT+ENTER to enter into block selection/edit mode.
  • Turn learning Vi into a game with VIM Adventures. (vim-adventures.com)
  • Never confuse forward Slash with back Slash again.
Direct download: coding-blocks-episode-112.mp3
Category:Software Development -- posted at: 8:01pm EDT

It's about time we finally learn how to debug by taking take a page from The Pragmatic Programmer playbook, while Michael replaces a developer's cheat sheet, Joe judges the H-O-R-S-E competition for VI, and Allen stabs you in the front.

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

We dig into the details of the basic tools while continuing our journey into The Pragmatic Programmer while Joe programs by coincidence, Michael can't pronounce numbers, and Allen makes a point.

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

Joe is distracted by all of the announcements from E3, Allen is on the run from the Feebs, and Michael counts debugging as coding. All this and more as we continue discussing The Pragmatic Programmer.

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

The Pragmatic Programmer teaches us how to use tracer bullets versus prototyping while Joe doesn't know who won the Game of Thrones, Allen thought he knew about road numbers, and Michael thinks 475 is four letters.

Direct download: coding-blocks-episode-108.mp3
Category:Software Development -- posted at: 9:24pm EDT

The dad jokes are back as we learn about orthogonal code while JZ (the 8-mile guy) has spaghetti on him, Michael's Harry Potter references fail, and Allen voice goes up a couple octaves.

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

We take a deep dive into the various forms of duplication and jump aboard the complain train as Allen complains about Confluent's documentation, Michael complains about Docker's documentation, and Joe complains about curl.

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

We begin our journey into the wisdom of The Pragmatic Programmer, which as Joe puts it, it's less about type-y type-y and more about think-y think-y, while Allen is not quite as pessimistic as Joe, and Michael can't wait to say his smart words.

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

We dig into the nitty gritty details of what a Progressive Web App (PWA) is and why you should care, while Allen isn't sure if he is recording, Michael was the only one prepared to talk about Flo and the Progressive Price Gun, and Joe has to get his headphones.

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

The Date deep dive continues as we focus in on C# and JavaScript, while Michael reminisces about the fluorescent crayons, Joe needs a new tip of the week, and Allen confuses time zones.

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

We take a deep dive into understanding why all Date-s are not created equal while learning that Joe is not a fan of months, King Kong has nothing on Allen, and Michael still uses GETDATE. Oops.

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

After being asked to quiet down, our friend, John Stone, joins us again as we move the conversation to the nearest cubicle while Michael reminds us of Bing, Joe regrets getting a cellphone, and Allen's accent might surprise you.

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

We gather around the water cooler to celebrate our 100th episode with our friend John Stone for some random developer discussions as Michael goes off script, Joe needs his techno while coding, and Allen sings some sweet sounds.

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

We learn all about JAMstack in real-time as Michael lowers the bar with new jokes, Allen submits a pull request, and Joe still owes us a tattoo.

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

We dig into heaps and tries as Allen gives us an up to date movie review while Joe and Michael compare how the bands measure up.

Direct download: coding-blocks-episode-98.mp3
Category:Software Development -- posted at: 1:16am EDT

We ring in 2019 with a discussion of various trees as Allen questions when should you abstract while Michael and Joe introduce us to the Groot Tree.

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

Just in time to help you spread some cheer this holiday season, the dad jokes are back as we dig into the details of hash tables and dictionaries.

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

We continue our deep dive into data structures, this time focusing in on arrays and array-like types as Allen gives Shania Twain some singing competition, Joe is going to owe us another tattoo, and wait ... when does Michael think C++ was invented?

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

We begin our journey into data structures by taking a deep dive into primitives while Allen makes Michael blush and Joe crashes his browser.

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

With the holiday season soon approaching, we address the most important requirements list of all ... our wish lists as Joe has to disclose a cheese powder incident, Michael hopes his Bitcoin gains some value, and Allen researches his purchases to the extreme.

Direct download: coding-blocks-episode-93.mp3
Category:Software Development -- posted at: 9:43pm EDT

This is a special collaboration featuring John Calloway of The Six Figure Developer and our own Allen Underwood. The episode was recorded out at Microsoft Ignite 2018, and features talk about the future of cloudy infrastructures with a particular focus on Azure Functions and Azure Cosmos DB.

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

We continue our dive into how to learn things while Michael's voice sounds an awful lot like Joe's, Joe says it's a square, and Allen says it's as triangle ... oh, and Google Feud is back!

Direct download: coding-blocks-episode-91.mp3
Category:Software Development -- posted at: 9:14pm EDT

We have some fun with our names, get ahead of ourselves during Survey Says, and vet Michael's tip on-air as we take a deep dive into comparing some popular Git workflows and when should we use which.

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

We wrap up our conversation on complexity and play some more over/under as Allen thinks learning is backwards, Michael doesn't write clean code, and Joe brings his dog to the discussion.

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

We continue our dive into Rob Conery's The Imposter's Handbook as Allen is Allen, Joe is Michael, Michael is Joe.

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

Joe's voice sounds funny, Allen has a theme, and Michael pours one out for Media Play as Michael's and Allen's impersonation of Joe is on point (#NailedIt).

Direct download: coding-blocks-episode-87.mp3
Category:Software Development -- posted at: 9:50pm EDT

We meet up around the water cooler for a quick round of lightning talks as Allen and Michael sing FizzBuzz while Joe passes the caching buck.

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

We continue digging into Rob Conery's The Imposter's Handbook as Joe explains Florida time, Allen likes greedy algorithms, and Michael shares his geography knowledge.

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

It's time we discuss algorithms we all need to know as we continue diving into Rob Conery's The Imposter's Handbook while Michael will read anything, Allen questions Greenland's name, and Joe talks wormholes.

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

We're talking databases, indexes, search engines, and why they're basically microwaves in this episode while Joe wears a polo, Allen's quick brown fox jumps over whatever, and Michael gives out fake URLs.

Direct download: coding-blocks-episode-83.mp3
Category:Software Development -- posted at: 9:20pm EDT

Inspired by Rob Conery's The Imposter's Handbook, we take an introspective look at ourselves to find two weaknesses and one strength while Allen shows off his vocal prowess in song, Joe needs a list, and Michael is a dash.

Direct download: coding-blocks-episode-82.mp3
Category:Software Development -- posted at: 1:49pm EDT

This episode we talk complexity theory while digging into Rob Conery's The Imposter's Handbook as Allen channels his inner Austin Powers, Michael finds linearly to complex to pronounce, and Joe ruins Batman for the rest of us.

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

This episode we're talking about server naming conventions, confusing command line arguments, and how high we can get our voices. Huge thanks to the NSA and the freedom of information act for making this episode possible.

Direct download: codingblocks-episode-080.mp3
Category:Software Development -- posted at: 10:07pm EDT

This week we're talking about some software anti-patterns, and the kinds of maintenance problems that arise from them. There are some anti-patterns we're very familiar with, and some we aren't so familiar with.

Direct download: codingblocks-episode-079-64.mp3
Category:Software Development -- posted at: 8:00pm EDT

It's time for more cowbell as we have a special guest in the studio, Will Madison (@IAmWillMadison), join us as Allen finally gets tripped up trying to pronounce a name, Joe teaches us the value of practice, and Michael evacuates in a rainbow colored straight line.

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

We're back with our last deep dive into Robert C. Martin's latest book, Clean Architecture, while Allen suffers from sleep deprivation, Joe shows us his dance moves, and Michael's mind is blown on how to unit test.

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

It's time for another deep dive into Robert C. Martin's Clean Architecture as Joe puts us on the spot, Allen has a new mission, and Michael shares his Easter eggs.

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

Michael can't tell higher from lower, Allen puts his views where he wants them, and Joe snaps it to a Slim Jim as we discuss how to make our architectures scream while discussing Robert C. Martin's Clean Architecture.

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

It's time for another deep dive into Robert C. Martin's Clean Architecture as Allen warns us about driving in front of him, Joe tries to describe a diagram again, and Michael can't understand the survey results.

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

Joe drinks too much coffee, Allen spits his coffee out, and Michael feels vindicated as the discussions about Robert C. Martin's latest book, Clean Architecture, continues.

Direct download: coding-blocks-episode-73.mp3
Category:Software Development -- posted at: 9:59pm EDT

Joe baits Michael, Michael takes the bait, and Allen lets it happen, as Uncle Bob explains how we can quantify the coupling between our components from his latest book, Clean Architecture.

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

Joe is down with OCP, Michael argues DRY, and Allen deletes our show notes as we dig into Components and Component Cohesion from Robert C. Martin's (aka Uncle Bob) Clean Architecture.

Direct download: coding-blocks-episode-71.mp3
Category:Software Development -- posted at: 9:40pm EDT

We're back with another installment as we challenge ourselves to compare how we'd each spend $2,500 on developer gear as Allen waxes on about the loudest quiet keyboard, Joe teaches us how cheese is made, and Michael puts some neon on his computer.

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

Michael forgets what his favorite part of the show is, Joe makes us wait to learn what his favorite part is, and Allen pronounces it "pair-a-dig-'ems" as we continue our deep dive into Uncle Bob's latest book: Clean Architecture.

Direct download: coding-blocks-episode-69.mp3
Category:Software Development -- posted at: 9:50pm EDT

Joe learns of our harebrained idea, Michael learns of Eisenhower's matrix, and Allen explains polyfills as we begin our dive into Uncle Bob's latest book, Clean Architecture.

Direct download: coding-blocks-episode-68.mp3
Category:Software Development -- posted at: 9:33pm EDT

Allen brings the dad jokes, Michael unplugs, and Joe gets a second wind as we discuss the anti-patterns found in object oriented programming.

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

It's time for another episode as Joe wants to choke a developer, Michael scraps his new social networking platform, and Allen finally learns of dad jokes while we continuing the anti-pattern conversation.

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

We've discussed design patterns too much. Now it's time for some discussion about anti-patterns as Joe has dark visions about robots, Allen has to take sensitivity training, and Michael picks Arial.

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

More Domain Driven Design talk this week: Supple Design, Declarative(ish?) Programming, and Ohio Envy.

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

Know what Joe and Waldo have in common? We can't find either, as this week, it's just Allen and Michael to continue the dive into Domain Driven Design.

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

We're not saying that Michael is Carmen Sandiego. We're just saying that nobody has ever seen them in a room together. And this week, we don't know where in the world either are, as Allen and Joe continue the Domain Driven Design discussion without Michael. Nor Carmen.

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

Stitcher is back and so are we as Michael proves he doesn't have a career as a rapper, Allen can't type on his phone, and Joe tweets with famous authors as we continue our dive into Domain Driven Design talking about aggregate roots, factories, and repositories.

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

We continue our Domain Driven Design conversation this week as Allen is indecisive, Michael decides for him, and Joe can't handle the night life.

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

We're back with another exciting episode as Michael questions Hollywood, Allen dreams of his Hackintosh, and Joe is surrounded by Star Wars as we talk about how to jumpstart your next app with Michael Crump (@mbcrump) and Clint Rutkas (@clintrutkas).

Direct download: coding-blocks-episode-59.mp3
Category:Software Development -- posted at: 1:39pm EDT

This week, Michael asks his customers about their anemic domain model, Allen talks in front of people, and Joe plays Rocket League as we begin our dive into understanding domain driven design.

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

This week we talk about all of the bad things we've done while making software. The good, the bad, ... oh wait, it compiles, never mind.

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

We're back with another deep dive into the infamous book Clean Code by Uncle Bob as Joe alters columns, Michael misreads things, and Allen has a positive customer service experience.

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

This week Allen is troubled by circles, Michael talks like a game show host, and Joe announces it's twins as we continue our deep dive into the classic Clean Code book by Robert C. Martin.

Direct download: coding-blocks-episode-55.mp3
Category:Software Development -- posted at: 4:58pm EDT

When and why should you write unit tests, and just how important are they? Take a listen and see what YOU think.

For the full show notes visit:
http://www.codingblocks.net/episode54

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

This week, we continue our Clean Code discussion as we dive into the joys and pains of error handing.

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

This week, Michael fails geography, Allen introduces us to Croom, and Joe has to potty as we head into our third installment of the Clean Code series.

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

Storing smaller subsets of data in a faster, closer memory can make astronomical differences in performance. This episode we're talking about the caching tools and techniques that application frameworks provide.

The original version of the shownotes can be found at:
http://www.codingblocks.net/episode46

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

Are you an Advanced Programmer? We dig into the final section of Robert Read’s fantastic writing: How to be a programmer. Also, how to cheat at Jira, a lazy butcher and if learning web development is worth it.

Link to Episode 40’s Full Show Notes
http://www.codingblocks.net/episode40

Direct download: coding-blocks-episode-040.mp3
Category:Software Development -- posted at: 9:33pm EDT

The Twelve-Factor App: Backing Services, Building and Releasing, Stateless Processes

 

Surveys – Wow we forget about them and ramble...sorry guys!

 

Mark Tinsley – PHP Composer – thanks for the tip!
https://getcomposer.org/

 

Joe made a game in Javascript (using dozens of libraries):

Box Pusher! (game name of the year)
https://github.com/THEjoezack/BoxPusher

 

Allen's cry for writing black-boxed, encapsulated code...
Episode on Encapsulation: http://www.codingblocks.net/episode23

Episode on SOLID Design: http://www.codingblocks.net/episode7

 

Probably want to listen to the first three parts of the 12 Factor App if you missed it:

http://www.codingblocks.net/episode32


IV. Backing Services

  • Any resource consumed over the network: databases, mail servers, cloud services, etc.

  • Anything external to your app (but could be local to your environment)

  • Should not have to change any code to redeploy – should be config changes if anything

  • Clearly Tech – Importance Rating: High

 

We've mentioned Splunk, and if you're not familiar, it's an enterprise piece of software that will aggregate logs from multiple sources (servers, computers, etc):
http://www.splunk.com/en_us/products/splunk-enterprise.html

 

Bug in Visual Studio that cost one person $6,500 in a few hours:

https://www.humankode.com/security/how-a-bug-in-visual-studio-2015-exposed-my-source-code-on-github-and-cost-me-6500-in-a-few-hours

 

V. Build, Release, Run

  • Build stage – transform which converts the code repo into an executable bundle

  • Release stage – combines the build with the required config and deposits it somewhere

  • Run – runs the app in the execution environment (development, staging, production, other)

  • Rolling back may be more complicated when you start talking about database schemas / data changes

  • Clearly Tech – Importance Rating: Conceptual???

 

Version numbers? What do you prefer? Version numbers with major and minor revisions? Or do you prefer timestamps?

 

 

VI. Processes

  • Stateless and Share Nothing

    • No local session

    • Make sure saving files go to an available repository

  • Clearly Tech – Importance Rating: High (Joe wants higher than high)

 

Resources We Like

Tips

 

Allen: Find problematic queries that are killing your SQL Server...replace 123 with the spid from sp_who2.

 

sp_who2 'active'

DBCC INPUTBUFFER(123)

 

If you want to be mean....replace 123 with the spid from sp_who2

KILL 123

 

Additionally, if there's high CPU and low I/O, it's likely either a missing or a fragmented index.

 

Joe: Tortoise Git

https://tortoisegit.org/

 

Mike: Tip of the week is the Pseudocode podcast
http://pseudocode.fm/

 

And...don't be lazy. We can't seem to get off our tails and get a business card made!

 

 


The Twelve-Factor App: Codebase, Dependencies, and Config

Dipping our toes into the DevOps waters with the Twelve-Factor App. How important is depedency management, and how fired would you be if you accidently leaked your company's source code?

Direct download: coding-blocks-episode-32.mp3
Category:Software Development -- posted at: 1:19pm 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 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

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

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

We Still Don't Understand Open Source Licensing

This week we're trying to wrap our heads around open source software licensing. We discuss the main types of licenses (and a few of our favorites!), what it means to violate a license, and take a fun look at a few weird questions.

Download the episode on iTunes or Stitcher and make sure to send us your feedback.

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

In Defense of Boxing/Unboxing

1. Boxed values take up more memory.

A boxed value resides in the heap. That means that we need a pointer (32b or 64b) from the stack to our reference-type in the heap as a well as a sync block index(32b).

This means a boxed int32 now takes up between 92b or 128b.

3-4 times the space!

Ouch!

 

2. Boxed values require an additional read

Values on the stack are right there. Stick and move, stick and move!

To fetch a boxed value you must first get the pointer, then look up the object.

This means boxed values are slower, in addition to being larger.

Stick and move, stick and move!

 

3. Short-lived values clog the heap

When an item is popped of the stack. It's gone. Gone Daddy Gone.

In contrast, unused boxed values pile up in the heap until the garbage collector decides to do something about it.

[caption id="attachment_290" align="aligncenter" width="317"]It adds up... It adds up...[/caption]

 

4. Boxing and unboxing operations takes time/cpu

Boxing requires allocating space in the heap and copying the value from the stack.

Unboxing is cheaper since you just need to get the address of the fields inside the boxed instance and you can skip the allocation, but you usually end up copying the value data from the heap back to the stack if you want to use it.

According to MSDN: "[Boxing] can take up to 20 times longer than a simple reference assignment. When unboxing, the casting process can take four times as long as an assignment."

 

5. Casting

Casting isn't free, but it's generally considered to be in the "Don't worry about it" category of performance hits. Use a profiler people!

The real problem with casting is that you get no compile type safety checks. Check ahead or be smote by InvalidCastExceptions.

 

6. Implicit Boxing

Okay, so boxing/unboxing is big, slow, and ugly...but it's also sneaky!

Consider the following code:

 var collection = new ArrayList(); for(var i = 99; i > 0; i--) {   collection.Add(i); } 

It looks innocuous enough, but that "Add" function ends up performing 99 box operations.

Here's the relevant IL:

   IL_0000:  newobj     instance void [mscorlib]System.Collections.ArrayList::.ctor()   IL_0005:  stloc.0   IL_0006:  ldc.i4.s   99   IL_0008:  stloc.1   IL_0009:  br.s       IL_001c   IL_000b:  ldloc.0   IL_000c:  ldloc.1   IL_000d:  box        [mscorlib]System.Int32   IL_0012:  callvirt   instance int32 [mscorlib]System.Collections.ArrayList::Add(object)   IL_0017:  pop   IL_0018:  ldloc.1   IL_0019:  ldc.i4.1   IL_001a:  sub   IL_001b:  stloc.1   IL_001c:  ldloc.1   IL_001d:  ldc.i4.0   IL_001e:  bgt.s      IL_000b 

This is one of the reasons why using an ArrayList will get your wrist slapped in a code review.

 

7. They're (almost) unnecessary!

Most discussions on boxing/unboxing in .Net focus on old skool data structures like ArrayList and HashTable.

These objects were the de facto (and de jour!) collections before .NET 2 came along and saved us all with generic collections like List and Dictionary.

And it was good!

Straight from the horses msdn: "Generics allow you to define type-safe classes without compromising type safety, performance, or productivity."

We get all the benefits of the ArrayList and HashTable collections without having to box or unbox.

if you’re living in a post 1.1 world then there just isn’t much reason to put up with boxing and unboxing anymore

But about that almost...

In Defense of Boxing and Unboxing

7 deadly sins aside, there are some good reasons that boxing/unboxing are still around.

This is what we came up with, with a little hint-tweet from @jonskeet.

1. Legacy Code

Pre .NET 2.0 you're stuck with ArrayList and HashTables, unless you want to roll/download something custom. Box away.

2. 3rd Party Library

If their function takes an object, you end up passing a reference type. No use sulking about it.

3. .NET internals

.Net notably makes use of boxing and unboxing with the dynamic keyword, and reflection would be pretty tough without boxing. :)

That said, these things are typically used for productivity over performance.

4. Mixed value/refernces type Collections

The Console.WriteLine overload that takes a string and Object params is a great example. The params let you pass an arbitrary number of arguments that are used to populate values in your string.

These params could be of value or reference type, so you're stuck with their common ancestor System.Object which ends up boxing the value types.

However, I have yet to see an application whose biggest performance bottleneck is writing to stdout.

Conclusion

M$FT did a great job designing C#, and they've done an even better job maintaining it. Between the generic collections added in .NET 2 and the ToString() trick I have a hard time getting behind this big, slow, and ugly contender but it still has it's places.

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

Interfaces are a powerful piece of object oriented programming that is often overlooked.  In this, the very first episode of Coding Blocks the Podcast, we discuss many of the things you should know about interfaces.

To help follow along with the podcast, here are some code snippets to explain some of the conversation.  In regards to Joe's statement about interfaces being like guard rails on a highway, putting some code snippets in here should give some context and greater understanding.

Full show notes here:
https://www.codingblocks.net/episode1

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

1