API Design & Moving from Junior to Senior Developer
-
Upload
christophercotton -
Category
Technology
-
view
805 -
download
0
description
Transcript of API Design & Moving from Junior to Senior Developer
![Page 1: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/1.jpg)
2012 Nov 29, christophercotton.com
API Design&Junior ➪ SeniorChristopher Cotton @_cotton for @NashSoftware
![Page 2: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/2.jpg)
The Past
✤ 20+ years Programming
✤ Been QA Tester, Junior Dev, Senior Dev, Technical Lead, Project Lead, Architect, Senior Member of Technical Staff 3 (What?!), CTO, Founder, Consultant and lots of random other jobs
✤ javax.mail http://www.google.com/#q=javax.mail+cotton
![Page 3: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/3.jpg)
The Now
✤ iOS, Android, Ruby on Rails
✤ @NashGameDev
✤ @SpacewardHo
✤ http://handstand.io
✤ Teach Kids Programming (YSI) http://www.fssd.org/index.php?option=com_content&task=view&id=110&Itemid=207
![Page 4: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/4.jpg)
Date
My Version, Not “The Truth”
![Page 5: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/5.jpg)
API stands for?
![Page 6: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/6.jpg)
This does what?
User.find_or_create_by_name("Bob")
![Page 7: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/7.jpg)
![Page 8: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/8.jpg)
API
✤ Contract - documented, agreement, cause/effect
✤ Interface - one service to another
✤ GEM, Library, TCP, HTTP, etc.
✤ Systems Integration
![Page 9: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/9.jpg)
Date
Lonely App
![Page 10: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/10.jpg)
Date
API Here, API There, Everywhere
![Page 11: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/11.jpg)
Date
Current Architecture
Device App
ContentDBScraper Packager FileStorage
Content Server
Blogs/Websites
App.Handstand
Google Analytics Task
Builder
Customer
Builder
Article List
Article Package
Amazon SQS
Market TaskAndroid Market
Config
LogAd List
Ads
AmazonS3
Version 2010/12/31All rights reserved
Handstand
Internal Systems
![Page 12: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/12.jpg)
Date
API - How to Consume
![Page 13: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/13.jpg)
How to use? What would you do?
![Page 14: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/14.jpg)
![Page 15: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/15.jpg)
![Page 16: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/16.jpg)
![Page 17: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/17.jpg)
![Page 18: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/18.jpg)
![Page 19: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/19.jpg)
![Page 20: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/20.jpg)
Date
API - How to Design
![Page 21: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/21.jpg)
Lots of Other Resources
✤ How to design RESTful APIs
✤ CRUD
✤ HTTP API
![Page 22: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/22.jpg)
What is the point?
![Page 23: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/23.jpg)
Who will use it?
✤ Dell Digital Delivery - 10 million machines, more each year to download software
✤ Cyberdog - other developers to implement new components
✤ JavaSoft javax.mail - Developers implementing Services, or sending Email
✤ Handstand - devices retrieving travel magazine
![Page 24: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/24.jpg)
Date
Document, Document, Document
![Page 25: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/25.jpg)
Why Document?
✤ Another programmer will need to know how it works, and trial and error sucks
✤ Test Your API, write a client from your own docs
✤ Keeps your code honest
✤ Becomes a real API when a client is written by someone other than you from your docs
![Page 26: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/26.jpg)
3ULPHU�Y��$3,�6SHFLILFDWLRQ���������� Y�����
&UHDWH�8VHU5(48(67��$XWKHQWLFDWLRQ�QRW�UHTXLUHG�
�3267��DSL�Y��FUHDWHBXVHU
�3$5$0(7(56�
XVHU>HPDLO@ 8VHU¶V�HPDLO� UHTXLUHG
XVHU>SDVVZRUG@ 8VHUV�SDVVZRUG� UHTXLUHG
XVHU>ILUVWBQDPH@ 8VHUV�ILUVW�QDPH� UHTXLUHG
XVHU>ODVWBQDPH@ 8VHUV�ODVW�QDPH� UHTXLUHG
�5(63216(��6HW�&RRNLH�KHDGHU�DQG�-621�SD\ORDG�
�+773���������2.�&RQWHQW�7\SH��DSSOLFDWLRQ�MVRQ��FKDUVHW XWI��6HW�&RRNLH��8 ^XVHUBXLG`��SDWK ���H[SLUHV 6DW�����$XJ���������������*076HW�&RRNLH��7 ^DXWKBWRNHQ`��SDWK ���H[SLUHV 6DW�����$XJ���������������*07�^�����FRGH��������������PVJ����2.�������GDWD���^���������ILUVWBQDPH����^ILUVWBQDPH`�����������ODVWBQDPH����^ODVWBQDPH`�����������XVHUBXLG����^XVHUBXLG`�����``��
(55256�
0HVVDJH���PVJ�� 'HVFULSWLRQ
�HPDLO�PLVVLQJ� 7KH�HPDLO�SDUDPHWHU�ZDV�PLVVLQJ
+DQGVWDQG�&RQILGHQWLDO ��
![Page 27: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/27.jpg)
Find & Reuse Good APIs
✤ Don’t reinvent the wheel
✤ Find another similar, and expand or convert
✤ Learn from bad APIs
![Page 28: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/28.jpg)
![Page 29: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/29.jpg)
Key Aspects
✤ Versioned
✤ Errors - was the request successful? invalid data? server blew up?
✤ Consistent to itself - delete_book, friend_delete
✤ Iteration
✤ Design with a partner or isolation, not large groups
![Page 30: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/30.jpg)
Iteration
✤ High Level APIs
✤ Data Model, Design Objects and Connections
✤ Keep asking, what other actions need to be done? What other data?
✤ Walk through the scenarios
✤ retrieve library, log in, add book, delete book, post comment
![Page 31: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/31.jpg)
![Page 32: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/32.jpg)
![Page 33: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/33.jpg)
Date
Practice, practice, practice
![Page 34: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/34.jpg)
Date
Q & A, Part One
![Page 35: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/35.jpg)
Date
SeniorJunior ➪
![Page 36: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/36.jpg)
✤ Worried about how you look, or what you say
✤ Focused on small parts, misses big picture
✤ Makes changes without understanding repercussions
✤ Not my part
Characteristics of Bad Junior(or bad Senior)
![Page 37: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/37.jpg)
Good Senior Developer(or Good Junior Developer)✤ Says, “I don’t know”
✤ Takes responsibility
✤ Continually Learning
✤ Will “Take one for the team”
✤ Given Any Problem, Can Invent a solution
✤ Can learn needed skills
✤ Goes beyond the basics
![Page 38: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/38.jpg)
Basic Mistakes
![Page 39: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/39.jpg)
Separate Concerns of Code
✤ Putting code unrelated into one group/class
✤ Networking code in the DB code
✤ UI Controller Code, with Table Cell Display Code
✤ Too many lines!
✤ “Wasn’t sure where else to put it” Ask!
![Page 40: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/40.jpg)
Cut & Paste Solutions
✤ Found something on Stack Overflow, paste it in!
✤ The Interweb is not always correct
✤ Take the time to understand what it does, and why
![Page 41: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/41.jpg)
Hard Coded Values
✤ Just don’t do it. Use config, use Class definitions, or Statics
![Page 42: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/42.jpg)
Reinvention, Bad idea
✤ Calendar formatter
✤ Network Library
✤ Search, or ask. Know your domain
![Page 43: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/43.jpg)
Warnings, Errors
✤ Fix warning messages, they are usually there for a reason
✤ If something fails, understand WHY it failed. Interested in making sure it doesn’t happen again
✤ Know where to fix it, document your changes
✤ Example: Cucumber test with TEXTAREA gave an extra ‘\r’
![Page 44: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/44.jpg)
Be sure to test
✤ “I’m sure it must work in all those cases”
✤ Take the time to think about your code
![Page 45: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/45.jpg)
Too Focused on Small Parts
✤ Focus on the most important parts. Don’t know? Ask!
✤ iOS app, focused on getting a particular toolbar exact to the specifications, but those specifications would change
✤ Optimizing before recording data, profiling
![Page 46: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/46.jpg)
How will this change the app?
✤ DB code, using “select statements” and adding in specific fields
✤ Made it work in the short term, impossible to manage in the long term
✤ Change one class, but not really understand how it is used elsewhere
![Page 47: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/47.jpg)
Date
How to Improve
![Page 48: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/48.jpg)
Date
Mentoring
![Page 49: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/49.jpg)
Date
Ask for Feedback, Code Reviews
![Page 50: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/50.jpg)
Date
Read/Learn
![Page 51: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/51.jpg)
Date
Build Tools, APIs, LibrariesDon’t do the same thing over and over
![Page 52: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/52.jpg)
Date
Enjoy the process
![Page 53: API Design & Moving from Junior to Senior Developer](https://reader034.fdocuments.in/reader034/viewer/2022052303/55643c28d8b42adb258b5272/html5/thumbnails/53.jpg)
Date
What is your.... Q & A, Part Deux