SlideShare uma empresa Scribd logo
1 de 83
Baixar para ler offline
Seven Ineffective
Coding Habits of
Many Programmers
@KevlinHenney
It turns out that style matters in
programming for the same
reason that it matters in writing.
It makes for better reading.
Douglas Crockford
JavaScript: The Good Parts
Noisy Code
Signal-to-noise ratio (often abbreviated SNR or
S/N) is a measure used in science and engineering
that compares the level of a desired signal to the
level of background noise.
Signal-to-noise ratio is sometimes used informally
to refer to the ratio of useful information to false or
irrelevant data in a conversation or exchange.
http://en.wikipedia.org/wiki/Signal_to_noise_ratio
To be, or not to be: that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles,
And by opposing end them?
William Shakespeare
Hamlet
Continuing existence or cessation of
existence: those are the scenarios. Is it
more empowering mentally to work towards
an accommodation of the downsizings and
negative outcomes of adversarial
circumstance, or would it be a greater
enhancement of the bottom line to move
forwards to a challenge to our current
difficulties, and, by making a commitment
to opposition, to effect their demise?
Tom Burton
Long Words Bother Me
public class RecentlyUsedList
{
private List<string> items;
public RecentlyUsedList()
{
items = new List<string>();
}
public void Add(string newItem)
{
if (items.Contains(newItem))
{
int position = items.IndexOf(newItem);
string existingItem = items[position];
items.RemoveAt(position);
items.Insert(0, existingItem);
}
else
{
items.Insert(0, newItem);
}
}
public int Count
{
get
{
int size = items.Count;
return size;
}
}
public string this[int index]
{
get
{
int position = 0;
foreach (string item in items)
{
if (position == index)
return item;
++position;
}
throw new ArgumentOutOfRangeException();
}
}
}
public class RecentlyUsedList
{
private List<string> items;
public RecentlyUsedList()
{
items = new List<string>();
}
public void Add(string newItem)
{
if (items.Contains(newItem))
{
int position = items.IndexOf(newItem);
string existingItem = list[position];
items.RemoveAt(position);
items.Insert(0, existingItem);
}
else
{
items.Insert(0, newItem);
}
}
public int Count
{
get
{
int size = items.Count;
return size;
}
}
public string this[int index]
{
get
{
int position = 0;
foreach (string value in items)
{
if (position == index)
return value;
++position;
}
throw new ArgumentOutOfRangeException();
}
}
}
public class RecentlyUsedList
{
private List<string> items = new List<string>();
public void Add(string newItem)
{
items.Remove(newItem);
items.Add(newItem);
}
public int Count
{
get
{
return items.Count;
}
}
public string this[int index]
{
get
{
return items[Count - index - 1];
}
}
}
Comments
A delicate matter, requiring taste and judgement. I tend to err on the side of
eliminating comments, for several reasons. First, if the code is clear, and uses
good type names and variable names, it should explain itself. Second, comments
aren't checked by the compiler, so there is no guarantee they're right, especially
after the code is modified. A misleading comment can be very confusing. Third,
the issue of typography: comments clutter code.
Rob Pike, "Notes on Programming in C"
There is a famously bad comment style:
i=i+1; /* Add one to i */
and there are worse ways to do it:
/**********************************
* *
* Add one to i *
* *
**********************************/
i=i+1;
Don't laugh now, wait until you see it in real life.
Rob Pike, "Notes on Programming in C"
A common fallacy is to assume authors
of incomprehensible code will somehow
be able to express themselves lucidly
and clearly in comments.
Kevlin Henney
https://twitter.com/KevlinHenney/status/381021802941906944
Unsustainable Spacing
To be, or not to be: that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles,
And by opposing end them?
William Shakespeare
Hamlet
Continuing existence or cessation of
existence: those are the scenarios. Is it
more empowering mentally to work towards
an accommodation of the downsizings and
negative outcomes of adversarial
circumstance, or would it be a greater
enhancement of the bottom line to move
forwards to a challenge to our current
difficulties, and, by making a commitment
to opposition, to effect their demise?
Tom Burton
Long Words Bother Me
Continuing existence or cessation of existence:
those are the
more empowe
to work towa
accommodati
downsizings
outcomes of
circumstance
a greater enh
the bottom li
forwards to a
our current d
by making a
opposition, t
demise?
How many programmers lay out their code
Column 80
How people read
To answer the question "What is clean design?"
most succinctly: a clean design is one that
supports visual thinking so people can meet their
informational needs with a minimum of
conscious effort.
Daniel Higginbotham ∙ "Clean Up Your Mess — A Guide to Visual Design for Everyone" ∙ http://www.visualmess.com/
You convey information by the way you arrange
a design's elements in relation to each other. This
information is understood immediately, if not
consciously, by the people viewing your designs.
Daniel Higginbotham ∙ "Clean Up Your Mess — A Guide to Visual Design for Everyone" ∙ http://www.visualmess.com/
This is great if the visual relationships are
obvious and accurate, but if they're not, your
audience is going to get confused. They'll have to
examine your work carefully, going back and
forth between the different parts to make sure
they understand.
Daniel Higginbotham ∙ "Clean Up Your Mess — A Guide to Visual Design for Everyone" ∙ http://www.visualmess.com/
public int howNotToLayoutAMethodHeader(int firstArgument,
String secondArgument)
public int ensureArgumentsAreAlignedLikeThis(
int firstArgument,
String secondArgument)
public int orEnsureArgumentsAreGroupedLikeThis(
int firstArgument, String secondArgument)
public int butNotAlignedLikeThis(int firstArgument,
String secondArgument)
int doNotFormat = likeThis(someArgumentOrExpression,
anotherArgumentOrExpression);
int insteadFormat =
somethingLikeThis(
someArgumentOrExpression,
anotherArgumentOrExpression);
int orFormat = somethingLikeThis(
someArgumentOrExpression,
anotherArgumentOrExpression);
int asItIs = unstable(someArgumentOrExpression,
anotherArgumentOrExpression);
int butThisIs =
stable(
someArgumentOrExpression,
anotherArgumentOrExpression);
int andThisIs = stable(
someArgumentOrExpression,
anotherArgumentOrExpression);
public ResultType arbitraryMethodName(FirstArgumentType firs
SecondArgumentType sec
ThirdArgumentType thir
LocalVariableType localVariable = method(firstArgument,
secondArgument)
if (localVariable.isSomething(thirdArgument,
SOME_SHOUTY_CONSTANT)) {
doSomethingWith(localVariable);
}
return localVariable.getSomething();
}
public ResultType arbitraryMethodName(
FirstArgumentType firstArgument,
SecondArgumentType secondArgument,
ThirdArgumentType thirdArgument) {
LocalVariableType localVariable =
method(firstArgument, secondArgument);
if (localVariable.isSomething(
thirdArgument, SOME_SHOUTY_CONSTANT)) {
doSomething(localVariable);
}
return localVariable.getSomething();
}
XXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXX
XX XXXXXXXXXXXXX XXXXXXXXXXX
XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXX XXXXXXXXXXXXX
XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX
public ResultType arbitraryMethodName(
FirstArgumentType firstArgument,
SecondArgumentType secondArgument,
ThirdArgumentType thirdArgument) {
LocalVariableType localVariable =
method(firstArgument, secondArgument);
if (localVariable.isSomething(
thirdArgument, SOME_SHOUTY_CONSTANT)) {
doSomething(localVariable);
}
return localVariable.getSomething();
}
XXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXX
XX XXXXXXXXXXXXX XXXXXXXXXXX
XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXX XXXXXXXXXXXXX
XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX
public ResultType arbitraryMethodName(
FirstArgumentType firstArgument,
SecondArgumentType secondArgument,
ThirdArgumentType thirdArgument)
{
LocalVariableType localVariable =
method(firstArgument, secondArgument);
if (localVariable.isSomething(
thirdArgument, SOME_SHOUTY_CONSTANT))
{
doSomething(localVariable);
}
return localVariable.getSomething();
}
XXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXX
XX XXXXXXXXXXXXX XXXXXXXXXXX
XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXX XXXXXXXXXXXXX
XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX
Lego Naming
Agglutination is a process in linguistic morphology
derivation in which complex words are formed by
stringing together morphemes, each with a single
grammatical or semantic meaning. Languages that
use agglutination widely are called agglutinative
languages.
http://en.wikipedia.org/wiki/Agglutination
Proxy
validate
Service
Value
get
create
Manager
check
Controller
set
Factory
Object
doenable
process
disable
Exception
add
remove
public interface ConditionChecker
{
boolean checkCondition();
}
public interface Condition
{
boolean isTrue();
}
public Connection createConnection(Provider...)
throws ConnectionFailureException
...
public Connection connectTo(Provider...)
throws ConnectionFailure
...
AccessViolationException
ArgumentOutOfRangeException
ArrayTypeMismatchException
BadImageFormatException
CannotUnloadAppDomainException
EntryPointNotFoundException
IndexOutOfRangeException
InvalidOperationException
OverflowException
AccessViolation
ArgumentOutOfRange
ArrayTypeMismatch
BadImageFormat
CannotUnloadAppDomain
EntryPointNotFound
IndexOutOfRange
InvalidOperation
Overflow
ArgumentException
ArithmeticException
ContextMarshalException
FieldAccessException
FormatException
NullReferenceException
ObjectDisposedException
RankException
TypeAccessException
Argument
Arithmetic
ContextMarshal
FieldAccess
Format
NullReference
ObjectDisposed
Rank
TypeAccess
InvalidArgument
InvalidArithmeticOperation
FailedContextMarshal
InvalidFieldAccess
InvalidFormat
NullDereferenced
OperationOnDisposedObject
ArrayRankMismatch
InvalidTypeAccess
Omit needless words.
William Strunk and E B White
The Elements of Style
Underabstraction
http://fragmental.tw/2009/04/29/tag-clouds-see-how-noisy-your-code-is/
http://fragmental.tw/2009/04/29/tag-clouds-see-how-noisy-your-code-is/
if (portfolioIdsByTraderId.get(trader.getId())
.containsKey(portfolio.getId()))
{
...
}
Dan North, "Code in the Language of the Domain"
97 Things Every Programmer Should Know
if (trader.canView(portfolio))
{
...
}
Dan North, "Code in the Language of the Domain"
97 Things Every Programmer Should Know
Unencapsulated State
public class RecentlyUsedList
{
private List<string> items = new List<string>();
public List<string> Items
{
get
{
return items;
}
}
public void Add(string newItem)
{
if(newItem == null)
throw new ArgumentNullException();
items.Remove(newItem);
items.Insert(0, newItem);
}
...
}
public class RecentlyUsedList
{
private List<string> items = new List<string>();
public List<string> Items
{
get
{
return items;
}
}
public void Add(string newItem)
{
if(newItem == null)
throw new ArgumentNullException();
items.Remove(newItem);
items.Insert(0, newItem);
}
...
}
public class RecentlyUsedList
{
private List<string> items = new List<string>();
public List<string> Items
{
get
{
return items;
}
}
public void Add(string newItem)
{
if(newItem == null)
throw new ArgumentNullException();
items.Remove(newItem);
items.Insert(0, newItem);
}
...
}
var list = new RecentlyUsedList();
list.Add("Hello, World!");
Console.WriteLine(list.Items.Count);
list.Items.Add("Hello, World!");
Console.WriteLine(list.Items.Count);
list.Items.Add(null);
Don't ever invite a
vampire into your
house, you silly boy.
It renders you
powerless.
public class RecentlyUsedList
{
private IList<string> items = new List<string>();
public int Count
{
get
{
return items.Count;
}
}
public string this[int index]
{
get
{
return items[index];
}
}
public void Add(string newItem)
{
if(newItem == null)
throw new ArgumentNullException();
items.Remove(newItem);
items.Insert(0, newItem);
}
...
}
public class RecentlyUsedList
{
private IList<string> items = new List<string>();
public int Count
{
get
{
return items.Count;
}
}
public string this[int index]
{
get
{
return items[Count – index - 1];
}
}
public void Add(string newItem)
{
if(newItem == null)
throw new ArgumentNullException();
items.Remove(newItem);
items.Add(newItem);
}
...
}
Getters and Setters
public class Money implements ...
{
...
public int getUnits() ...
public int getHundredths() ...
public Currency getCurrency() ...
...
public void setUnits(int newUnits) ...
public void setHundredths(int newHundredths) ...
public void setCurrency(Currency newCurrency) ...
...
}
public final class Money implements ...
{
...
public int getUnits() ...
public int getHundredths() ...
public Currency getCurrency() ...
...
}
public final class Money implements ...
{
...
public int units() ...
public int hundredths() ...
public Currency currency() ...
...
}
When it is not
necessary to
change, it is
necessary not to
change.
Lucius Cary
Uncohesive Tests
Everybody knows that TDD stands for Test Driven
Development. However, people too often concentrate
on the words "Test" and "Development" and don't
consider what the word "Driven" really implies. For
tests to drive development they must do more than
just test that code performs its required functionality:
they must clearly express that required functionality
to the reader. That is, they must be clear specifications
of the required functionality. Tests that are not written
with their role as specifications in mind can be very
confusing to read.
Nat Pryce and Steve Freeman
"Are Your Tests Really Driving Your Development?"
public class RecentlyUsedList
{
...
public RecentlyUsedList() ...
public int Count
{
get...
}
public string this[int index]
{
get...
}
public void Add(string newItem) ...
...
}
[TestFixture]
public class RecentlyUsedListTests
{
[Test]
public void TestConstructor() ...
[Test]
public void TestCountGet() ...
[Test]
public void TestIndexerGet() ...
[Test]
public void TestAdd() ...
...
}
methodtest
test
test
method
method
test
test
namespace RecentlyUsedList_spec
{
[TestFixture]
public class A_new_list
{
[Test] public void Is_empty() 
}
[TestFixture]
public class An_empty_list
{
[Test] public void Retains_a_single_addition() 
[Test] public void Retains_unique_additions_in_stack_order() 
}
[TestFixture]
public class A_non_empty_list
{
[Test] public void Is_unchanged_when_head_item_is_readded() 
[Test] public void Moves_non_head_item_to_head_when_it_is_readded() 
}
[TestFixture]
public class Any_list_rejects
{
[Test] public void Addition_of_null_items() 
[Test] public void Indexing_past_its_end() 
[Test] public void Negative_indexing() 
}
}
namespace RecentlyUsedList_spec
{
[TestFixture]
public class A_new_list
{
[Test] public void Is_empty() 
}
[TestFixture]
public class An_empty_list
{
[Test] public void Retains_a_single_addition() 
[Test] public void Retains_unique_additions_in_stack_order() 
}
[TestFixture]
public class A_non_empty_list
{
[Test] public void Is_unchanged_when_head_item_is_readded() 
[Test] public void Moves_non_head_item_to_head_when_it_is_readded() 
}
[TestFixture]
public class Any_list_rejects
{
[Test] public void Addition_of_null_items() 
[Test] public void Indexing_past_its_end() 
[Test] public void Negative_indexing() 
}
}
A test case should
be just that: it
should correspond
to a single case.
At some level
the style
becomes the
substance.

Mais conteúdo relacionado

Mais procurados

Lean Startup in the Enterprise
Lean Startup in the EnterpriseLean Startup in the Enterprise
Lean Startup in the EnterpriseDavid Bland
 
3 HACKS PARA CONSEGUIR MÁS LEADS Y MEJORAR TU SEO, UX y CRO
3 HACKS PARA CONSEGUIR MÁS  LEADS Y MEJORAR TU SEO, UX y CRO3 HACKS PARA CONSEGUIR MÁS  LEADS Y MEJORAR TU SEO, UX y CRO
3 HACKS PARA CONSEGUIR MÁS LEADS Y MEJORAR TU SEO, UX y CROIñaki Tovar
 
openai-chatgpt sunumu
openai-chatgpt sunumuopenai-chatgpt sunumu
openai-chatgpt sunumuglkabakc
 
Actionable Tips to Increase Your Website Authority - Lily Ray
Actionable Tips to Increase Your Website Authority - Lily RayActionable Tips to Increase Your Website Authority - Lily Ray
Actionable Tips to Increase Your Website Authority - Lily RayLily Ray
 
Art of Persuasion by Perry Belcher
Art of Persuasion by Perry BelcherArt of Persuasion by Perry Belcher
Art of Persuasion by Perry BelcherPerry Belcher
 
Software is Eating Bio
Software is Eating BioSoftware is Eating Bio
Software is Eating Bioa16z
 
You deleted how many pages? 130M and heres why - brightonSEO Autumn 2021
You deleted how many pages? 130M and heres why - brightonSEO Autumn 2021You deleted how many pages? 130M and heres why - brightonSEO Autumn 2021
You deleted how many pages? 130M and heres why - brightonSEO Autumn 2021David Lewis
 
Hegazi_ChatGPT_Book.pdf
Hegazi_ChatGPT_Book.pdfHegazi_ChatGPT_Book.pdf
Hegazi_ChatGPT_Book.pdfAmirHegazi1
 
Digital Marketing Conversion Optimization Marketing Strategy Deck Ungagged Day 2
Digital Marketing Conversion Optimization Marketing Strategy Deck Ungagged Day 2Digital Marketing Conversion Optimization Marketing Strategy Deck Ungagged Day 2
Digital Marketing Conversion Optimization Marketing Strategy Deck Ungagged Day 2Roland Frasier
 
How to Prepare Your Brand for Upcoming AI Features in Search
How to Prepare Your Brand for Upcoming AI Features in SearchHow to Prepare Your Brand for Upcoming AI Features in Search
How to Prepare Your Brand for Upcoming AI Features in SearchLily Ray
 
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdfKiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdfssuser62db4d1
 
How to leverage indexation tracking to monitor issues and improve performance
How to leverage indexation tracking to monitor issues and improve performanceHow to leverage indexation tracking to monitor issues and improve performance
How to leverage indexation tracking to monitor issues and improve performanceSimon Lesser
 
Build an LLM-powered application using LangChain.pdf
Build an LLM-powered application using LangChain.pdfBuild an LLM-powered application using LangChain.pdf
Build an LLM-powered application using LangChain.pdfStephenAmell4
 
Becoming an exponential organization in an Age of Disruption
Becoming an exponential organization in an Age of DisruptionBecoming an exponential organization in an Age of Disruption
Becoming an exponential organization in an Age of DisruptionRob van Alphen
 
Training Avatars for the Metaverse
Training Avatars for the MetaverseTraining Avatars for the Metaverse
Training Avatars for the MetaverseBrentDavis68
 
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023Johnny Sung
 
Lean Analytics Cycle
Lean Analytics CycleLean Analytics Cycle
Lean Analytics CycleHiten Shah
 
Metaverse - The Future of Marketing and Web 3.0.pdf
Metaverse - The Future of Marketing and Web 3.0.pdfMetaverse - The Future of Marketing and Web 3.0.pdf
Metaverse - The Future of Marketing and Web 3.0.pdfthetechnologynews
 

Mais procurados (20)

Lean Startup in the Enterprise
Lean Startup in the EnterpriseLean Startup in the Enterprise
Lean Startup in the Enterprise
 
3 HACKS PARA CONSEGUIR MÁS LEADS Y MEJORAR TU SEO, UX y CRO
3 HACKS PARA CONSEGUIR MÁS  LEADS Y MEJORAR TU SEO, UX y CRO3 HACKS PARA CONSEGUIR MÁS  LEADS Y MEJORAR TU SEO, UX y CRO
3 HACKS PARA CONSEGUIR MÁS LEADS Y MEJORAR TU SEO, UX y CRO
 
openai-chatgpt sunumu
openai-chatgpt sunumuopenai-chatgpt sunumu
openai-chatgpt sunumu
 
Actionable Tips to Increase Your Website Authority - Lily Ray
Actionable Tips to Increase Your Website Authority - Lily RayActionable Tips to Increase Your Website Authority - Lily Ray
Actionable Tips to Increase Your Website Authority - Lily Ray
 
Art of Persuasion by Perry Belcher
Art of Persuasion by Perry BelcherArt of Persuasion by Perry Belcher
Art of Persuasion by Perry Belcher
 
Software is Eating Bio
Software is Eating BioSoftware is Eating Bio
Software is Eating Bio
 
You deleted how many pages? 130M and heres why - brightonSEO Autumn 2021
You deleted how many pages? 130M and heres why - brightonSEO Autumn 2021You deleted how many pages? 130M and heres why - brightonSEO Autumn 2021
You deleted how many pages? 130M and heres why - brightonSEO Autumn 2021
 
Hegazi_ChatGPT_Book.pdf
Hegazi_ChatGPT_Book.pdfHegazi_ChatGPT_Book.pdf
Hegazi_ChatGPT_Book.pdf
 
Digital Marketing Conversion Optimization Marketing Strategy Deck Ungagged Day 2
Digital Marketing Conversion Optimization Marketing Strategy Deck Ungagged Day 2Digital Marketing Conversion Optimization Marketing Strategy Deck Ungagged Day 2
Digital Marketing Conversion Optimization Marketing Strategy Deck Ungagged Day 2
 
How to Prepare Your Brand for Upcoming AI Features in Search
How to Prepare Your Brand for Upcoming AI Features in SearchHow to Prepare Your Brand for Upcoming AI Features in Search
How to Prepare Your Brand for Upcoming AI Features in Search
 
Metaverse Infographics
Metaverse InfographicsMetaverse Infographics
Metaverse Infographics
 
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdfKiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
 
The Creative Ai storm
The Creative Ai stormThe Creative Ai storm
The Creative Ai storm
 
How to leverage indexation tracking to monitor issues and improve performance
How to leverage indexation tracking to monitor issues and improve performanceHow to leverage indexation tracking to monitor issues and improve performance
How to leverage indexation tracking to monitor issues and improve performance
 
Build an LLM-powered application using LangChain.pdf
Build an LLM-powered application using LangChain.pdfBuild an LLM-powered application using LangChain.pdf
Build an LLM-powered application using LangChain.pdf
 
Becoming an exponential organization in an Age of Disruption
Becoming an exponential organization in an Age of DisruptionBecoming an exponential organization in an Age of Disruption
Becoming an exponential organization in an Age of Disruption
 
Training Avatars for the Metaverse
Training Avatars for the MetaverseTraining Avatars for the Metaverse
Training Avatars for the Metaverse
 
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
[AI / ML] 用 LLM (Large language model) 來整理您的知識庫 @Devfest Taipei 2023
 
Lean Analytics Cycle
Lean Analytics CycleLean Analytics Cycle
Lean Analytics Cycle
 
Metaverse - The Future of Marketing and Web 3.0.pdf
Metaverse - The Future of Marketing and Web 3.0.pdfMetaverse - The Future of Marketing and Web 3.0.pdf
Metaverse - The Future of Marketing and Web 3.0.pdf
 

Destaque

Worse Is Better, for Better or for Worse
Worse Is Better, for Better or for WorseWorse Is Better, for Better or for Worse
Worse Is Better, for Better or for WorseKevlin Henney
 
Clean code, Feb 2012
Clean code, Feb 2012Clean code, Feb 2012
Clean code, Feb 2012cobyst
 
Clean code: meaningful Name
Clean code: meaningful NameClean code: meaningful Name
Clean code: meaningful Namenahid035
 
Scub Foundation, usine logicielle Java libre
Scub Foundation, usine logicielle Java libreScub Foundation, usine logicielle Java libre
Scub Foundation, usine logicielle Java libreStéphane Traumat
 
ERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projectsERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projectsChristian Charreyre
 
ERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projectsERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projectsChristian Charreyre
 
BibBase Linked Data Triplification Challenge 2010 Presentation
BibBase Linked Data Triplification Challenge 2010 PresentationBibBase Linked Data Triplification Challenge 2010 Presentation
BibBase Linked Data Triplification Challenge 2010 PresentationReynold Xin
 
Comment travailler avec les logiciels Open Source
Comment travailler avec les logiciels Open SourceComment travailler avec les logiciels Open Source
Comment travailler avec les logiciels Open SourceChristian Charreyre
 
Créer une distribution Linux embarqué professionnelle avec Yocto Project
Créer une distribution Linux embarqué professionnelle avec Yocto ProjectCréer une distribution Linux embarqué professionnelle avec Yocto Project
Créer une distribution Linux embarqué professionnelle avec Yocto ProjectChristian Charreyre
 
A System Is Not a Tree
A System Is Not a TreeA System Is Not a Tree
A System Is Not a TreeKevlin Henney
 
Yocto une solution robuste pour construire des applications à fort contenu ap...
Yocto une solution robuste pour construire des applications à fort contenu ap...Yocto une solution robuste pour construire des applications à fort contenu ap...
Yocto une solution robuste pour construire des applications à fort contenu ap...Christian Charreyre
 
Présentation Yocto - SophiaConf 2015
Présentation Yocto - SophiaConf 2015Présentation Yocto - SophiaConf 2015
Présentation Yocto - SophiaConf 2015Christian Charreyre
 
Open Embedded un framework libre pour assurer la cohérence de son projet
Open Embedded un framework libre pour assurer la cohérence de son projetOpen Embedded un framework libre pour assurer la cohérence de son projet
Open Embedded un framework libre pour assurer la cohérence de son projetChristian Charreyre
 
Using heka
Using hekaUsing heka
Using hekaExotel
 
Python Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & stylePython Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & styleKevlin Henney
 

Destaque (20)

Functional C++
Functional C++Functional C++
Functional C++
 
Worse Is Better, for Better or for Worse
Worse Is Better, for Better or for WorseWorse Is Better, for Better or for Worse
Worse Is Better, for Better or for Worse
 
Clean code, Feb 2012
Clean code, Feb 2012Clean code, Feb 2012
Clean code, Feb 2012
 
Clean code: meaningful Name
Clean code: meaningful NameClean code: meaningful Name
Clean code: meaningful Name
 
Scub Foundation, usine logicielle Java libre
Scub Foundation, usine logicielle Java libreScub Foundation, usine logicielle Java libre
Scub Foundation, usine logicielle Java libre
 
Clean architectures
Clean architecturesClean architectures
Clean architectures
 
ERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projectsERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projects
 
ERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projectsERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projects
 
Meetup Systemd vs sysvinit
Meetup Systemd vs sysvinitMeetup Systemd vs sysvinit
Meetup Systemd vs sysvinit
 
BibBase Linked Data Triplification Challenge 2010 Presentation
BibBase Linked Data Triplification Challenge 2010 PresentationBibBase Linked Data Triplification Challenge 2010 Presentation
BibBase Linked Data Triplification Challenge 2010 Presentation
 
Comment travailler avec les logiciels Open Source
Comment travailler avec les logiciels Open SourceComment travailler avec les logiciels Open Source
Comment travailler avec les logiciels Open Source
 
Créer une distribution Linux embarqué professionnelle avec Yocto Project
Créer une distribution Linux embarqué professionnelle avec Yocto ProjectCréer une distribution Linux embarqué professionnelle avec Yocto Project
Créer une distribution Linux embarqué professionnelle avec Yocto Project
 
A System Is Not a Tree
A System Is Not a TreeA System Is Not a Tree
A System Is Not a Tree
 
Yocto une solution robuste pour construire des applications à fort contenu ap...
Yocto une solution robuste pour construire des applications à fort contenu ap...Yocto une solution robuste pour construire des applications à fort contenu ap...
Yocto une solution robuste pour construire des applications à fort contenu ap...
 
Présentation Yocto - SophiaConf 2015
Présentation Yocto - SophiaConf 2015Présentation Yocto - SophiaConf 2015
Présentation Yocto - SophiaConf 2015
 
Open Embedded un framework libre pour assurer la cohérence de son projet
Open Embedded un framework libre pour assurer la cohérence de son projetOpen Embedded un framework libre pour assurer la cohérence de son projet
Open Embedded un framework libre pour assurer la cohérence de son projet
 
OS libres pour l'IoT - Zephyr
OS libres pour l'IoT - ZephyrOS libres pour l'IoT - Zephyr
OS libres pour l'IoT - Zephyr
 
Autotools
AutotoolsAutotools
Autotools
 
Using heka
Using hekaUsing heka
Using heka
 
Python Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & stylePython Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & style
 

Semelhante a Seven Ineffective Coding Habits of Many Programmers

Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersKevlin Henney
 
Seven Ineffective Coding Habits of Many Java Programmers
Seven Ineffective Coding Habits of Many Java ProgrammersSeven Ineffective Coding Habits of Many Java Programmers
Seven Ineffective Coding Habits of Many Java ProgrammersKevlin Henney
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersKevlin Henney
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersKevlin Henney
 
Turning Development Outside-In
Turning Development Outside-InTurning Development Outside-In
Turning Development Outside-InKevlin Henney
 
Incompleteness Theorems: Logical Necessity of Inconsistency
Incompleteness Theorems:  Logical Necessity of InconsistencyIncompleteness Theorems:  Logical Necessity of Inconsistency
Incompleteness Theorems: Logical Necessity of InconsistencyCarl Hewitt
 
Giving Code a Good Name
Giving Code a Good NameGiving Code a Good Name
Giving Code a Good NameKevlin Henney
 
Intuition & Use-Cases of Embeddings in NLP & beyond
Intuition & Use-Cases of Embeddings in NLP & beyondIntuition & Use-Cases of Embeddings in NLP & beyond
Intuition & Use-Cases of Embeddings in NLP & beyondC4Media
 
DN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
DN18 | A/B Testing: Lessons Learned | Dan McKinley | MailchimpDN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
DN18 | A/B Testing: Lessons Learned | Dan McKinley | MailchimpDataconomy Media
 
Causal inference-for-profit | Dan McKinley | DN18
Causal inference-for-profit | Dan McKinley | DN18Causal inference-for-profit | Dan McKinley | DN18
Causal inference-for-profit | Dan McKinley | DN18DataconomyGmbH
 
NDC 2011 - The FLUID Principles
NDC 2011 - The FLUID PrinciplesNDC 2011 - The FLUID Principles
NDC 2011 - The FLUID Principlesanoras
 
Experiments in Reasoning
Experiments in ReasoningExperiments in Reasoning
Experiments in ReasoningAslam Khan
 
Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...
Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...
Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...Codemotion
 
Everything you always wanted to know about psychology and technical communica...
Everything you always wanted to know about psychology and technical communica...Everything you always wanted to know about psychology and technical communica...
Everything you always wanted to know about psychology and technical communica...Chris Atherton @finiteattention
 
Diagnosing cancer with Computational Intelligence
Diagnosing cancer with Computational IntelligenceDiagnosing cancer with Computational Intelligence
Diagnosing cancer with Computational IntelligenceSimon van Dyk
 
2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datos2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datosPHP Conference Argentina
 
KevlinHenney_PuttingThereIntoArchitecture
KevlinHenney_PuttingThereIntoArchitectureKevlinHenney_PuttingThereIntoArchitecture
KevlinHenney_PuttingThereIntoArchitectureKostas Mavridis
 
Why Agile Works But Isn't Working For You
Why Agile Works But Isn't Working For YouWhy Agile Works But Isn't Working For You
Why Agile Works But Isn't Working For YouDavid Harvey
 

Semelhante a Seven Ineffective Coding Habits of Many Programmers (20)

Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many Programmers
 
Seven Ineffective Coding Habits of Many Java Programmers
Seven Ineffective Coding Habits of Many Java ProgrammersSeven Ineffective Coding Habits of Many Java Programmers
Seven Ineffective Coding Habits of Many Java Programmers
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many Programmers
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many Programmers
 
Turning Development Outside-In
Turning Development Outside-InTurning Development Outside-In
Turning Development Outside-In
 
Incompleteness Theorems: Logical Necessity of Inconsistency
Incompleteness Theorems:  Logical Necessity of InconsistencyIncompleteness Theorems:  Logical Necessity of Inconsistency
Incompleteness Theorems: Logical Necessity of Inconsistency
 
Giving Code a Good Name
Giving Code a Good NameGiving Code a Good Name
Giving Code a Good Name
 
Intuition & Use-Cases of Embeddings in NLP & beyond
Intuition & Use-Cases of Embeddings in NLP & beyondIntuition & Use-Cases of Embeddings in NLP & beyond
Intuition & Use-Cases of Embeddings in NLP & beyond
 
The Rule of Three
The Rule of ThreeThe Rule of Three
The Rule of Three
 
DN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
DN18 | A/B Testing: Lessons Learned | Dan McKinley | MailchimpDN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
DN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
 
Causal inference-for-profit | Dan McKinley | DN18
Causal inference-for-profit | Dan McKinley | DN18Causal inference-for-profit | Dan McKinley | DN18
Causal inference-for-profit | Dan McKinley | DN18
 
NDC 2011 - The FLUID Principles
NDC 2011 - The FLUID PrinciplesNDC 2011 - The FLUID Principles
NDC 2011 - The FLUID Principles
 
Design Patterns: Back to Basics
Design Patterns: Back to BasicsDesign Patterns: Back to Basics
Design Patterns: Back to Basics
 
Experiments in Reasoning
Experiments in ReasoningExperiments in Reasoning
Experiments in Reasoning
 
Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...
Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...
Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...
 
Everything you always wanted to know about psychology and technical communica...
Everything you always wanted to know about psychology and technical communica...Everything you always wanted to know about psychology and technical communica...
Everything you always wanted to know about psychology and technical communica...
 
Diagnosing cancer with Computational Intelligence
Diagnosing cancer with Computational IntelligenceDiagnosing cancer with Computational Intelligence
Diagnosing cancer with Computational Intelligence
 
2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datos2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datos
 
KevlinHenney_PuttingThereIntoArchitecture
KevlinHenney_PuttingThereIntoArchitectureKevlinHenney_PuttingThereIntoArchitecture
KevlinHenney_PuttingThereIntoArchitecture
 
Why Agile Works But Isn't Working For You
Why Agile Works But Isn't Working For YouWhy Agile Works But Isn't Working For You
Why Agile Works But Isn't Working For You
 

Mais de Kevlin Henney

The Case for Technical Excellence
The Case for Technical ExcellenceThe Case for Technical Excellence
The Case for Technical ExcellenceKevlin Henney
 
Empirical Development
Empirical DevelopmentEmpirical Development
Empirical DevelopmentKevlin Henney
 
Lambda? You Keep Using that Letter
Lambda? You Keep Using that LetterLambda? You Keep Using that Letter
Lambda? You Keep Using that LetterKevlin Henney
 
Lambda? You Keep Using that Letter
Lambda? You Keep Using that LetterLambda? You Keep Using that Letter
Lambda? You Keep Using that LetterKevlin Henney
 
Solid Deconstruction
Solid DeconstructionSolid Deconstruction
Solid DeconstructionKevlin Henney
 
Procedural Programming: It’s Back? It Never Went Away
Procedural Programming: It’s Back? It Never Went AwayProcedural Programming: It’s Back? It Never Went Away
Procedural Programming: It’s Back? It Never Went AwayKevlin Henney
 
Structure and Interpretation of Test Cases
Structure and Interpretation of Test CasesStructure and Interpretation of Test Cases
Structure and Interpretation of Test CasesKevlin Henney
 
Refactoring to Immutability
Refactoring to ImmutabilityRefactoring to Immutability
Refactoring to ImmutabilityKevlin Henney
 
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...Kevlin Henney
 
Thinking Outside the Synchronisation Quadrant
Thinking Outside the Synchronisation QuadrantThinking Outside the Synchronisation Quadrant
Thinking Outside the Synchronisation QuadrantKevlin Henney
 
The Error of Our Ways
The Error of Our WaysThe Error of Our Ways
The Error of Our WaysKevlin Henney
 
SOLID Deconstruction
SOLID DeconstructionSOLID Deconstruction
SOLID DeconstructionKevlin Henney
 

Mais de Kevlin Henney (20)

Program with GUTs
Program with GUTsProgram with GUTs
Program with GUTs
 
The Case for Technical Excellence
The Case for Technical ExcellenceThe Case for Technical Excellence
The Case for Technical Excellence
 
Empirical Development
Empirical DevelopmentEmpirical Development
Empirical Development
 
Lambda? You Keep Using that Letter
Lambda? You Keep Using that LetterLambda? You Keep Using that Letter
Lambda? You Keep Using that Letter
 
Lambda? You Keep Using that Letter
Lambda? You Keep Using that LetterLambda? You Keep Using that Letter
Lambda? You Keep Using that Letter
 
Solid Deconstruction
Solid DeconstructionSolid Deconstruction
Solid Deconstruction
 
Get Kata
Get KataGet Kata
Get Kata
 
Procedural Programming: It’s Back? It Never Went Away
Procedural Programming: It’s Back? It Never Went AwayProcedural Programming: It’s Back? It Never Went Away
Procedural Programming: It’s Back? It Never Went Away
 
Structure and Interpretation of Test Cases
Structure and Interpretation of Test CasesStructure and Interpretation of Test Cases
Structure and Interpretation of Test Cases
 
Agility ≠ Speed
Agility ≠ SpeedAgility ≠ Speed
Agility ≠ Speed
 
Refactoring to Immutability
Refactoring to ImmutabilityRefactoring to Immutability
Refactoring to Immutability
 
Old Is the New New
Old Is the New NewOld Is the New New
Old Is the New New
 
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...
 
Thinking Outside the Synchronisation Quadrant
Thinking Outside the Synchronisation QuadrantThinking Outside the Synchronisation Quadrant
Thinking Outside the Synchronisation Quadrant
 
Code as Risk
Code as RiskCode as Risk
Code as Risk
 
Software Is Details
Software Is DetailsSoftware Is Details
Software Is Details
 
Game of Sprints
Game of SprintsGame of Sprints
Game of Sprints
 
Good Code
Good CodeGood Code
Good Code
 
The Error of Our Ways
The Error of Our WaysThe Error of Our Ways
The Error of Our Ways
 
SOLID Deconstruction
SOLID DeconstructionSOLID Deconstruction
SOLID Deconstruction
 

Último

Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书rnrncn29
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodManicka Mamallan Andavar
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical trainingGladiatorsKasper
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSneha Padhiar
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptJohnWilliam111370
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfDrew Moseley
 
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESkarthi keyan
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTSneha Padhiar
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 

Último (20)

Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument method
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdf
 
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 

Seven Ineffective Coding Habits of Many Programmers

  • 1. Seven Ineffective Coding Habits of Many Programmers @KevlinHenney
  • 2. It turns out that style matters in programming for the same reason that it matters in writing. It makes for better reading. Douglas Crockford JavaScript: The Good Parts
  • 3.
  • 5. Signal-to-noise ratio (often abbreviated SNR or S/N) is a measure used in science and engineering that compares the level of a desired signal to the level of background noise. Signal-to-noise ratio is sometimes used informally to refer to the ratio of useful information to false or irrelevant data in a conversation or exchange. http://en.wikipedia.org/wiki/Signal_to_noise_ratio
  • 6. To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? William Shakespeare Hamlet
  • 7. Continuing existence or cessation of existence: those are the scenarios. Is it more empowering mentally to work towards an accommodation of the downsizings and negative outcomes of adversarial circumstance, or would it be a greater enhancement of the bottom line to move forwards to a challenge to our current difficulties, and, by making a commitment to opposition, to effect their demise? Tom Burton Long Words Bother Me
  • 8. public class RecentlyUsedList { private List<string> items; public RecentlyUsedList() { items = new List<string>(); } public void Add(string newItem) { if (items.Contains(newItem)) { int position = items.IndexOf(newItem); string existingItem = items[position]; items.RemoveAt(position); items.Insert(0, existingItem); } else { items.Insert(0, newItem); } } public int Count { get { int size = items.Count; return size; } } public string this[int index] { get { int position = 0; foreach (string item in items) { if (position == index) return item; ++position; } throw new ArgumentOutOfRangeException(); } } }
  • 9. public class RecentlyUsedList { private List<string> items; public RecentlyUsedList() { items = new List<string>(); } public void Add(string newItem) { if (items.Contains(newItem)) { int position = items.IndexOf(newItem); string existingItem = list[position]; items.RemoveAt(position); items.Insert(0, existingItem); } else { items.Insert(0, newItem); } } public int Count { get { int size = items.Count; return size; } } public string this[int index] { get { int position = 0; foreach (string value in items) { if (position == index) return value; ++position; } throw new ArgumentOutOfRangeException(); } } } public class RecentlyUsedList { private List<string> items = new List<string>(); public void Add(string newItem) { items.Remove(newItem); items.Add(newItem); } public int Count { get { return items.Count; } } public string this[int index] { get { return items[Count - index - 1]; } } }
  • 10.
  • 11.
  • 12. Comments A delicate matter, requiring taste and judgement. I tend to err on the side of eliminating comments, for several reasons. First, if the code is clear, and uses good type names and variable names, it should explain itself. Second, comments aren't checked by the compiler, so there is no guarantee they're right, especially after the code is modified. A misleading comment can be very confusing. Third, the issue of typography: comments clutter code. Rob Pike, "Notes on Programming in C"
  • 13. There is a famously bad comment style: i=i+1; /* Add one to i */ and there are worse ways to do it: /********************************** * * * Add one to i * * * **********************************/ i=i+1; Don't laugh now, wait until you see it in real life. Rob Pike, "Notes on Programming in C"
  • 14. A common fallacy is to assume authors of incomprehensible code will somehow be able to express themselves lucidly and clearly in comments. Kevlin Henney https://twitter.com/KevlinHenney/status/381021802941906944
  • 15.
  • 17. To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? William Shakespeare Hamlet
  • 18. Continuing existence or cessation of existence: those are the scenarios. Is it more empowering mentally to work towards an accommodation of the downsizings and negative outcomes of adversarial circumstance, or would it be a greater enhancement of the bottom line to move forwards to a challenge to our current difficulties, and, by making a commitment to opposition, to effect their demise? Tom Burton Long Words Bother Me
  • 19. Continuing existence or cessation of existence: those are the more empowe to work towa accommodati downsizings outcomes of circumstance a greater enh the bottom li forwards to a our current d by making a opposition, t demise?
  • 20. How many programmers lay out their code Column 80
  • 22. To answer the question "What is clean design?" most succinctly: a clean design is one that supports visual thinking so people can meet their informational needs with a minimum of conscious effort. Daniel Higginbotham ∙ "Clean Up Your Mess — A Guide to Visual Design for Everyone" ∙ http://www.visualmess.com/
  • 23. You convey information by the way you arrange a design's elements in relation to each other. This information is understood immediately, if not consciously, by the people viewing your designs. Daniel Higginbotham ∙ "Clean Up Your Mess — A Guide to Visual Design for Everyone" ∙ http://www.visualmess.com/
  • 24. This is great if the visual relationships are obvious and accurate, but if they're not, your audience is going to get confused. They'll have to examine your work carefully, going back and forth between the different parts to make sure they understand. Daniel Higginbotham ∙ "Clean Up Your Mess — A Guide to Visual Design for Everyone" ∙ http://www.visualmess.com/
  • 25. public int howNotToLayoutAMethodHeader(int firstArgument, String secondArgument) public int ensureArgumentsAreAlignedLikeThis( int firstArgument, String secondArgument) public int orEnsureArgumentsAreGroupedLikeThis( int firstArgument, String secondArgument) public int butNotAlignedLikeThis(int firstArgument, String secondArgument)
  • 26. int doNotFormat = likeThis(someArgumentOrExpression, anotherArgumentOrExpression); int insteadFormat = somethingLikeThis( someArgumentOrExpression, anotherArgumentOrExpression); int orFormat = somethingLikeThis( someArgumentOrExpression, anotherArgumentOrExpression);
  • 27. int asItIs = unstable(someArgumentOrExpression, anotherArgumentOrExpression); int butThisIs = stable( someArgumentOrExpression, anotherArgumentOrExpression); int andThisIs = stable( someArgumentOrExpression, anotherArgumentOrExpression);
  • 28. public ResultType arbitraryMethodName(FirstArgumentType firs SecondArgumentType sec ThirdArgumentType thir LocalVariableType localVariable = method(firstArgument, secondArgument) if (localVariable.isSomething(thirdArgument, SOME_SHOUTY_CONSTANT)) { doSomethingWith(localVariable); } return localVariable.getSomething(); }
  • 29. public ResultType arbitraryMethodName( FirstArgumentType firstArgument, SecondArgumentType secondArgument, ThirdArgumentType thirdArgument) { LocalVariableType localVariable = method(firstArgument, secondArgument); if (localVariable.isSomething( thirdArgument, SOME_SHOUTY_CONSTANT)) { doSomething(localVariable); } return localVariable.getSomething(); }
  • 30. XXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXX XX XXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXX XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX
  • 31. public ResultType arbitraryMethodName( FirstArgumentType firstArgument, SecondArgumentType secondArgument, ThirdArgumentType thirdArgument) { LocalVariableType localVariable = method(firstArgument, secondArgument); if (localVariable.isSomething( thirdArgument, SOME_SHOUTY_CONSTANT)) { doSomething(localVariable); } return localVariable.getSomething(); }
  • 32. XXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXX XX XXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXX XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX
  • 33. public ResultType arbitraryMethodName( FirstArgumentType firstArgument, SecondArgumentType secondArgument, ThirdArgumentType thirdArgument) { LocalVariableType localVariable = method(firstArgument, secondArgument); if (localVariable.isSomething( thirdArgument, SOME_SHOUTY_CONSTANT)) { doSomething(localVariable); } return localVariable.getSomething(); }
  • 34. XXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXX XX XXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXX XXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX
  • 35.
  • 37. Agglutination is a process in linguistic morphology derivation in which complex words are formed by stringing together morphemes, each with a single grammatical or semantic meaning. Languages that use agglutination widely are called agglutinative languages. http://en.wikipedia.org/wiki/Agglutination
  • 39.
  • 49. Omit needless words. William Strunk and E B White The Elements of Style
  • 50.
  • 54. if (portfolioIdsByTraderId.get(trader.getId()) .containsKey(portfolio.getId())) { ... } Dan North, "Code in the Language of the Domain" 97 Things Every Programmer Should Know
  • 55. if (trader.canView(portfolio)) { ... } Dan North, "Code in the Language of the Domain" 97 Things Every Programmer Should Know
  • 56.
  • 58. public class RecentlyUsedList { private List<string> items = new List<string>(); public List<string> Items { get { return items; } } public void Add(string newItem) { if(newItem == null) throw new ArgumentNullException(); items.Remove(newItem); items.Insert(0, newItem); } ... }
  • 59. public class RecentlyUsedList { private List<string> items = new List<string>(); public List<string> Items { get { return items; } } public void Add(string newItem) { if(newItem == null) throw new ArgumentNullException(); items.Remove(newItem); items.Insert(0, newItem); } ... }
  • 60. public class RecentlyUsedList { private List<string> items = new List<string>(); public List<string> Items { get { return items; } } public void Add(string newItem) { if(newItem == null) throw new ArgumentNullException(); items.Remove(newItem); items.Insert(0, newItem); } ... } var list = new RecentlyUsedList(); list.Add("Hello, World!"); Console.WriteLine(list.Items.Count); list.Items.Add("Hello, World!"); Console.WriteLine(list.Items.Count); list.Items.Add(null);
  • 61. Don't ever invite a vampire into your house, you silly boy. It renders you powerless.
  • 62. public class RecentlyUsedList { private IList<string> items = new List<string>(); public int Count { get { return items.Count; } } public string this[int index] { get { return items[index]; } } public void Add(string newItem) { if(newItem == null) throw new ArgumentNullException(); items.Remove(newItem); items.Insert(0, newItem); } ... }
  • 63. public class RecentlyUsedList { private IList<string> items = new List<string>(); public int Count { get { return items.Count; } } public string this[int index] { get { return items[Count – index - 1]; } } public void Add(string newItem) { if(newItem == null) throw new ArgumentNullException(); items.Remove(newItem); items.Add(newItem); } ... }
  • 64.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70. public class Money implements ... { ... public int getUnits() ... public int getHundredths() ... public Currency getCurrency() ... ... public void setUnits(int newUnits) ... public void setHundredths(int newHundredths) ... public void setCurrency(Currency newCurrency) ... ... }
  • 71. public final class Money implements ... { ... public int getUnits() ... public int getHundredths() ... public Currency getCurrency() ... ... }
  • 72. public final class Money implements ... { ... public int units() ... public int hundredths() ... public Currency currency() ... ... }
  • 73. When it is not necessary to change, it is necessary not to change. Lucius Cary
  • 74.
  • 76. Everybody knows that TDD stands for Test Driven Development. However, people too often concentrate on the words "Test" and "Development" and don't consider what the word "Driven" really implies. For tests to drive development they must do more than just test that code performs its required functionality: they must clearly express that required functionality to the reader. That is, they must be clear specifications of the required functionality. Tests that are not written with their role as specifications in mind can be very confusing to read. Nat Pryce and Steve Freeman "Are Your Tests Really Driving Your Development?"
  • 77. public class RecentlyUsedList { ... public RecentlyUsedList() ... public int Count { get... } public string this[int index] { get... } public void Add(string newItem) ... ... }
  • 78. [TestFixture] public class RecentlyUsedListTests { [Test] public void TestConstructor() ... [Test] public void TestCountGet() ... [Test] public void TestIndexerGet() ... [Test] public void TestAdd() ... ... }
  • 80. namespace RecentlyUsedList_spec { [TestFixture] public class A_new_list { [Test] public void Is_empty()  } [TestFixture] public class An_empty_list { [Test] public void Retains_a_single_addition()  [Test] public void Retains_unique_additions_in_stack_order()  } [TestFixture] public class A_non_empty_list { [Test] public void Is_unchanged_when_head_item_is_readded()  [Test] public void Moves_non_head_item_to_head_when_it_is_readded()  } [TestFixture] public class Any_list_rejects { [Test] public void Addition_of_null_items()  [Test] public void Indexing_past_its_end()  [Test] public void Negative_indexing()  } }
  • 81. namespace RecentlyUsedList_spec { [TestFixture] public class A_new_list { [Test] public void Is_empty()  } [TestFixture] public class An_empty_list { [Test] public void Retains_a_single_addition()  [Test] public void Retains_unique_additions_in_stack_order()  } [TestFixture] public class A_non_empty_list { [Test] public void Is_unchanged_when_head_item_is_readded()  [Test] public void Moves_non_head_item_to_head_when_it_is_readded()  } [TestFixture] public class Any_list_rejects { [Test] public void Addition_of_null_items()  [Test] public void Indexing_past_its_end()  [Test] public void Negative_indexing()  } }
  • 82. A test case should be just that: it should correspond to a single case.
  • 83. At some level the style becomes the substance.