Skip to content
Clean Code - Writing Meaningful Names episode artwork

EPISODE · Sep 28, 2016 · 1H 51M

Clean Code - Writing Meaningful Names

from Coding Blocks

In this episode, we take our first dive into the book Clean Code by Robert Martin and specifically we talk about writing meaningful names for all things code related. You'll be amazed at how following some decent rules that you can start naming things that will help you and fellow coders understand your code at a glance. You can see the original show notes and put your own stamp on our survey here: http://www.codingblocks.net/episode47 News Samsung 960 Pro http://www.anandtech.com/show/10698/samsung-announces-960-pro-and-960-evo-m2-pcie-ssds SQL Server 2016 Columnstore for real time operational analytics https://msdn.microsoft.com/en-us/library/dn817827.aspx Krebs site taken off Akamai http://www.zdnet.com/article/krebs-on-security-booted-off-akamai-network-after-ddos-attack-proves-pricey/ The best Android distribution is iOS? Outlaw's thoughts on various phone OS's Survey [yop_poll id="23"] Meaningful Names - Clean Code Chapter 2 "If a name requires a comment, then the name does not reveal its intent" Write explicit code - naming variables and methods can reveal the entire intent of the code Avoid using words that would be confusing like "List" as they refer to programming types and could be misleading : accountList should be accounts Avoid using characters that look like numbers i and L or capital o disinformative vs noninformative noise words "data" "info" - noninformative Types should almost never be in a name "table" "string" "object" Names should be distinguished so a user can look at them and understand the differences Use pronounceable names Use searcheable names - longer names trump shorter names Author's pref - single letter names should only be used as local variables inside small methods - length of the name should correspond to the size of its scope Avoid encoding names Avoid Hungarian Notation with typing as part of the variable name - simply not needed nowadays Stop prefixing member (instance) variables with m_ or _ Decorating Interfaces vs Classes with a prefix / suffix - opinion - he prefers ClassImp or vs IType Don't force someone to map variable names in their mind - n = username…smart programmer vs professional programmer - clarity is king Class names should be nouns - English 101 - NOT VERBS Method names should be verbs Use get, set, is - javabean standard When constructors are overloaded, use static factory methods with explicit names - liked this one, possibly make the constructors private Don't get cute with naming by means of jokes (inside or well known) Use consistent naming - Get, Set, Controller - makes it easier to understand and code various parts of an application Avoid puns - add for a collection vs add for setting a value - two different meanings with the same name Use technical names such as pattern names or CS terms in your names - other programmers will understand them better than the problem domain in some cases Fall back to the problem domain for a name if there is no suitable technical name Adding context to naming can clarify their use - prefixes can work but putting variables into classes may work out better "Hardest thing about choosing good names is that it requires good descriptive skills and a shared cultural background" Renaming things that don't make sense as you work in code is a good thing. Resources we Like Clean Code Clean Code by Robert C. Martin Even though we're giving our thoughts on the various ideas throughout the book, Clean Code has tons of excellent sample code that really helps drive the points home. We can't recommend it enough - it's probably one of the few books EVERY developer should read and revisit from time to time. http://amzn.to/2cryvJR Tip of the Week Allen: Implementing OAuth in ASP.NET for a number of providers http://www.oauthforaspnet.com/ Michael: Get out there! Go to conferences, meetups, do it all! http://www.connect.tech/ https://www.atlantacodecamp.com/2016

Episode metadata supplied by the publisher feed · Published Sep 28, 2016

Embed this episode

Ready to play

Clean Code - Writing Meaningful Names

0:00 1:51:36

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.

No similar episodes found.

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 beliefs We’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 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 toughness Removing 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 strategies I will also talk about specific tools that you can use to ensure that you race faster. <b BAT Community Podcast BAT Community & Brave Basic Attention Token (BAT) is a revolutionary digital advertising and rewards platform from the inventor of JavaScript and co-founder of Mozilla and Firefox that rewards users in Ethereum-based BAT tokens. Brave is a fast, BAT-powered privacy browser that blocks all 3rd-party ads and trackers by default. Learn more about BAT, Brave and tech with this podcast! The Belief Breakthrough Show Tina Encarnacion The Belief Breakthrough Show is all about breaking past limiting beliefs and shifting perspective to achieve the life you dream of. The show is hosted by Tina Encarnacion the Author of Stuck In The Fire, Reiki Energy Healer and Trauma & Abuse Coach. Each month she brings on eight guests that focus on a specific limiting belief to help the listeners breakthrough their blocks and get closer to their destiny.

Frequently Asked Questions

How long is this episode of Coding Blocks?

This episode is 1 hour and 51 minutes long.

When was this Coding Blocks episode published?

This episode was published on September 28, 2016.

Can I download this Coding Blocks episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!