Profile

Cover photo
Andrew Dang (Drew)
Works at University of California - San Diego
Attends University of California, San Diego
Lives in La Jolla
345 followers|326,977 views
AboutPostsCollectionsPhotosVideos+1'sReviews

Stream

Andrew Dang (Drew)

Shared publicly  - 
 
Won a tiki mug from #ucsdbookstore on their #funfridays contest. I need to start making a ton of tropical drinks this summer.

#freeswag #ucsd
1
Add a comment...

Andrew Dang (Drew)

Shared publicly  - 
 
 
Programming challenge: Ok, so you may ask why would you program like this, but the answer is if you try this out it will force you to think in a different way that can actually benefit you longer term when writing OO code. Here is the challenge:

"In The ThoughtWorks Anthology a new book from the Pragmatic Programmers, there is a fascinating essay called “Object Calisthenics” by Jeff Bay. It’s a detailed exercise for perfecting the writing of the small routines that demonstrate characterize good OO implementations. If you have developers who need to improve their ability to write OO routines, I suggest you have a look-see at this essay. I will try to summarize Bay’s approach here. 

He suggests writing a 1000-line program with the constraints listed below. These constraints are intended to be excessively restrictive, so as to force developers out of the procedural groove. I guarantee if you apply this technique, their code will move markedly towards object orientation. The restrictions (which should be mercilessly enforced in this exercise) are:

1. Use only one level of indentation per method. If you need more than one level, you need to create a second method and call it from the first. This is one of the most important constraints in the exercise. 

2. Don’t use the ‘else’ keyword. Test for a condition with an if-statement and exit the routine if it’s not met. This prevents if-else chaining; and every routine does just one thing. You’re getting the idea.

3. Wrap all primitives and strings. This directly addresses “primitive obsession.” If you want to use an integer, you first have to create a class (even an inner class) to identify it’s true role. So zip codes are an object not an integer, for example. This makes for far clearer and more testable code.

4. Use only one dot per line. This step prevents you from reaching deeply into other objects to get at fields or methods, and thereby conceptually breaking encapsulation.

5. Don’t abbreviate names. This constraint avoids the procedural verbosity that is created by certain forms of redundancy—if you have to type the full name of a method or variable, you’re likely to spend more time thinking about its name. And you’ll avoid having objects called Order with methods entitled shipOrder(). Instead, your code will have more calls such as Order.ship().

6. Keep entities small. This means no more than 50 lines per class and no more than 10 classes per package. The 50 lines per class constraint is crucial. Not only does it force concision and keep classes focused, but it means most classes can fit on a single screen in any editor/IDE.

7. Don’t use any classes with more than two instance variables. This is perhaps the hardest constraint. Bay’s point is that with more than two instance variables, there is almost certainly a reason to subgroup some variables into a separate class. 

8. Use first-class collections. In other words, any class that contains a collection should contain no other member variables. The idea is an extension of primitive obsession. If you need a class that’s a subsumes the collection, then write it that way. 

9. Don’t use setters, getters, or properties. This is a radical approach to enforcing encapsulation. It also requires implementation of dependency injection approaches and adherence to the maxim “tell, don’t ask.” 

Taken together, these rules impose a restrictive encapsulation on developers and force thinking along OO lines. I assert than anyone writing a 1000-line project without violating these rules will rapidly become much better at OO. They can then, if they want, relax the restrictions somewhat. But as Bay points out, there’s no reason to do so. His team has just finished a 100,000-line project within these strictures."

Quote from: http://goo.gl/Wly2s4
5 comments on original post
1
Add a comment...

Andrew Dang (Drew)

Shared publicly  - 
 
I'm hoping to add these #swagtag to my bundle of loot!

#freeswag
 
So next week the rest of the sweatshirts, stickers and bottle openers will get sent out. But here in the meantime, we have some really cool (I mean insanely awesome) tags we are going to give away just for following and sharing this post with the hashtag #SwagTag . Leave a comment here and tell us where you are placing the tag. Have fun and Monday I will pick winners.

Make sure to follow +CyanogenMod and feel free to share!
68 comments on original post
1
Add a comment...

Andrew Dang (Drew)

Shared publicly  - 
 
Made this free tee shirt at the Samsung Booth in 2013.

#freeswag   #samsung   #android   #pride   #lgbt  
2
Add a comment...

Andrew Dang (Drew)

Shared publicly  - 
 
Won a $50 UCSD Bookstore Giftcard from getting 2nd Place in the Scariest Costume Contest in 2014. A smart phone with low battery IS pretty scary.

#freeswag   #giftcards   #UCSD   #halloween   #costumecontest  
1
1
Jacob Thomas's profile photoAndrew Dang (Drew)'s profile photowritten tinxe's profile photo
2 comments
 
+Jacob Thomas​ Lol, maybeeee. First place was a go pro bundle. I really wanted that.
Add a comment...

Andrew Dang (Drew)

Shared publicly  - 
1
Add a comment...
Have him in circles
345 people
George Diez's profile photo
Aiyana Bailin's profile photo
Mallesh K's profile photo
olatunji Emmanuel's profile photo
Cindi Chen's profile photo
JUAN Sanchez's profile photo
TechZimo.com's profile photo
Mohammed Alkhafajy's profile photo
Clinton Rodriguez's profile photo

Andrew Dang (Drew)

Shared publicly  - 
 
 
Huge thanks to +Brian Hardy for sharing this image with me the other night. Therefore, I want to share it with all of you.

It's a great way to get some awesome savings on some amazing +Motorola Mobility products such as the Moto 360, Moto X, Nexus 6 and even accessories. 

The code can be used repeatedly and it's also kind of a contest for the Moto Makers group. Which ever one has their code used the most gets to go hangout with +Motorola Mobility at some special event and to be honest, I'd love to see +Brian Hardy win as I know he would share a lot of awesome stuff with us from that event.

If you're in the market for a new device or need some accessories for your device, then use that code right now to save you some cold, hard cash!

#MotoMaker   #Motorola   #Savings  
1
Add a comment...

Andrew Dang (Drew)

Shared publicly  - 
1
Add a comment...

Andrew Dang (Drew)

Shared publicly  - 
 
Snatched a Red HP Chromebook 11 from Google's #chromebookforeveryone  contest in 2013.

#freeswag   #chromebook   #hp   #google   #contests  
1
Add a comment...

Andrew Dang (Drew)

Shared publicly  - 
 
Won a +TYLT  Moto360 band from +TECHAERIS . It looks so much better in person! And, it feels awesome! Thanks!

#freeswag   #moto360   #motorola   #smartwatches   #google  
1
1
TECHAERIS's profile photo
Add a comment...

Andrew Dang (Drew)

Shared publicly  - 
 
Getting myself ready for #pride

#androidify #gay #lgbt #queer #unique
1
Add a comment...
Andrew's Collections
People
Have him in circles
345 people
George Diez's profile photo
Aiyana Bailin's profile photo
Mallesh K's profile photo
olatunji Emmanuel's profile photo
Cindi Chen's profile photo
JUAN Sanchez's profile photo
TechZimo.com's profile photo
Mohammed Alkhafajy's profile photo
Clinton Rodriguez's profile photo
Education
  • University of California, San Diego
    Computer Science, 2010 - present
  • University of California, San Diego
    Global Health Studies, 2010 - present
  • University of California, San Diego
    Microbiology, 2010 - present
Basic Information
Gender
Male
Other names
Drew, Druster, Drewskii, and Gander
Apps with Google+ Sign-in
  • AdVenture Capitalist
Story
Tagline
Microbiologist | Aspiring Physician | Gaymer | Tech Enthusiast | LGBT Activist |
Introduction
What I am and what I do is defined by my adventure in trying to define excellence. I live by Aristotle's quote, "We are what we repeatedly do. Excellence, therefore, is not an act but a habit."

I post about and participate in discussions on science fiction, fantasy, Star Wars, biology, android, technology, education, and photography!
Bragging rights
B.S. in Microbiology. Java and C Programming fluency. Can make bomb-ass Pho. Crafted Harry Potter wands.
Work
Occupation
Student
Employment
  • University of California - San Diego
    College Ambassador, 2012 - present
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
La Jolla
Previously
Los Angeles - Alhambra
Links
Other profiles
Andrew Dang (Drew)'s +1's are the things they like, agree with, or want to recommend.
StackSocial
plus.google.com

Apps + gear to make you better, faster, more awesome.

Loot Crate
plus.google.com

Epic geek and gamer gear delivered monthly.

LG G Watch R Review and Giveaway: One of the Best Android Wear Smartwatches
www.makeuseof.com

One of the best Android wearables comes with a hefty $300 price-tag and an equally oversized name: LG's G Watch R. LG's second Android Wear

MakeUseOf
plus.google.com

Technology Simplified

iPad Air 2 Review and Giveaway
www.youtube.com

Read the full review and enter to win at http://www.makeuseof.com/tag/ipad-air-2-review-giveaway

All The Obvious Reasons You Need To Date A Guy With A Hairy Chest
elitedaily.com

You haven’t really lived until you’ve dated a man with a hairy chest.

Corgi-Break
chrome.google.com

It's time for a Corgi Break.

Git - Working with Remotes
git-scm.com

Working with Remotes. To be able to collaborate on any Git project, you need to know how to manage your remote repositories. Remote reposito

ganderdnaw - North America - LoLNexus
www.lolnexus.com

This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site. Curse Sites. Top Sites; MM

Secret
market.android.com

Secret is a new way to share what you’re thinking and feeling with your friends.[+] Write anything that’s on your mind, free of judgment.[+]

How Can I Stay Motivated and Finish My School Work?
lifehacker.com

Dear Lifehacker, Recently, I've been too bored or unmotivated to do my school assignments. No matter how hard I try to actually focus on it,

No Excuse List
www.noexcuselist.com

The best place on the web to learn anything, free.

Motorola Mobility
plus.google.com

Welcome to the Official Google+ Motorola Mobility page

Rebel Squadrons
plus.google.com

Keeping the Empire on their toes as a fully interactive Star Wars Club since 1994

Timely Alarm Clock
market.android.com

Timely is on SALE! Get the Premium upgrade at 75% off for just $0.99.Timely is the beautiful Alarm Clock for Android, featuring a stunning u

Life at Google
plus.google.com

Join the conversation on our job opportunities, offices, culture and life at Google.

Nexus
plus.google.com

News and notes on the latest hardware from Google.

Our Energy Future Public Lecture Series
plus.google.com

Connecting the community with UC San Diego energy research

The Walking Dead
market.android.com

When the world is ravaged by a zombie apocalypse, police officer Rick Grimes and a small group of others must face a terrifying new reality.

It's okay. If you want affordable and decent Vietnamese food, Banh Mi Che Cali is a good choice. This is less of a sit down restaurant than a take out service because it's a quite small venue. It's a lot faster if you go take out. Don't expect 5 star American service. I'm a frequent of Che Cali, so it's nice that the staff know my orders right before I walk through the doors. The banh mi "sandwiches" are a lot healthier alternatives than the fast food burgers and a lot cheaper. I love ordering these for road trips or small get-togethers. I highly recommend the BBQ pork. They have boba milk teas for the cheap! 2 for $2.25. That's a steal! Don't expect it to be good as the milk teas from Cha for Tea. Pho is not the best. At most, it's decent. As another reviewer pointed, the best food is usually up on the counter. These include the deserts.
• • •
Public - a year ago
reviewed a year ago
I believe the restaurant is trying create a comfortable setting for the modern Americanized Asian family. Folks from all backgrounds will find something appealing to eat from their menu. Their food ranges from pizza, pasta, and a variety of Vietnamese, Chinese, and Thai cuisine. I was able to dish out on one of their Italian pastas which I find to be very good in taste. It wasn't "excellent," but it was able to leave me with a satisfied full stomach. The atmosphere was really nice. It was very clean and modern. I have to note that there isn't much Asian to this place except the food in the menu. Great place for the kids. There are several chalk board walls where they provide chalk to their guests to draw with. The service was adequate. They were fast to serve us because there weren't many folks around to tend to at the time.
• • •
Quality: Very GoodAppeal: ExcellentService: Very Good
Public - 3 years ago
reviewed 3 years ago
2 reviews
Map
Map
Map