[digdog dig];

  • Archive
  • RSS
“Actually, Sheldon Has Better Design.”

If you’re an iOS developer, and love the sitcom The Big Bang Theory, then you have to watch season 4 episode 12: The Bus Pants Utilization (original air date is January 6, 2011.)

In this episode, Leonard comes up with an idea for his iOS app and derails his friendship with Sheldon.

What’s the App?

It’s a handwriting-recognition based equation solver, or in Sheldon’s way: “The Surprisingly Helpful Equation-Linked Differential Optimized Numerator.” The idea behind this is to use iPhone’s camera to take a picture of the equation, and scan it with handwriting recognition, then run it through a symbolic evaluation engine, and bam.

Learning Cocoa

During the episode, they show several actual Objective-C code snippets and interesting design sketches on white boards, here are some of them:


They have a CRecognition object holds an UIImage instance variable, and sadly they name it _Photo (with underline as prefix), it’s not the naming convention Apple suggested.


The next morning, Sheldon starts his own design, if you look closer, it’s much more considered than Leonard’s.


For example, since this is an utility app, Sheldon comes up with a flip view design that similar to built-in Camera/Stocks app. A full screen SPhotoView with a snapshot button in the middle, and on the other side, it’s SEquationView and a UITableView at the bottom with some buttons.


In here, you can see more details. A UITableView holds the scanned equations, and supports rotation for landscape full screen detail view and portrait detail view. On the right side, Sheldon shows better understanding about UIViewController’s view hierarchy design concept.


Later, Leonard’s team is doing some reference counting. Instead of accessing instance variable directly in -initWithPhoto: and -dealloc, they decide to use retain property self.photo, with class method to return a autoreleased CRecognition object, and claim there’s no leaks.

What a mess, you should always use instance variable directly in -initWithPhoto: and -dealloc when creating/releasing instance object.


Here you see Leonard’s app class hierarchy, mostly MFC-ish (thanks, @lukhnos.) style naming convention for the class names, almost everything starts with letter “C” (is for “Class” I think), CAppDelegate, CMainView, CCameraView, CSymbolicView, etc. They should use prescribed prefix like “LRH,” which means Leonard, Rajesh and Howard.

 
The beautiful Penny is next to Sheldon, and there’s Facebook API on the white board.


In the end, Penny’s shoes app project. There’re many of them on the AppStore already, and the UI design for this one looks kinda lame.


And Sheldon is working on this project… (for customer from hell?)

Conclusion

I love and enjoy this episode a lot, and the TBBT crew does a great job for all these minor details, they look very convincing to me.

But, they should use Mac when doing the coding, I only saw Raj’s MacBook Pro, and rest of them are using PCs. That’s not right, you can’t run Xcode on PC, well, unless they all use Hackintoshes…

Also, If you want to hire someone for your iOS app project, I highly recommend Sheldon Cooper.

References

The Big Bang Theory: 4x12 The Bus Pants Utilization
Apple: Introduction to Coding Guidelines for Cocoa
[digdog dig]; - To nil, or not to nil, that is the question
View Separately

“Actually, Sheldon Has Better Design.”

If you’re an iOS developer, and love the sitcom The Big Bang Theory, then you have to watch season 4 episode 12: The Bus Pants Utilization (original air date is January 6, 2011.)

In this episode, Leonard comes up with an idea for his iOS app and derails his friendship with Sheldon.

What’s the App?

It’s a handwriting-recognition based equation solver, or in Sheldon’s way: “The Surprisingly Helpful Equation-Linked Differential Optimized Numerator.” The idea behind this is to use iPhone’s camera to take a picture of the equation, and scan it with handwriting recognition, then run it through a symbolic evaluation engine, and bam.

Learning Cocoa

During the episode, they show several actual Objective-C code snippets and interesting design sketches on white boards, here are some of them:

They have a CRecognition object holds an UIImage instance variable, and sadly they name it _Photo (with underline as prefix), it’s not the naming convention Apple suggested.

The next morning, Sheldon starts his own design, if you look closer, it’s much more considered than Leonard’s.

For example, since this is an utility app, Sheldon comes up with a flip view design that similar to built-in Camera/Stocks app. A full screen SPhotoView with a snapshot button in the middle, and on the other side, it’s SEquationView and a UITableView at the bottom with some buttons.

In here, you can see more details. A UITableView holds the scanned equations, and supports rotation for landscape full screen detail view and portrait detail view. On the right side, Sheldon shows better understanding about UIViewController’s view hierarchy design concept.

Later, Leonard’s team is doing some reference counting. Instead of accessing instance variable directly in -initWithPhoto: and -dealloc, they decide to use retain property self.photo, with class method to return a autoreleased CRecognition object, and claim there’s no leaks.

What a mess, you should always use instance variable directly in -initWithPhoto: and -dealloc when creating/releasing instance object.

Here you see Leonard’s app class hierarchy, mostly MFC-ish (thanks, @lukhnos.) style naming convention for the class names, almost everything starts with letter “C” (is for “Class” I think), CAppDelegate, CMainView, CCameraView, CSymbolicView, etc. They should use prescribed prefix like “LRH,” which means Leonard, Rajesh and Howard.

The beautiful Penny is next to Sheldon, and there’s Facebook API on the white board.

In the end, Penny’s shoes app project. There’re many of them on the AppStore already, and the UI design for this one looks kinda lame.

And Sheldon is working on this project… (for customer from hell?)

Conclusion

I love and enjoy this episode a lot, and the TBBT crew does a great job for all these minor details, they look very convincing to me.

But, they should use Mac when doing the coding, I only saw Raj’s MacBook Pro, and rest of them are using PCs. That’s not right, you can’t run Xcode on PC, well, unless they all use Hackintoshes…

Also, If you want to hire someone for your iOS app project, I highly recommend Sheldon Cooper.

References

  1. The Big Bang Theory: 4x12 The Bus Pants Utilization
  2. Apple: Introduction to Coding Guidelines for Cocoa
  3. [digdog dig]; - To nil, or not to nil, that is the question
    • #TBBT
    • #The Big Bang Theory
    • #iOS
    • #app
  • 2 years ago
  • 60
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

60 Notes/ Hide

  1. digdoritos reblogged this from digdog
  2. digdoritos likes this
  3. shesma reblogged this from digdog
  4. hameteman reblogged this from digdog and added:
    Read more…
  5. botalpha likes this
  6. we-break-the-earth reblogged this from digdog and added:
    totally agree that...is awesome owning...brilliant writers
  7. neomusashi likes this
  8. inamiy likes this
  9. soulim reblogged this from cocoaheads
  10. noplans reblogged this from do-nothing
  11. do-nothing reblogged this from cocoaheads
  12. iosdevlog likes this
  13. ashokgelal reblogged this from myconsole
  14. digdog likes this
  15. khealywu likes this
  16. shortbreadsh likes this
  17. astonishingbrettwhite likes this
  18. benzado reblogged this from digdog and added:
    develop an iPhone app....work out their designs
  19. fri13th likes this
  20. appiphone likes this
  21. jarodl likes this
  22. melissayu likes this
  23. zonble likes this
  24. benzado likes this
  25. codestuffs reblogged this from digdog
  26. codestuffs likes this
  27. beefdisciple likes this
  28. tbbt-fans likes this
  29. travisjeffery likes this
  30. achappell reblogged this from cocoaheads and added:
    This is freaking amazing!
  31. chaoticplanet likes this
  32. myconsole reblogged this from cocoaheads
  33. mitchjohnson likes this
  34. nfarina likes this
  35. yllan likes this
  36. corntoole likes this
  37. cocoageek likes this
  38. tworolleicordlenses reblogged this from cocoaheads
  39. cocoaheads reblogged this from digdog
  40. digdog posted this
← Previous • Next →

[digdog dig];

MAKE A POO-POO AND COME UP WITH A FRESH NEW IDEA
  • RSS
  • Random
  • Archive
  • Mobile
Effector Theme by Pixel Union