hasan: whats preventing me to write nearly accurate code
DESCRIPTION
TRANSCRIPT
![Page 1: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/1.jpg)
what is preventing me to write nearly accurate code
nhm tanveer hossain khan (hasan)http://hasan.we4tech.com
somewhere in...
![Page 2: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/2.jpg)
what are we going to talk today?
• what is preventing me (probable you too)
• how to write nearly accurate code
• question / answer session
![Page 3: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/3.jpg)
what is preventing me? my observation
![Page 4: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/4.jpg)
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
![Page 5: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/5.jpg)
patience
• from company
• from me
• => spaghetti code
• => quick solution
!
![Page 6: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/6.jpg)
unclear understanding of requirements
• from client
• from product owner
• from user story or use case
• or too detailed spec (feel like class book)
![Page 7: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/7.jpg)
commitment overflow
• from client
• from product owner
• from peer
![Page 8: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/8.jpg)
not enough space for refactoring
![Page 9: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/9.jpg)
lack of domain specific knowledge
![Page 10: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/10.jpg)
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
![Page 11: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/11.jpg)
most smart code
![Page 12: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/12.jpg)
most smart codedef test_limited_list_of_requests
get(:requests) # ... rest goes here....end
![Page 13: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/13.jpg)
most smart codedef 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 endend
![Page 14: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/14.jpg)
break!
![Page 15: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/15.jpg)
take deep breath !!
![Page 16: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/16.jpg)
welcome back!!!
![Page 17: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/17.jpg)
how to write nearly accurate code
![Page 18: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/18.jpg)
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
![Page 19: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/19.jpg)
think some one watching your code !!
![Page 20: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/20.jpg)
behavior driven development (BDD)
• before development
• create spec
• verify spec with stakeholder
• during development
• ensure all spec passed
• ensure all spec expectations were met
![Page 21: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/21.jpg)
BDD example
![Page 22: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/22.jpg)
BDD examplecontext Company, "while creating a new company" do it "should not be valid without a company name" do @company.should_not be_valid @company.errors.on(:name).should == "can't be blank" end
it "should not have error after save" do @company.name = “somewhere in....” @company.save.should be_true @company.errors.should be_empty endend
![Page 23: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/23.jpg)
BDD example
![Page 24: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/24.jpg)
remember !!
![Page 25: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/25.jpg)
“your code is mirror of you”
![Page 26: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/26.jpg)
nothing preventing me to say you
![Page 27: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/27.jpg)
nothing preventing me to say you
thank you!!!
![Page 28: Hasan: Whats preventing me to write nearly accurate code](https://reader034.vdocuments.mx/reader034/viewer/2022051817/547cbb6b5906b57a378b45a7/html5/thumbnails/28.jpg)
now what is preventing you? (Q/A)