Michael Outlaw Podcast Image

Michael Outlaw

Michael Outlaw is a software developer and co-host of Coding Blocks Podcast.

Appearances

Add Appearances
Recent episodes featuring Michael Outlaw
The Pragmatic Programmer – Know Thy Tools
Episode of
Coding Blocks
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. Hey, are you reading these show notes via your podcast player? When you get back to your desk, you can find this episode’s full show notes at https://www.codingblocks.net/episode110 and be a part of 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 … Anonymous VoteSign in with WordpressWhat&#39;s your structured text format of choice?XMLJSONYAMLCSVvote News Thank you to everyone that left us a review: iTunes: BreakpointWontBeHit, SymphonicPictures Stitcher: arnonAllen created a Spotify playlist based on the responses to our last contest.Joe will be giving his Intro to the JAMstack talk at the Daytona Devs meetup later this month. (Meetup) Back to Basics Tools can amplify your talent.can because you need to know how to use them to their full capabilities to the best of your abilities.Expect to add new tools to your toolbox regularly.And be on the lookout for better ways of accomplishing tasks.Like a craftsman, you should mold your tools to work best for you over time.Don’t fall victim to adopting only one power tool, such as an IDE.Be capable and comfortable beyond the limits of your IDE. For example, use Visual Studio? Know how to use msbuild.exe and/or dotnet.exe to accomplish similar build tasks that you can do in Visual Studio.This will be a huge benefit when you want to script those builds for your build server. The Power of Plain Text The best way to store knowledge is plain text.What is plain text? Printable characters that can be read and understood directly by a person.Consider Input245 = 46ab. While is this human readable, it is not understandable by a person.This doesn’t mean that it can’t be unstructured though. The authors cite XML, SGML, and HTML as valid examples, but today we’d include JSON. Tip Keep Knowledge in Plain Text Drawbacks to storing data as plain text:Can take more storage.Can be more CPU intensive to process.Don’t worry that by putting metadata in plain text you’re exposing it to the system’s users.Even if you were, that might not be the worst thing.But, just because binary formats might obscure the data, don’t mistake obscurity for security.Benefits of using plain text:Insurance against obsolescence.Data that is human readable and self-describing will outlive all other forms and the applications that created it.The key here is the self-describing though.Keeping a binary file rather than text file also means you’d have to understand all the intimate details of the format to parse the file, whereas with text, chances of parsing it are much higher.A string like AMZN8882804331 doesn’t really help make those numbers jump out as a phone number.But a string like <phone>888-280-4331</phone> is much easier for the human eye to scan and understand.That’s the difference between human readable and human understandable.Leverage – just about every tool out there can operate on plain text.Most Linux tools are built around shell scripts that are mostly human readable as an example.If you use plain text to drive your tests, adding/updating/modifying tests becomes trivial.The advantages of using plain text as your standard across heterogeneous environments can outweigh all of the drawbacks.Look at how popular JSON is for exactly that.Communicating with a common standard is a must, and for the most part, plain text is the standard. Shell Games If you do all of your work using UIs, you’re not taking full advantage of the capabilities of your system.The advantage of UIs is that they are WYSIWYG.But the drawback is that what you see is all that you get.Even if the GUI is amazing, there are still some things you just can’t do in them such as creating pipelines by chaining commands together.Pragmatic programmers don’t just write code, write documentation, or automate the build. We do all of it.Any one tool’s scope is usually limited to how it was expected to be used.For example, notepad.exe isn’t expected to be used to write code. You can. But it isn’t expected.Learn the shell.The commands may seem obscure or terse in the beginning.But they are powerful and concise.And knowing them can make you far more efficient.Imagine if you only knew how to use Git via a UI available only on Windows. What happens when you need to work on Linux?Understanding shell commands allows you to create powerful scripts to automate common tasks Tip Use the Power of Command Shells If you learn the shell, you’ll be more productive.Using the shell is all about keeping your ten fingers actively executing the commands you’re thinking, rather than one hand clicking on a button.As a side benefit, you’ll feel like some sort of wizard Resources We Like The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)The Pragmatic Bookshelf (pragprog.com) Is a GUID unique 100% of the time? (Stack Overflow)Universally unique identifier (Wikipedia)Birthday problem (Wikipedia)The Incredible Growth of Python (Stack Overflow)NERDTree for Vim (GitHub) Tip of the Week Discover your favorite programming font. (app.programmingfonts.org)Find the CliffsNotes, err, cheat sheet for your favorite editor. (Cheatography)If the Udemy course you want to take isn’t on sale, search for a discount.Never have to remember how to type your favorite emojis again. (˼●̙̂ ̟ ̟̎ ̟ ̘●̂˻) (Emojicons)Breach – A new podcast investigating history’s most notorious data breaches.
The Pragmatic Programmer – How to Estimate
Episode of
Coding Blocks
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. So there you are using your podcast player to read these notes. But what happens when you get to your computer? Head over to https://www.codingblocks.net/episode109 to find this episode’s full show notes and join in on the conversation. Sponsors Discover.bot – a digital space for bot developers and enthusiasts of all skill levels to learn from one another, share stories, and move the bot conversation forward. Want to learn more about building bots? Get started with their Guide to Bot Building Frameworks.Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. 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. Survey Says … Anonymous VoteSign in with WordpressHow much data do you use per month for your home ISP?Less than 250GB.Less than 500GB.Less than 1TB.No idea, unlimited plan bro.You&#39;d have to ask my neighbor.vote News Thank you, thank you, thank you for taking the time to leave us a review: iTunes: binarycode86, Lio W, rbleattler, xXJesusXFreakXx, techno-logic Stitcher: plogen, dirty_matlab, Grandpappy, plogen12, DamiaoDiasBe sure to see Allen speaking at the Atlanta Intelligent Devices meetup on June 24th where he’ll be giving his talk Moving from Batches to Real Time with Apache Kafka. (Meetup) The Other DSL and Estimating Domain Specific Languages Computer languages influence how you think about a problem,Designing a solution in F# will be different than C# and will be different from Go. Tip Program closer to the problem domain Using a domain language allows for common communication amongst members of various teams in an understandable way.This sounds like the ubiquitous language discussed in the book Domain Driven Design – Tackling Complexity in the Heart of Software by Eric Evans (Amazon).Listen to our discussion of that book in the following episodes:58. Why Domain Driven Design60. Software Architecture – The Domain in Domain Driven Design61. Software Architecture – Aggregate Roots, Factories, and Repositories62. Software Architecture – Strategic Design and Domain Events63. Software Architecture – Explicit Constraints, Processes, Specification Pattern and more64. Software Architecture – What is Supple Design?Write code in the vocabulary of the application domain.This language doesn’t need to be executable. By focusing on the higher level abstraction, you can concentrate on the domain problems and ignore the implementation details. Writing in a mini-language:This could be using a tool that interacts with existing applications as if you were a user on the system.This could be in the form of meta programming.Create metadata that you then use to dynamically generate the required API’s and UI’s.This can simplify maintenance on an application as all your code is generated for you.This comes at a cost though because it can make it harder to extend and possibly even maintain over time by using these mini-languages. Estimating The process of estimating forces you to know more about your programs.It makes you understand which pieces need optimizing and which pieces can be left alone. Tip Estimate to avoid surprises When is Your Estimate Accurate Enough? Know the context. Does the estimate need high accuracy or a ballpark figure?Units are important. The more accurate the unit, the more accurate the recipient of the estimate will assume it to be.90 days will likely mean 90 days in the mind of the recipient.3 months will likely mean, somewhere around 3-4 monthsThe authors recommend to estimate in days for up to 15 days, in weeks for up to 8 weeks, in months for up to 30 weeks, and anything over that … question if you should really be estimating?Understand what’s being asked to be estimated. You must understand the scope of the domain.Your answer can include assumptions like “Assuming we keep our db tables the way they are, this feature will take __ days”.Build a bare bones mental model. Doing so can reveal things that wouldn’t have been immediately apparent.This can also expose new answers to the original question as well as alternatives in what can be done in a given amount of time with some trade-offs.Building the model identifies inaccuracies in the estimation.Further refining the model can improve the estimation. However, going too far may not improve it much as eventually there is a point of diminishing returns.Break the model into components.Identify the parameters of these components.Identify the parameters that have the most impact on your module.Start evaluating your model by plugging in values to these parameters, and this will help you answer the estimate question.If you see strange results, that might indicate you’ve made a mistake in identifying your impactful parameters. This can be valuable information.Track your estimates and your sub-estimates as well.Evaluate how close you were to your estimations.If you miss your estimates, find out why. It’ll help future estimates. Estimating Project Schedules Estimating large development projects is difficult.The best way to get good estimates is to iterate on the same project and see how it progresses.Check requirements.Analyze risk.Design, Implement, Integrate.Validate with the usersHaving to nail down a perfect estimation at the beginning, before doing any iteration is a mistake.Why? Because it’d be a guess.As you finish an iteration, you can use that to refine your project estimates, and you continue to do this and gain confidence in the estimates over time. Tip Iterate the Schedule with the Code Most companies or management want estimates up front.Help management understand that iterating on the project schedule is in their best interest.What’s the best answer to give when asked for an estimate? “I’ll get back to you”Estimates that were not thought out will typically come back to haunt you. Resources We Like The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)The Pragmatic Bookshelf (pragprog.com) Tip of the Week Trust us when we tell you to open your favorite command shell that can execute curl. Then execute this command: curl parrot.live.Use OctoLinker to automatically add links for include, require, or import statements as you browse GitHub projects. (Chrome Web Store)Manage your pull requests within Visual Studio using the Pull Requests for Visual Studio extension. (Visual Studio Marketplace, devblogs.microsoft.com)Split your Cmder windows into 4 separate command shells (GitHub)Use CTRL + ; to search for files and methods within Visual Studio. Note that if you add _any_ uppercase letter, Visual Studio will assume that the entire string is a case sensitive search. Otherwise, if all text is lowercase, it will perform a case insensitive search.Use CTRL + SHIFT + T to navigate to a specific file by name within Visual Studio.
The Pragmatic Programmer – Tracer Bullets and Prototyping
Episode of
Coding Blocks
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. Using your podcast player to read these show notes? You can find this episode’s full show notes and be apart of the conversation at https://www.codingblocks.net/episode108. Sponsors Discover.bot – a digital space for bot developers and enthusiasts of all skill levels to learn from one another, share stories, and move the bot conversation forward. Want to learn more about building bots? Get started with their Guide to Bot Building Frameworks.Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. 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. Survey Says … Anonymous VoteSign in with WordpressDo you discuss podcasts with your friends or co-workers?Are you kidding? That&#39;s all we talk about.Absolutely. They need all of the help they can get.Absolutely. I need all of the help I can get.No. It&#39;s my secret, super power. They can&#39;t know where my tips come from.vote News As is tradition, we take a moment to thank those that took time our of their day to leave us a review:iTunes: s0dz, TheCrow2269, Aphexwolf, AshleyJWalkerStitcher: takunnithan, iwantoutlawtoreadmyname, SkywalkerIsNullDon’t miss your chance to kick Allen in the shins! Allen will be speaking June 24th at the Atlanta Intelligent Devices meetup, giving his talk Moving from Batches to Real Time with Apache Kafka. (Meetup) Ready, Aim, Fi … Wait, Gotta Recalculate Tracer Bullets There are two effective way to fire a machine gun in the dark:Have knowledge of the environment, run some calculations, and execute.Or use tracer bullets.Tracer bullets “light up” when shot.They give immediate feedback. If the tracer bullets are hitting your target, so are your other bullets.Think about how this relates to Project Management:Waterfall: Full knowledge, excellent planning, and execution, vsAgile: Shorter feedback loops and continuous adjustment. Tip Use Tracer Bullets to Find the Target, “Tracer Code” is not throwaway. It contains all of the validation, documentation, tests, etc. that production code has.Design is feedback driven.Similar to the agile movement, continuous integration, and MVP notions that are popular now, i.e. you incrementally improve.The alternative is to subdivide everything into modules, build in a vacuum and put it all together and hope it works in the end. Advantages of “Tracer Code” Users get to see things working early.\Reduces the risk of disappointment and makes the stakeholders invested in the process.Developers build a structure to work in.“The most daunting piece of paper is the one with nothing written on it.”You have an integration platform as opposed to developers working in silos and then hoping to get them working all together.Continuous Integration/DeliveryYou have something to demonstrate.You’re more in touch with progress. Tracer bullets don’t always hit the target Tracer code is designed to show you what you’re hitting. It’s okay if you miss as long as you can adjust.Tracer code starts out small, when changes are easier to make.“A small body of code has low inertia.”The business will feel more comfortable with change when they see how easily things can change. Tracer Code vs. Prototyping Prototypes are designed to explore a single aspect.Prototypes are designed to be throw away.You might prototype a landing page to see if the business users like it.Tracer code is agile, lean but complete. Prototypes and Post-it Notes Prototypes are throwaway projects designed to test out an idea, aka “proof of concept”.Typically used to test out specific aspects of an idea as well; how it looks, how it works, etc.Provides the ability to correct at a much reduced price.For example, you don’t need to build a whole car for wind tunnel testing.The prototype acts as a model, something we can use to analyze and expose risk and validate ideas for cheap.Use post-it notes to depict a workflow.Use a whiteboard to draw out GUI concepts.If you can’t give up on the details of a project, then maybe it’s not a prototype. Maybe tracer bullets are better. Pro-tip The more prototypical your project looks, the less likely it will get shoved to production. What to prototype? Anything that carries risk.ArchitectureNew functionality.Structure or contents of external data.Third-party tools or components.Performance issues.UX Tip Prototype to Learn What can you ignore? Correctness (dummy data is good).Completeness (fake or disable other components).Robustness (who needs validation?) – choosing a non-approved path may crash n’ burn (i.e. only this workflow “works”).Style (slacking on documentation/comments).The higher level the tool, the better. Saves you time. Prototyping Architecture Post-it notes work pretty well and can tell you:Are the responsibilities well defined and appropriate?Are the collaborations well-defined?Is coupling minimized?Can you identify sources of duplication?Are interface definitions and constraints acceptable?Does every module have an access path that it needs? How not to prototype Communicate the intentions of the prototype project. You don’t want your prototype code to be “released” code.Advocate for tracer bullets if you’re worried about your prototype making its way to production. Using prototypes properly can save a lot of money and time by identifying problems early in the process. Resources We Like The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)The Pragmatic Bookshelf (pragprog.com)Route number (Wikipedia)Adobe Explains It All: Photoshop (theblog.adobe.com) Tip of the Week My Top 8 Visual Studio Code Tips and Features (scotch.io) … spoiler alert, Joe’s favorite is Zen mode.The design tools you need in your toolbox:Adobe XD – Wireframe, design, prototype, and more (adobe.com)Infragistics indigo.design – Visual design, UX prototyping, and code generation/development (infragistics.com)Building a new battle station? PCPartPicker is your friend! (pcpartpicker.com)Lorem Picsum – Like lorem ipsum … but for photos! (picsum.photos)
The Pragmatic Programmer – Is Your Code Orthogonal?
Episode of
Coding Blocks
The dad jokes are back as we learn about orthogonal code from The Pragmatic Programmer while JZ (the 8-mile guy) has spaghetti on him, Michael’s Harry Potter references fail, and Allen’s voice goes up a couple octaves. Are you reading these show notes via your podcast player? You can find this episode’s full show notes and join in the conversation by going to https://www.codingblocks.net/episode107. While you’re there, be sure to checkout past episodes as well. 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.Discover.bot – a digital space for bot developers and enthusiasts of all skill levels to learn from one another, share stories, and move the bot conversation forward. Want to learn more about building bots? Get started with their Guide to Bot Building Frameworks. Survey Says … Anonymous VoteSign in with WordpressWhat is your preferred type of language to spend most of your day in?Dynamically typed languages like JavaScript or Python. I can&#39;t be bothered to compile. I catch my errors at runtime.Statically typed languages like Java, C, or C#. I&#39;d like to say that my errors are caught at compile time. But sadly not always.Functional languages like Haskell or F#. Here&#39;s a quarter kid, get a real programming language. SQL. If you&#39;re not working in sets, you&#39;re wasting your time with one-offs. vote News Thank you to everyone that left a review:iTunes: marathon57, NDIndian2019, Steeeeeevee, rholloway4, ogre14t, skmetzger, Knack of flying, vikingsfan421Stitcher: Zach Ingbretsen. LouisHendricks, OhHelpMePronounceThis, omnomynousWanna kick Allen in the shins? Opportunity is knocking.Allen will be speaking June 24th at the Atlanta Intelligent Devices meetup, giving his talk Moving from Batches to Real Time with Apache Kafka. (Meetup) Orthogonality on Orthogon Alley Geometry term: two lines are orthogonal if they meet at right angles.In software, two components are orthogonal if changes in one does not affect the other.For example, changes to a database do not affect the UI and vice versa.Nonorthogonal systems are more complex than orthogonal systems. Tip Eliminate effects between unrelated things. Benefits of Orthogonality Design components that are self-contained.SINGLE, well-defined purpose. Remember SRP (the single responsibility principle)?When components are isolated, you can change them without worrying about other components.Obviously if you change the external interface, all bets are off.A few primary benefits of writing orthogonal components:There’s a productivity boost because changes are localized, making development and testing time greatly reduced.Simple components are easier to design than complex, large components.Promotes reusability because when you have simpler, well-defined components, they can be reused easily and maybe in unexpected ways.There is a slight productivity gain when you use two orthogonal components together. Orthogonality Reduces Risk Bad code (or diseased code as the book calls it) is isolated.The system is less fragile overall.Orthogonal code promotes testability.The system might not be as tied to any vendors because your coupling is in smaller, more well defined components. Applying Orthogonality Project Teams How do you organize teams into well-defined responsibilities with little overlap? While there’s no one answer, the authors prefer to separate infrastructure from application (database, middleware, UI).Measuring team orthogonality – the more people required to make a decision, the less orthogonal the teams are divided. Design Layers are only coupled to the abstractions below it.If I change the requirements behind a particular function, how many layers would be affected? One should be the answer (although often not realistic). Toolkits and Libraries When working with 3rd party toolkits and libraries, isolate those libraries in your own code so that an update to the library shouldn’t require you to change the signature of your code or interfaces.AOP (Aspect-oriented Programming) is a great example of orthogonal code. You can implement logging throughout your application without touching your code simply by applying aspects to your classes/namespaces. Coding Every time you write code you run the risk of duplication. This requires attention to the overall picture.Keep your code decoupled. Remember the Law of Demeter.Write “shy” code, don’t expose anything that needn’t be.Object state changes should happen from the component being used, not your use of the component.Avoid global data.Sharing data globally causes problems. It is better to pass “shared data” into any component that depends on it.By passing the “shared” data around rather than actually sharing it, this will also reduce tight coupling to any particular implementation.Be careful about singletons. Don’t use them as global variables in disguise. Doing so creates tight couplings.Avoid similar functions.This usually indicates problems with the overall structure.Look into using a strategy pattern, template method pattern, or others.Be willing to refactor your code. Be purposely critical for improving orthogonality and structure. Testing Typically orthogonal systems are much easier to test because the components are much smaller and more focused.Bug fixes are a good way to identify the orthogonality of the system as well: Does a simple change fix everything, or do you have to sprinkle changes throughout the code base.Analyze trends to identify the number of files modified for each bug fix. Documentation With orthogonal documentation you should be able to change the look without changing the content. Living the Orthogonal Dream Developing orthogonal and DRY components makes for more flexible, testable, understandable, and easier to debug systems. Reversibility Engineers tend to like objective solutions to a problem, like 10 > 7.Most problems aren’t that easy though. Often the solutions we come up with aren’t binarily right or wrong.As you make decisions, you commit to a smaller target.The more critical decisions you make, the smaller the target for success becomes.As the target gets smaller, it becomes easier to miss.If you are inflexible to change, a snag with any of those decisions can be a snag for the whole project.Many things can change: requirements, pricing, new versions, etc. If you’ve fully committed to your technology choices then you can be put in a bad spot. Tip There are no final decisions. Flexible architecture You need to keep your code AND your architecture flexible.Poor encapsulation, high coupling, hard-coded logic/parameters reduce flexibility.Try to make all your decisions reversibile. Resources We Like The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)The Pragmatic Bookshelf (pragprog.com)Ask HN: What are examples of GitHub repositories with high code quality? (Hacker News)Single responsibility principle (Wikipedia)Aspect-oriented programming (Wikipedia)Law of Demeter (Wikipedia)Bug Prediction at Google (Google Engineering Tools) Me: I&#39;m so sorry, my dog ate my homeworkComp Sci Professor: your dog ate your coding assignment?Me: Prof:Me: it took him a couple bytes— Kyle (@KylePlantEmoji) April 8, 2019 Umm, what? Tip of the Week MDX Deck – Use React’s JSX inside markdown inside a presentation.Includes presenter mode, notes, and short-cuts.Dave Follett wrote a nice getting started guide: Learning MDX Deck: Getting Started (dev.to)Fortunately for us, someone printed out the various encodings to answer URL Encoding using C#. (Stack Overflow)CSS Zen Garden – See the beauty of CSS design.This one stood out, but be sure to change your window size (a few times) to see all of it’s glory: http://csszengarden.com/219/.This one bums us out: http://csszengarden.com/169.Learn Kubernetes Basics (kubernetes.io)kubectl Cheat Sheet (kubernetes.io)
The Pragmatic Programmer – The Evils of Duplication
Episode of
Coding Blocks
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. How are you reading these show notes? If you answered something similar to your podcast player, you can find this episode’s full show notes and join in the conversation at https://www.codingblocks.net/episode106. Sponsors 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.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 … Anonymous VoteSign in with WordpressWhy don&#39;t you go to conferences?Too expensive. Gotta think about that ROI.Too far. I could finish an entire Coding Blocks podcast just getting there.What about both of the above? Oh, that&#39;s this option.But I do go to conferences. Why can&#39;t I participate in the survey?vote News To everyone that left us a review, thank you:iTunes: MinimallyViablePacemaker, dude_scottStitcher: brianpFeel like kicking us in the shins? Here’s your chance:Joe will be speaking May 16th at the Orlando .NET User Group, giving his talk Introduction to JAMstack. (onetug.org)Allen will be speaking June 24th at the Atlanta Intelligent Devices meetup, giving his talk Moving from Batches to Real Time with Apache Kafka. (Meetup) The Evils of Duplication Change is constant.We spend a large part of our time in maintenance mode.Maintenance is a part of the entire process – it happens daily, even while we’re writing the initial code and get new requirements.It’s easy to duplicate knowledge: in the specifications, the code, etc.DRY Principle (Don’t Repeat Yourself).Every piece of knowledge should have a single, unambiguous representation within a system.Repeating knowledge in your code means … it’s not a question of if you’ll forget about the multiple places to maintain, it’s when.The authors make the point that DRY is one of the most important tools/principals in the book. How does duplication happen? Imposed – Programmers feel like they don’t have a choice.Inadvertent – Programmers didn’t realize they were doing it.Impatient – Laziness.Interdeveloper – Multiple people doing it and don’t realize it. Imposed Duplication Using a code generator to build code from some common set of metadata can help protect you from this form of duplication.Some examples:Documentation in code.Bad code requires a lot of documentation.A lot of documentation often becomes stale as the code changes, leading to lies!Possibly generate code from your documentation.Problems with the language itselfC, C++, Pascal require separate header files with declarations and then the implementation files with the code for those declarations. No way around this really.Just make sure you’re not putting the same comments in each file. Doing so would be a waste and likely a place where something will be forgotten over time. Inadvertent Duplication Some examples:Accidental denormalization of data – same attribute in multiple layers that are related.This can also happen with mutually dependent items.The authors point out that sometimes this is necessary due to expensive calculations that you want to cache for performance reasons.If you need to do this, encapsulate that information. Don’t expose the property directly, but instead use accessor methods. That way your storage and retrieval of the data is transparent to the consumer of the data and you can implement it however you like. Impatient Duplication “… short cuts make for long delays.”Some examples:Using the same literal in multiple spots.Copying and pasting source code from a standard implementation and tweaking just a bit.It takes discipline to avoid this type of duplications but doing so will save a lot of time in the long run. Interdeveloper Duplication It’s very common for this to happen when multiple developers are working on multiple applications.How to solve?Clear overall vision.Strong project leader.Division of responsibilities.That still doesn’t solve all of it. When there’s functionality that doesn’t “live” in one of those core responsibilities, it often has a good chance of being duplicated.Methods that help:Open and frequent communication between developers.Appoint a project librarian (or group?).Have a central place in the source tree where utility scripts live.Take care that this doesn’t become a dumping ground.Continually explore other’s source code and be a part of PR’s and code reviews. Tip Make it easy to reuse.If you don’t make it easy, people won’t reuse it. Resources We Like The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)The Pragmatic Bookshelf (pragprog.com)Public Variable vs Public Property – Clean Code the Right Way (YouTube)Spotify engineering culture (part 1) (Spotify Labs)Email Address Regular Expression That 99.99% Works. (emailregex.com)Customize your Visual Studio’s start page:BetterStartPage – Replaces the news section with a custom project dashboard. (Visual Studio Marketplace, GitHub)Solution Start Page – Replaces the news section with a customizable overview of your solutions. (Visual Studio Marketplace) Tip of the Week Use multiple mediums to learn, such as, podcasts, YouTube, online courses (Udacity, Udemy, Pluralsight, etc.), books, writing (blogs, wikis, etc.), and side-projects.Use js.org to host your next JavaScript project for free! (js.org)Google Docs have version history! You can find the history options from within the document’s File menu (File -> Version history) or by right clicking on the file and selecting View details.Use flowchart.js to create a SVG flow chart diagram from a textual representation. (flowchart.js)Wanna draw Git diagrams instead? Use gitgraph.js to draw amazing Git subway lanes. (gitgraphjs.com)Use SHIFT+Right Click on a file in File Explorer to select “Copy as path” as well as other options. Who knew Microsoft took a page out of Apple’s playbook and started hiding options in the UI.
Share Profile
Are you Michael? Verify and edit this page to your liking.
Stats
Location
Atlanta, GA, USA
Episode Count
225
Podcast Count
1
Total Airtime
1 week, 4 days