SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
Wisdom for Programmers

Sung-Kook Han
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
The RedMonk Programming Language Rankings: September 2012

1.JavaScript
2.Java
3.PHP
4.Python
5.Ruby
6.C#
7.C++
8.C
9.Objective-C
10.Shell
11.Perl
12.Scala
13.Haskell
14.ASP
15.Assembly
16.ActionScript
17.R
18.Visual Basic
19.CoffeeScript
20.Groovy

http://redmonk.com/sogrady/2012/09/12/language-rankings-9-12/#ixzz26XhGIOrn
FORTRAN 77

Assembler

COBOL
APL
C
Objective-C
XML

PASCAL

BASIC
LISP
C++

C#

PROLOG
ML

JAVA
RDF/RDFS

OWL








void HandleStuff( CORP_DATA & inputRec, int crntQtr, EMP_DATA empRec, double
& estimRevenue, double ytdRevenue, int screenX, int screenY, COLOR_TYPE &
newColor, COLOR_TYPE & prevColor, StatusType & status, int expenseType )
{




int i;
for ( i = 0; i < 100; i++ ) {
 inputRec.revenue[i] = 0;


inputRec.expense[i] = corpExpense [crntQtr ][ i ];

}
UpdateCorpDatabase( empRec );

estimRevenue = ytdRevenue * 4.0 / (double) crntQtr;
newColor = prevColor;

status = SUCCESS;
if ( expenseType == 1 ) {
for ( i = 0; i < 12; i++ ) 
 profit[i] = revenue[i] - expense.type1[i];
}
else if ( expenseType == 2 ) { 
profit[i] = revenue[i] - expense.type2[i];
}
else if ( expenseType == 3 ) 
profit[i] = revenue[i] - expense.type3[i];
}
선서
나는
프로그램 고수들을 나의 멘토로 모시고,
그들의 지혜를 경청하고 실천하여,
프로그래밍의 본질을 깨우쳐

프로그래밍의 전설적 고수가 되고자 합니다...
Define the problem completely.
If you don't understand it, you can't program it.
Without a good problem definition,
you might put effort into solving the wrong problem.
Be sure you know what you’re aiming at before you shoot.
Think first, Program lately.
Put the Mouse Down and Step Away from the Keyboard..
Throw away the keyboard !!
Fire, Aim, Ready ??
Look before leap.
Draw Diagrams !!
Think twice, code once.
Design first, then code.
Use the top-down approach.
Look at the whole picture !!
Draw Diagrams !!
Keep It Simple, Stupid! (KISS)
Keep it short and simple.
Occam's razor !!
Everything should be made as simple as possible,
but no simpler. - Albert Einstein
Don’t Repeat Yourself. (DRY)
Once And Only Once !!
Duplication is Evil (DIE).
Insanity: doing the same thing over and over again
and expecting different results.
Read The Fine Magazine. (RTFM)
Read The Fine Manual.
Read books, magazines, blogs, twitter feeds, and web sites.
Always try to work with a mentor.
If you can't find a mentor, consider moving on.

Go to conferences. Listen to podcasts.
Continuous Learning…
Understand the Art behind the Language.
Understand the philosophy of programming language.
Understand the culture of your programming language !!

Be aware of the specific strengths and weaknesses of the
language you’re using.
Choose the right programming language.
Don’t limit your programming thinking
only to the concepts that are supported
automatically by your language.
Divide and Conquer !!
Modern software is inherently complex.
Minimize the amount of essential complexity that anyone’s
brain has to deal with at any one time.
Don't Be Afraid to Break Things.
Keep accidental complexity from needlessly proliferating.
Modeling.
Without good software modeling, you may have the right problem
but the wrong solution.
It may be impossible to have successful construction.
Code is design.
Model-driven architecture: MVC Model
GoF: Design Patterns
Abstraction !!
Keep the level of the abstraction !!
Encapsulate all in the side .
Hide Secrets (Information Hiding).
Localize them.
Avoiding global data.
Single Responsibility.
Single Responsibility Principle:
a class should have one, and only one, reason to change.
Every piece of knowledge must have a single, unambiguous,
authoritative representation within a system.
-- Andy Hunt and Dave Thomas in The Pragmatic Programmer.

Single Source of Truth in model-driven architectures.
Defensive Programming
A clever person solves a problem. A wise person avoids it.
– Einstein
Be careful for Exceptions, Errors, Warnings,…
Make it fail-safe before you make it better.
Protecting Your Program From Invalid Inputs.
garbage in, nothing out / garbage in, error message out /
no garbage allowed in
Build Your Own Assertion Mechanism.
Automate Your Coding Standard.
Pretty Print (PP).
Style !! Layout !! Format !!
Hungarian notation by Charles Simonyi.
Use (naming) conventions.
Iterate, Repeatedly, Again and Again
Programming is neither fully an art nor fully a science.
As it’s typically practiced, it’s a “craft” that’s somewhere
between art and science. -- McConnell 2004
A first attempt might produce a solution that works,
but it’s unlikely to produce the best solution.

Don't be afraid to start over
Programmer(programming)
Comments are not evil.
Provide good documentation.

Don't just echo code in comments
- make every comment meaningful.
Choose Your Tools with Care.
Right Programming Language and Right Tools !!
Design Tools // Source-Code Tools // Executable-Code Tools
Tool-Oriented Environments
Building Your Own Programming Tools
Discipline is the best tool.
Ask "What Would the User Do?"
You are not the User.
Use case analysis.
The User is the King. The user is Dummy.
User-Friendly.
Pieces of the advice
 Never assume the computer assumes anything.
 Don't patch bad code - rewrite it.
 Make sure all variables are initialized before use.
 Choose a data representation which makes the program simple.
 Be sparing with temporary variables.
 Parenthesize to avoid ambiguity.
 Avoid side effects
 Use library functions.
 Choose a data representation which makes the program simple.
 Test input for plausibility and validity.
Be Open Mind !!
Refuse to pretend you’re an expert when you’re not.
Readily admit your mistakes.
Get excited about programming !!
Open, Share, Communicate, and Cooperate !!
.
References.
Very Simple Quiz: What’s wrong ?
// Compute roots of a quadratic equation.
// This code assumes that (b*b-4*a*c) is positive.
temp = Sqrt( b*b - 4*a*c );
root[O] = ( -b + temp ) / ( 2 * a );
root[1] = ( -b - temp ) / ( 2 * a );
...
// swap the roots
temp = root[0];
root[0] = root[1];
root[1] = temp;
for ( int i = 0; i < numPayCodes; i++ ) {
for ( int j = 0; j < 12; j++ ) {
for ( int k = 0; k < numDivisions; k++ ) {
sum = sum + transaction[ j ][ i ][ k ];
}
}
}

Contenu connexe

Tendances

Script writing (2)
Script writing (2)Script writing (2)
Script writing (2)lenteraide
 
10 steps to becoming a professional software engineer
10 steps to becoming a professional software engineer10 steps to becoming a professional software engineer
10 steps to becoming a professional software engineerJimmy Sorensen
 
Clean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesClean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesRuth Sperer
 
Intro flash cards
Intro flash cardsIntro flash cards
Intro flash cardslorhow58
 
Intro flash cards
Intro flash cardsIntro flash cards
Intro flash cardslorhow58
 
Pair programming and pair training
Pair programming and pair trainingPair programming and pair training
Pair programming and pair trainingRoberto Bettazzoni
 
Design concerns for concrete syntax
Design concerns for concrete syntaxDesign concerns for concrete syntax
Design concerns for concrete syntaxMikhail Barash
 
What is Coding
What is CodingWhat is Coding
What is CodingRoboGarden
 
10 Things You Probably Should Have Learned With Your Computer Science Degree....
10 Things You Probably Should Have Learned With Your Computer Science Degree....10 Things You Probably Should Have Learned With Your Computer Science Degree....
10 Things You Probably Should Have Learned With Your Computer Science Degree....New Relic
 
Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programmingMohammad Kamrul Hasan
 
5 reasons why NetBeans should be in every developers toolkit (devfest2014)
5 reasons why NetBeans should be in every developers toolkit (devfest2014)5 reasons why NetBeans should be in every developers toolkit (devfest2014)
5 reasons why NetBeans should be in every developers toolkit (devfest2014)idrsolutions
 
Zoo of domain-specific languages
Zoo of domain-specific languagesZoo of domain-specific languages
Zoo of domain-specific languagesMikhail Barash
 
What Is Coding And Why Should You Learn It?
What Is Coding And Why Should You Learn It?What Is Coding And Why Should You Learn It?
What Is Coding And Why Should You Learn It?Syed Hassan Raza
 

Tendances (18)

Language Workbenches
Language WorkbenchesLanguage Workbenches
Language Workbenches
 
Script writing (2)
Script writing (2)Script writing (2)
Script writing (2)
 
10 steps to becoming a professional software engineer
10 steps to becoming a professional software engineer10 steps to becoming a professional software engineer
10 steps to becoming a professional software engineer
 
DSLs: what, why, how
DSLs: what, why, howDSLs: what, why, how
DSLs: what, why, how
 
Clean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesClean Code and Common Engineering Practices
Clean Code and Common Engineering Practices
 
JetBrains MPS
JetBrains MPSJetBrains MPS
JetBrains MPS
 
Intro flash cards
Intro flash cardsIntro flash cards
Intro flash cards
 
Intro flash cards
Intro flash cardsIntro flash cards
Intro flash cards
 
Learn java theory presentation
Learn java theory presentationLearn java theory presentation
Learn java theory presentation
 
Pair programming and pair training
Pair programming and pair trainingPair programming and pair training
Pair programming and pair training
 
Design concerns for concrete syntax
Design concerns for concrete syntaxDesign concerns for concrete syntax
Design concerns for concrete syntax
 
What is Coding
What is CodingWhat is Coding
What is Coding
 
DSL development
DSL developmentDSL development
DSL development
 
10 Things You Probably Should Have Learned With Your Computer Science Degree....
10 Things You Probably Should Have Learned With Your Computer Science Degree....10 Things You Probably Should Have Learned With Your Computer Science Degree....
10 Things You Probably Should Have Learned With Your Computer Science Degree....
 
Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programming
 
5 reasons why NetBeans should be in every developers toolkit (devfest2014)
5 reasons why NetBeans should be in every developers toolkit (devfest2014)5 reasons why NetBeans should be in every developers toolkit (devfest2014)
5 reasons why NetBeans should be in every developers toolkit (devfest2014)
 
Zoo of domain-specific languages
Zoo of domain-specific languagesZoo of domain-specific languages
Zoo of domain-specific languages
 
What Is Coding And Why Should You Learn It?
What Is Coding And Why Should You Learn It?What Is Coding And Why Should You Learn It?
What Is Coding And Why Should You Learn It?
 

En vedette

Presentacion3
Presentacion3Presentacion3
Presentacion3zirbruno
 
Idean_LeanResearch_Jan2014_FINAL
Idean_LeanResearch_Jan2014_FINALIdean_LeanResearch_Jan2014_FINAL
Idean_LeanResearch_Jan2014_FINALLiya James
 
GA_LeanResearch
GA_LeanResearchGA_LeanResearch
GA_LeanResearchLiya James
 
Hp Uiuc Part2
Hp Uiuc Part2Hp Uiuc Part2
Hp Uiuc Part2zirbruno
 
Presentacion1
Presentacion1Presentacion1
Presentacion1zirbruno
 
D I G I T A L J U K E C O R P O R A T I O N Finish
D I G I T A L  J U K E  C O R P O R A T I O N FinishD I G I T A L  J U K E  C O R P O R A T I O N Finish
D I G I T A L J U K E C O R P O R A T I O N Finishlmiloje2
 
Layers of Smalltalk Application
Layers of Smalltalk ApplicationLayers of Smalltalk Application
Layers of Smalltalk Applicationspeludner
 
How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7
How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7
How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7X User
 
Van Catalogiseren Naar Metadatabeheer131107
Van  Catalogiseren Naar Metadatabeheer131107Van  Catalogiseren Naar Metadatabeheer131107
Van Catalogiseren Naar Metadatabeheer131107guestf040ad
 
Semantic Technology: State of the arts and Trends
Semantic Technology: State of the arts and TrendsSemantic Technology: State of the arts and Trends
Semantic Technology: State of the arts and TrendsWon Kwang University
 
4th Industrial Revolution and Restoration of Humanity
4th Industrial Revolution and Restoration of Humanity4th Industrial Revolution and Restoration of Humanity
4th Industrial Revolution and Restoration of HumanityWon Kwang University
 

En vedette (17)

Presentacion3
Presentacion3Presentacion3
Presentacion3
 
How to innovate your ICT business
How to innovate your ICT businessHow to innovate your ICT business
How to innovate your ICT business
 
Idean_LeanResearch_Jan2014_FINAL
Idean_LeanResearch_Jan2014_FINALIdean_LeanResearch_Jan2014_FINAL
Idean_LeanResearch_Jan2014_FINAL
 
GA_LeanResearch
GA_LeanResearchGA_LeanResearch
GA_LeanResearch
 
Hp Uiuc Part2
Hp Uiuc Part2Hp Uiuc Part2
Hp Uiuc Part2
 
Presentation1
Presentation1Presentation1
Presentation1
 
Presentacion1
Presentacion1Presentacion1
Presentacion1
 
D I G I T A L J U K E C O R P O R A T I O N Finish
D I G I T A L  J U K E  C O R P O R A T I O N FinishD I G I T A L  J U K E  C O R P O R A T I O N Finish
D I G I T A L J U K E C O R P O R A T I O N Finish
 
Sws Han
Sws HanSws Han
Sws Han
 
Killer Presentation
Killer PresentationKiller Presentation
Killer Presentation
 
Layers of Smalltalk Application
Layers of Smalltalk ApplicationLayers of Smalltalk Application
Layers of Smalltalk Application
 
How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7
How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7
How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7
 
Van Catalogiseren Naar Metadatabeheer131107
Van  Catalogiseren Naar Metadatabeheer131107Van  Catalogiseren Naar Metadatabeheer131107
Van Catalogiseren Naar Metadatabeheer131107
 
Semantic Technology: State of the arts and Trends
Semantic Technology: State of the arts and TrendsSemantic Technology: State of the arts and Trends
Semantic Technology: State of the arts and Trends
 
Lib0604
Lib0604Lib0604
Lib0604
 
Ontology Dev
Ontology DevOntology Dev
Ontology Dev
 
4th Industrial Revolution and Restoration of Humanity
4th Industrial Revolution and Restoration of Humanity4th Industrial Revolution and Restoration of Humanity
4th Industrial Revolution and Restoration of Humanity
 

Similaire à Good programming

The Art of Evolutionary Algorithms Programming
The Art of Evolutionary Algorithms ProgrammingThe Art of Evolutionary Algorithms Programming
The Art of Evolutionary Algorithms ProgrammingJuan J. Merelo
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsSteven Smith
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic RevisitedAdam Keys
 
Cs8392 u1-1-oop intro
Cs8392 u1-1-oop introCs8392 u1-1-oop intro
Cs8392 u1-1-oop introRajasekaran S
 
Rrw02 Week 1 Assignment
Rrw02 Week 1 AssignmentRrw02 Week 1 Assignment
Rrw02 Week 1 AssignmentSheri Elliott
 
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...Arnauld Loyer
 
Essential c notes singh projects
Essential c notes singh projectsEssential c notes singh projects
Essential c notes singh projectsSINGH PROJECTS
 
Mastering python lesson1
Mastering python lesson1Mastering python lesson1
Mastering python lesson1Ruth Marvin
 
On being a professional software developer
On being a professional software developerOn being a professional software developer
On being a professional software developerAnton Kirillov
 
Documentation for developers
Documentation for developersDocumentation for developers
Documentation for developersMichael Marotta
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidStanojko Markovik
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developerAnton Kirillov
 
Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...
Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...
Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...RootedCON
 
Take the Smalltalk Red Pill
Take the Smalltalk Red PillTake the Smalltalk Red Pill
Take the Smalltalk Red PillOSOCO
 

Similaire à Good programming (20)

The Art of Evolutionary Algorithms Programming
The Art of Evolutionary Algorithms ProgrammingThe Art of Evolutionary Algorithms Programming
The Art of Evolutionary Algorithms Programming
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patterns
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic Revisited
 
Cs8392 u1-1-oop intro
Cs8392 u1-1-oop introCs8392 u1-1-oop intro
Cs8392 u1-1-oop intro
 
Rrw02 Week 1 Assignment
Rrw02 Week 1 AssignmentRrw02 Week 1 Assignment
Rrw02 Week 1 Assignment
 
Os Goodger
Os GoodgerOs Goodger
Os Goodger
 
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
 
Essential c
Essential cEssential c
Essential c
 
Essential c notes singh projects
Essential c notes singh projectsEssential c notes singh projects
Essential c notes singh projects
 
Essential c
Essential cEssential c
Essential c
 
Essential c
Essential cEssential c
Essential c
 
Essential c
Essential cEssential c
Essential c
 
Mastering python lesson1
Mastering python lesson1Mastering python lesson1
Mastering python lesson1
 
On being a professional software developer
On being a professional software developerOn being a professional software developer
On being a professional software developer
 
Documentation for developers
Documentation for developersDocumentation for developers
Documentation for developers
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with android
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developer
 
How to code
How to codeHow to code
How to code
 
Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...
Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...
Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...
 
Take the Smalltalk Red Pill
Take the Smalltalk Red PillTake the Smalltalk Red Pill
Take the Smalltalk Red Pill
 

Plus de Won Kwang University

Plus de Won Kwang University (9)

Prospects, concerns, and response strategies for the post-AI world
Prospects, concerns, and response strategies for the post-AI worldProspects, concerns, and response strategies for the post-AI world
Prospects, concerns, and response strategies for the post-AI world
 
Digital_Healthcare_and_ICT.pdf
Digital_Healthcare_and_ICT.pdfDigital_Healthcare_and_ICT.pdf
Digital_Healthcare_and_ICT.pdf
 
humanities and liberal arts in the age of Artificial Intelligence
humanities and liberal arts in the age of Artificial Intelligencehumanities and liberal arts in the age of Artificial Intelligence
humanities and liberal arts in the age of Artificial Intelligence
 
스마트 교수학습법
스마트 교수학습법스마트 교수학습법
스마트 교수학습법
 
[배포]4차 교육혁신
[배포]4차 교육혁신[배포]4차 교육혁신
[배포]4차 교육혁신
 
Tutorial kcc-2011
Tutorial kcc-2011Tutorial kcc-2011
Tutorial kcc-2011
 
Future Library
Future LibraryFuture Library
Future Library
 
Onto Sem
Onto SemOnto Sem
Onto Sem
 
Semantic Search Trend
Semantic Search TrendSemantic Search Trend
Semantic Search Trend
 

Dernier

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Good programming

  • 2.
  • 3.
  • 5. The RedMonk Programming Language Rankings: September 2012 1.JavaScript 2.Java 3.PHP 4.Python 5.Ruby 6.C# 7.C++ 8.C 9.Objective-C 10.Shell 11.Perl 12.Scala 13.Haskell 14.ASP 15.Assembly 16.ActionScript 17.R 18.Visual Basic 19.CoffeeScript 20.Groovy http://redmonk.com/sogrady/2012/09/12/language-rankings-9-12/#ixzz26XhGIOrn
  • 6.
  • 8.     void HandleStuff( CORP_DATA & inputRec, int crntQtr, EMP_DATA empRec, double & estimRevenue, double ytdRevenue, int screenX, int screenY, COLOR_TYPE & newColor, COLOR_TYPE & prevColor, StatusType & status, int expenseType ) {     int i; for ( i = 0; i < 100; i++ ) {  inputRec.revenue[i] = 0;   inputRec.expense[i] = corpExpense [crntQtr ][ i ];  } UpdateCorpDatabase( empRec );  estimRevenue = ytdRevenue * 4.0 / (double) crntQtr; newColor = prevColor;  status = SUCCESS; if ( expenseType == 1 ) { for ( i = 0; i < 12; i++ )   profit[i] = revenue[i] - expense.type1[i]; } else if ( expenseType == 2 ) {  profit[i] = revenue[i] - expense.type2[i]; } else if ( expenseType == 3 )  profit[i] = revenue[i] - expense.type3[i]; }
  • 9. 선서 나는 프로그램 고수들을 나의 멘토로 모시고, 그들의 지혜를 경청하고 실천하여, 프로그래밍의 본질을 깨우쳐 프로그래밍의 전설적 고수가 되고자 합니다...
  • 10. Define the problem completely. If you don't understand it, you can't program it. Without a good problem definition, you might put effort into solving the wrong problem. Be sure you know what you’re aiming at before you shoot.
  • 11. Think first, Program lately. Put the Mouse Down and Step Away from the Keyboard.. Throw away the keyboard !! Fire, Aim, Ready ?? Look before leap. Draw Diagrams !! Think twice, code once. Design first, then code.
  • 12. Use the top-down approach. Look at the whole picture !! Draw Diagrams !!
  • 13. Keep It Simple, Stupid! (KISS) Keep it short and simple. Occam's razor !! Everything should be made as simple as possible, but no simpler. - Albert Einstein
  • 14. Don’t Repeat Yourself. (DRY) Once And Only Once !! Duplication is Evil (DIE). Insanity: doing the same thing over and over again and expecting different results.
  • 15. Read The Fine Magazine. (RTFM) Read The Fine Manual. Read books, magazines, blogs, twitter feeds, and web sites. Always try to work with a mentor. If you can't find a mentor, consider moving on. Go to conferences. Listen to podcasts. Continuous Learning…
  • 16. Understand the Art behind the Language. Understand the philosophy of programming language. Understand the culture of your programming language !! Be aware of the specific strengths and weaknesses of the language you’re using. Choose the right programming language. Don’t limit your programming thinking only to the concepts that are supported automatically by your language.
  • 17. Divide and Conquer !! Modern software is inherently complex. Minimize the amount of essential complexity that anyone’s brain has to deal with at any one time. Don't Be Afraid to Break Things. Keep accidental complexity from needlessly proliferating.
  • 18. Modeling. Without good software modeling, you may have the right problem but the wrong solution. It may be impossible to have successful construction. Code is design. Model-driven architecture: MVC Model GoF: Design Patterns
  • 19. Abstraction !! Keep the level of the abstraction !! Encapsulate all in the side . Hide Secrets (Information Hiding). Localize them. Avoiding global data.
  • 20. Single Responsibility. Single Responsibility Principle: a class should have one, and only one, reason to change. Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. -- Andy Hunt and Dave Thomas in The Pragmatic Programmer. Single Source of Truth in model-driven architectures.
  • 21. Defensive Programming A clever person solves a problem. A wise person avoids it. – Einstein Be careful for Exceptions, Errors, Warnings,… Make it fail-safe before you make it better. Protecting Your Program From Invalid Inputs. garbage in, nothing out / garbage in, error message out / no garbage allowed in Build Your Own Assertion Mechanism.
  • 22. Automate Your Coding Standard. Pretty Print (PP). Style !! Layout !! Format !! Hungarian notation by Charles Simonyi. Use (naming) conventions.
  • 23. Iterate, Repeatedly, Again and Again Programming is neither fully an art nor fully a science. As it’s typically practiced, it’s a “craft” that’s somewhere between art and science. -- McConnell 2004 A first attempt might produce a solution that works, but it’s unlikely to produce the best solution. Don't be afraid to start over
  • 24. Programmer(programming) Comments are not evil. Provide good documentation. Don't just echo code in comments - make every comment meaningful.
  • 25. Choose Your Tools with Care. Right Programming Language and Right Tools !! Design Tools // Source-Code Tools // Executable-Code Tools Tool-Oriented Environments Building Your Own Programming Tools Discipline is the best tool.
  • 26. Ask "What Would the User Do?" You are not the User. Use case analysis. The User is the King. The user is Dummy. User-Friendly.
  • 27. Pieces of the advice  Never assume the computer assumes anything.  Don't patch bad code - rewrite it.  Make sure all variables are initialized before use.  Choose a data representation which makes the program simple.  Be sparing with temporary variables.  Parenthesize to avoid ambiguity.  Avoid side effects  Use library functions.  Choose a data representation which makes the program simple.  Test input for plausibility and validity.
  • 28. Be Open Mind !! Refuse to pretend you’re an expert when you’re not. Readily admit your mistakes. Get excited about programming !! Open, Share, Communicate, and Cooperate !! .
  • 30. Very Simple Quiz: What’s wrong ? // Compute roots of a quadratic equation. // This code assumes that (b*b-4*a*c) is positive. temp = Sqrt( b*b - 4*a*c ); root[O] = ( -b + temp ) / ( 2 * a ); root[1] = ( -b - temp ) / ( 2 * a ); ... // swap the roots temp = root[0]; root[0] = root[1]; root[1] = temp; for ( int i = 0; i < numPayCodes; i++ ) { for ( int j = 0; j < 12; j++ ) { for ( int k = 0; k < numDivisions; k++ ) { sum = sum + transaction[ j ][ i ][ k ]; } } }