SlideShare a Scribd company logo
1 of 28
what is preventing me
  to write nearly
   accurate code
        nhm tanveer hossain khan (hasan)
               http://hasan.we4tech.com
                         somewhere in...
what are we going to
      talk today?

• what is preventing me (probable you too)
• how to write nearly accurate code
• question / answer session
what is preventing me?
   my observation
being too honest!
• in commitment
• in writing code
• skipping known issue
• not feeling colorful moment
• not feeling togetherness
• not feeling inclusiveness
• not feeling in team way instead of my way.
• focusing on too many projects
!   patience
• from company
• from me
 • => spaghetti code
 • => quick solution
unclear understanding
   of requirements

• from client
• from product owner
• from user story or use case
• or too detailed spec (feel like class book)
commitment overflow

• from client
• from product owner
• from peer
not enough space for
     refactoring
lack of domain specific
      knowledge
over complicating code/
      architecture
• not mockable environment
• not testable environment
• bootstrapping takes longer than 1 minute
• <= usually team does
 • work with workaround
 • re-code similar function
most smart code
most smart code
def test_limited_list_of_requests
   get(:requests)
  # ... rest goes here....
end
most smart code
def self.included(base)
  %w( get post put delete head ).each do |method|
   base.class_eval <<-EOV, __FILE__, __LINE__
     def #{method}(action, parameters = nil, session = nil, flash = nil)
      process(action, parameters, session, flash)
     end
   EOV
  end
end
break!
take deep breath !!
welcome back!!!
how to write nearly
  accurate code
patience
• being honest
• understanding ethics
• feel in team way
• document all known issues
• (example) formated user story
 •   As a user
     I want to add comment
     So that visitor can find my understanding.

• comment everything
  follow coding convention
think some one
watching your code !!
behavior driven
     development (BDD)
• before development
 • create spec
 • verify spec with stakeholder
• during development
 • ensure all spec passed
 • ensure all spec expectations were met
BDD example
BDD example
context Company, quot;while creating a new companyquot; do
 it quot;should not be valid without a company namequot; do
   @company.should_not be_valid
   @company.errors.on(:name).should == quot;can't be blankquot;
 end

 it quot;should not have error after savequot; do
   @company.name = “somewhere in....”
   @company.save.should be_true
   @company.errors.should be_empty
 end
end
BDD example
remember !!
“your code is mirror of
         you”
nothing preventing me
      to say you
nothing preventing me
      to say you
     thank you!!!
now what is preventing
     you? (Q/A)

More Related Content

What's hot (7)

Php
PhpPhp
Php
 
Wireframing For Web CMS Projects
Wireframing For Web CMS ProjectsWireframing For Web CMS Projects
Wireframing For Web CMS Projects
 
Be HTML5-ready today
Be HTML5-ready todayBe HTML5-ready today
Be HTML5-ready today
 
How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applications
 
Rahulpotfolio
RahulpotfolioRahulpotfolio
Rahulpotfolio
 
HTML5
HTML5HTML5
HTML5
 
Exemplos Aula4
Exemplos Aula4Exemplos Aula4
Exemplos Aula4
 

Similar to Whats Preventing Me To Write Nearly Accurate Code.Key

Hasan: Whats preventing me to write nearly accurate code
Hasan: Whats preventing me to write nearly accurate codeHasan: Whats preventing me to write nearly accurate code
Hasan: Whats preventing me to write nearly accurate code
SQABD
 
Code Review
Code ReviewCode Review
Code Review
rantav
 
Increasing code quality with code reviews (poetry version)
Increasing code quality with code reviews (poetry version)Increasing code quality with code reviews (poetry version)
Increasing code quality with code reviews (poetry version)
David Stockton
 
Effective TDD - Less is more
Effective TDD - Less is moreEffective TDD - Less is more
Effective TDD - Less is more
Ben Lau
 
How To Do Kick-Ass Software Development, by Sven Peters
How To Do Kick-Ass Software Development, by Sven PetersHow To Do Kick-Ass Software Development, by Sven Peters
How To Do Kick-Ass Software Development, by Sven Peters
ZeroTurnaround
 
How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....
Mike Harris
 
Code Review
Code ReviewCode Review
Code Review
Ravi Raj
 
Good code, Bad Code
Good code, Bad CodeGood code, Bad Code
Good code, Bad Code
josedasilva
 

Similar to Whats Preventing Me To Write Nearly Accurate Code.Key (20)

Hasan: Whats preventing me to write nearly accurate code
Hasan: Whats preventing me to write nearly accurate codeHasan: Whats preventing me to write nearly accurate code
Hasan: Whats preventing me to write nearly accurate code
 
Brutal refactoring, lying code, the Churn, and other emotional stories from L...
Brutal refactoring, lying code, the Churn, and other emotional stories from L...Brutal refactoring, lying code, the Churn, and other emotional stories from L...
Brutal refactoring, lying code, the Churn, and other emotional stories from L...
 
Code Quality Makes Your Job Easier
Code Quality Makes Your Job EasierCode Quality Makes Your Job Easier
Code Quality Makes Your Job Easier
 
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDD
 
Efficient JavaScript Development
Efficient JavaScript DevelopmentEfficient JavaScript Development
Efficient JavaScript Development
 
Becoming A Php Ninja
Becoming A Php NinjaBecoming A Php Ninja
Becoming A Php Ninja
 
Code Review
Code ReviewCode Review
Code Review
 
Increasing code quality with code reviews (poetry version)
Increasing code quality with code reviews (poetry version)Increasing code quality with code reviews (poetry version)
Increasing code quality with code reviews (poetry version)
 
Ben Elmore - Do You Speak Flex
Ben Elmore - Do You Speak FlexBen Elmore - Do You Speak Flex
Ben Elmore - Do You Speak Flex
 
Effective TDD - Less is more
Effective TDD - Less is moreEffective TDD - Less is more
Effective TDD - Less is more
 
How To Do Kick-Ass Software Development, by Sven Peters
How To Do Kick-Ass Software Development, by Sven PetersHow To Do Kick-Ass Software Development, by Sven Peters
How To Do Kick-Ass Software Development, by Sven Peters
 
10 Things Designers Do That Piss Developers Off (And Vice Versa)
10 Things Designers Do That Piss Developers Off (And Vice Versa)10 Things Designers Do That Piss Developers Off (And Vice Versa)
10 Things Designers Do That Piss Developers Off (And Vice Versa)
 
Striving towards better PHP code
Striving towards better PHP codeStriving towards better PHP code
Striving towards better PHP code
 
Efficient JavaScript Development
Efficient JavaScript DevelopmentEfficient JavaScript Development
Efficient JavaScript Development
 
Refactoring legacy code
Refactoring legacy codeRefactoring legacy code
Refactoring legacy code
 
How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....
 
Code Review
Code ReviewCode Review
Code Review
 
BDD with Behat
BDD with BehatBDD with Behat
BDD with Behat
 
No more dead kittens - Clean Code
No more dead kittens - Clean CodeNo more dead kittens - Clean Code
No more dead kittens - Clean Code
 
Good code, Bad Code
Good code, Bad CodeGood code, Bad Code
Good code, Bad Code
 

More from nhm taveer hossain khan

More from nhm taveer hossain khan (13)

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
RubyConfBD 2013 decouple, bundle and share with ruby gems
RubyConfBD 2013   decouple, bundle and share with ruby gems RubyConfBD 2013   decouple, bundle and share with ruby gems
RubyConfBD 2013 decouple, bundle and share with ruby gems
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 
Agile Scrum Kanban (BASIS SoftExpo 2011)
Agile Scrum Kanban (BASIS SoftExpo 2011)Agile Scrum Kanban (BASIS SoftExpo 2011)
Agile Scrum Kanban (BASIS SoftExpo 2011)
 
phpXperts seminar 2010 CodeMan! with noSQL!
phpXperts seminar 2010 CodeMan! with noSQL!phpXperts seminar 2010 CodeMan! with noSQL!
phpXperts seminar 2010 CodeMan! with noSQL!
 
Hi code man! ain't you crazy enough ?
Hi code man! ain't you crazy enough ?Hi code man! ain't you crazy enough ?
Hi code man! ain't you crazy enough ?
 
Let s imagine you have contributed to build the better bangladesh
Let s imagine you have contributed to build the better bangladeshLet s imagine you have contributed to build the better bangladesh
Let s imagine you have contributed to build the better bangladesh
 
Ain't you crazy enough ?
Ain't you crazy enough ?Ain't you crazy enough ?
Ain't you crazy enough ?
 
Agile Project Management Basis Software Exposition 2010
Agile Project Management Basis Software Exposition 2010Agile Project Management Basis Software Exposition 2010
Agile Project Management Basis Software Exposition 2010
 
Ruby on Rails small application demo
Ruby on Rails small application demoRuby on Rails small application demo
Ruby on Rails small application demo
 
Developing Quality Web Application
Developing Quality Web ApplicationDeveloping Quality Web Application
Developing Quality Web Application
 
Better code in JavaScript
Better code in JavaScriptBetter code in JavaScript
Better code in JavaScript
 
TekS Short Git Overview
TekS Short Git OverviewTekS Short Git Overview
TekS Short Git Overview
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 

Whats Preventing Me To Write Nearly Accurate Code.Key

  • 1. what is preventing me to write nearly accurate code nhm tanveer hossain khan (hasan) http://hasan.we4tech.com somewhere in...
  • 2. what are we going to talk today? • what is preventing me (probable you too) • how to write nearly accurate code • question / answer session
  • 3. what is preventing me? my observation
  • 4. being too honest! • in commitment • in writing code • skipping known issue • not feeling colorful moment • not feeling togetherness • not feeling inclusiveness • not feeling in team way instead of my way. • focusing on too many projects
  • 5. ! patience • from company • from me • => spaghetti code • => quick solution
  • 6. unclear understanding of requirements • from client • from product owner • from user story or use case • or too detailed spec (feel like class book)
  • 7. commitment overflow • from client • from product owner • from peer
  • 8. not enough space for refactoring
  • 9. lack of domain specific knowledge
  • 10. over complicating code/ architecture • not mockable environment • not testable environment • bootstrapping takes longer than 1 minute • <= usually team does • work with workaround • re-code similar function
  • 12. most smart code def test_limited_list_of_requests get(:requests) # ... rest goes here.... end
  • 13. most smart code def self.included(base) %w( get post put delete head ).each do |method| base.class_eval <<-EOV, __FILE__, __LINE__ def #{method}(action, parameters = nil, session = nil, flash = nil) process(action, parameters, session, flash) end EOV end end
  • 17. how to write nearly accurate code
  • 18. patience • being honest • understanding ethics • feel in team way • document all known issues • (example) formated user story • As a user I want to add comment So that visitor can find my understanding. • comment everything follow coding convention
  • 19. think some one watching your code !!
  • 20. behavior driven development (BDD) • before development • create spec • verify spec with stakeholder • during development • ensure all spec passed • ensure all spec expectations were met
  • 22. BDD example context Company, quot;while creating a new companyquot; do it quot;should not be valid without a company namequot; do @company.should_not be_valid @company.errors.on(:name).should == quot;can't be blankquot; end it quot;should not have error after savequot; do @company.name = “somewhere in....” @company.save.should be_true @company.errors.should be_empty end end
  • 25. “your code is mirror of you”
  • 26. nothing preventing me to say you
  • 27. nothing preventing me to say you thank you!!!
  • 28. now what is preventing you? (Q/A)

Editor's Notes