The document discusses improving code quality through effective code review processes. It outlines common coding mistakes like redundant code, long or deeply nested functions, large modules, poor comments, and hardcoding. It recommends following best practices like coding guidelines, centralized server communication, and the single responsibility principle. The document also discusses measuring and reducing code complexity, avoiding memory leaks, optimizing images, static code analysis, and profiling to improve code quality.
We know that Code Reviews are a Good Thing. We probably have our own personal lists of things we look for in the code we review, while also fearing what others might say about our code. How to we ensure that code reviews are actually benefiting the team, and the application? How do we decide who does the reviews? What does "done" look like?
In this talk, Trisha will identify some best practices to follow. She'll talk about what's really important in a code review, and set out some guidelines to follow in order to maximise the value of the code review and minimise the pain.
Presentation from Agile Base Camp 2 conference (Kiev, May 2010) and AgileDays'11 (Moscow, March 2011) about one of the most useful engineering practices from XP world.
Многие жалуются на качество кода, автоматизированных тестов или продукта в целом, на количество ошибок, найденных конечными пользователями или отделом тестирования. Почему это происходит? Необходимо понимать, что для того чтобы не допустить подобных ситуаций требуются дополнительные усилия – необходимо следить за качеством кода и работать над его улучшением.
Code Review является одной из наиболее полезных и эффективных практик для ранней борьбы с дефектами в коде и повышению его качества. Использование Code Review на различных этапах разработки, начиная от дизайна и заканчивая написанием кода и тестов, помогает построить ранний цикл обратной связи и избежать потерь времени в будущем на исправление ошибок.
Дополнительным преимуществом применения Code Review является распространение знаний между членами команды и адаптация других командных подходов. Данная практика может быть интересна любому члену команды вне зависимости от его роли в проекте.
В докладе будут рассмотрены основные аспекты Code Review, способы проведения, инструменты и техники. Также будут продемонстрированы основные ошибки в использовании этой практики, полезные советы, приемы по внедрению и поддержке.
We know that Code Reviews are a Good Thing. We probably have our own personal lists of things we look for in the code we review, while also fearing what others might say about our code. How to we ensure that code reviews are actually benefiting the team, and the application? How do we decide who does the reviews? What does "done" look like?
In this talk, Trisha will identify some best practices to follow. She'll talk about what's really important in a code review, and set out some guidelines to follow in order to maximise the value of the code review and minimise the pain.
Presentation from Agile Base Camp 2 conference (Kiev, May 2010) and AgileDays'11 (Moscow, March 2011) about one of the most useful engineering practices from XP world.
Многие жалуются на качество кода, автоматизированных тестов или продукта в целом, на количество ошибок, найденных конечными пользователями или отделом тестирования. Почему это происходит? Необходимо понимать, что для того чтобы не допустить подобных ситуаций требуются дополнительные усилия – необходимо следить за качеством кода и работать над его улучшением.
Code Review является одной из наиболее полезных и эффективных практик для ранней борьбы с дефектами в коде и повышению его качества. Использование Code Review на различных этапах разработки, начиная от дизайна и заканчивая написанием кода и тестов, помогает построить ранний цикл обратной связи и избежать потерь времени в будущем на исправление ошибок.
Дополнительным преимуществом применения Code Review является распространение знаний между членами команды и адаптация других командных подходов. Данная практика может быть интересна любому члену команды вне зависимости от его роли в проекте.
В докладе будут рассмотрены основные аспекты Code Review, способы проведения, инструменты и техники. Также будут продемонстрированы основные ошибки в использовании этой практики, полезные советы, приемы по внедрению и поддержке.
Build security into CI/CD pipelines for effective security automation on AWS ...Amazon Web Services
Realizing DevSecOps and effectively implementing security into CI/CD pipelines on AWS remains a challenging proposition for most organizations today. In this session, we share the essential principles of achieving security automation in your CI/CD pipelines and across the build, deploy, and run phases of your applications. Finally, we conclude with a demonstration of security automation across all three phases of your applications that are deployed on AWS infrastructure, showing you how to bring security automation to your organization today.
It is not to complicated to keep new project with good code quality for half year. Maybe, for one year. But what if team works on some project for years? Or even ”better”: you need to support and grow large project after another team. Presentation describes Continuous Inspection, main measures of code quality that will make your life better, continuous inspection and how to cook it with SonarQube.
How to improve your code quality? The answer is continuous refactoring. Learn more about refactoring. Know the most frequent code smells (antipatterns), telling when to refactor. Go through the catalog of well-known refactorings, telling how to improve your code.
How to successfully grow a code review cultureNina Zakharenko
As a team grows, code ownership is distributed. Code review becomes increasingly important to support the maintainability of complex codebases. An effective code base is on that can be worked on collaboratively by a team.
In this talk we'll discuss how to introduce a successful code review culture to your development team that will foster the idea of shared ownership. This in turn will result in a happy and healthy code base.
https://webexpo.net/prague2016/talk/how-to-successfully-grow-a-code-review-culture/
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
In this introduction to Test Driven Development (TDD) or Behaviour Driven Development (BDD) we give a high level description of what it is and why it is useful for developers. Then we go into some details on stubs and mocks, test data, UI testing, SQL testing, JavaScript testing, web services testing and how to start doing TDD/BDD on an existing code base.
Discover how Helix QAC can improve your code quality by watching our “How to Easily Manage Code Quality” webinar. The webinar will cover:
-How to measure code quality.
-How to improve code quality.
-How Helix QAC helps to manage code quality.
Digital transformation is on its way and the industry is required to adopt new concepts and techniques, like the Internet of things (IoT), Cloud and Enterprise Mobility. As a matter of that, new business models arise, which need to be evaluated by companies to not lose market shares and stay in touch with the competitors.
Gartner’s vision of Bi-modal IT seems to become more and more the reality, which besides all chances, also brings a lot of challenges companies have to deal with. One essential topic for implementing the ideas of Bi-modal IT is API Management – at least from our point of view. In addition, it is also a key enabler to define a solid strategy, in order to meet the challenges with respect to digital transformation.
** Kubernetes Certification Training: https://www.edureka.co/kubernetes-cer... **
This Edureka tutorial on "Kubernetes Networking" will give you an introduction to popular DevOps tool - Kubernetes, and will deep dive into Kubernetes Networking concepts. The following topics are covered in this training session:
1. What is Kubernetes?
2. Kubernetes Cluster
3. Pods, Services & Ingress Networks
4. Case Study of Wealth Wizards
5. Hands-On
DevOps Tutorial Blog Series: https://goo.gl/P0zAfF
Presentation given at Open Source Summit Japan 2016 about the state of the cloud native technology (Cloud Native Computing Foundation) and the standardization of container technology (Open Container Initiative)
This presentation is part of one of my webinar in clean code webinar series. The contents are slightly edited to share the information in public domain. In this presentation, I tried to provide detailed introduction to code refactoring practice.
This presentation will be useful for software architects/Managers,developers and QAs. Do share your feedback in comments.
You want to improve your software skills. That’s a given. You may be a mentor or a manager who needs to improve the knowledge sharing among your software developers across different projects. Code Reviews can do just that while improving code quality in your projects. Code Review not only builds developer team spirit but also offers new ways to improve a software solution. You’ll walk away from this session with in-depth understanding of Code Review to strengthen your team.
Build security into CI/CD pipelines for effective security automation on AWS ...Amazon Web Services
Realizing DevSecOps and effectively implementing security into CI/CD pipelines on AWS remains a challenging proposition for most organizations today. In this session, we share the essential principles of achieving security automation in your CI/CD pipelines and across the build, deploy, and run phases of your applications. Finally, we conclude with a demonstration of security automation across all three phases of your applications that are deployed on AWS infrastructure, showing you how to bring security automation to your organization today.
It is not to complicated to keep new project with good code quality for half year. Maybe, for one year. But what if team works on some project for years? Or even ”better”: you need to support and grow large project after another team. Presentation describes Continuous Inspection, main measures of code quality that will make your life better, continuous inspection and how to cook it with SonarQube.
How to improve your code quality? The answer is continuous refactoring. Learn more about refactoring. Know the most frequent code smells (antipatterns), telling when to refactor. Go through the catalog of well-known refactorings, telling how to improve your code.
How to successfully grow a code review cultureNina Zakharenko
As a team grows, code ownership is distributed. Code review becomes increasingly important to support the maintainability of complex codebases. An effective code base is on that can be worked on collaboratively by a team.
In this talk we'll discuss how to introduce a successful code review culture to your development team that will foster the idea of shared ownership. This in turn will result in a happy and healthy code base.
https://webexpo.net/prague2016/talk/how-to-successfully-grow-a-code-review-culture/
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
In this introduction to Test Driven Development (TDD) or Behaviour Driven Development (BDD) we give a high level description of what it is and why it is useful for developers. Then we go into some details on stubs and mocks, test data, UI testing, SQL testing, JavaScript testing, web services testing and how to start doing TDD/BDD on an existing code base.
Discover how Helix QAC can improve your code quality by watching our “How to Easily Manage Code Quality” webinar. The webinar will cover:
-How to measure code quality.
-How to improve code quality.
-How Helix QAC helps to manage code quality.
Digital transformation is on its way and the industry is required to adopt new concepts and techniques, like the Internet of things (IoT), Cloud and Enterprise Mobility. As a matter of that, new business models arise, which need to be evaluated by companies to not lose market shares and stay in touch with the competitors.
Gartner’s vision of Bi-modal IT seems to become more and more the reality, which besides all chances, also brings a lot of challenges companies have to deal with. One essential topic for implementing the ideas of Bi-modal IT is API Management – at least from our point of view. In addition, it is also a key enabler to define a solid strategy, in order to meet the challenges with respect to digital transformation.
** Kubernetes Certification Training: https://www.edureka.co/kubernetes-cer... **
This Edureka tutorial on "Kubernetes Networking" will give you an introduction to popular DevOps tool - Kubernetes, and will deep dive into Kubernetes Networking concepts. The following topics are covered in this training session:
1. What is Kubernetes?
2. Kubernetes Cluster
3. Pods, Services & Ingress Networks
4. Case Study of Wealth Wizards
5. Hands-On
DevOps Tutorial Blog Series: https://goo.gl/P0zAfF
Presentation given at Open Source Summit Japan 2016 about the state of the cloud native technology (Cloud Native Computing Foundation) and the standardization of container technology (Open Container Initiative)
This presentation is part of one of my webinar in clean code webinar series. The contents are slightly edited to share the information in public domain. In this presentation, I tried to provide detailed introduction to code refactoring practice.
This presentation will be useful for software architects/Managers,developers and QAs. Do share your feedback in comments.
You want to improve your software skills. That’s a given. You may be a mentor or a manager who needs to improve the knowledge sharing among your software developers across different projects. Code Reviews can do just that while improving code quality in your projects. Code Review not only builds developer team spirit but also offers new ways to improve a software solution. You’ll walk away from this session with in-depth understanding of Code Review to strengthen your team.
Sass Code Reviews - How one code review changed my life #SassConf2015Stacy Kvernmo
After writing CSS for over 10 years you'd think you would know everything there is to know, right? I couldn't be more wrong and I found out the hard way. While my first formal code review session was painfully embarrassing it was also the most important lesson I have learned throughout my career. Code reviews force you to communicate on a different level which ultimately leads to more thoughtful coding practices. When writing Sass and other pre-processed languages it is even more important that you review your code continually, which even the more seasoned front end developers may neglect at times.
Bottom line: Code reviews will make you better.
Effective Code Review (Or How To Alienate Your Coworkers)Perforce
In this talk, the architects of Perforce Swarm will guide you through the process of starting and updating a code review. They will also share some of their secrets for performing effective reviews. Learn how to start and update code reviews using Swarm, best practices for performing effective review, and the benefits of pre-commit automated testing and deployment.
Improving code quality with continuous integration (PHPBenelux Conference 2011)Martin de Keijzer
Continuous Integration is the combination of any number of the available tools used to improve quality of both code and process. In this session we will look at these available tools and how these can be used. We will also look at Continuous Integration in general and CruiseControl in particular, at how to set it up and built a platform for robust and high-quality code. This session is a must-see for development leaders and technical managers alike, to understand the available options and the advantages offered by this approach.
Development is inherently collaborative. So why aren't you doing code review? This session discusses the importance of collaboration around your source code, the impact code review can have on development teams, and offers guidance on how to get started.
Atlassian Speaker: Matt Quail
Customer Speaker: Patrick Coleman of Dash
Key Takeaways:
* Peer code review explained
* Benefits and approaches to effective code review
How to do code review? What is the process? What to look for? How to keep a good vibe and improve the team?
These and many other questions are solved for good in this presentation.
FishEye opens your source code repository and helps development teams keep tabs on what's going on using a web interface.
Crucible is a peer code review tool that allows teams to review, edit, comment and record outcomes.
Scripting experts from Inductive Automation cover general best practices that will help you add flexibility and customization to HMI, SCADA, IIoT, and other industrial applications. Some specific tips about using scripting in the Ignition platform will be included as well.
In this webinar, learn more about:
• Common scripting pitfalls and how to avoid them
• The best programming languages to use
• Things to consider before using scripting
• How scripting environments work
• Scripting timesavers
• And more
Scripting experts from Inductive Automation cover general best practices that will help you add flexibility and customization to HMI, SCADA, IIoT, and other industrial applications. Some specific tips about using scripting in the Ignition platform will be included as well.
In this webinar, learn more about:
• Common scripting pitfalls and how to avoid them
• The best programming languages to use
• Things to consider before using scripting
• How scripting environments work
• Scripting timesavers
• And more
Complete C++ programming Language CourseVivek chan
This is the Complete course of C++ Programming Language for Beginners. All Topics of C++ programming Language are covered in this single power point presentation.
Visit: www.cyberlabzone.com
[Gophercon 2019] Analysing code quality with linters and static analysisWeverton Timoteo
How do you define a "good code"? How to write high-quality software with assistance of linters and static analysis.
Using golint, govet and gofmt can improve our code.
PVS-Studio and static code analysis techniqueAndrey Karpov
What is «static code analysis»? It is a technique that allows, at the same time with unit-tests, dynamic code analysis, code review and others, to increase code quality, increase its reliability and decrease the development time.
Technology selection for a given problem is often a tough ask. This is immensely useful comparative analysis betweeen Greenplum, Vectorwise and Amazon Redshift.
Steve Jobs has not only revolutionized high tech industry by introducing ground breaking products, but he has also showed us the way for managing organization and personal life.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
2. The objective of code review exercise is to ensure highest
code quality.
Quality code ensures that your code is :
Understandable
Extendable and easily modified with changing business
requirements
Scalability : Covers performance, maintainability and fault
tolerance
Reliable : Does not easily breakdown
In this discussion, we look at commonly found problems in
code, and find ways of overcoming them.
Code Quality
3. Coding Guidelines
Understanding and Avoiding Common Coding and Design Mistakes
Memory Leaks
Bad smells of code
Excessive and un-necessary API calls
Best Practices
Centralized Server Communication
Following Single Responsibility Principle
Centralized Threading
Optimizing Use of Images in terms of file access, storage, and draw calls
Reducing Code Complexity
Static Code Analysis
Profiling
Path to High Quality Code
4. Coding conventions are a set of guidelines for a specific
programming language that recommend programming style,
practices and methods for each aspect of a piece program
written in this language.
These conventions usually cover file organization, indentation,
comments, declarations, statements, white space, naming
conventions, programming practices, programming principles,
programming rules of thumb, etc.
Coding Guidelines
5. Redundant Code
Writing functions which span many pages
Writing functions with deeply nested if’s, case's
Writing badly typed functions
Function names which do not reflect what the functions do
Variable names which are meaningless
Using processes when they are not needed
Badly chosen data structures (Bad representations).
Bad comments or no comments at all (always document arguments
and return value).
Hard coded values
Unindented code.
Inaccessible parts of code (Dead Code)
The Most Common Mistakes
6. Leads to lack of reusability
Can lead in unforeseen results
Example:
Code to perform sell operation added at 21 different places.
As a consequence, coins or virtual money being used in the
project ends up being negative in a multi threaded game.
Redundant Code
7. Long functions may not always be bad
Especially when a single algorithm is implemented
Long functions are bad when they have too many if blocks
Seriously consider dividing those functions
Extremely long functions are definitely bad
General rule of thumb is consider sub dividing your method
when more than 50 lines of code
Don’t Write Very Long Function’s
8. Nested code is code containing case/if/receive statements
within other case/if/receive statements.
It is bad programming style to write deeply nested code - the
code has a tendency to drift across the page to the right and
soon becomes unreadable.
Try to limit most of your code to a maximum of two levels of
indentation.
This can be achieved by dividing the code into shorter
functions.
Don't Write Deeply Nested Code
9. A module should not contain more than 400 lines of
source code.
It is better to have several small modules than one
large one.
A module is also very long when it has too many
subroutines/functions
Don't Write
Very Large Modules
10. Comments should be clear and concise and avoid
unnecessary wordiness.
Make sure that comments are kept up to date with
the code.
Comments should add to the understanding of the
code.
Comments
11. The important things to document are:
The purpose of the function.
The domain of valid inputs to the function. That is, data structures
of the arguments to the functions together with their meaning.
The domain of the output of the function. That is, all possible data
structures of the return value together with their meaning.
If the function implements a complicated algorithm, describe it.
The possible causes of failure and exit signals which may be
generated by exit/1, throw/1 or any non-obvious run time errors.
Note the difference between failure and returning an error.
Any side effect of the function.
Comments About Function/Method
12. Example:
%%--------------------------------------------------------
%% Function: get_server_statistics/2
%% Purpose: Get various information from a process.
%% Args: Option is normal|all.
%% Returns: A list of {Key, Value}
%% or {error, Reason} (if the process is dead)
%% Modification History:
%%--------------------------------------------------------------
Comments About Function/Method
(Cont’d)
13. Never leave commented code when
submitting/committing code
Remember the source code control system will help
you!
Do Not Comment Out Old Code –
Remove It
14. Many errors go unnoticed until runtime at client site.
Exceptions provide a powerful and flexible way to handle issues in
your code,
Use them wisely.
Common examples of such errors include:
Sending messages an object doesn’t respond to
Going out of bounds of an array
Accessing invalid data
File not found
Unable to save/retrieve file on a network server because of incorrect
encodling e.g. ASCII on client side and Unicode on server side
Losing the connection to the window server
Exception Handling
15. When reviewing code, please make sure that you do not
have any segments/blocks of code where control will never
be transferred.
Inaccessible code is also called dead code.
Examples include a function that is never used.
An if/else block that is never supposed to be get control
transferred to it.
Use exception handling to cover unexpected scenarios
rather than leaving inaccessible code for end of world type
scenarios.
Inaccessible Code
16. Avoid hardcoding values into the source code
Hard coding requires the program's source code to be
changed any time the input data changes
Constants may be put in a separate configuration file when
necessary
Avoid Hard Coded Values
17. How efficient is an algorithm or piece of code?
CPU (time) Usage
Memory Usage
Disk Usage
Network Usage
We express complexity of our algorithms using big-O
notation.
For a problem of size N:
a constant-time method is "order 1": O(1)
a linear-time method is "order N": O(N)
a quadratic-time method is "order N squared": O(N2)
Code Complexity
18. In 1976, Tom McCabe published a paper arguing that code
complexity is defined by its control flow.
It seems to be generally accepted that control flow is one of
the most useful measurements of complexity
High complexity scores have been shown to be a strong
indicator of low reliability and frequent errors.
The Cyclomatic Complexity computation based on Tom
McCabe's work and is defined in Steve McConnell's book,
Code Complete on page 395 :
Start with 1 for the straight path through the routine
Add 1 for each of the following keywords or their equivalents:
if, while, repeat, for, and, or
Add 1 for each case in a case statement
Code Complexity(Cont’d)
19. So, if we have this C# example:
while (nextPage != true)
{
if ((lineCount <= linesPerPage) && (status != Status.Cancelled) &&
(morePages == true))
{
// ...
}
}
In the code above, we start with 1 for the routine, add 1 for the while,
add 1 for the if, and add 1 for each && for a total calculated complexity
of 5.
Anything with a greater complexity than 10 or so is an excellent
candidate for simplification and refactoring.
Minimizing complexity is a great goal for writing high-quality,
maintainable code.
Code Complexity(Cont’d)
20. Some advantages of McCabe's Cyclomatic Complexity
include:
It is very easy to compute, as illustrated in the example
It can be computed immediately in the development lifecycle
(which makes it Agile-friendly)
It provides a good indicator of the ease of code maintenance
It can help focus testing efforts
It makes it easy to find complex code for formal review
Code Complexity(Cont’d)
21. Formal code review coupled with complexity measurements
provide a very compelling technique for quality improvement,
and it is something that can easily be adopted by an Agile
team.
So, what can you do to implement this technique for your
project?
Find a tool that computes code metrics (specifically complexity)
for your language and toolset
Schedule the tool so that it automatically runs and captures
metrics every day
Use the code complexity measurement to help identify
candidates for formal code review
Capture the results of the code review and monitor their follow-
up (too many teams forget about the follow-up)
Code Complexity(Cont’d)
22. Programmers love to write loops !
Loops can significantly increase code complexity while
decreasing code quality.
Common mistakes to avoid in loops are :
Memory allocations in loops
Variable declarations in loops
Function calls that just return constant value
Loops
23. Example
In this for loop, we are calling array count function multiple
function multiple times, although it remains fixed throughout the
execution of the loop.
for (int i = 0; i< [landPatchesArray count]; i++)
for (int j=0;………)
{
}
Alternatively
Int i=0; int j=0;
landPatchArrayCount=[landPatchesArray count];
for (i = 0; i<landPatchArrayCount; i++)
for (j=0;………)
Loops(Cont’d)
24. Pay careful attention to memory allocation and deallocation.
Always run profiler to check for memory leaks.
Memory Leaks
25. Its difficult to think of applications that do not have use of
multiple threads.
Threads are horrible:
They tend to make behavior of your programs as
unpredictable
As soon as you notice unpredictable behavior then you
start putting synchronized blocks around your code and
data.
Developers just start creating threads without ever
thinking about organizing/managing their threads.
Centralized Threading Model
26. Grand Central Dispatch is a mechanism for controlling
multiple threads of execution.
It is an implementation of task parallelism based on
the thread pool pattern.
GCD works by allowing specific tasks in a program
that can be run in parallel to be queued up for
execution and, depending on availability of
processing resources, scheduling them to execute on
any of the available processor cores[11].
Centralized Threading Model
(Cont’d)
27. Centralized server communication is important because we
need to ensure consistent behavior of the system when
updating or retrieving its state from the server.
A common mistake is to allow individual modules to update
their own state with the server.
Example
In one scenario, inconsistent game state udpation resulted
because of non-adherence to single responsibility principle
because many classes were managing their own
NSURLConnections, and none of the instances really do much
error handling or robust retry logic.
Centralized Server Communication
28. Pay careful attention to optimizing use of Images in terms of
file access, storage, and draw calls.
PNG and JPG formats are highly inefficient, because the data
must be parsed into bitmap form on the fly at load time.
iOS Specific Image Formats can come to your rescue in such a
scenario
One of the better format is pvr.ccz, which cocos2d natively
supports,
Pvr.ccz image are faster to read from disk, and require no
parsing to load into memory.
Use spritesheets to minimize image loading and faster
rendering through batch sprites.
Optimizing Image Use
29. Static code analysis is the process of detecting errors and
defects in software's source code.
Static analysis can be viewed as an automated code review
process.
Static Code Analysis
30. Static analysis is usually poor regarding diagnosing memory
leaks and concurrency errors.
To detect such errors you actually need to execute a part of
the program virtually. It requires extra effort and
carefulness.
A static analysis tool warns you about odd fragments. It
means that the code can actually be quite correct.
It is called false-positive reports.
Disadvantages of Static Code
Analysis
31. Profiling is a form of dynamic program analysis that
measures, for example, the usage of memory, the usage of
particular instructions, or frequency and duration of
function calls.
The most common use of profiling information is to aid
program optimization.
Profiling is achieved by instrumenting either the program
source code or its binary executable form using a tool called
a profiler (or code profiler).
Profiling