Clean Code - Formatting Matters episode artwork

EPISODE · Nov 29, 2016 · 2H 18M

Clean Code - Formatting Matters

from Coding Blocks

For the full show notes visit: http://www.codingblocks.net/episode50 News Husain and Mike - Check your email! Shout out to AngryZoot! We just haven't mentioned her in a while, and she's awesome - and does martial arts Cynical Developer - James Studdart - Cake, XAML, React (Zac Braddy) Mark McDow - Winner of the O'Reilly Software Architecture Convention - $1700 Maurizio Pozzobon - Code Maid retraction O'Reilly discount code - 50% off print, 40% off e-books! (Soft Skills - JavaScript: The Good Parts) So - you should probably follow us on twitter, or join the mailing list! Michael attended DevFest 2016 - Google Developer Group http://www.gdgatl.xyz/ Secret Back Door in Some U.S. Phones Sent Data to China, Analysts Say http://www.nytimes.com/2016/11/16/us/politics/china-phones-software-security.html Allen attended MVP Summit - amazing Did some F# http://c4fsharp.net/ F# Dojo with Fractal Trees: https://github.com/c4fsharp/Dojo-Fractal-Forest Did some Bot programming - cool stuff Hololens: https://www.microsoft.com/microsoft-hololens/en-us Uhro Sharp - 3D programming in C# https://developer.xamarin.com/guides/cross-platform/urho/ Visual Studio for the Mac?! https://www.visualstudio.com/vs/visual-studio-mac/ Reply All - Pepe the Frog https://gimletmedia.com/episode/77-the-grand-tapestry-of-pepe/ Want a Coding Blocks sticker? Send us a Self-Addressed-Stamped-Envelope Clean Code - Drawing! Oddvar Tengesdal won a copy of Clean Code! Programming Beyond Practices http://shop.oreilly.com/product/0636920047391.do Survey [yop_poll id="26"] Formatting If your code is a mess, then people will assume that your attention to detail in how the app was coded is also a mess - perception Teams should adopt formatting rules and follow them Automated tools help with the process "Code formatting is important" Code formatting has a direct affect on maintainability and extensibility of code over time Vertical Formatting Try to keep max length around 500 lines long and smaller is better - FitNesse app is in this range Tomcat and Ant - several thousand lines long and at least half are over 200 Newspaper metaphor - read it vertically - headlines at the top detail increases as we go down the page Separate concepts with blank lines Closely associated code should be grouped together so it's dense Concepts (methods) that are closely related should be grouped as closely together as possible to keep from hunting through files Variable declarations should be as close to their usage as possible If the methods are short, then the variable declarations should be at the top of the function! Control variables for loop should be defined within the loop Instance variables should be declared at the top of a class When one function calls another, those should be close vertically in the file Conceptual affinity - when methods do similar things or are named similarly, they should also appear close to each other Vertical ordering of methods - the caller should be first, then the callee, and that method's callee, etc…on down the page New Survey New Macbooks - Death of Macbook Pro? - The beginning of a new awesome era? Horizontal Formatting How wide should a line be?! In the popular projects examined, it appeared that 40% of lines were between 20 and 60 characters Another 30% of lines were less than 10 characters… Author suggests that beyond 100-120 is careless Put spaces on both sides of an assignment operator (equals sign) Don't put spaces between the function name and the parens DO put spaces after individual arguments / parameters in a list - shows they are separate Also use spacing to indicate the precedence of operations - think of spacing in math equations with several parentheses - author calls it out for order of precedence, I actually don't like this one - I prefer grouping with parens Lining up variable declarations, names, types - found that it was distracting to the "story" of the code….I agree Hierarchically lining up code based on it's scope - super important Author would sometimes condense multiple lines into one (like a get; set;) eventually set it back for readability (breaking indentation) What about for PRINT statements in SQL??? while statements - indent the semicolon on the next line…otherwise they're hidden Follow the team's formatting rules…don't go vigilante He threw in Uncle Bob's formatting rules Resources we Like Clean Code Clean Code http://amzn.to/2cryvJR Tip of the Week Michael: Chrome Debugging - Break on Attribute Modification https://developers.google.com/web/tools/chrome-devtools/javascript/add-breakpoints Allen: Enforce code formatting amongst many editors for people on a team - from Gustav in our Slack community http://editorconfig.org/ Joe: Coding Math on Youtube: https://www.youtube.com/user/codingmath

Episode metadata supplied by the publisher feed · Published Nov 29, 2016

NOW PLAYING

Clean Code - Formatting Matters

0:00 2:18:35

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

API Intersection Stoplight Building a successful API requires more than just coding. It starts with collaborative design, focuses on creating a great developer experience, and ends with getting your company on board, maintaining consistency, and maximizing your API’s profitability.In the API Intersection, you’ll learn from experienced API practitioners who transformed their organizations, and get tangible advice to build quality APIs with collaborative API-first design.Jason Harmon brings over a decade of industry-recognized REST API experience to discuss topics around API design, governance, identity/auth versioning, and more.They’ll answer listener questions, and discuss best practices on API design (definition, modeling, grammar), Governance (multi-team design, reviewing new API’s), Platform Transformation (culture, internal education, versioning) and more.They’ll also chat with experienced API practitioners from a wide array of industries to draw out practical takeaways and insights you can use.H Unshamed & Unchained: Carving Space For Self-Healing & Habit Transformation Danny Poelman Welcome to "Unshamed & Unchained: Carving Space For Self-Healing & Habit Transformation", the podcast where we break the chains of shame and societal expectations to create a safe space for self-healing, habit transformation, and personal growth. Hosted by a seasoned life coach, Danny Poelman DDS, with years of hands-on experience, this podcast is your guide to reclaiming your voice, embracing your story, and living life on your terms.In each episode, we dive deep into the topics that matter most to you—whether it's:-breaking free from unwanted habits like pornography-excessive people-pleasing-healing from past trauma-recovering from narcissistic abuse or religious/relational trauma-anxiety/depression-money mindset blocks-overcoming limiting beliefsWe’re not afraid to talk about the things that are often considered taboo, because we believe that through honest, unfiltered conversations, real transformation happens.You’ll hear real Khanyisa Keke TV Khanyisa Keke On Khanyisa Keke TV, developers can learn and improve their Android for Kotlin Development skills. On this podcast, programmers can learn Android for Kotlin coding from scratch, improve their existing programming skills, get tips, be kept up to date with all the latest happenings and get access to free resources. Powered by Firstory Hosting The Triathlon Mental Performance Podcast Neil Edge This podcast is for you if you are a Triathlete that is interested in learning about tools and strategies to overcome challenges and to utilize the power of your mind to race faster.I'm an experienced Triathlon Mental Performance Coach working with both Age Groupers and Pros.Episodes will cover the following and more.How to improve your mental toughnessRemoving the possibility of panic attacks in open water Removing the fear of fast descents on your bike -Removing mental blocks to improve your race times Completely remove performance anxiety (you don't have to just cope with it)4 weeks to race day - Strategies to  arrive at your a-race feeling calm and confident, with race day mental strategiesI will also talk about specific tools that you can use to ensure that you race faster.<b

Frequently Asked Questions

How long is this episode of Coding Blocks?

This episode is 2 hours and 18 minutes long.

When was this Coding Blocks episode published?

This episode was published on November 29, 2016.

What is this episode about?

For the full show notes visit: http://www.codingblocks.net/episode50 News Husain and Mike - Check your email! Shout out to AngryZoot! We just haven't mentioned her in a while, and she's awesome - and does martial arts Cynical Developer - James...

Can I download this Coding Blocks episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!