SlideShare a Scribd company logo
Wisdom for Programmers

Sung-Kook Han
Good programming
Good programming
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
Good programming
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 ];
}
}
}

More Related Content

PDF
Best Practices For Writing Super Readable Code
PPTX
The modern view on implementation of classic design patterns in Java
PDF
Androides y Mazmorras. Part I (dungeons & robots)
PPTX
Java 8, the Good, the Bad and the Ugly
PPTX
OOP paradigm, principles of good design and architecture of Java applications
PPTX
Dion computerprogramming
PDF
Java design patterns
PPSX
Php course-session1
Best Practices For Writing Super Readable Code
The modern view on implementation of classic design patterns in Java
Androides y Mazmorras. Part I (dungeons & robots)
Java 8, the Good, the Bad and the Ugly
OOP paradigm, principles of good design and architecture of Java applications
Dion computerprogramming
Java design patterns
Php course-session1

What's hot (18)

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

Viewers also liked (17)

PPT
Presentacion3
PDF
How to innovate your ICT business
PDF
Idean_LeanResearch_Jan2014_FINAL
PDF
GA_LeanResearch
PPT
Hp Uiuc Part2
PPT
Presentation1
PPT
Presentacion1
PPT
D I G I T A L J U K E C O R P O R A T I O N Finish
PDF
Killer Presentation
PPT
Layers of Smalltalk Application
PDF
How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7
PPT
Van Catalogiseren Naar Metadatabeheer131107
PDF
Semantic Technology: State of the arts and Trends
PDF
Ontology Dev
PDF
4th Industrial Revolution and Restoration of Humanity
Presentacion3
How to innovate your ICT business
Idean_LeanResearch_Jan2014_FINAL
GA_LeanResearch
Hp Uiuc Part2
Presentation1
Presentacion1
D I G I T A L J U K E C O R P O R A T I O N Finish
Killer Presentation
Layers of Smalltalk Application
How to create_a_simple_java_web_service_and_publish_it_on_netbeans_7
Van Catalogiseren Naar Metadatabeheer131107
Semantic Technology: State of the arts and Trends
Ontology Dev
4th Industrial Revolution and Restoration of Humanity
Ad

Similar to Good programming (20)

ODP
The Art of Evolutionary Algorithms Programming
PDF
computer science cousre related to python
PPTX
Cinci ug-january2011-anti-patterns
PDF
Culture And Aesthetic Revisited
PDF
Cs8392 u1-1-oop intro
PDF
Rrw02 Week 1 Assignment
PDF
Os Goodger
PDF
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
PDF
Essential c
PDF
Essential c
PDF
Essential c notes singh projects
PDF
Essential c
PDF
Essential c
PPTX
Mastering python lesson1
PDF
On being a professional software developer
PPT
Documentation for developers
PDF
The Good, the Bad and the Ugly things to do with android
PPT
Evolving as a professional software developer
ODP
How to code
ODP
Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...
The Art of Evolutionary Algorithms Programming
computer science cousre related to python
Cinci ug-january2011-anti-patterns
Culture And Aesthetic Revisited
Cs8392 u1-1-oop intro
Rrw02 Week 1 Assignment
Os Goodger
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
Essential c
Essential c
Essential c notes singh projects
Essential c
Essential c
Mastering python lesson1
On being a professional software developer
Documentation for developers
The Good, the Bad and the Ugly things to do with android
Evolving as a professional software developer
How to code
Joxean Koret - Interactive Static Analysis Tools for Vulnerability Discovery ...

More from Won Kwang University (9)

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

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Cloud computing and distributed systems.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
KodekX | Application Modernization Development
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
sap open course for s4hana steps from ECC to s4
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Cloud computing and distributed systems.
The AUB Centre for AI in Media Proposal.docx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Mobile App Security Testing_ A Comprehensive Guide.pdf
Network Security Unit 5.pdf for BCA BBA.
KodekX | Application Modernization Development
Understanding_Digital_Forensics_Presentation.pptx
Review of recent advances in non-invasive hemoglobin estimation
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
Per capita expenditure prediction using model stacking based on satellite ima...
MIND Revenue Release Quarter 2 2025 Press Release
Unlocking AI with Model Context Protocol (MCP)
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx

Good programming

  • 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
  • 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 ]; } } }