To tell a better story in code, start with knowing your audience, use ubiquitous languages in your code so that no translation is needed for your audience.
Apply visual design principles to identify code smells and organize the layout in a way to strengthen the communication.
Start from there then practice often by refactoring.
The truth is there are never shortcuts to tell a better story in life or in code, practice practice practice by refactoring we will make our code tell a better story.
Let’s opt in better software for our future selves and others. Let’s make our code accessible for those who are interested in our code. Let’s invite our audience to our story in code.
There's an old joke that goes, “The two hardest things in programming are cache invalidation, naming things, and off-by-one errors.” In this talk, we'll discuss the subtle art of naming things – a practice we do every day but rarely talk about.
The blogs "Dynamic Language Weenies Victorious After All (http://diagrammes-modernes.blogspot.com/2007/07/dynamic-language-weenies-in-default.html)" and "Invasion of the dynamic language weenies? (http://blogs.adobe.com/shebanation/2007/03/invasion_of_the_dynamic_langua.html)" are based on “Invasion Of The Dynamic Language Weenies (http://www.hacknot.info/hacknot/action/showEntry?eid=93)”. Unfortunately http://www.hacknot.info/hacknot/action/showEntry?eid=93 is no longer easily accessible. I could manage to retrieve the article from Internet Archive (http://www.archive.org/).
Get the best deals in python assignment help from the leading experts in the world. We have already offered the best Help with Python to more than 5000+ students.
A spell checker is an application program to
process the natural languages in machine readable format
effectively. Spelling checking and correction is a basic
necessity and a tedious work in any language, so we require
spell checker software to do this, which is the fundamental
necessity for any work. Spell checker is a set of program
which analyzes the wrongly used word and corrects it by the
most possible correct word. The challenging task here is the
work done for a Kannada language. In a software system
many Kannada words are typed in several formats since
Kannada has many fonts to write the grammar properly.
In this paper, we describe some techniques used in
Kannada language by a spell checker. We use NLP, which is
a field of computer science having relationship between
human (i.e., natural languages) and computers. Usually, we
have some modern NLP algorithms based on machine
learning to carry out the work.
Boost Your Base Bootcamp - [Online & Offline] In BanglaStack Learner
Boost Your Base Bootcamp
Stack School:
https://courses.stackschool.co/courses/boost-your-base-bootcamp
"Boost Your Base Bootcamp[ Online + Offline ]", In this long course we will introduce you to C Programming Language, Java, Data Structures and Algorithms, Design Patterns and Problem Solving. At the end of the Bootcamp, you will find yourself in a place where you can engage yourself in any field of the IT world.
50+ Weeks, 100+ Classes - A Long Journey to Become A Programmer
অবজেক্ট অরিয়েন্টেড প্রোগ্রামিং, ডাটা স্ট্রাকচারস এবং অ্যালগোরিদম
আইটি জগতে নিজেকে যোগ্য করে গড়ে তোলার জন্য আপনার দরকার প্রোগ্রামিং এবং কম্পিউটার সাইন্সের দক্ষতা। এই দীর্ঘ কোর্সে আমরা আপনাকে সি প্রোগ্রামিং ল্যাংগুয়েজ, জাভা, ডাটা স্ট্রাকচার এবং অ্যালগোরিদম, ডিজাইন প্যাটার্ন এবং প্রব্লেম সল্ভিং এর সাথে পরিচয় করাবো। হাতে কলমে শেখানোর সাথে সাথে ইন্ডিভিজুয়াল এবং গ্রুপ প্রোজেক্টের মাধ্যমে আপনাকে দক্ষ করে গোড়ে তোলার চেষ্টা করা হবে এই সুবিশাল কোর্সে। এই কোর্স শেষে আপনি নিজেকে এমন একটি জায়গায় আবিষ্কার করবেন যেখান থেকে আপনি আইটি জগতের যেকোনো ফিল্ডে নিজেকে জড়িত করতে পারবেন। আপনার প্রোগ্রামিং এর ভিত্তি তৈরির কাজ করবে এই বুটক্যাম্পটি।
There's an old joke that goes, “The two hardest things in programming are cache invalidation, naming things, and off-by-one errors.” In this talk, we'll discuss the subtle art of naming things – a practice we do every day but rarely talk about.
The blogs "Dynamic Language Weenies Victorious After All (http://diagrammes-modernes.blogspot.com/2007/07/dynamic-language-weenies-in-default.html)" and "Invasion of the dynamic language weenies? (http://blogs.adobe.com/shebanation/2007/03/invasion_of_the_dynamic_langua.html)" are based on “Invasion Of The Dynamic Language Weenies (http://www.hacknot.info/hacknot/action/showEntry?eid=93)”. Unfortunately http://www.hacknot.info/hacknot/action/showEntry?eid=93 is no longer easily accessible. I could manage to retrieve the article from Internet Archive (http://www.archive.org/).
Get the best deals in python assignment help from the leading experts in the world. We have already offered the best Help with Python to more than 5000+ students.
A spell checker is an application program to
process the natural languages in machine readable format
effectively. Spelling checking and correction is a basic
necessity and a tedious work in any language, so we require
spell checker software to do this, which is the fundamental
necessity for any work. Spell checker is a set of program
which analyzes the wrongly used word and corrects it by the
most possible correct word. The challenging task here is the
work done for a Kannada language. In a software system
many Kannada words are typed in several formats since
Kannada has many fonts to write the grammar properly.
In this paper, we describe some techniques used in
Kannada language by a spell checker. We use NLP, which is
a field of computer science having relationship between
human (i.e., natural languages) and computers. Usually, we
have some modern NLP algorithms based on machine
learning to carry out the work.
Boost Your Base Bootcamp - [Online & Offline] In BanglaStack Learner
Boost Your Base Bootcamp
Stack School:
https://courses.stackschool.co/courses/boost-your-base-bootcamp
"Boost Your Base Bootcamp[ Online + Offline ]", In this long course we will introduce you to C Programming Language, Java, Data Structures and Algorithms, Design Patterns and Problem Solving. At the end of the Bootcamp, you will find yourself in a place where you can engage yourself in any field of the IT world.
50+ Weeks, 100+ Classes - A Long Journey to Become A Programmer
অবজেক্ট অরিয়েন্টেড প্রোগ্রামিং, ডাটা স্ট্রাকচারস এবং অ্যালগোরিদম
আইটি জগতে নিজেকে যোগ্য করে গড়ে তোলার জন্য আপনার দরকার প্রোগ্রামিং এবং কম্পিউটার সাইন্সের দক্ষতা। এই দীর্ঘ কোর্সে আমরা আপনাকে সি প্রোগ্রামিং ল্যাংগুয়েজ, জাভা, ডাটা স্ট্রাকচার এবং অ্যালগোরিদম, ডিজাইন প্যাটার্ন এবং প্রব্লেম সল্ভিং এর সাথে পরিচয় করাবো। হাতে কলমে শেখানোর সাথে সাথে ইন্ডিভিজুয়াল এবং গ্রুপ প্রোজেক্টের মাধ্যমে আপনাকে দক্ষ করে গোড়ে তোলার চেষ্টা করা হবে এই সুবিশাল কোর্সে। এই কোর্স শেষে আপনি নিজেকে এমন একটি জায়গায় আবিষ্কার করবেন যেখান থেকে আপনি আইটি জগতের যেকোনো ফিল্ডে নিজেকে জড়িত করতে পারবেন। আপনার প্রোগ্রামিং এর ভিত্তি তৈরির কাজ করবে এই বুটক্যাম্পটি।
Code quality directly impacts how easy or hard your job is. The higher the quality, the easier it is for anyone (including you) to quickly jump in and get to work. Where do you start? In this session, Tonya Mork will empower you to simplify your code while dramatically increasing its code quality.
It's all about building <human code>, code that is highly human readable and understandable.
This slide deck is from a session I gave for WPSessions. https://wpsessions.com/sessions/code-quality-makes-jobs-easier/
This talk happened at the University of Tarragona (URV) with a lot of students as attendees. It encourages to strive for a learning culture and being better professionals in software development.
WordCamp Nashville: Clean Code for WordPressmtoppa
Slides from my talk at WordCamp Nashville, including notes. Covers why clean code is important, and provides 10 tips to make your code cleaner, for WordPress and beyond
We want code that is easy to understand, re-usable, and flexible. But we are always up against deadlines, so we rush, and end up with code that is messy, buggy, hard to maintain, and makes us go slower even though we’re trying to go faster.
What is clean code? In this talk I’ll provide some answers to this question, and introduce you to 10 good habits that will help keep your code clean, such as the use of meaningful names for your variables and functions, and following the “Boy Scout Rule” (leave the code cleaner than you found it). I will even try to persuade you that using a lot of code comments is a sign that there are problems with your code.
Mobile Warsaw - Efficient Localization for iOS AppsEdgar Figueiredo
In this talk for the Mobile Warsaw Meetup I presented how to automate the whole process of localising your iOS app to multiple languages. I also discuss why localisation is a good idea, and share some links to nice material on the topic
At the core, the job of a software developer is and has always been the same: writing good, elegant, sustainable and bug-free software that exceeds the expectations of your clients. But the context in which we do our job is changing and with it the skills required to be a great software developer. In this talk, I want to go through a couple of things that I think make the difference between a developer and a great developer. This includes some technical skills and practices, but also non-technical things that you might not consider relevant for a developer at first.
Many teams may have a front end developer among their ranks, but besides a title or area of responsibility, it can be difficult to pinpoint the exact craft of front end development. Expertise in web technologies is a good start, but we can't forget the users we actually build for. This talk will examine the impact of the front end on User Experience. I'll talk about how becoming more fluent across more UX concerns like content and user research can help front enders make better decisions, can bring more clarity to our craft, and result in building better experiences for our users.
Do you wish to gain thorough knowledge on the topic of computer coding and its numerous benefits? Continue to our blog for a quick lesson on what is coding. (Source URL: https://www.goodcore.co.uk/blog/what-is-coding/)
Form Function Class 6, Manila, Philippines 14/11/2015Holger Bartel
Sweating Details - Slides from my talk at Form Function Class 6 in Manila Philippines on Nov 14th, 2015.
This talk is about sweating details and how small tweaks and changes can make a big difference in any of the web design stages. From optimising the process, via UX and design all the way to performance, this talk covers possible tweaks and recommendations with some practical examples to improve the overall experience of our products.
Top 10 Interview Questions for Coding Job.docxSurendra Gusain
Hello everyone!! Today’s blog topic is ‘Top 10 Interview Questions for Coding Job.’ Questions related to programming and coding are a crucial part of a developer’s position interview. If you want to succeed, you need to be familiar with the fundamental concepts of coding and programming. Your coding skills play a huge factor in increasing your chances of hiring in the interview process. Coding is an excellent field with various career opportunities within the country or even abroad but it also means it has lots of competition which makes the whole interview process quite challenging.
Top 10 Interview Questions for Coding Job.docxSurendra Gusain
Hello everyone!! Today’s blog topic is ‘Top 10 Interview Questions for Coding Job.’ Questions related to programming and coding are a crucial part of a developer’s position interview. If you want to succeed, you need to be familiar with the fundamental concepts of coding and programming. Your coding skills play a huge factor in increasing your chances of hiring in the interview process. Coding is an excellent field with various career opportunities within the country or even abroad but it also means it has lots of competition which makes the whole interview process quite challenging.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
More Related Content
Similar to How to tell a better story (in code)(final)
Code quality directly impacts how easy or hard your job is. The higher the quality, the easier it is for anyone (including you) to quickly jump in and get to work. Where do you start? In this session, Tonya Mork will empower you to simplify your code while dramatically increasing its code quality.
It's all about building <human code>, code that is highly human readable and understandable.
This slide deck is from a session I gave for WPSessions. https://wpsessions.com/sessions/code-quality-makes-jobs-easier/
This talk happened at the University of Tarragona (URV) with a lot of students as attendees. It encourages to strive for a learning culture and being better professionals in software development.
WordCamp Nashville: Clean Code for WordPressmtoppa
Slides from my talk at WordCamp Nashville, including notes. Covers why clean code is important, and provides 10 tips to make your code cleaner, for WordPress and beyond
We want code that is easy to understand, re-usable, and flexible. But we are always up against deadlines, so we rush, and end up with code that is messy, buggy, hard to maintain, and makes us go slower even though we’re trying to go faster.
What is clean code? In this talk I’ll provide some answers to this question, and introduce you to 10 good habits that will help keep your code clean, such as the use of meaningful names for your variables and functions, and following the “Boy Scout Rule” (leave the code cleaner than you found it). I will even try to persuade you that using a lot of code comments is a sign that there are problems with your code.
Mobile Warsaw - Efficient Localization for iOS AppsEdgar Figueiredo
In this talk for the Mobile Warsaw Meetup I presented how to automate the whole process of localising your iOS app to multiple languages. I also discuss why localisation is a good idea, and share some links to nice material on the topic
At the core, the job of a software developer is and has always been the same: writing good, elegant, sustainable and bug-free software that exceeds the expectations of your clients. But the context in which we do our job is changing and with it the skills required to be a great software developer. In this talk, I want to go through a couple of things that I think make the difference between a developer and a great developer. This includes some technical skills and practices, but also non-technical things that you might not consider relevant for a developer at first.
Many teams may have a front end developer among their ranks, but besides a title or area of responsibility, it can be difficult to pinpoint the exact craft of front end development. Expertise in web technologies is a good start, but we can't forget the users we actually build for. This talk will examine the impact of the front end on User Experience. I'll talk about how becoming more fluent across more UX concerns like content and user research can help front enders make better decisions, can bring more clarity to our craft, and result in building better experiences for our users.
Do you wish to gain thorough knowledge on the topic of computer coding and its numerous benefits? Continue to our blog for a quick lesson on what is coding. (Source URL: https://www.goodcore.co.uk/blog/what-is-coding/)
Form Function Class 6, Manila, Philippines 14/11/2015Holger Bartel
Sweating Details - Slides from my talk at Form Function Class 6 in Manila Philippines on Nov 14th, 2015.
This talk is about sweating details and how small tweaks and changes can make a big difference in any of the web design stages. From optimising the process, via UX and design all the way to performance, this talk covers possible tweaks and recommendations with some practical examples to improve the overall experience of our products.
Top 10 Interview Questions for Coding Job.docxSurendra Gusain
Hello everyone!! Today’s blog topic is ‘Top 10 Interview Questions for Coding Job.’ Questions related to programming and coding are a crucial part of a developer’s position interview. If you want to succeed, you need to be familiar with the fundamental concepts of coding and programming. Your coding skills play a huge factor in increasing your chances of hiring in the interview process. Coding is an excellent field with various career opportunities within the country or even abroad but it also means it has lots of competition which makes the whole interview process quite challenging.
Top 10 Interview Questions for Coding Job.docxSurendra Gusain
Hello everyone!! Today’s blog topic is ‘Top 10 Interview Questions for Coding Job.’ Questions related to programming and coding are a crucial part of a developer’s position interview. If you want to succeed, you need to be familiar with the fundamental concepts of coding and programming. Your coding skills play a huge factor in increasing your chances of hiring in the interview process. Coding is an excellent field with various career opportunities within the country or even abroad but it also means it has lots of competition which makes the whole interview process quite challenging.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
CFD analysis is incredibly effective at solving mysteries and improving the performance of complex systems!
Here's a great example: At a large natural gas-fired power plant, where they use waste heat to generate steam and energy, they were puzzled that their boiler wasn't producing as much steam as expected.
R&R and Tetra Engineering Group Inc. were asked to solve the issue with reduced steam production.
An inspection had shown that a significant amount of hot flue gas was bypassing the boiler tubes, where the heat was supposed to be transferred.
R&R Consult conducted a CFD analysis, which revealed that 6.3% of the flue gas was bypassing the boiler tubes without transferring heat. The analysis also showed that the flue gas was instead being directed along the sides of the boiler and between the modules that were supposed to capture the heat. This was the cause of the reduced performance.
Based on our results, Tetra Engineering installed covering plates to reduce the bypass flow. This improved the boiler's performance and increased electricity production.
It is always satisfying when we can help solve complex challenges like this. Do your systems also need a check-up or optimization? Give us a call!
Work done in cooperation with James Malloy and David Moelling from Tetra Engineering.
More examples of our work https://www.r-r-consult.dk/en/cases-en/
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
2. Welcome to NYC
Welcome to NYC.
This is my first ever conference speaking. Start with the Call For
Proposal day event in Feb organized by Write/Speak/Code,
Google developer group and Codebar. During that event we
promised that we would at least submit one CFP by the end of
this year, and here I am. Everyone please raise your hand. Can
you promise you would also submit at least 1 CFP this year? Yes
you do. We saw it. Thank you!!
3. Who Am I?
• Bonnie Pan
• Staff Applications Engineer
• Medidata Solutions
My name is Bonnie Pan.
I am a Staff Applications Engineer at Medidata Solutions. We
develop applications for clinical trials, making an impact in
patients’ lives around the world.
I am an immigrant from China. I moved here 11 years ago and
started my family here.
I am very proud to be a mom of two kids. I spend a lot of time
with them trying to teach them about the world. my favorite
method to teach is telling stories.
4. The 3 Story Rules
Storytelling is hard. After years’ practice I have learned some
rules to tell a better story.
I find these rules can apply to coding as well.
So… what are the rules that I apply for a good story?
5. RULE #1
Know Your Audience
Rule #1: Know your audience.
While this is more obvious with my children, it is not obvious with
Code.
So the first question is, Who is the audience of our code?
Who reads our code; who modifies our code;who wants to know
the logic behind the code;how to make sure that those who
maintain the code and who consume the code are on the same
page?
It is better to know these before we write the code.
6. “To communicate effectively, the code must be
based on the same language used to write the
requirements - the same language that the
developers speak with each other and with
domain experts.”
–Eric Evans, Domain Driven Design
I recently switched to a new development team in the same
company.
I noticed that we were calling the same concept of a business
entity that performs clinical trials differently on different teams,
one team referred to it as study group, while the other called it
client division. When we collaborate on integration, we need to do
this translation all the time. This is a cognitive cost that we want
to prevent.
One technique to keep us aligned is to speak and code in
Ubiquitous Language.
Ubiquitous Language is a term that Eric Evans uses in the book
Domain Driven Design for the practice of building up a common
and rigorous language throughout the team.
7. Speak in Ubiquitous Language
It is a language understood and spoken by everyone on the team
and in all communications.
To cultivate ubiquitous language is to model it loud and use it in
all communications including code. When in conversations with
product, testers and developers, come up with terms to describe
the business concepts, and pay attention to those specific terms
that the team agrees on. Then use those terms in the code.
Ubiquitous language represents the intersection of business
jargon and technical jargon. We can still use the implementation
oriented technical terms among developers, however the core
concepts in the domain should not allow synonyms or
translations.
8. Code and people have a bidirectional relationship.
It is obvious to see how people can impact code. Because it is
people who write and modify the code. But existing code also
impacts people. For example I would automatically pick up terms
in code for discussions. I would copy the existing code patterns
as a team convention.
When we code in the ubiquitous language we preserve and
accumulate the abstractions and the knowledge of the domain.
Ubiquitous language is essentially a domain model based
language, as we refine our language, the domain model also gets
richer. It connects team communication to the software
implementation. Therefore, no translation is needed within the
team.
Because the language is based on the domain model, when we
recognize a change in the language, it also indicates a change is
Code in Ubiquitous Language
Code <——-> People
9. needed in the domain model, which resides in the code. Therefore,
speak and code in ubiquitous language requires a conscious team
effort and commitment to exercise the language.
10. Utilize other asynchronous
communication artifacts
• Scenarios
• Tests
• Commits
• Pull Request
Descriptions
• Documentation
• Coding Decisions
What I learned from my storytelling experience to my kids, is that
reading the words out loud in a colorful story book is not enough
to attract their attention. I find I often need to sing, ask them
questions, or play games with my kids while telling them stories.
Same applies to the code. What needs to be there for whoever is
interested in our code?
How do we write the code so that our code is more accessible to
our audience?
For product, it is helpful for them to see scenarios that are written
in english and describe high level business workflows.
For testers, it will be helpful for them to review scenarios and test
cases. I have worked with testers looking for information in pull
requests and each commit messages along with them. So it is
good practice to write a short paragraph on the background
context of the code changes, and write more descriptive commit
11. messages.
For developers, start with intention revealing names for parameters,
variables, methods, classes, and file names. I find it is also helpful to
note down some coding decisions of why we write code in certain
ways. Own your expertise in writing!
For technical writers, they will love us if we add diagrams and
up-to-date documentation.
12. But How to Write it?
We have discussed how to tell a better story in Code, the first
step is that we need to know our audience, speak and code in
ubiquitous language, and utilize other communication artifacts to
invite our audience to our code story. But how to write it? Let’s
write some code together next.
13. Let’s Code FizzBuzz!
Let’s code FizzBuzz!
I found this FizzBuzz game online. The game is to play maths with
kids. I am going to save this game for Aimee when she grows up.
It is to practice 5 and 7 times tables.
On the left side is the text description of the game. On the right
side is examples.
The rules in this game are..
How about when a number contains multiple 5s for example 55?
Should the player say Fizz Fizz or Fizz Fizz Fizz?
This is why examples are important in requirements because
description in text often have ambiguities. We use examples to
remove ambiguity, clarify requirements, and make sure we are on
the same story.
14. Since today I am talking about how to write a better story in code.
I thought it would be helpful to start with some story in code and
to make it better along the talk.
The code is in ruby. But the concept is language agnostic.
In fact I switched from C# to ruby last year due to the change of
teams. So my code may not look very ruby idiomatic.
Ask yourself if you can tell the rules of FizzBuzz by taking a
glance of it.
15. Considering what we have discussed, I added tests, utilize other
communication artifacts to compliment our story in code.
Tests are very important.
First of all, they are live requirement documentation. And more
than that, good tests identify and remove ambiguities in the
business requirements.
Secondly, well covered test cases serve as a safety net for future
code changes.
The last thing we want to do in refactoring legacy systems is to
change the existing behavior.
So before we start changing code in a legacy system without
tests, we write tests first. We call those tests capturing the actual
behavior of a piece of code “Characterization tests”. We continue
adding tests until we are satisfied that we understand the code.
Now that tests are available, let’s make the code easier to
understand. Where do we start?
16. We start with code smells. I drew this picture.
A code smell is any characteristic in the source code of a program
that possibly indicates a deeper problem. This is a well explored
area where we have tools available to help us identify those
smells such as data clump, long method and conditional
complexity. For example, we can use the rubycritic gem to identify
ruby code smells.
Human beings are naturally good at visual processing...
Does the visual presentation of the code convey additional
information?
If we borrow the visual design principles from the publishing
industry, will they help us identify code smells and thus improve
the code?
Code Smells
What are they?
17. RULE #2
Visual Design
This comes to my Rule #2 Pay attention to the visual and use
visual design principles to identify code smells and make the key
information stand out.
The Visual design principles we will talk about today I am sure
you already use some of them automatically. I would like to talk
about these small things so after the talk we can do it more
consciously and thus with more strength. Focus on these visual
design principles and think about what they can do for
communication.
18. Look at this version of the code for FizzBuzz problem, the
fizz_buzzify method is too crowded.
It is lacking empty space so my brain immediately shuts down
when I see it.
A lot of lines of code without spacing is the first code smell to me.
19. Visual Design
Principle 1:
White Space
White space in visual design is empty space where to rest our
eyes; in code it is where to rest our brain.
My brain is small, so to me the more white space, the better,
which implies small classes that do one thing and small methods
that do one thing.
After inserting 2 lines of whitespace, I feel much better reading
the code because the white space has delivered an additional
message to me. It tells me how I can read the code in a divide
and conquer maner.
This method has three portions to it. First, a variable assignment.
Then business logic that I don’t want to read. Lastly, a conditional
logic to derive the return value.
20. Visual Design
Principle 1:
White Space
Every line of white space matters more than we would think. How about
adding one more line of white space in the second portion?
This instantly tells me that the body of the business logic contains two parts.
One is about Fizz and the other is about Buzz.
But now the code separated by the white spaces is not on the same
abstraction level.
21. Visual Design
Principle 2:
Proximity
Let’s extract the code to methods. And this is where Proximity
principle is in the play.
The Principle of Proximity states: Group related items together.
Move them physically close to each other, so the related items are
seen as one cohesive group rather than a bunch of unrelated bits.
The closeness or lack of closeness indicates the relationship.
The purpose of proximity is to organize so that the layout
strengthens the communication.
When we write code, we know which pieces of information are
logically connected, express that information graphically by
closeness. For example, a variable should be declared as close
as possible to its first usage. If one function calls another, they
should be close. Don’t put variable declaration or assignment
anywhere just because there is space and let our code readers’
eyes hop around.
22. If there are too many separate elements on a page, try extracting code
to methods to reveal a higher-level abstraction.
Watch for elements that have inappropriate relationships. If they are not
related, move them apart! This usually happens when we extract code to
methods with wrong abstraction.
Now if I take a close look at fizzify and buzzify, both of which contain two
operations. I am not certain if these two operations are related to each
other. Let’s revert by inlining the methods, and align them so that it is
easier to compare.
23. Visual Design
Principle 3:
Alignment
Now let’s inline the extracted methods back, and align them so
that it is easier to see the sameness and difference.
The Principle of Alignment states: Nothing should be placed
arbitrarily on the page.
In fact newspaper design has already told us we like vertical
alignment very much.
With the new arrangement of the code, I find the first two sections
of the business logic are about the divisible rule with different
inputs, and the next two sections are about the contains rule with
different inputs.
Wow divisible and contains! These words appear in our text
description too.
Now as I have revealed the domain concepts of divisible rule and
contains rule, I am planning to abstract to domain objects and use
ubiquitous language in code.
24. It is time to practice our idea! As the old saying goes, practice
makes perfect.
My rule #3 to tell a better story in code is to practice by
refactoring.
Refactoring is the process of changing a software system in such
a way that it does not alter the external behavior of the code yet
improves its internal structure, where a better story is told.
It is easier to read, easier to understand and easier to change.
RULE #3
Practice by Refactoring
25. Let’s review what we have done so far.
We are guided by visual design principles and have rearranged
our code so it is easier to compare.
1. Rearrange the
code
Comparing
26. Since the code is vertically aligned, it is easier to identify two
operations about divisible rule with different inputs, and two
operations about the contains rule with different inputs. We can
extract to methods and give them intention revealing name.
2. Extract to
Methods
Naming
27. Then we abstract to domain concepts and use ubiquitous
language of DivisibleRule and ContainsRule.
3. Abstract to
Objects
Domain Concepts
28. Now the code looks like this. Can you now tell the rules of the FizzBuzz
game? But what about the concept of multiple divisibles and contains?
29. The best part of refactoring is that it is an inexpensive learning experience.
We can always stash and redo it again.
As a good story is rewritten many times. I just learned on Wednesday that
Sandi Metz rewrote her first chapter 8 times. A better story in code is told
when we refactor multiple times too.
Practice another idea and compare, choose the version that helps you
understand the code better.
4. Stash and
Redo again
And continue
30. From my experience with refactoring...
• It is okay that I don’t know where I
am going
31. But believe in small but safe steps.
Start with small little things, such as rearranging the code.
Identify some code smells, give intention revealing names,
extract methods and start from there.
Baby steps, one change at a time.
By safe, I mean we create a safety net before refactoring,
which is tests.
• It is okay that I don’t know where I
am going
• Believe in small but safe steps
32. Tests are important not only they are our safety net, they also
serve as live documentation that can show us the examples
to clarify the expected behavior.
Naming is too important to ignore. Naming anchors the
understanding. hard to understand names makes us afraid to
change.
• It is okay that I don’t know where I
am going
• Believe in small but safe steps
• Naming and tests are important
33. After each refactoring, let’s ask ourselves: do I understand
the code better?
To choose between different refactoring versions: which
version do I understand the code better?
• It is okay that I don’t know where I
am going
• Believe in small but safe steps
• Naming and tests are important
• “Do I understand it better?”
34. In summary…
To tell a better story in code, start with knowing your audience,
use ubiquitous languages in your code so that no translation is
needed for your audience.
Apply visual design principles to identify code smells and organize
the layout in a way to strengthen the communication.
Start from there then practice often by refactoring.
The truth is there are never shortcuts to tell a better story in life or
in code, practice practice practice by refactoring we will make our
code tell a better story.
Let’s opt in better software for our future selves and others. Let’s
make our code accessible for those who are interested in our
code. Let’s invite our audience to our story in code.
Summary
1. Know Your Audience
- Use Ubiquitous language in Your Code
2. Apply Visual Design Principles
- Identify Code Smells
3. Practice Often
- Refactor Refactor Refactor
37. If you are interested in my talk, please check out these talks that inspired me.
Links and References
• Ubiquitous Language Image
• https://www.infoq.com/articles/ddd-contextmapping
• Fizz-Buzz Game
• http://www.dr-mikes-math-games-for-kids.com/fizz-buzz.html
• Source code: https://github.com/bpan02/fizzbuzz
• Talks that inspired me
• Succession: A Refactoring Story by Katrina Owen
• All the Little Things by Sandi Metz
• Livable Code by Sarah Mei