86
Going the Extra Mile in building Beautiful & Scalable Applications .............................................................................................................. .............................................................................................................. 1

Going the Extra Mile

Embed Size (px)

DESCRIPTION

Go the Extra Mile in developing your next big web app.DRY, KISS, Agile are your friends. Go out and build something awesome...

Citation preview

Page 1: Going the Extra Mile

Going the Extra Mile in

building Beautiful & Scalable Applications

..............................................................................................................

..............................................................................................................

1

Page 2: Going the Extra Mile

Karthik Kastury

B.E. Information ScienceEngineer / Hacker / Blogger / Apple fanboi and evil minded. *Pun Intended*

24x7 Internet Geek | Unlucky in Cards

................................................................................................................................

................................................................................................................................

Blog

Twitter

Emailhttp://karthik.kastury.in/[email protected]@KarthikDot

Internet Addict for 11+ Years...

2

Page 3: Going the Extra Mile

#ExtraMileNitte..............................................................................................................

...........................................................................................................

3

Page 4: Going the Extra Mile

Ready to Dive in?..............................................................................................................

..............................................................................................................

4

Page 5: Going the Extra Mile

Going the Extra Mile in

building Beautiful & Scalable Applications

..............................................................................................................

..............................................................................................................

What? Why? How?> >

Conclusion..............................................................................................................

5

Page 6: Going the Extra Mile

WHAT?..............................................................................................................

..............................................................................................................

6

Page 7: Going the Extra Mile

What we do today

‣Traditional Development Tools like .NET or JAVA with their IDE’s.

‣Development in teams can be tricky at best.

‣Testing, Documentation are usually ignored, or need separate tools themselves.

..............................................................................................................

..............................................................................................................7

Page 8: Going the Extra Mile

OUCH!..............................................................................................................

..............................................................................................................8

Page 9: Going the Extra Mile

OMG!..............................................................................................................

..............................................................................................................

9

Page 10: Going the Extra Mile

Some might like this, but it's mostly because most Software

Development Tools are designed for computers, not for human beings.

..............................................................................................................

..............................................................................................................10

Page 11: Going the Extra Mile

They treat you like a Baby

..............................................................................................................

..............................................................................................................11

Page 12: Going the Extra Mile

LEARNING TO WALK..............................................................................................................

..............................................................................................................

12

Page 13: Going the Extra Mile

When you are the

..............................................................................................................

..............................................................................................................13

Page 14: Going the Extra Mile

BOSS..............................................................................................................

..............................................................................................................

14

Page 15: Going the Extra Mile

Is it Bad?

‣Development, Testing, Debugging are different cycles. *

‣Documentation is often ignored, or left to another team.

‣Collaboration between teams, Version Control are different tools, and not standards based.

..............................................................................................................

..............................................................................................................* Until VS 2010

15

Page 16: Going the Extra Mile

Going the Extra Mile in

building Beautiful & Scalable Applications

..............................................................................................................

..............................................................................................................16

Page 17: Going the Extra Mile

WHY?..............................................................................................................

..............................................................................................................

17

Page 18: Going the Extra Mile

There are no traffic jams along the extra mile “ ”ROGER STAUBACH

..............................................................................................................

..............................................................................................................18

Page 19: Going the Extra Mile

Why?

‣Personal ambitions

‣Clients will you ( Yes, this is good )

‣You will get noticed

‣More opportunities ...

..............................................................................................................

..............................................................................................................19

Page 20: Going the Extra Mile

CODING CAN BE FUN!..............................................................................................................

..............................................................................................................

20

Page 21: Going the Extra Mile

HOW?..............................................................................................................

..............................................................................................................

21

Page 22: Going the Extra Mile

How?‣Use modern Development Languages.

‣Go beyond Relational Databases (NoSQL)

‣The Internet (Mobile) is the ONLY platform going forward.

‣Social Coding Platforms is the key to Success.

‣Be bold enough to break the traditions.

..............................................................................................................

..............................................................................................................22

Page 23: Going the Extra Mile

Buzz Words

..............................................................................................................

..............................................................................................................23

Page 24: Going the Extra Mile

GET REAL..............................................................................................................

..............................................................................................................

24

Page 25: Going the Extra Mile

GETTING REAL

‣Build the Real thing first.

‣Stay Small and Agile

‣Start with Interface, and build backwards.

‣Do what’s needed, and nothing that’s not.

..............................................................................................................

..............................................................................................................25

Page 26: Going the Extra Mile

BE AGILE..............................................................................................................

..............................................................................................................

26

Page 27: Going the Extra Mile

BE AGILE!

‣Start building right away.

‣It’s easier to throw something away, when you didn’t spend time doing it.

‣Build, Test, Gather Feedback and iterate.

‣Lower the cost of change.

..............................................................................................................

..............................................................................................................27

Page 28: Going the Extra Mile

LESS IS MORE..............................................................................................................

..............................................................................................................

28

Page 29: Going the Extra Mile

LESS IS MORE!

‣Don’t try to one up Competitors.

‣Solve the simple problems, and leave the rest.

‣Think ahead, and build what’s best for your users, rather than build everything.

..............................................................................................................

..............................................................................................................29

Page 30: Going the Extra Mile

KEEP IT SIMPLE,..............................................................................................................

..............................................................................................................

30

Page 31: Going the Extra Mile

STUPID..............................................................................................................

..............................................................................................................

31

Page 32: Going the Extra Mile

KEEP IT SIMPLE, STUPID!

‣Each time you increase your code, you increase complexity exponentially.

‣Complex code => More Bugs

‣So, write Less Code, Less Features in short Keep it Simple, Stupid. (K.I.S.S )

..............................................................................................................

..............................................................................................................32

Page 33: Going the Extra Mile

DON’T REPEAT YOURSELF

..............................................................................................................

..............................................................................................................

33

Page 34: Going the Extra Mile

Don’t Repeat Yourself

‣Reduce Duplicate Code.

‣Changing one component should not have cascading effects.

‣Modularize, Use Code Generators.

‣Single Source of Truth.

..............................................................................................................

..............................................................................................................34

Page 35: Going the Extra Mile

COLLABORATE..............................................................................................................

..............................................................................................................

35

Page 36: Going the Extra Mile

COLLABORATE‣Share your code. (Don’t be a jerk)

‣Take feedback from the end users during development.

‣Make sure you get the product right, before its too late.

‣Help others, and help yourself.

..............................................................................................................

..............................................................................................................36

Page 37: Going the Extra Mile

GEN ‘Y’ TOOLS..............................................................................................................

..............................................................................................................

37

Page 38: Going the Extra Mile

Use the Next Generation Tools‣The world no longer relies on one Language.

‣Performance, Scalability are the key.

‣Ruby on Rails (Web), WPF(Windows), Cocoa (iPhone and MacOSX)

‣MVC (Model View Controller)

‣Zero Dependency, and easy Configuration

..............................................................................................................

..............................................................................................................38

Page 39: Going the Extra Mile

39

Page 40: Going the Extra Mile

Ruby on Rails is astounding. Using it is like watching a kung-fu movie, where a dozen bad-ass frameworks prepare to beat up the little newcomer only to be handed their asses in a variety of imaginative ways.

“”

..............................................................................................................

..............................................................................................................

Nathan Torkington, O'Reilly Program Chair for OSCON

40

Page 41: Going the Extra Mile

Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity.

It lets you write beautiful code by favoring convention over configuration.

..............................................................................................................

..............................................................................................................41

Page 42: Going the Extra Mile

Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity.

It lets you write beautiful code by favoring convention over configuration.

..............................................................................................................

..............................................................................................................42

Page 43: Going the Extra Mile

Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity.

It lets you write beautiful code by favoring convention over configuration.

..............................................................................................................

..............................................................................................................43

Page 44: Going the Extra Mile

Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity.

It lets you write beautiful code by favoring convention over configuration.

..............................................................................................................

..............................................................................................................44

Page 45: Going the Extra Mile

Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity.

It lets you write beautiful code by favoring convention over configuration.

..............................................................................................................

..............................................................................................................45

Page 46: Going the Extra Mile

Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity.

It lets you write beautiful code by favoring convention over configuration.

..............................................................................................................

..............................................................................................................46

Page 47: Going the Extra Mile

80/20..............................................................................................................

..............................................................................................................

Like the 69 of the real world!

47

Page 48: Going the Extra Mile

MVC..............................................................................................................

..............................................................................................................

48

Page 49: Going the Extra Mile

Model View

Controller

StructuresApplication

ProvidesData

ProvidesUX and UI

49

Page 50: Going the Extra Mile

A Programmer’sBest Friend

54

A Programmer’sBest Friend

..............................................................................................................

..............................................................................................................50

Page 51: Going the Extra Mile

say = “I love Ruby”puts say

=> “I love Ruby”

..............................................................................................................

..............................................................................................................51

Page 52: Going the Extra Mile

say = “I love Ruby”puts say

..............................................................................................................

..............................................................................................................

no “main” method

no typedeclarations.

string...

no “superfluous” keywords (“var”)

no end ofinstruction

marker

52

Page 53: Going the Extra Mile

say = “I love Ruby”say[‘love’] = “*love*”puts say.upcase

=> “I *LOVE* RUBY”

..............................................................................................................

..............................................................................................................53

Page 54: Going the Extra Mile

3.times { puts say }

=> “I *love* Ruby”=> “I *love* Ruby”=> “I *love* Ruby”

..............................................................................................................

..............................................................................................................54

Page 55: Going the Extra Mile

[Ruby is] a dynamic, open source programming language with a focus on simplicity and productivity.

It has an elegant syntax that is natural to read and easy to write.

..............................................................................................................

..............................................................................................................55

Page 56: Going the Extra Mile

[Ruby is] a dynamic, open source programming language with a focus on simplicity and productivity.

It has an elegant syntax that is natural to read and easy to write.

..............................................................................................................

..............................................................................................................56

Page 57: Going the Extra Mile

[Ruby is] a dynamic, open source programming language with a focus on simplicity and productivity.

It has an elegant syntax that is natural to read and easy to write.

..............................................................................................................

..............................................................................................................57

Page 58: Going the Extra Mile

[Ruby is] a dynamic, open source programming language with a focus on simplicity and productivity.

It has an elegant syntax that is natural to read and easy to write.

..............................................................................................................

..............................................................................................................58

Page 59: Going the Extra Mile

[Ruby is] a dynamic, open source programming language with a focus on simplicity and productivity.

It has an elegant syntax that is natural to read and easy to write.

..............................................................................................................

..............................................................................................................59

Page 60: Going the Extra Mile

TAKING THE PAIN OUT OF THINGS YOU DON’T LIKE DOING

60

Page 61: Going the Extra Mile

61

Page 62: Going the Extra Mile

EXPLORE..............................................................................................................

..............................................................................................................

62

Page 63: Going the Extra Mile

VERSION CONTROL..............................................................................................................

..............................................................................................................63

Page 64: Going the Extra Mile

VERSION CONTROL‣One of the most overlooked features of modern development.

‣A time machine for your code.

‣Easy to setup, Zero Headaches.

‣Examples Git(Github.com), SVN, Mercurial

..............................................................................................................

..............................................................................................................64

Page 65: Going the Extra Mile

DISASTERS STRIKE..............................................................................................................

..............................................................................................................

65

Page 66: Going the Extra Mile

BUT DON’T CRY!..............................................................................................................

..............................................................................................................

66

Page 67: Going the Extra Mile

Git to the Rescue!

‣Git is the simplest Version Control tool you’ll ever use.

‣Scales beautifully to any number of developers.

‣Online Community Support and Code repo at Github.com

..............................................................................................................

..............................................................................................................67

Page 68: Going the Extra Mile

Git Magic!

..............................................................................................................

..............................................................................................................

Step 1:

Step 2:

Step 3:

git init

git add .

git commit -a -m “Your Message”

Go back in Time!

git reset --hard <hash>

68

Page 69: Going the Extra Mile

DATABASES..............................................................................................................

..............................................................................................................

69

Page 70: Going the Extra Mile

Beyond SQL and RDBMS‣Relational Databases are hard to scale.

‣Concepts from the 1980’s, don’t work in the internet era.

‣Adopt NoSQL i.e. Not only SQL

‣No one Database fits the bill, so experiment.

‣SQL will be what COBOL is to our generation.

..............................................................................................................

..............................................................................................................70

Page 71: Going the Extra Mile

Let’s take an example

................................................................................................................................

................................................................................................................................

Come up with a simple database schema for Facebookto store profile information and friends.

71

Page 72: Going the Extra Mile

It Probably Looks like..................................................................................................................................

................................................................................................................................

id Name DOB ....

User

fid1 fid2 state

Friends

Select * from Friends where fid1= ‘myid’ OR fid2= ‘myid’ AND state=1

72

Page 73: Going the Extra Mile

How about this...................................................................................................................................

................................................................................................................................

A Representation of how Facebook stores Data.

73

Page 74: Going the Extra Mile

Consider Twitter...

..............................................................................................................

..............................................................................................................

‣Averages about 1000 tweets per second. (~1000 inserts per second)

‣Contains metadata such as Hashtags, and Mentions.

‣About 1 Billion Searches per day or 11k searches per second

74

Page 75: Going the Extra Mile

The World of NoSQL

..............................................................................................................

..............................................................................................................

‣Cassandra DB‣VoltDB‣MongoDB‣MemcacheDB‣Redis‣CouchDB

and many more...

75

Page 76: Going the Extra Mile

READY TO JUMP?

..............................................................................................................

..............................................................................................................

76

Page 77: Going the Extra Mile

Let’s build an app‣We are going to build an application in Rails.

‣A Simple blog, with comments and access control.

‣Sounds complex? Should take ~15mins with Rails magic.

‣Let’s use Git for good measure.

..............................................................................................................

..............................................................................................................77

Page 78: Going the Extra Mile

78

Page 79: Going the Extra Mile

Final Words...

..............................................................................................................

..............................................................................................................

‣Modern Software Development is fun.

‣Uncomplicate and Simplify

‣Bid Goodbye to Complex IDEs and general purpose languages like C, Java.

‣Build applications in bottom up fashion, rather than top down!

79

Page 80: Going the Extra Mile

LIVE ON THE EDGE..............................................................................................................

..............................................................................................................

80

Page 81: Going the Extra Mile

CODE IS POETRY..............................................................................................................

..............................................................................................................

81

Page 82: Going the Extra Mile

..............................................................................................................

..............................................................................................................

Q+A82

Page 83: Going the Extra Mile

Get the Related Resources

..............................................................................................................

..............................................................................................................

[email protected]

83

Page 84: Going the Extra Mile

I’m available to help................................................................................................................................

................................................................................................................................

Blog

Twitter

Emailhttp://karthik.kastury.in/[email protected]@KarthikDot

Ask http://karthik.kastury.in/ask

84

Page 85: Going the Extra Mile

Footnotes................................................................................................................................

................................................................................................................................

All images are creative commons licensed from Flickr.

37 Signals Signals vs Noise Blog.

Agile Programming Tips

85

Page 86: Going the Extra Mile

THE END..............................................................................................................

..............................................................................................................Or the start of something new.

86