Coding Blocks Podcast Image

Coding Blocks

Claimed
 16 people rated this podcast

Podcast Episodes

Mark All
Search Episodes...
The Pragmatic Programmer – How to Build Pragmatic Teams
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. In case you’re using your podcast player to read these show notes, you can find this episode’s full show notes and join the conversation at https://www.codingblocks.net/episode114. 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 Velocity Conference – Get expert insight on building and maintaining cloud native systems. 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 … Anonymous VoteSign in with WordpressWhat's your favorite type of swag?Stickers, because they make my laptop go faster.Shirts, because I wear them pretty often and they make me look pretty.Water bottles. Gotta stay hydrated. And then run to the bathroom inbetween talks.Coffee cups. Coding requires coffee.Hats, because everyone has a bad hair day every now and then.Socks. Everyone loves super cute socks. Except Florida man.Bags, because they cost the most.Pens/notebooks, in case I need to write something down super quick!vote News A big thank you to those that took a moment out of their busy lives to leave us a review:iTunes: SimplyManuel, Eric Shin Is Strong, WwHG10Stitcher: AwesomeWithLawson, Glen Moyes, SimplyManuel, codesfrcoffee, RedPeril, TGibson, LecherouscthulhuCome see us at Atlanta Code Camp 2019.Allen will be giving his Real Time Data with Kafka Streams talk,And Joe will be giving his What’s this crazy JAMstack? talk.Joe was a guest on episode 10 of the Backend Bear. Building Pragmatic Teams The methods learned so far from this book can be applied to teams in addition to the individual.By working on a “pragmatic team”, the advantages of practicing the methods of the book are multiplied many times over.However, these methods are only a starting point. Pragmatic teams will evolve, adapt, and refine these practices to best fit their environment. No Broken Windows Everyone on the team should care about quality.Pragmatic teams can not accept broken windows.Quality needs to come from every team member. Boiled Frogs It is easy for an individual to overlook the overall big picture environment while in the heat of a project’s development. It’s even easier for teams.Team members can easily assume that someone else is addressing a bug, or that some environmental change was OK’d.Keep in mind, environment changes don’t necessarily have to mean hardware or configuration. It could mean, bringing in a new technology for example.Everyone should be on the lookout for changes to the environment.The authors suggest appointing a chief water tester to monitor scope creep, timelines, and environments … anything that wasn’t originally agreed upon.Keep metrics on new requirements.Pragmatic teams shouldn’t reject new feature requests outright. Instead, be aware when and that they occur.Otherwise, you might be the one boiling. Communicate Pragmatic teams need to communicate clearly to the everyone else as one voice.The worst teams are those that bad tempered or difficult to get information from.Their meetings have no structure. No one wants to talk.Their documentation is awful. No two documents have the same format and each use different terminology, i.e. no ubiquitous language.Great teams have a personality.You look forward to meeting with them because they are organized.Their presentations are well-prepared.Their documentation is consistent. Current. Accurate. Concise.All members of the team use the same ubiquitous language and speak with one voice.Externally. Internally, they have lively debates, where strong opinions are expressed.Good developers are passionate developers.The simple marketing trick to communicate as one: generate a brand.Create a team name and logo.When communicating with others, use the name/logo.It builds an identity for your team to build on.As well as something memorable for others to associate your work with. Don’t Repeat Yourself Duplication is wasted effort.This duplicated effort can create maintenance headaches.Good communication between teams can help reduce duplication.A project librarian can coordinate documentation and repositories.Other’s can go to the librarian when they’re looking for something.And the librarian can spot duplication when they’ve been given something new.However, if the project is too big for one librarian, appoint a few people as the primary contacts for various functional areas of the project.And don’t forget the value of online user groups, mailing lists, forums, wikis, etc. for archiving questions/answers, and discussions. Orthogonality Traditional teams are organized such that individuals are assigned roles based on their job function.The Rational Unified Process: An Introduction (Amazon) identifies 27 different roles within a project!Roles have an implicit hierarchy: the closer the role is to the user, the more senior the role.Some development environments have strict divisions of responsibility. You might not be able to talk to the testers or the chief architect, for example.To make matters worse, some organizations might have different sub-teams report to different management chains.Don’t fall victim to thinking that the various tasks for a project can happen in isolation, because they can’t.Analysis, design, coding, testing – These are all different perspectives of the same problem.Developers that are two or three levels removed from the user will likely not be aware of how their code is used and therefore not able to make informed decisions while developing it. Tip 60 Organize Around Functionality, Not Job Functions. Team Division The authors prefer to split teams up by functionality. Each (small) team should be responsible for a small aspect of the overall system.And each team is responsible to each other.Commitments change with each project and so do the people per team.Splitting the teams up by functionality doesn’t need to translate to use cases though.The DB can count as a team. The help subsystem can count as a team.Look for largely self-contained groups of people.This is similar to how we’d break up code into modules.Use the same techniques, such as by contract, decoupling, and orthogonality.By doing so, we help isolate the entire team from changes outside it.When done properly, this can reduce interactions, reduce time scales, increase quality, and reduce bugs.Developers will be more committed.Teams will feel more ownership because they know they alone are responsible for their part.But this approach will only work with responsible developers and strong project management. Two heads Each project has two heads: one technical and other other administrative.The technical head is responsible for the development style, assigns responsibilities, and arbitrates discussions.All that while always keeping an eye on the big picture, removing unnecessary commonality among teams to maintain high orthogonality.This person is the lead architect.The administrative head is the project manager.They schedule necessary resources, monitor and report on progress to the stakeholders, and might also act as the PR representative when communicating outside of the teams. Additional Resources for Larger Teams Librarian – Indexes and stores code and documentation.A tool builder – Someone that provides the tools, environments, and support. Automation The best way to ensure consistency and accuracy is to automate everything that can be automated.That bash script, makefile, etc. isn’t going to change itself. Typically.And it can be versioned.Automation is an essential element of a Pragmatic Team.Appoint one or more people as the tool builders to build and deploy tools that automate the project’s boring parts. Know When to Stop Adding Paint Pragmatic teams give each member the opportunity to shine.They provide team members with enough structure to support them and ensure the project delivers against those requirements.And then resist the urge to add more paint. Resources We Like The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)The Pragmatic Bookshelf (pragprog.com)lagniappe (Wikipedia)Spotify engineering culture (part 1) (labs.spotify.com) Tip of the Week Git tips:Undo your last commit: git reset HEAD~ (Stack Overflow)Undo all of your current changes and reset the environment back to the last commit: git reset --hard HEADRemove all untracked files: git clean -fRemove untracked directories, too: git clean -f -dJoe’s reasons to use Kotlin (in no particular order):Reason #147 – Using natural language test function names with backticks (discuss.kotlinlang.org)Reason #136 – Higher-Order Functions and Lambdas (kotlinlang.org)Reason #17 – fold, reduce, MapOverview of Microsoft Authentication Library (MSAL) (docs.microsoft.com)
The Pragmatic Programmer – How to use Exceptions
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 … Anonymous VoteSign in with WordpressWhen 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 ...?a.) Ask peer's if it's a good idea before implementing it? The voice of many carries more weight.b.) Ask the relative team lead if you can implement it? If the boss doesn't like it, it doesn't matter.c.) Implement a proof-of-concept and get stakeholders to weigh in? Because they don't know about it, they need to be sold on it.d.) Just do it. I can't waste precious time checking if other's like my idea.e.) Abandon it. It's already too much effort.vote News Thank you for taking a moment out of your day to leave us a review.iTunes: MatteKarla, WinnerOfTheRaceCondition, michael_mancusoStitcher: rundevcycle, Canmichaelpronouncethis, WinnerOfTheRaceCondition, C_Flat_Fella, UncleBobsNephew, alexUniqueAutonomous 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 33 Amazing Sites with Beautiful Free Icon Sets (blog.usepastel.com)Envato Elements (Envato)Relearn CSS layout (Every Layout)Announcing docs.microsoft.com/samples (docs.microsoft.com)Browse code samples (docs.microsoft.com)Try Kotlin (kotlinlang.org)Samsung DeX (Samsung)
The Pragmatic Programmer – How to Generate Code
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 … Anonymous VoteSign in with WordpressWhat native language are you most interested in?Rust, because safety first.Go, because I wanna be fast and parallel.C, the old ways are best.C++, the good parts.No thanks, I have deadlines.You forgot mine, you expletives.vote News We really appreciate every review we get. Thank you for taking the time.iTunes: AsIRoseOneMorn, MrBramme, MP7373, tbone189, BernieF1982, Davidwrpayne, mldennisonStitcher: 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: Passive code generators are run once (scaffolding).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 The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)The Pragmatic Bookshelf (pragprog.com) C# and .NET Core scripting with the “dotnet-script” global tool (hanselman.com)Using the CodeDOM (docs.microsoft.com) Johnny Dangerously (1984) (IMDb) 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. know the difference between forward and back slash pic.twitter.com/y0yxr1AmGX— David Neal (@reverentgeek) October 20, 2016
The Pragmatic Programmer – How to Debug
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. If you’re reading these show notes via your podcast player, be sure to check out https://www.codingblocks.net/episode111 where you can find this episode’s full show notes, as well as previous episodes, and be 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 your favorite shell of choice?bashkshashDashzshfishCommand PromptPowerShellvote News We take a moment to thank everyone that left us a review:iTunes: Sebastian Schrodinger, drakegens, svolvovsky, Bert1994DK, -Branford-, MikeMac-AU, dylan w roberts, ManYouFactSharingEngineEar, Jahn_08 Stitcher: i_dare_you_to_try_fsharp, geoffster, Mr Maladroit, Stickersoft, InfinitePumpkin, SPACEDANCEThe authors of The Pragmatic Programmer, Andrew Hunt and David Thomas, discuss the 20th Anniversary Edition on episode 352 of The Changelog. The Meat and Potatoes Power Editing Learn one editor very well and use it for everything. Tip 22: Use a Single Editor Well If you use a single editor for everything, the keystrokes, commands, shortcuts, etc. will become second nature for various tasks. Features to look for in your editor Configurable. You should be able to configure all aspects of the editor to your preferences.Extensible. You should be able to configure/integrate with the compiler of your choice.Programmable. You should be able to program the IDE to perform complex tasks (i.e. macros). Source Control Gives you a giant UNDO button that you can use to rewind days, weeks, or longer!Allows you to see who changed something.Commenting allows you to see the why something changed.Lets you see the differences between versions.You can track which files change the most.Using source control properly allows you to go back to a specific release version in time.Allow for concurrent changes to files. Tip 23: Always Use Source Control Even if you’re the only one working on the project.Put everything in source control: documentation, memos, phone numbers, etc. Source Code and Builds Using source control allows for automated code pulls and builds.Additionally if you have automated tests set up, those can be run through as well. Debugging The term bug is credited to Rear Admiral Dr. Grace Hopper, inventor of COBOL.Debugging will consume the majority of your day. Accept it. Psychology of Debugging Accept that debugging is just another form of probem solving.It doesn’t matter who’s to fault for the origin of the bug. It’s your problem now. Tip 24: Fix the Problem, Not the Blame. A Debugging Mindset Adopt the right mindset before you start.Drop your defences and forget your ego.Forget about the project pressures and get comfortable. Tip 25: Don’t Panic Take a step back and think about what conditions might cause the bug.Don’t waste any brain cells on thoughts like “that can’t happen” because it has.Don’t just fix the bug though.Determine the root cause and fix that so that it doesn’t happen again. Where to Start Before you start, first make sure your environment compiles.Set your compiler to treat warnings as errors so that you can focus on the more difficult problems.Talk to the user that reported the bug (if possible). You may be able to get more information.Test boundary conditions and realistic usage patterns.“The best way to start fixing a bug is to make it reproducible.”Create a unit test that reproduces the bug when applicable. Tracing Debuggers focus on the state of the application now, but sometimes you need to watch the state over time.Tracing statements are diagnostic messages printed out that say something like got here or value of x = 2.When doing this, sometimes it’s helpful to add the fully qualified method name (like class::method()) to remove ambiguity.Tracing can be invaluable when time itself is a factor.These tracing statements should be in a consistent format. Rubber Ducking Simply talk through the problem to someone else. Seems silly, but it often works.The simple act of describing step-by-step what is supposed to happen often causes the problem to leap out as you explain it.By forcing yourself to explain it verbally to someone else, you have to state things that you might otherwise take for granted. Process of Elimination While it might be possible that a bug exists in a 3rd party library or the OS, this shouldn’t be your first thought.Assume that the problem is in your code first.Even if the library does have a bug, you will still need to eliminate the possibility of an issue in your code first before submitting the bug report. Tip 26: “select” Isn’t Broken If you changed one thing and things stopped working, guess what? It’s probably that one thing.If you don’t have an idea of where to start, a binary search can help. The Element of Surprise When you find yourself surprised by a bug saying something like “that’s impossible”, you must reevaluate what you know as true.The amount of surprise you have is directly proportional to the amount of trust you have in that particular code.You must accept that one or more of your assumptions is wrong.Don’t gloss over a piece of code because you “know” it works.Prove that it works. In this situation. With this data. And these conditions. Tip 27: Don’t Assume It – Prove It Determine why this bug wasn’t caught before.Create or update unit tests so that it is caught in the future.Ask yourself: “Are there other places that might have this same bug?” If so, fix them, too.If it took a while to fix this bug, ask yourself why?Is there anything you can do (i.e. refactor) that would make it easier in the future.If the bug is due to someone else’s wrong assumption, discuss the issue with the whole team.If one person misunderstood, it’s likely that others did, too.Part of your debugging checklist should include: Are your tests complete? Resources We Like The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)The Pragmatic Bookshelf (pragprog.com) Tip of the Week Preview your markdown in VS Code by using CMD+K V on macOS or CTRL+K V on Windows.Use LINQPad as your ultimate .NET scratchpad. (LINQPad)Use vimtutor to learn VI.Reversee – The super simple reverse proxy web debugger.
The Pragmatic Programmer – Know Thy Tools
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 hisWe be JAMmin with 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
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
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?
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
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.
The Pragmatic Programmer – Investing in Your Knowledge Portfolio
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. If you’re reading these show notes via your podcast player, you can find this episode’s full show notes and join in the conversation at https://www.codingblocks.net/episode105. 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. 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.Stellares.ai – The AI-powered talent agent that does all the work and screening for you to find your next great opportunity outside of your network. Find the job that’s just right for you. Survey Says Anonymous VoteSign in with WordpressDid you improve on the things you wanted to for 2018?I did, as well as improving on additional things.I was able to focus on my 2018 goals and improve on them.I crushed some. Failed at others.No, dang it.Wait. I was supposed to set some goals?vote News We give thanks to everyone that left us a review:iTunes: dziekuje, Angel Filev, dnsbtchr, Galal Hassan, Brains eat zombies, strangulatedherniaStitcher: Ralzes, GrayMath Technology, VladOS, SammichesAllen found his new favorite escape game experience at Odyssey Escape Game. (odysseyescapegame.com)Come kick Allen in the shins June 24th at the Atlanta Intelligent Devices Meetup where he’ll be giving his talk on Kafka. And doughnuts. Or donuts? (Meetup) A Pragmatic Philosophy Written by programmers, not designers of some framework or language, the book presents patterns for developing software. This book is packed full of greatness even in the foreword: There are no perfect tools, methodologies, or solutions. You must pick the best bits for each particular situation.Don’t fall in love with any particular technology or tool.Use your experience to help pick the right solutions for any particular situation.Pragmatic programmers get the work done and do it well. This book is for those who want to be more productive and effective developers. Traits of a Pragmatic Programmer How would you rate yourself on these traits? Early adopter / fast adapterInstinctive and passionate about trying out new technologies.Confident and grasp new things quickly.InquisitiveYou ask a ton of questions, you want to know as much as you can about what’s being done.Critical thinkerDon’t accept whatever is being said or claimed. Use your experience to think through the problem.RealisticYou understand when something is complex and what that means for timelines.Jack of all tradesYou keep your knowledge broad even if your practice is very focused / narrow. Tips Care about your craft.Think about your work.Always evaluate what you’re doing and why. Just Good Advice Embrace individuality and craftsmanship, even on large teams.Always be working to sharpen and hone your skills. The Cat Ate My Source Code “The greatest of all weaknesses is the fear of appearing weak.” – J. B. Bossuet Adopt an attitude, style, and philosophy of approaching problems and solutions where you’re always thinking about the big picture.Take responsibility for your actions.Commit to something being done right even though you don’t have control over all aspects of what’s being done.This doesn’t mean you have to fall on the sword. In “impossible” situations, it’s up to your discretion to not accept responsibility for what is happening.Accepting responsibility is being held accountable.If you do make a mistake or there is a shortcoming, be honest and offer options.Vendor didn’t come though? You should have had a contingency plan. Can’t blame things on them.Being responsible doesn’t mean being perfect. It means working to prevent mistakes, and then working to fix them when things go wrong.Be willing to change, but be cautious at the same time.Know how good your software has to be. Define what is good enough? Tip Offer options, not excuses.“Rubber Duck” it. If what you have to say sounds lame, then you should probably save your breath and find some possible solutions.Admit when you need help or more resources. Software Entropy Entropy refers to the amount of “disorder” in a system.Also known as “software rot” .Despite best plans and best people working on a project, it can still suffer from this. Tip Don’t live with broken windows.Don’t leave poor decisions or bad code in your code.If you don’t have time to fully fix it, patch it somehow.Neglect accelerates rot, rot begets rot.Don’t let the “the rest of the code sucks” mentality sink in, otherwise it will decline faster than you could imagine.Keeping the codebase clean effectively makes others not want to mess it up.If you don’t have time to do things properly, maybe consider “boarding it up”, i.e. comment the code out or display a warning. Stone Soup and Boiled Frogs Tip Be a catalyst for changeTalking about change often goes nowhere.People want to plan meetings.Then management approvals.Barriers to entry pile up.This is known as “start-up fatigue”.Start making strides in the direction you see the change needs to happen, show people, and they’ll begin to rally around you.People find it easier to join an ongoing success. Tip Remember the big picture, don’t be the frog in boiling water.Constantly review what’s happening around you otherwise you’ll lose sight of what’s happening and things can start to deteriorate without your noticing. Good-Enough Software Users should be able to participate in determining if something is good enough.The scope and quality of the system you create should be part of the project specifications.Knowing when to stop iterating over the same code is important.Code can never be perfect so leave well enough alone. Don’t over-embellish or over-refine an otherwise perfectly good program. Tip Make quality a requirements issue.Letting your users experience the software now may lead to better overall software in the future, even better than the path of perfecting what is there now.Great software today is better than perfect software tomorrow.How can we set standards around quality? Test coverage, code reviews, static code analysis, etc. maybe? Your Knowledge Portfolio “An investment in knowledge always pays the best interest.” – Benjamin Franklin Your knowledge portfolio is all the knowledge you’ve gained programming both in the technical as well as domain specific bits you’ve picked up over time.Your knowledge and experience are your most important professional assets … but are expiring assets.Consider investing in your knowledge portfolio like you would make financial investments:Invest regularly, as a habit.Diversify.Manage risk.Buy low, sell high.Review and Rebalance. Tip Invest regularly in your knowledge portfolioLearn at least one new language a year.Read a technical book each quarter.Read nontechnical books, too.Take classes.Participate in user groups.Experiment with different environments.Stay current by subscribing to trade magazines, journals, newsletters, or similar.Join and participate in online communities and read white papers for technologies of interest.Be on the lookout for opportunities. If you can’t answer a question … don’t let it go! Tip Critically analyze what you read and hear.Try to think critically about what you read and hear, don’t take it for truth.Beware of zealots, or any time somebody can confidently tell you “the way”. Communicate! Ideas are worthless unless you can communicate itMeetings, tickets, wikis, and code are all forms of communication.Understand what you want to say.Jot down your high level goals.Have a plan for getting it across.Know your audience.The WISDOM acrostic:What do you want them to learn?What is their Interest?How Sophisticated are they?How much Detail do they want?Whom do you want to Own the info?How can you Motivate them to listen to you?Choose your moment wisely and make what you’re saying relevant in time.Communicate with your audience the way they want to be communicated with.Make your message look good.Presentation is as important as the content itself.Which is easier to read? One full page of text? Or two pages of text broken apart into sections with section headers?Get people involved in your documents early and often.Involving your audience builds relationships and creates better documents.Be a listener. If you don’t listen to others, they won’t listen to you.Get back to people. People hate when you don’t reply, even if it’s just an “I’ll get back to you later.” Tip It’s Both What You Say and the Way You Say It. Resources We Like The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon)The Pragmatic Bookshelf (pragprog.com)Programmers’ Build Errors: A Case Study (at Google) (static.googleuserconent.com)Broken windows theory (Wikipedia)How ‘Broken Windows’ Helped Shape Tensions Between Police And Communities (www.wnyc.org) Tip of the Week Git the source code for your favorite old games. (GitHub)Learn about all of your favorite design patterns using The Catalog of Design Patterns. (refactoring.guru)Learn VS Code tricks you didn’t even know about. VS Code can do that?! (vscodecandothat.com)Sharpen your Azure skills with these self paced labs provided by Microsoft:Acquire the cloud skills you need, at your own pace (handsonlabs.microsoft.com) Welcome to Self-paced Labs (www.microsoft.com)
Should Your Web App be a Progressive Web App (PWA)?
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.
The Second Date is Always Easier
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.
Why Date-ing is Hard
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.
What Should You Learn Next?
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.
Tackling Tough Developer Questions
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.
JAMstack with J.A.M.
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. If you’re reading these show notes via your podcast player, be sure to head to https://www.codingblocks.net/episode99 to find this episode’s full show notes and join in on the conversation. 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. 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 WordpressWhat do you think of JAMStack?It&#39;s like, the future, yo.Eh, I&#39;ll let this front-end fad pass and maybe grab on to the next one.You can pry the back-end from my cold dead hands.vote News As always, we like to take a moment to thank everyone left us a review: iTunes: scoobybejesus, MikeMacDev, krauselingStitcher: Mackiovello, askerov, BrickGWEmail: Travis T.The Coding Blocks crew will be at the Orlando Code Camp on March 30th, 2019. Come find us so you can kick Joe in the shins! JAMstack What is it? JavaScript + APIs (re-usable) + Markup“Modern web development architecture based on client-side JavaScript, reusable APIs, and prebuilt Markup.” – JAMstack.orgPioneered by companies like Netlify, who specialize in hosting static sites and upselling optional services like authentication, forms, and serverless functions.There are no prescribed technologies aside from JavaScript.Defined more by what it’s NOTChallenges include permissions, real-time persistence, user friendly admin-y things JavaScript Client-Side JS focus (though the tools you use to build will likely be different).Framework agnostic, even works with vanilla JavaScript.No server side rendering, in fact no server side at all!Authentication is handled outside the app, like an API. APIs All server-side processes or persistence are abstracted into APIs.All APIs are accessed over HTTPS from the JS.Treat your own server-side components as 3p. Markup Templated markup should be prebuilt at deploy time.Usually using a site generator or build tool. Why is this a thing? Because static sites have gotten more powerfulProgressive Web Apps (PWA)Better front end tools/frameworks like Babel, React, or Vue.More and more SAAS and Cloud components commoditizing services, such as Let’s Encrypt for SSL/TLS certificates, Stripe for payments, the various OAuth services offered by companies like Google or Facebook, and webhooks. Why JAMStack? Can’t beat web performance via static files/CDN.Cheaper scaling and hosting because scaling and hosting equal CDNs.Perfect for side projects!Better Developer experience.Loose coupling.Targeted coding and debugging.Simpler, less stuff to learn and maintain.SecurityCompare a JAMstack security footprint to your LAMP security footprint (patches, credentials, open ports, etc.) Best Practices: The app should be distributed on a CDN.The more app/content on the edges, the better the UX.Modern Build Tools: Babel, WebPack, Gatsby, etc.Everything you need to run the app lives in a single git repository. Simple npm install to run the app.Focus on automated buildsThere is less emphasis on persistence, so changes generally need to be deployed.Atomic deploys (deploy everything at once instead of file by file).Instant cache invalidation.Use a CDN that can handle instant cache purges.Static doesn’t mean “no tests”. Downsides Scales great for users…but how do large projects scale for devs?Steep learning curve for non-devs.Heavily dynamic pages. Resources We Like JAMstack (jamstack.org)JAMstack Examples (jamstack.org)JAMstack Resources (jamstack.org)What is JAM Stack (dev.to)The Sweetness of JAMstack: JavaScript, APIs, and Markup (thenewstack.io)These Shocking WordPress Stats Will Actually Make Your Head Spin. (whoishostingthis.com)14 Surprising Statistics About WordPress Usage (managewp.com) Tip of the Week Practice all year long by solving past Advent of Code problems. (adventofcode.com)Find amazing local (!) deals on the Facebook Marketplace. (facebook.com)C# code snippets in Visual Studio. (docs.microsoft.com)
Data Structures – Heaps and Tries
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. Reading this episode’s show notes via your podcast player? Head to https://www.codingblocks.net/episode98 to find this episode’s full show notes and participate in the conversation. 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.Discover.bot – a digital space for bot developers and enthusiasts of all skill levels to learn from one another, share stories, and move the conversation forward. New to bots? Get started with their Beginner’s Guide.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 time do you spend coding outside of work?Nada. I don&#39;t write code for free.Until I go to bed.I take the weekend off. Otherwise I&#39;m writing code.Like a sine wave, I go through phases. Sometimes more. Sometimes less.vote News Thank you to everyone that took time out of their day to leave us a review: iTunes: Pendelgeist, bothzoliStitcher: jbzcooper, Terrance, Saltire Steve We’ll be giving away a ticket to React Amsterdam. Trie as you may … Heaps What is it? Heaps are specialized binary trees that keep data sorted-ish.This makes them slower for lookups, but faster for insertions.They are also really good at getting their roots plucked.Wikipedia list 18 different types of heaps, but we focus on Min/Max heaps (particularly max).Sorted-ish?Heaps are very similar to binary search tree (BST), they have two values – but unlike a BST, the children are always less than the parent (or more in a min tree).This means that your root node is always the biggest value in the whole tree.Because heaps aren’t so strict on the ordering, it’s quicker, O(log n), to insert data than it is into a sorted array.It’s also quicker on average to insert into than a BST, in both cases the insertion time comes down to the height of the tree but we can cheaply keep the heap balanced – no straight lines here!The downside is that heaps are slower for lookups, because you potentially have to look at every node in the tree.Finally, the killer feature – it’s really efficient to remove the root node. How does it work? Heaps are typically stored in an array. Because it’s a binary tree you can quickly calculate a node’s children based on its index.Downside is you need to pre-allocate memory, and either have to set a max size or use a dynamic array data structure that will grow as needed.Adding to the heap has cool names like “up-heap”, “bubble up”, “trickle up”. Add your node to the bottom level (easy in an array, just shove it in the first open value).If the new node is less than its parent, swap and repeat. Extraction, downheap, trickle-down, bubble-down, etc. Move the last filled value in the array to 0.If this node is greater than one of its children, swap and repeat. Pros Fast insert O(1) on average, O(log n) for worst case.Fast removal of root node. Cons Slow search O(n). When to use? When you need to quickly insert data, and you only care about the min or max value.Don’t use a heap when you need to search for arbitrary values.Priority Queues (BFS). Tries What is it? Tries, (technically) pronounced “tree” as in retrieval, aka digital tree, (compressed) radix tree, prefix tree.They are specialized tree where the nodes don’t matter.Instead, the “key” or “value” or “payload” is associated with the edges, and the nodes just exist for convenience.The true values in the tree only exist on the leaves, and siblings share what is called a common prefix. How does it work? English Spellchecker example:English is a mess, every rule has an exception – q is not always followed by u, i is not always before e, y isn’t always a vowel.You need to store every english word in order to implement a spell checker (~1M depending on how you count).You could keep a hash table, or a big sorted array then scan the document word by word to look to see if it’s valid.This should be fast enough too, worst case for hash or sorted array is O(log n) (worst case 20 operations to find a word in the WORST case!) but how much RAM would you need to keep 1M words in memory…However, if you look at the data you’ll see that a lot of words are really similar – code, codes, coder, coders, coding, …We can do better with tries!!Let’s start with an empty trie, and every time we add a word, lets have an edge represent one letter of the word.When we add the word “code” we get an edge for c, o, d, and e – when we add “coder” …we already have edges for 4 of the letters, so we just add an edge for the r.When we stored each of those coding words in an array, we ended up storing 26 characters, using a trie: 10.Sure, we saved some space – but think about what it takes to see if a word exists? Checking for “code” just means looking for a branch for each letter – the number of comparisons is equal to the number of letters.To make things even better, it’s actually really easy to offer auto-complete now – as the user types a letter, we can take another step down the trie to see if it exists … and even follow the tree down to show what words we think you might be typing.While the example used natural language, tries are also useful for permutations, digits, or even binary – basically anything that has a lot of identical prefix data.Note there is actually a better data structure for an autocomplete/spell checker: Deterministic Acyclic Finite State Automaton (DAFSA for short)! Tries also compress really well, like combining any nodes that only have one child – in the spellchecker example, imagine that “q” was always followed by a “u” – then you could combine to a “qu” node. Pros Often used in place of a hash.Faster worse case lookup than an imperfect hash table.No messy/bad hash functions to deal with.No messy/bad collision strategies to deal with.Easy to provide an ordered listing of keys with no additional data structures. Cons Trie lookups can be slower than hash lookups, particularly if the random-access time of the medium is bad.Not good when there would be long meaningless chains (like 2.3333333333334).Can potentially take more space than a hash table (imagine having the pointer over head for each character where there isn’t a lot of overhead, as opposed to a single pointer to a string). When to use? Fast insert, fast and efficient sorting, lots of duplicated data…like in the bowels of search engines, or spell checkers/autocomplete. Resources We Like The Imposter’s Handbook (bigmachine.io)List of data structures (Wikipedia)Heap (data structure) (Wikipedia)Binary Heap + Priority Queue visualization (Binary Tree Visualizer)Min Heap visualization (USFCA)Trie (Wikipedia)Trie (Prefix Tree) visualization (USFCA)How many bytes will a string take up? (Stack Overflow)Deterministic acyclic finite state automation (Wikipedia)Compressing Radix Trees Without (Too Many) Tears (Medium) Tip of the Week Order yourself some dev stickers! (Amazon)How to programmatic disable C# Console Application’s Quick Edit mode? (Stack Overflow)Package Thief vs Glitter Bomb Trap (YouTube)Use the Semantic Syntax Colorizer to liven up your IDE experience in Visual Studio Code.
Data Structures – (some) Trees
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.
Data Structures – Hashtable vs Dictionary
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. Hey you. Yes you. Are you reading this via your podcast player? You can find this episode’s full show notes and be a part of the conversation by visiting https://www.codingblocks.net/episode96. Sponsors Manning Publications – Sign up to Manning’s Deal of the Day (here) to participate in the Countdown to 2019 to be in the running to win awesome prizes and get special daily discounts. 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 WordpressHow do you plan to spend your time off this holiday season?Spending time with the family because the holidays are all about the memories.I&#39;m not avoiding the family, I&#39;m building my next great project.Escaping the family _and_ the keyboard. What time off?vote   News Thank you to everyone that took a moment to make our holidays a little bit brighter by leaving a review: iTunes: krauseling, Jla115, Ross44ross, hutchybong, JonMabale, code_in_my_robe, Saltoshi, SXENedger, BubbaCow Stitcher: Järvinen, EliavCodeIsrael, sbgood, maxim_bendiks, Nathan Iyer Thanks to chumak84 for the clarification of string interning. (Wikipedia) We play a little game of How much data is generated every minute by use? taken from the data provided by Domo’s Data Never Sleeps 5.0 infographic. (Domo) Hashtables vs Dictionary Hashtable About hash tables When it comes to reading data, arrays are great (and fast) because getting to the next element is just a matter of math (i.e. the offset is the size of the type of thing in the array). But when it comes to writing, or more specifically inserting data, linked lists are great because we only need adjust some pointers. A hash table takes the best of these two worlds and smashes them together … sometimes The MSDN documentation succinctly describes the Hashtable class as _Represents a collection of key/value pairs that are organized based on the hash code of the key._ How do they work? Consider the core structure to the hash table to be an array. Each element contains an object that contains the key and the value(s). In the Wikipedia article for hash table, this object is called a bucket. Bucket?! The data that you want to use as the key to read and/or write is used to create a hash that serves as the index to the array. Implementation can vary based on how collisions are handled (i.e. keys that produce the same hash). Popular Collision Resolution Strategies Separate Chaining In this implementation, the elements in the array are pointers to a linked list of buckets. During a collision, you traverse the list looking for your key. A good hash table will rarely have more than 3 items at the same array index, so the list traversal is small. Open Addressing In this implementation, the elements in the array are the buckets themselves. The hash value serves as a starting point. Meaning that during a write operation, if we go to that index in the array, and something is already there, we will continue on to the next element in the array looking for an empty slot to write our value. And for a read operation, we will similarly start at the index of the hash and look for the key we’re looking for and continue until we either find it or get to an empty slot in the array. Other strategies include: Cuckoo hashing Hopscotch hashing Robin Hood 2-choice hashing As the name implies, two hashing functions are used. During a write operation, the new key/value pair is written to the array’s index location that has the fewest objects already at each hash value. Complexity Space: Average and Worst case = O(n) Search, Insert, and Delete: Average = O(1) and Worst case = O(n) Pros Speed. Hash tables are fast. Reads are generally O(1) (ignoring collisions). If there is a collision, the read/write time _can be_ reduced to O(n/k) where k is the size of the hash table, which can be reduced to just O(n). Assuming a good hashing algorithm is used, performance will usually be O(1). But this assumes that by “good”, the performance of the hashing algorithm is considered … i.e. a slow algorithm might still be O(1) but be slower than alternatives. Cons Depending on language, looking at you C#, the Hashtable type is loosely typed. The cost of the hashing function can be more than just looping over the list, specially for few entries. Because hash table entries are spread around, there is poor “locality of reference” and can trigger processor cache misses. Cache performance can also be poor or ineffective depending on implementations, such as separate chaining. Performance degrades when there are many collisions. When to use If we’re talking language specific implementations of the Hashtable _type_ … Um. Don’t? At least, not in C#? Prefer the Dictionary type. And um, not in Java either. Use HashMap. In more general terms, use them when … You need an associative array … i.e. you want to access the array by some key, like a name, rather than by index. Database indexing Cache Sets Dictionary What is it? And how does it work? Like a hash table, dictionary holds key/value pairs. By definition hash tables are weakly typed, but dictionaries are not Hashtable numbers = new Hashtable(); Dictionary<int, string> dictionary = new Dictionary<int, string >(); C# Detail, Hashtable and Dictionary use a different collision strategy. Hashtable uses a rehash strategy, while Dictionary utilizes “chaining”. Chaining is using a secondary data structure (sparse array) rather than re-hashing. Chaining is…complicated, and there are different methods for doing it (separate chaining vs open-addressing). Wait, but didn’t we just talk about how adding and removing items from an array takes time? Doesn’t that mean that chaining will be slower than a normal hash lookup? What about memory size? Sounds like it will potentially be double? Nah, it’s fine. Chaining ends up running in O(1) on average time as well, because of the implementation details of chaining. Weird math ahead … Namely that the length of the list can never exceed the bucket size. This keeps the “load factor” (ratio of nodes to buckets) low so the average lookup time ends up being known as the separate chaining ends up being O(n/m) and since n/m are equal, you get 1 … on average. Pros Same pros as hash tables. In static languages, dictionary are more efficient because there is no boxing necessary. Operations are safer, because errors are caught at compile time. Cons Same cons as hash tables. When to use Whenever you need a hash table like data structure, but want type safety. Fast insert, delete, lookup – sparse data. What about.. Hashes and Dictionaries technically don’t support ordering, so what the heck is IOrderedDictionary? Dictionary vs Hashtable in C# Hashtable uses the type object as both the key and value. Meaning they are loosely typed. This also means value types like int get boxed/unboxed during use (see episode 2). Dictionaryon the other hand is strongly typed. So the key and value types are explicitly defined in the code. This favors failing at compile time rather than run time. This is a valid use of a Hashtable in C#:using System; using System.Collections; public class Program { public static void Main() { var h = new Hashtable(); h.Add("foo", "bar"); h.Add(1, 2); foreach(var key in h.Keys) { Console.WriteLine(h[key]); } } } Closing Thoughts C#’s Dictionary is like Java’s Hashtable. In C# – Dictionary<TKey,TValue> In Java – Hashtable<K,V> In fact, in Java, Hashtable extends Dictionary (abstract) Although you’re supposed to use HashMap instead. And a Javascript Object can be used like a dictionary (aka associative array). Resources We Like The Imposter’s Handbook (bigmachine.io) List of data structures (Wikipedia) Big-O Complexity Chart (bigocheatsheet.com) Hash table (Wikipedia) Hashtable Class (docs.microsoft.com) Dictionary<TKey, TValue> Class (docs.microsoft.com) Class Hashtable<K,V> (docs.oracle.com) Back to basics: Dictionary part 1, hash tables (Mark Vincze’s coding blog) Back to basics: Dictionary part 1, hash tables – Separate chaining (Mark Vincze’s coding blog) An Extensive Examination of Data Structures Using C# 2.0 (docs.microsoft.com) Why is Dictionary preferred over Hashtable? (Stack Overflow) What’s the difference between Hashtable and Dictionary? (Stack Overflow) When to use a HashTable (Stack Overflow) Data Structures and Algorithms: When To Use What? (theGarbageCollector) 2. Boxing and Unboxing in .NET (Coding Blocks Episode 2) Tip of the Week Join the Slack community and join in on all of the fun in #pet-pictures. Visualize your time series data using Grafana. (Grafana Labs) Add emojis to your file (_never_ in your code!) in Visual Studio Code by using WIN+; Thanks AngryZoot! (Twitter) Windows + ; lets you put emoji in your VS Code. pic.twitter.com/fnE1JOKKmH — The Real Groot. (@AngryZoot) December 3, 2018
Data Structures – Arrays and Array-ish
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? How are you reading this? If you’re using your podcast player to read these show notes, you can visit https://www.codingblocks.net/episode95 to view this show’s full show notes and be a part of the discussion. 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. Manning Publications – Sign up to Manning’s Deal of the Day (here) to participate in the Countdown to 2019 to be in the running to win awesome prizes and get special daily discounts. Discover.bot – a digital space for bot developers and enthusiasts of all skill levels to learn from one another, share stories, and move the conversation forward. New to bots? Get started with their Beginner’s Guide. Survey Says Anonymous VoteSign in with WordpressWhat do you want to focus on improving in 2019?Front-End, there&#39;s a 3p service for everything now.Back-End, cuz Flexbox...done.Persistence is king, data data data.Algorithms and data structures, can&#39;t go wrong with fundamentals.Clean Code, master the tactical before the strategic.Architecture, I&#39;ve ascended to higher levels of abstraction.DevOps, good luck doing anything without me!vote   News We take a moment to say thank you to everyone that took time out of their busy schedules to leave us a review: iTunes: Mr_Joe1, Scweiss1, akaryrye, JacobCastiglioni Stitcher: kannan, WeirdFlexButOK How do you get other people within a company to get on board with writing better code? Is it megabits? Or megabytes? Arrays + Cousins Array What is it? And how does it work? A way to store a collection of items. In C, these arrays are stored in a continuous block of memory. You either have to declare the array type and size or you have to initialize the array with the elements at the time the type is defined, or both. Example initializations: int myArray[10]; int myArray[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} int myArray[10] = {1, 2, 3} No index checking in C – ever get that index out of bounds error in our other languages? So what happens? It doesn’t blow up – you’ll just get unexpected / garbage results. C also won’t blow up if you initialize it with more data that what’s in the defined size – C++, C#, Java, etc will complain at compile time. In languages like C, sometimes people get confused between arrays and pointers. It’s true that arrays start at a spot in memory and then contain the contiguous space in memory, but it’s not the same thing as having a pointer to that first memory location. You can check by doing a sizeof in C to see that they are indeed different. Confusion typically happens because arrays are passed as pointers in C and you access the array members using pointer arithmetic. C arrays can contain anything except void or functions. Can be initiated in any of three memory segments – data, heap and stack. Dynamically allocated arrays go on the heap. What’s a dynamically allocated array? One that’s created using malloc – allocates a chunk of space on the heap by defining how much space you need. Static / Global arrays get allocated to the data segment. Local arrays are put on the stack. What about JavaScript? Things are loosely enforced at best. You don’t define a length or a type. Technically, it’s nothing more than a special object behind the scenes that use numerical keys for sorting purposes. Because it’s an object, it is copied by reference. Don’t believe us, just put this into your console typeof [] If using the array (without breaking the rules) there are built in optimizations like storing the data in contiguous memory spaces. What are examples of _breaking the rules_? Manually set a property on an array either with dot notation or using a non-numerical key. Leave major gaps in the indices. Reverse adding items to the array from largest index to smallest. Add items to the array ordered, and life will be great Push / Pop are fast, but Shift / Unshift are costly. Use for .. of Technically can use for .. in because it’s an object, but not a good idea. 10 – 100x slower, AND you can get additional items that you didn’t expect. Length isn’t really length…it’s the largest numbered index + 1 let myArr = []; myArr[200] = true; // myArr.length === 201; Length is writeable – what?! Yeah, you can increase it, and nothing majorly bad happens … but if you decrease it, it’ll truncate data in the array above the specified length. More about Arrays In a strongly typed language, these items must be of the same type. In loosely typed languages, typically you can store whatever you’d like in the collection. In most typed languages, an array is a fixed sized sequential set of data – typically stored in contiguous memory. In scripting languages like JavaScript, the memory allocation may not be contiguous – rather it’s an implementation detail of the engine itself. When is an array not an array? Arrays generally have fixed sizes because the allocated memory needs to be contiguous. The size can be dynamically set at run time but you generally can’t grow it without moving it. Ruby has dynamic arrays, which are allocated dynamically, and contiguous…but will automatically reallocate more space as needed – copying all of the existing data to a new spot and allocating more space. Python doesn’t have arrays, it has lists which are not fixed and are not contiguous. JavaScript has “arrays” which are objects, with properties like “length” that are saved properties on the object. “In V8 and Carakan (and presumably Chakra), all (non-host) objects (both those that are arrays and those that aren’t) with properties whose names are array indexes (as defined in ES5) are stored as either a dense array (a C array containing some value wrapper) or a sparse array (which is implemented as a binary search tree).” When is a JS array not an array? When you do weird stuff! Sizes JavaScript: Maximum Size: 2^31 (unsigned 32 bit integer ~ 4.29 billion elements) C#: Maximum Size: By default, the maximum size of an Array is 2 gigabytes (GB). In a 64-bit environment, you can avoid the size restriction by setting the enabled attribute of the gcAllowVeryLargeObjects configuration element to true in the run-time environment. However, the array will still be limited to a total of 4 billion elements, and to a maximum index of 0X7FEFFFFF in any given dimension (0X7FFFFFC7 for byte arrays and arrays of single-byte structures). Java: Maximum Size: 2GB -> 2^31 When to use In typed languages, you’ll probably want to use this if trying to squeeze out every bit of performance available. Otherwise, using the built in List types are typically more flexible and powerful. Linked List What is it? And how does it work? Ordered set of objects that contain references the next item in a list, like a conga line. There are also double-linked lists which contain a reference to the previous object. What’s the deal with double? You have the additional overhead of setting previous and next values. Advantage is that it’s easy to drop a node, given the node (i.e.: node.prev.next = node.next) (rather than iterating through the list to find the node‘s prev). Pros Don’t need to specify a size up front. No over-allocating. No need for contiguous memory. Easy to insert/delete, think about removing an item from a sorted array. Cons No random access. You need to iterate through the list to get to any particular object. Terrible choice for some algorithms, like binary search. Extra memory required, one pointer per object. When to use When you have lots of insert/deletes. When you don’t need random access. When you don’t know a fixed size. What about … Languages that don’t have pointers? Use a reference: var node2 = { value: 5, next: node1 } C#? LinkedList class …isn’t it trivial? Why would you ever need that? Nice to have helpers like AddFirst, AddLast, RemoveLast, AddAfter, etc. LinkedList vs List – List is actually backed by an array, and LinkedList can cheaply add/remove items out of the middle of the list, List can only cheaply add to the end. Queue What is it? And how does it work? Very similar to a Stack … the biggest difference is the order in which data is removed. Queues are FIFO’s – First In First Out – oldest items get removed first. FIFO Bottles! Think about your school lunch line – you got in line first, you got served first and then you left the line. Useful When Ordering is important via the FIFO. Breadth first searches. Resource sharing among multiple consumers – you basically go to your first consumer in line, 2nd, etc. Asynchronous data syncing – data not received at the same rate it is sent. Derivatives Priority Queues Similar to the standard queue with the exception that queue items have a priority associated with them, and the higher priority items are dequeued first. If the priorities are the same, then the queue falls back to standard operating mode FIFO. Useful When Efficient for finding shortest path in Dijkstra’s algorithm. Data compression (Huffman). AI Deque – Double Ended Queue Allows insert and delete at both ends. This essentially makes a queue a hybrid of a stack and a queue. Useful When Handling clockwise and counter-clockwise rotations in O(1) time. Efficient at adding or removing items from both ends of the queue. Circular Queue Also known as a Ring Buffer. Last item in the queue links back to the first item. Seeing if a queue is full – if the first item -1 == last item, then the queue is full. Useful When Used for memory management – allows you to fully utilize memory locations that might have been skipped otherwise. Traffic systems – constantly cycle through and switch on the next traffic light on a timer basis. CPU scheduling. Stack What is it? And how does it work? A stack is a “last in, first out” data structure (LIFO). Think of anything you’ve ever stacked … a stack of plates, a stack of books, a stack of pancakes … you don’t have random access but instead access the top most item on the stack. Stacks have two principle operations, push and pop, and often a peek operation. push – put a new element at the top of the stack. pop – remove the top most element from the stack. peek – see the top most element on the stack without removing it. Stacks can be implemented using at its core either an array of a linked list Technically only a singly linked list is necessary … i.e. we only need to point to the next item in the stack (the one below), because we’re only going to traverse down the stack. Pros Fast way to know where you’ve been. Reads/writes are O(1) since you are only touching the top of the stack. Cons In some languages, stacks are used to store both input data as well as return addresses of the calls making them susceptible to stack smashing attacks when the input sizes aren’t verified. This is no random access to a stack … it’s last in, first out. When to use Backtracking while traversing a graph or tree. Remember depth-first search. Reversing things like a string (or any other array/list like thing). Call stack. Writing your own compiler … stacks are often used to ensure opening/closing constructs like curly braces, parenthesis, etc. are balanced. Resources We Like The Imposter’s Handbook (bigmachine.io) List of data structures (Wikipedia) JavaScript data types and data structures (MDN web docs) Arrays in C/C++ (GeeksforGeeks) Arrays in C Langugage | Set 2 (Properties) (GeeksforGeeks) Arrays in C (Swarthmore College) Arrays (JavaScript.info) ECMA Script Array [[DefineOwnProperty]] (P, Desc, Throw) (ECMA International) Performance of Arrays vs. Lists (Stack Overflow) List vs Array performance example (IDE GeekforGeeks) Are javascript Arrays actually implemented as arrays? (Stack Overflow) ECMA Script ArrayCreate (length, [, proto]) (ECMA International) LinkedList<T> Class (docs.microsoft.com) Queue Data Structure (GeeksforGeeks) Applications of Priority Queue (GeeksforGeeks) Why do we need Deque data structures in the real world? (Stack Overflow) What is the daily life example of a circular queue? (Quora) Stack (abstract data type) (Wikipedia) Data Structures and Algorithms: When To Use What? (theGarbageCollector) Abstract Data Types: Stack, Queue, Priority Queue (theGarbageCollector) Data segment (Wikipedia) Tip of the Week Want to share a tip? Submit your tip at https://www.codingblocks.net/tips. Use npm ci for faster, more reliable builds. (The NPM Blog) Thanks gaprogman! doFactory .NET Design Pattern Framework 4.5 (doFactory) Thanks JoeRecursionJoe! BenchmarkDotNet – Powerful .NET library for benchmarking. (GitHub) Use git subtree to merge repositories together or split portions out into new repositories all while maintaining the history. (GitHub) Thanks GreenFieldCoder! devdocs.io – All of the documentation for everything you’ll ever use in one place. Thanks Konrad!
94. Data Structures – Primitives
We begin our journey into data structures by taking a deep dive into primitives while Allen makes Michael blush and Joe crashes his browser. Reading these show notes via your podcast player? Head to https://www.codingblocks.net/episode94 to view this show’s full show notes and participate in the discussion. Sponsors Coder.com – Sign up to use Visual Studio Code in the browser and server power your IDE with access of up to 96 cores. 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 do you value most in a job?Pay. It&#39;s all about the Benjamins.Tech stack. I need to remain interested.Commute. Or the lack thereof. I mean, I love listening to Coding Blocks and all, but a new set of tires every month is ridiculous.Location, location, location. Just like real estate.Team. I need to be surrounded by people better than me so I can grow.Industry. I want the type of problems I solve to matter. To me.Benefits. I like to take off for the summer.Work. Life. Balance. I have a life outside of the office.vote News Special thanks to everyone that took a moment to leave us a review. It means a lot to us. iTunes: Praslisa, Techanda, Raj Agz, hartzell.jkh Stitcher: Scott_V, HotGarbage, btsui, Michael Tippett, GreenPlane, MPDaves, JoesTheBest, stephencweiss, Zhuul303 Primitives About data structures Data structures and algorithms are the heart of computer science. Data structures refer specifically to how we store and interact with data in our programs. The data structures you choose can have a huge impact on resources. Different languages often have built-in support for data structures. Some data structures cannot truly be built in some languages: How would you build an array in JavaScript? What about SQL? Examples of Some Standard Data Structures Basic: Arrays, Linked Lists. More advanced: Trees, Tries, Hash tables, Heaps. Each has their own strengths and weaknesses. About Primitives Primitives are the most basic types that all other types are built on. Primitives refer to one of 2 things: Basic types – sorta like elements on the periodic table, they can’t be broken down into anything smaller. Built in types – most languages also include composite types as well, mainly for convenience. In C#, String is built-in, but not considered a primitive, as well as DateTime, Enums, too. Wikipedia lists the basic primitive types as… Character Integer Floating-point Fixed-point numbers A note about rounding in C# – By default, Math.Round() rounds to nearest even number if halfway between two numbers. Decimal has more storage, but it’s range is less than that of a double… Bool Reference A tangent about floating-point numbers Why do we need floating-point types? We know how to represent integers in binary form. For example, we can represent 10 in binary as 00001010. Or 3 would be 00000011 in binary. So if 1 in binary is 00000001 and 3 is 00000011, how would we represent 1/3 in binary? Even on paper, we actually can’t do it. So to get around it, we use symbols. So we’ll say 1/3 = 0.3333 with a line over the last 3 representing that it goes on forever. So, what about 1/3 + 1/3? On paper, we might write this as 0.6667 and consider this approximation good enough. Why is a float called a float? Because the placement of the decimal point can vary from one number to the next. This is based on how it is stored. Floating-point number storage is made up of three parts: the sign, the mantissa, aka coefficient of significand, and the exponent. Storage is made up of 3 parts: For a 32-bit float: 1 bit for the sign, 23 bits of mantissa, and 8 bits of exponent. For a 64-bit float: 1 bit for the sign, 52 bits of mantissa, and 11 bits of exponent. Fixed-point numbers, the alternative to float-point Using the explanation above for floating-point numbers, consider the alternative to a floating-point number, i.e. a fixed-point number. For a fixed-point number, the position of the decimal place is a known constant, such as the money and smallmoney types in SQL Server which have, at most, 4 decimal places. Floating-point numbers in .NET There are two types of real numbers in .NET: binary floating-point numbers and decimal floating-point numbers. For binary floating-point numbers, there is float and double (or System.Single and System.Double). Binary floating-point numbers are base 2 in regards to the formula we use to calculate what number the structure is representing. For decimal floating-point numbers, there is the decimal type. Decimal floating-point numbers are similar to binary floating-point numbers, except they are base 10 instead of base 2 in regards to the formula we use to calculate what number the structure is representing. Floating-point arithmetic Floating-point arithmetic is sometimes considered bad, because the results aren’t what we might expect. However, floating-point arithmetic can be fine depending on how you’re using it. If your variable represents money, it’s best to stick with precise numbers like the decimal type. However, calculations using decimals is an order of magnitude slower than floating-point types (and also use at least twice the memory). But if what your variable represents is something in the real world, say the measurement of a piece of wood, a float or double might be good enough, since the likelihood of the measure is already inexact by its nature. Precision vs Accuracy Precision refers to the amount of information used to represent a number. Accuracy indicates how close a value is to its true value. If we represent pi as an approximate value using the number 3, it is only accurate to one decimal place. Regardless of what the precision of the variable is. Back to primitives First thought here, isn’t everything in C#/Python/Ruby an Object? Answers, is … not quite Just about everything in C# is derived from System.Object, including most of the primitives Every type in C# directly or indirectly derives from the object class type, and object is the ultimate base class of all types. Values of reference types are treated as objects simply by viewing the values as type object. That’s why you can do things like 12.ToString(). Interfaces and pointers are not children of System.Object. So why aren’t there just 3 primitives? Object and Int/UIntPtr? Well, C# types have a property called “IsPrimitive” so you can do typeof(MyClass).isPrimitive to see what C# has to say about it. Resources We Like The Imposter’s Handbook (bigmachine.io) List of data structures (Wikipedia) JavaScript data types and data structures (MDN web docs) Decimal vs Double and Other Tips About Number Types in .NET (Exception Not Found) Why do you need float/double? (Stack Overflow) Binary floating point and .NET (C# in Depth) Decimal floating point in .NET (C# in Depth) Floating Point in .NET part 1: Concepts and Formats (Extreme Optimization) IEEE Standard for Floating-Point Arithmetic (IEEE 754) (Wikipedia) Difference between decimal, float and double in .NET? (Stack Overflow) String caching. Memory optimization and re-use (Stack Overflow) (aka string interning) Metaprogramming in ES6: Symbols and why they’re awesome (Keith Cirkel) Tip of the Week Got a tip you want to share? Submit your tip at https://www.codingblocks.net/tips. Theme your Visual Studio Code to your liking (code.visualstudio.com) Thanks to Brianmm02! Like Git, but not a cmdline fan? Check out GitKraken (gitkraken.com) Thank you Lee Oades! Set up multiple users within Chrome to ease your testing burden as different users. Learn how to use R and Python within SQL Server with SQL Server Machine Learning Services (microsoft.github.io)
93. Developer Shopping Spree
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. Using your podcast player to read these show notes? You can view this episode’s full show notes and participate in the discussion over at https://www.codingblocks.net/episode93. 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 Anonymous VoteSign in with WordpressWho is your favorite virtual assistant?Alexa. The OG of assistants.Google Assistant. Because accuracy matters.Siri. Who needs accuracy with looks this good?Cortana. Hipsterific. I only like things no one else likes.vote News To everyone that left us a review, thank you. We truly appreciate it. iTunes: can’t Tic, BBallDaniel3, Kitchener16253 Stitcher: aflak, thepigeonfighter Lists Worth Checking Twice … Joe’s Blinged-Out Wish List Price Description $99.99 Corsair RMX Series RM860x 850W ATX12V (Amazon) $139.99 Corsair Hydro Series H115i PRO RGB Water Cooler (Amazon) $197.99 Samsung 970 Pro M.2 2280 512GB (Amazon) $319.74 Corsair Vengeance RGB Pro 32GB (3000) (Amazon) $399.99 ASUS Prime X299-Deluxe LGA 2066 (X299 6Gb/s) (Amazon) $699.99 ZOTAC GeForce GTX 1080 Ti (Amazon) $1,129.99 Intel Core i9-7949X Skylake X 14-Core 3.1 GHz (Amazon) Michael’s Automated Wish List Description Price Sonos One (Amazon) $199.00 Tile Mate with Replaceable Battery (4 pack) (Amazon) $59.99 TP-Link Kasa Smart Wi-Fi Plug Mini (Amazon) $44.99 Alternate: Amazon Smart Plug (Amazon) $24.99 Google Home Mini (Google) $49.00 Philips Hue White and Color Ambiance Smart Light Bulb Starter Kit (Amazon) $99.99 Alternate: TP-Link Kasa Smart Wi-Fi LED Light Bulb (Amazon) $39.99 Google WiFi system, 3 Pack (Amazon) $255.95 AMORTEK Outlet Wall Mount Holder for Google Home Mini (Amazon) $8.99 AMORTEK Google Wifi Wall Mount 3 Pack (Amazon) $17.99 LG 34UC80-B 34-inch 21:9 Curved UltraWide QHD IPS Monitor (Amazon) $549.99 CORSAIR CRYSTAL 570X RGB Mid-Tower Case (Amazon) $179.99 Samsung 970 Pro 512GB (Amazon) $197.99 Samsung 860 Evo 1TB (Amazon) $166.99 Razer DeathAdder Chroma (Amazon) $54.49 Transcend 64GB Flash Drive (Amazon) $23.99 ELLESYE Qi Certified Wireless Charging Stand (Amazon) $25.99 BRAINWAVZ Truss – The All Metal Under Desk Dual Headphone Hanger Stand Mount (Amazon) $14.99 Coffee Gator Stainless Steel Container (Amazon) $28.97 Apple Watch Series 4, 44mm GPS+Cellular (Amazon) $529.00 Allen’s Wish List Price Description $657 LG 43 UHD with USB C – 8ms (Amazon) $697 Or an alternative, LG 55″ UHD TV! (Amazon) $99 Not Flat Anti-Fatigue Mat (Amazon) $699 Rebel Treadmill 1000 Under Desk Treadmill (Amazon) $40 14 Pc Anti-Snap Exercise Bands (Amazon) $67 Logitech c930e WebCam (Amazon) $319 Kinesis Advantage 2 USB Win / Mac (Amazon) $149 SteelSeries Arctis 7 Gaming / Conferencing Headphones (Amazon) $34 Monoprice 8323 Hifi DJ Bluetooth Headphones (Amazon) $27 Comfortable Earpads – Velour, Faux Leather, Memory Foam (Amazon) $12 Headphone holder (don’t get this one – it bends) (Amazon) $32 Charging station for 6 devices / Watch holder (Amazon) $293 Netgear Orbi RBK50 3000 2 Pack 5k sqft (Amazon) $340 Amplifi HD Alternative to the Orbi – 10k sqft (Amazon) $245 Document Scanner (Amazon) $3 Algorithms App (Android) (Google Play) $328 Autonomous Ergo Chair 2  (Autonomous) $99 Circle with Disney (Built into Orbi above) (Amazon) Resources We Like Stack Overflow Developer Desktop Build – 2017 (nickcraver.com) Coke Commercial – It’s Delux, son! (YouTube) Tip of the Week FLIR C2 Compact Thermal Imaging System (Amazon) Alternative: FLIR ONE Thermal Imaging Camera for iOS (Gen 3) (Amazon) Bring the cloud to the edge with Azure IoT Edge (azure.microsoft.com) Freeze your CSS State by using F8 (Stack Overflow) Automate your life with IF This Then That (IFTTT)
92. Azure Functions and CosmosDB from MS Ignite
This is a special episode recorded at Microsoft Ignite 2018 where John Callaway from The 6 Figure Developer Podcast joins Allen Underwood to talk about Azure Functions and CosmosDB. Find out what they are and why you might want to try them out for yourself. Using your podcast player to read these show notes? You can view this episode’s full show notes and participate in the discussion over at https://www.codingblocks.net/episode92 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. News Huge thank you to all those that left us a review, we really do appreciate it. iTunes: Rick Wolter, Nikola Jankovic Big Thanks to Microsoft Huge thanks to Microsoft for having us out here to record an episode at Microsoft Ignite in their podcast booths! If you’ve not heard of Ignite, here’s why you might care… Over 700 deep dive sessions Over 100 self-paced workshops Watch demos, check out the latest technology, meet the experts Keynotes from speakers such as Satya Nadella Swag…of course you come for the swag Azure Functions What are they? Serverless – just means you don’t have a server running 24/7 that you’re paying for No provisioning or maintaining servers – all handled by Azure managed compute platform Scales on demand Supports multiple languages (depending on trigger types) Why should you care? Easy and inexpensive way to get familiar with the cloud Ability to create powerful, low-cost micro services Worry about your application functionality, and not your infrastructure ANNOUNCEMENT Azure Functions 2.0 is out as of Ignite (September 24th, 2018)! Can run in Mac, Linux and Windows Azure functions in Kubernetes Azure functions in IoT edge Faster than v1 – much faster Can use .NET Core 2.1 Now load their own contexts meaning less conflicts https://azure.microsoft.com/en-us/blog/introducing-azure-functions-2-0/ How do you use them? Through the use of Triggers HTTP Timer Queue Service Bus Queue Service Bus Topic Blob Event Hub CosmosDB IoT Hubs (Event / Service Bus) Generic Webhook External File And More… Most of the more generic trigger types support C#, F# and Javascript There is also support for additional languages in experimental mode such as: Bash, Batch, PHP, PowerShell, Python and Typescript Best Practices Avoid long running functions – under 5 minutes from what I’ve seen If not using “Durable Functions”, use storage queues for cross function communication There are limits on storage queue size – 64KB – if that’s a problem, utilize storage blobs Write functions to be stateless If state needs to be maintained, use state on the data itself, such as having a state member or property Write the function to be idempotent – it will return the same value with the same inputs Write defensive functions Plan for failures at each step Make sure the next time the function runs it can pick up where the previous failed or left off, and doesn’t redo work – could be detrimental depending on what’s being done Know about poison queues and how to use them https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue#trigger—poison-messages Scalability and how function scaling works https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale Assuming the “Consumption Plan” CPU and RAM scale up automatically – up to 1.5GB of RAM Function apps that share the same consumption plan scale independently Function files are stored on the main storage account associated with the function Interesting gotcha – when using a blob trigger, it can take up to 10 minutes for a blob to be processed if the function went to sleep Can avoid this by having an App Service plan with Always Enabled turned on, or use an Event Grid trigger A scale controller automatically scales up the number of instances of the function to meet demand Maximum number of 200 instances – created 10 seconds apart There is no maximum number of concurrent requests a function can handle though Need to be concerned with number of connections being used – 300 is the limit Billing is in gigabyte-seconds – combination of the memory size and execution time of the function At the time of this writing… Consumption plan pricing includes a monthly free grant of 1 million requests and 400,000 GB-s of resource consumption per month GB-s = Average memory size in Gigabytes (rounded up to the nearest 128MB) times the execution time in milliseconds Minimum is 100ms and 128MB $0.000016/GB-s 1 million executions is $0.20 https://azure.microsoft.com/en-us/pricing/details/functions/ Best Practices https://docs.microsoft.com/en-us/azure/azure-functions/functions-best-practices Useful Tools for Azure Functions and CosmosDB (and Azure in general) Azure Core Tools https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local Azure Data Explorer https://azure.microsoft.com/en-us/features/storage-explorer/ Visual Studio / Visual Studio Code https://code.visualstudio.com/download CosmosDB What is it? Globally distributed, multi-model database for any scale It offers throughput, latency, availability, and consistency guarantees with comprehensive service level agreements (SLAs), something no other database service can offer Can distribute your data to any azure regions with the click of a button Multi-homing API’s can detect your nearest enabled data center and route traffic there for lowest possible latency All you do is add regions you want to scale to, no application changes necessary Multi-Model Uses the Atom-Record-Sequence (ARS) based data model – this just means it natively supports multi-models Document, Graph, Key-Value, Table, Column-Family, and others A number of API’s are available in multiple language SDKs SQL – schema-less JSON database storage with SQL querying capability MongoDB – MongoDB as a service – scalable and expressive document database Cassandra – CassandraDB as a service – highly available, document database Gremlin – Graph Database Table – Key-Value storage – similar to Azure Table Storage but with lower latency, globally available, automatic-indexing with little to no code changes Scalability Scales at per second granularity Storage scales transparently and automatically For a typical 1KB item, Cosmos DB guarantees end-to-end latency of reads under 10 ms and indexed writes under 15 ms at the 99th percentile, within the same Azure region. The median latencies are significantly lower (under 5 ms). High Availability 99.99% availability SLA for all single region database accounts, and all 99.999% read availability on all multi-region database accounts. Tunable consistency levels – allows you to choose how important consistent reads and writes are Don’t Worry About Performance Wait, what?! Rapidly iterate the schema of your application without worrying about database schema and/or index management. Azure Cosmos DB’s database engine is fully schema-agnostic – it automatically indexes all the data it ingests without requiring any schema or indexes and serves blazing fast queries. Who’s it For? Any web, mobile, gaming, and IoT application that needs to handle massive amounts of data, reads, and writes at a global scale with near-real response times for a variety of data will benefit from Azure Cosmos DB’s guaranteed high availability, high throughput, low latency, and tunable consistency. Monitoring Azure Functions Built in monitoring using function storage for logging – limited information Azure Application Insights – preferred method There’s a daily limit for free monitoring, so pay close attention to your caps Configure via an instrumentation key Cosmos DB Simply choose the Metrics page of the Cosmos DB to watch Can also pull the performance information using the SQL API’s Resources we Like https://functionschallenge.azure.com/ https://microsoft.com/learn If you don’t have a PluralSight account, start a free trial and then check out the courses below: https://www.codingblocks.net/pluralsight https://app.pluralsight.com/library/courses/azure-functions-fundamentals https://app.pluralsight.com/library/courses/csharp-code-azure-functions-reducing-duplication Tip of the Week Online editor for coding web applications https://codesandbox.io/ Choosing the right estimator http://scikit-learn.org/stable/tutorial/machine_learning_map/
91. How to Learn Programming Skills
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 a triangle … oh, and Google Feud is back! Using your podcast player to read these show notes? You can view this episode’s full show notes and participate in the discussion over at https://www.codingblocks.net/episode91. 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. News To everyone that left us a review, thank you. We truly appreciate it. iTunes: lawfej, Arezx27, Zta192 Stitcher: Inquizarus, garyalex, SarahA How to Get Better at Getting Better The 5 models Deliberate Practice Dreyfus Model of Skill Acquisition Four Stages of Competence The Learning Pyramid 7 Learning Styles Setting goals Uber or Graph Database? Picking what is important to you… Play to strengths? Strengthen your weaknesses? Focus on highest ROI? Deliberate practice Understand your goals, your aptitude, and execute custom exercises Tailored towards advancing skill, ignores knowledge Listen to episode 78 for a deep dive on deliberate practice. Dreyfus Model of Skill Acquisition Controversial The optimum way to learn changes as your knowledge and skill grow Novice Understand the tools / philosophy Explore ecosystem Define learning goals Getting started Beginner Training course Buy a book Playground project Intermediary Experiments Documentation Reading Advanced Teach others Four Stages of Competence The square, er, triangle, wait square? Diagrams are hard. Unconscious incompetence Don’t recognize the deficit Often undervalues the skill Conscious Incompetence You know you’re bad Making mistakes and learning from them is important Conscious Competence Using the skill requires attention and effort’ Unconscious Competence Skill becomes second nature Teaching can be tough, depending on how you learn The Learning Pyramid (aka cone of learning, or cone of experience) The Learning Square, no wait, this one’s a triangle. Passive Teaching Methods Lecture 5% Reading 10% Audio Visual 20% Demonstration 30% Participatory Teaching Methods 50% Practicing by doing 75% Teaching others 90% Well, it’s controversial. 7 Learning Styles Visual (spatial):You prefer using pictures, images, and spatial understanding. Aural (auditory-musical): You prefer using sound and music. Verbal (linguistic): You prefer using words, both in speech and writing. Physical (kinesthetic): You prefer using your body, hands and sense of touch. Logical (mathematical): You prefer using logic, reasoning and systems. Social (interpersonal): You prefer to learn in groups or with other people. Solitary (intrapersonal): You prefer to work alone and use self-study. Also controversial. Resources We Like The Imposter’s Handbook (bigmachine.io) Take Control of Your Life (Complete Developer Podcast, episode 16) How to pick up a new technology in minimal time? (dev.to) Dreyfus model of skill acquisition (Wikipedia) Four stages of competence (Wikipedia) Why the ‘learning pyramid’ is wrong (The Washington Post) Overview of Learning Styles (learning-styles-online.com) Learning Styles Debunked: There is No Evidence Supporting Auditory and Visual Learning, Psychologists Say (Association for Psychological Science) How to be a Programmer: Community Version (GitHub) How to be a Programmer: Personal and Team Skills (episode 38) How to be an Intermediate Programmer (episode 39) How to be an Advanced Programmer (episode 40) #100DaysOfCode Tip of the Week DevTube – Find curated programming videos by topic, speaker, and popularity. Code Sharing with Serverless Functions using NPM or Node packages.
90. Comparing Git Workflows
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.
Rate Podcast
Followers
Podcast Details
Started
Sep 9th, 2013
Latest Episode
Sep 3rd, 2019
Release Period
Weekly
No. of Episodes
178
Avg. Episode Length
About 2 hours
Explicit
No
Do you host or manage this podcast?
Claim and edit this page to your liking.
Are we missing an episode or update?
Use this to check the RSS feed immediately.