devday.lk - bare knuckle web development
DESCRIPTION
Can you go faster with less weight? In 45 minutes, I build a web server with an address book with tests firsts and no frameworks. What can you do if you really understand what's going on?TRANSCRIPT
Bare-knuckle web development
DevDay.LKJohannes Brodwall, Chief scientist
Exilesoft Global
@jhannes
It can be fun and productive to use the basic
tools
• Philosophy• Demonstration
• Ruminations
Part I:
Why
• Learn new technologies
OR• Learn new things about your
technology
High impact with low ceremony
• Framework light• Test-driven
• No calculators
Light on framework
How much time do you spend
• In debugger?• Waiting for build?
• On Stackoverflow?
Frameworks solve 80% of the job…
… and makes the rest 10 times as hard
Test-driven
Fast feedback cycle
“I can see how TDD works for toy examples…”
“… but how can we use it when we have all these
really complicated technologies???”
(Hint:“all these complicated technologies”
I think I see your problem right here...)
“Don’t use a calculator…”
Part II:
Demo: Phonebook web app
What can you learn?
• Test for web applications• Specifying requirements with tests• The difference between
realistic slow tests (aka “integration”)and limited fast tests (aka “unit”)
• Dependencies in your tests• What does the web server do?• Refactoring shortcuts• Growing design• Alternatives to HTML templates (maybe)
Part III:
Ruminations
Those are my principles, and if you
don't like them... well, I have others.
- Groucho Marx
Build your app this way?
Probably not
Well, why not?
I am most likely insane
Or...
The reasonable man adapts himself to the world:
the unreasonable one persists in trying to adapt the world to himself.
Therefore all progress depends on the unreasonable man.
- George Bernard Shaw
Understand what’s going on
«Don’t reinvent the wheel»
Are you using technology to solve
your problems?
Or so that you don’t have to face your
problems?
... yet.
Overheated brain
95 % test coverage
95 % test coverage
5-10 seconds
95 % test coverage
5-10 seconds
< 1 day to create «framework»
SOAP:1. Construct XML
2. POST on HttpURLConnection
@Overridepublic String getCountryByIp(String ipAddress) { Document soapRequest = soapElement("S:Envelope", $("S:Body", wsxElement("wsx:GetGeoIP", $("wsx:IPAddress", ipAddress)))); Document soapResponse endpoint.postRequest(getSOAPAction(), soapRequest); return $(soapResponse).xpath("/Envelope/Body/*") .xpath("GetGeoIPResult/CountryName").text();}
No friction
Conclusion:
No calculator until…
Don’t just learn new technologies
.
Don’t just learn new technologies
=> Learn new approaches, techniques and features about the
technology you use
Thank [email protected]
http://johannesbrodwall.com
http://exilesoft.com/exilee
@jhannes
Believe nothing on the faith of traditions.Do not believe a thing because many people speak of it.
Do not believe on the faith of the sages of the past. Do not believe what you yourself have imagined.
After examination, believe what you yourself have tested and found to be reasonable
- Buddha