PHILOSOPHY OF CODING. An untidy room is like bad code: you spend hours in finding things and when you try to add something you are just adding mess.

Slides:



Advertisements
Similar presentations
FUNCTIONAL EXPRESSIONS
Advertisements

Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Why Software.
Identifying Propaganda Techniques
Platinum Sponsor LARGE SCALE REFACTORING Volodymyr Fedak.
IRobot, Prosthetic Arm, and Rescue Robot Group 4 Adrian Burke Darren Draper Collin Palmer Max Reinisch Viyat Jhaveri Can Gurkan.
REFACTORING. What is refactoring ? In refactoring, you start with the basic code and make it better. Change the internal structure of the existing code.
API Design CPSC 315 – Programming Studio Fall 2008 Follows Kernighan and Pike, The Practice of Programming and Joshua Bloch’s Library-Centric Software.
James Tam Object-Oriented Design Approaches to object-oriented design Some principles for good design Benefits and Drawbacks of the Object-Oriented Approach.
Software Engineering and Design Principles Chapter 1.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 4.0.
Objects First With Java A Practical Introduction Using BlueJ Designing object-oriented programs How to write code in a way that is easily understandable,
10-Jun-15 Fibonacci Numbers A simple example of program design.
Nov 10, Fall 2006IAT 8001 Debugging. Nov 10, Fall 2006IAT 8002 How do I know my program is broken?  Compiler Errors –easy to fix!  Runtime Exceptions.
© 2010 John Dalbey Ch 9: Reviews Humphrey proposes that personal reviews will result in improved quality. Now that we have a defined process and some real.
Debugging CPSC 315 – Programming Studio Fall 2008.
Design: Coupling and Cohesion How to write classes in a way that they are easily understandable, maintainable and reusable.
Object-Oriented Analysis and Design Lecture 11 Maintenance (from Schach, “O-O and Classical Software Engineering”)
13-Jul-15 Effective Programming. “The new US stealth fighter, the F-22 Raptor, was deployed for the first time to Asia earlier this month. On Feb. 11,
CODING Research Data Management. Research Data Management Coding When writing software or analytical code it is important that others and your future.
Solving Equations Solving open sentences using inverse operations.
Station Models!.
CSC 213 – Large Scale Programming. Today’s Goal  Learn Unified Process to design programs  Understand what are the “types” of Java classes  Methods.
© Curriculum Foundation1 Section 2 The nature of the assessment task Section 2 The nature of the assessment task There are three key questions: What are.
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
Chapter 7 Designing Classes. Class Design When we are developing a piece of software, we want to design the software We don’t want to just sit down and.
Unit 2.3 How do businesses survive? SG Business Management.
1 Web Based Programming Section 6 James King 12 August 2003.
Copyright © 2007 by Marline E. Pearson. All Rights Reserved. Lesson Five Principles of Smart Relationships.
Jun 16, 2014IAT 2651 Debugging. Dialectical Materialism  Dialectical materialism is a strand of Marxism, synthesizing Hegel's dialectics, which proposes.
The Passionate Programmer Igor Morozov By Chad Fowler.
University Prep Math Patricia van Donkelaar Course Outcomes By the end of the course,
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 3.0.
Sadegh Aliakbary Sharif University of Technology Spring 2012.
Health and Wellness Mr. Sierer. Wellness and Your Health Health is a condition of your physical, emotional, mental, and social well being. To be healthy,
Simplifying Rational Expressions – Part II
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
Refactoring Improving the structure of existing code Refactoring1.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
SE: CHAPTER 7 Writing The Program
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Software Engineering Chapter 3 CPSC Pascal Brent M. Dingle Texas A&M University.
Designing Classes 2 How to write classes in a way that they are easily understandable, maintainable and reusable.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 5.0.
Software Testing and Maintenance 1 Code Review  Introduction  How to Conduct Code Review  Practical Tips  Tool Support  Summary.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 16, Methodologies: Putting it all together.
Exponents Power base exponent means 3 factors of 5 or 5 x 5 x 5.
Designing Classes. Software changes Software is not like a novel that is written once and then remains unchanged. Software is extended, corrected, maintained,
Testing Mutable Objects CS 5010 Program Design Paradigms "Bootcamp" Lesson © Mitchell Wand, This work is licensed under a Creative Commons.
SEG 4110 – Advanced Software Design and Reengineering Topic T Introduction to Refactoring.
Refactoring Agile Development Project. Lecture roadmap Refactoring Some issues to address when coding.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
Objects First With Java A Practical Introduction Using BlueJ Designing classes How to write classes in a way that they are easily understandable, maintainable.
1 COS 260 DAY 12 Tony Gauvin. 2 Agenda Questions? 5 th Mini quiz –Chapter 5 40 min Assignment 3 Due Assignment 4 will be posted later (next week) –If.
Software Design Patterns in Test Automation
Refactoring. DCS – SWC 2 Refactoring ”A change made to the internal structure of software to make it easier to understand and cheaper to modify without.
THEORIES OF INTELLIGENCE SCALE  For the Activity that we are about to do, use a scale of 1-6 to answer the following questions. There are no right or.
Big6 Research and Problem Solving Skills 6 th Grade Project Creating a Travel Brochure.
7 th Grade Big6 Project Assignment: Make a children’s informational book (It can be in graphic novel format or regular picture-book format)
TEN MONEY SAVING TIPS FOR TEENAGERS BY PHILLIP QUINTANA.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 6.0.
29-Jun-16 Effective Programming. “The new US stealth fighter, the F-22 Raptor, was deployed for the first time to Asia earlier this month. On Feb. 11.
Implementation Topics Describe –Characteristics of good implementations –Best practices to achieve them Understand role of comments Learn debugging techniques.
BIG DATA Initiative SMART SubstationBig Data Solution.
Reviewing Code A guide to smelling another developer’s source code.
Steve Chenoweth, RHIT Ch 12 in Fowler
Objects First with Java
CSCI 1260 – Lecture 2: Instantiation, Aggregation, and Composition
Object Oriented Design & Analysis
Chapter 9: Implementation
Presentation transcript:

PHILOSOPHY OF CODING

An untidy room is like bad code: you spend hours in finding things and when you try to add something you are just adding mess.

A tidy room is like good code: you immediately find things, and you can easily change the way they are organized.

The speed of development is related to costs. The speed of development can increase over time as you indulge in bad practices. It can improve with refactoring.

The speed of development is not just the time you spend to develop a certain functionality, but the time others will spend in adding functionalities to your code.

A maintainable code can easily be changed, reduce the costs, has a limited number of bugs, and... make the developers more happy!

The big question How to write maintainable code?

Remember: smart is the one who can see far away, but in the only direction allowed by the blinders. Wise is the one who can turn his head 360 degrees. Don't be intelligent when you code. Be wise!

First principle: design before coding. The more time you spend on design, the less time you will spend on debugging.

Second principle: understand the functionality before coding or bug fixing. If you understand the functionality, the code will be an open book.

Third principle: be simple! Find the simplest solution for the complexity you have to deal with. Complex solutions or not normalized schemas will add complexity exponentially along the development process. When you have to change something unnecessarily complex, you will resort to a quadratic complex trick.

Fourth principle: separation of concerns to avoid spaghetti code. Separation of concerns is mainly achieved by encapsulating. When a change affect only one part of your code, it's easy to add functionalities. Spaghetti code means that when you touch something, the entire castle of cards collapse on itself.

When you puncture a tire, you can easily substitute it. With spaghetti-code, you would have to buy a new car.

Indicator of a good code (not spaghetti-code style!) The time spent in reading and understanding the code or the time spent in bug fixing should be low, compared to the time spent in coding.

Fifth principle: code reuse. "One of the attributes that most strongly distinguishes expert programmers from less experienced ones is that experts strive for and usually achieve a high degree of code reuse" (by Joshua Bloch, Effective Java) That include writing atomic functions, which promotes code reuse.

Good code is always maintainable, bad code is always unmaintainable.

The pyramid of good coding

Final truth The universe is actually terribly simple, unfortunately explaining things in a complex way is just as easy.