
Behind enemy lines: 3 months as an iOS developer at Google - chubs
http://www.splinter.com.au/2012/12/26/behind-enemy-lines-google/
======
gdubs
I've had to resolve merge conflicts with pbxproj files and xib files, and
while it's not pretty, it's not a good enough reason to eschew interface
builder. There's a reason that toolset is still around since the NeXTStep
days: it's powerful. It gets a lot of giggles from people who are less
experienced with Cocoa / iOS, and think that programmatically defined UI is
for 'real' coders. In my experience, the amount of time you save wiring-up an
app with interface builder is significant. With the editor assistant screen
open, you can even drag UI element outlets directly to your code, and it will
automatically insert your property declarations (and same with method
actions). The idea that I'm going to grok someone else's UI code at a glance
-- the same way I would looking at a visual document -- is absurd. Does
interface builder fit every situation? Absolutely not. But for the vast
majority of apps, you'll get your rapid prototype finished more quickly if you
use the tools, and then you can tweak from there.

~~~
koko775
I stopped having merge conflicts with pbxproj files - ever - once I started
making use of this tool in my projects:

[https://github.com/WebKit/webkit/blob/master/Tools/Scripts/s...](https://github.com/WebKit/webkit/blob/master/Tools/Scripts/sort-
Xcode-project-file)

It can be run while Xcode is open; it'll just reset the tree view. It
basically alphabetizes everything, so there is one canonical ordering to items
that you add to the project.

------
davidjgraph
Am I the only one thinking that this contract was probably bound under an NDA,
and that making such a post is generally bad practice leaving employment/a
contract (regardless of whether there's an NDA).

I know nothing ultra-secret is given away, but if I were looking for a
contractor, I'd be concerned that such a person might perform a post-mortem on
my company after leaving as well.

~~~
eliben
I'll second this. I think such a post from a contractor is inappropriate,
unless he cleared it with some Google authority, which I doubt he has.

~~~
j_baker
What confidential information did he reveal?

~~~
eliben
I don't know. But reading his post it's obvious he discusses a lot of details
of the internal development methodology in Google which seems like something
you should ask for approval to publish.

~~~
j_baker
You don't know that anything he said is confidential. You don't know that he
didn't get approval for this, which you say he "should" do clearly without
knowing anything about Google's policies. I'm also assuming you don't know
what his NDA specifies. How can I construe this to _not_ have you reaching a
premature conclusion with too little info?

~~~
eliben
I did say "... unless he cleared it with some Google authority, which I doubt
he has."

So what are you specifically objecting? My saying that I doubt he cleared it
with Google? I'm entitled to my doubts, thank you :-)

~~~
j_baker
It strikes me as being officious to judge a person's actions as
"inappropriate" without having the proper context (what their NDA says, what
Google considers confidential, etc).

------
trendnet
"Anyway, yes, there is a bit of anti-iOS sentiment there, you’ll be constantly
teased about Obj-C’s strange syntax..."

Ah, yes, and Java and C++ are all flowers and unicorns flying around.

~~~
interpol_p
Yeah I was struck by that line too.

After 10 years as a C++ and Java developer, and 3 years of Objective-C,
Objective-C is by far my preferred language (although it's an absolute must to
use with an auto-completing IDE due to its wordiness).

~~~
nicholassmith
I think it's mostly Obj-C's syntax is a bit of an oddity if you're a
C/C++/Java/Python/Go (I think that's the main flavours in Google) developer
who's never seen it before, but after spending some time in it it does make a
lot of sense how it's been approached.

Plus isn't syntax mocking the same as editor mocking? Expected and pointless.

~~~
zem
expected, pointless and not really taken seriously by anyone involved. it's
just a fun social convention to identify with a team and mock the other team
and it's adherents.

------
cromwellian
Umm, nary an iPhone to be found? Most people I know at Google have an iOS
product of some sort. Maybe it is different in Google Australia vs Mountain
View, but Googlers aren't shy about Apple HW. I would say 50% of Googlers
carry MacBooks.

~~~
archangel_one
The standard dev setup is a Linux desktop and a Mac laptop (Macbook Pro / Air)
or a ThinkPad. So unsurprisingly, you'll see a lot of Mac laptops, but not
necessarily iPhones. Also, a Macbook doesn't run iOS. The article author is
being more accurate with his terminology than you are, which might lead to the
confusion.

~~~
jmillikin
I work on Mountain View, and several people on my team have iPhones. The
reason is that we have an oncall rotation, and nobody wants to miss a page
because their phone kernel panicked or "PagerService has stopped" during their
shift. Plus, the iPhone batteries last longer.

I suspect the author's experience might be because he worked in an office
where teams are located in closer physical proximity. It can be socially
difficult to use an iPhone when the local Android team sits just down the
hall.

~~~
corresation
_The reason is that we have an oncall rotation, and nobody wants to miss a
page because their phone kernel panicked or "PagerService has stopped" during
their shift._

Are you seriously trying to claim that there is a greater risk with a Nexus 4,
for instance, of a pager service stopping or a kernel panic? Your post seems
utterly ridiculous.

~~~
matwood
I have found my Android phone (HTC 1X) to be much more likely to have an app
crap out and kill the battery by repeatedly polling location services. After
removing app after app looking for the culprit it appears to have been Google
Plus. It's recently been updated, so maybe they fixed it.

I never had this issue on my iPhone(s).

~~~
drzaiusapelord
Self-respecting googlers aren't using sense or touchwiz junk. They're rocking
a Nexus phone or running something like CM.

~~~
matwood
I have friends with Nexus phones that end up with similar issues.

~~~
drzaiusapelord
Meh, I have a nexus and the wife has an iphone. They both have had their fair
share of problems. I think its a little crazy to say, in 2013, that the
android line is this unstable phone and if you're a sysadmin on call then you
must have an iphone because its so super reliable. I'm a sysadmin, I do fine
with android, thanks.

~~~
matwood
Nowhere did I say the iPhone was perfect or the Android was horrible. I was
commenting on the battery life. My only phone right now is an Android phone
and I enjoy using it. Because of the iPhones locked down nature and limit on
background processes it is much less likely to be killed by a rogue process
draining the battery. This has been my experience and others I know with other
Android phones (including the Nexus).

Regardless of which device you like to use, ignoring its faults doesn't help
them get fixed.

------
archangel_one
FWIW, I do see the occasional iPhone at Google - but not many, of course.

And no, the Nexus 4 wasn't an option for the Xmas present this year. Not
totally surprising given the obvious trouble LG's having keeping up with
demand.

~~~
MatthewPhillips
Most people still using a Galaxy Nexus there?

~~~
archangel_one
No, mostly Nexus 4's, but they're generally prerelease devices - or I guess a
few are bought separately. Still quite a few GNex's around of course.

------
brown9-2
_Everyone has a task list to work from, and for each task you ‘branch off’
(kindof, they use a customised version of an obscure source control system,
but i’ll translate it into Git parlance)._

Is Perforce really that obscure?

~~~
malkia
It's widely used in video-games development. All metadata is kept on the
server (unlike others like svn/cvs). The GUI tools are easy to use (p4win and
p4v for all platforms). The thing just works. I love playing with
git/hg/fossil/etc., but when comes to huge binary files (psd, tga, tiff, fbx)
p4 is the king.

~~~
malkia
Microsoft also uses some kind of perforce based client (they bought/licensed
some source code version of it many years ago).

------
mattquiros
As an Android developer who's required to learn iOS just to port one of my
projects, I do find Objective-C's syntax to be strange--quite sloppy, in fact.
I tried to list down the things I don't like about the language while going
through my reference, and here are some of them so far:

\- Defining the method signatures in a header file or an @interface section,
then repeating the same method signatures just to implement them in
@implementation. I just think it's an awful waste of effort.

\- The idea of categories. The way I see it, there doesn't seem to be a reason
not to subclass since categories won't make sense anyway if you don't include
the original class in #import.

\- @optional directive in protocols. I think of protocols as Java interfaces,
and I assume that's the intended purpose for having them, so having an
@optional directive seems quite pointless to me.

\- Obscure variable scoping. I find myself having to memorize too many
visibility rules--ones that apply to the objects themselves (what attributes
they inherited, local/block scoping, etc.), ones that apply to files
themselves (defining instance variables within @interface, global BUT in-file
variables within @implementation, the extern keyword, etc.). This is much
simpler and elegantly done in Java where you don't need to switch between
thinking of your program as a bunch of interacting objects and as a bunch of
files.

\- Which makes me think that Objective-C just doesn't have good OOP in the
first place.

\- Conditional compilation. When is this ever useful? I just can't visualize
having to write this (maybe for games?), but again, I never had to do this in
Java.

~~~
kevinh
It's amusing because the _opposites_ of some of these are things that bother
me about Java. Having everything in one file? Messy. Not having categories?
Sad. @optional is nice if you want to be able to degrade to a default case.
Scoping is primarily just C so YMMV.

ObjC is a purer form of OOP than Java is.

Not to mention Java has it's own quirks in my books: no unsigned variables, no
typedefs, calling a function on a null pointer creates an exception instead of
returning null (what's up with that?), etc. And don't get me started with how
Android uses xml (poorly).

Really with languages I think it's primarily what you're used to.

~~~
cageface
I'm mainly an iOS guy but the way Android manages layouts and resources in XML
beats the pants off of xibs + interface builder for non-trivial UIs.

~~~
GoldenMonkey
You've gotta be kidding. What user interface tool does android + eclipse
provide? There is nothing there, you've gotta hand roll it in xml. The UI tool
is limited and a pain to work with.

I think android's ability to use folders to support different layouts and
resources beats the file naming conventions necessary for supporting the same
scenario in iOS... i.e. myLogo~ipad.png

~~~
cageface
I leave the WYSIWYG for the designer - it quickly falls apart for actually
programming complex UIs. My job is to translate PSDs into working UI. There's
a good reason we abandoned WYSIWYG for web design years ago and a modern
mobile app is no less dynamic.

I can change the underlying grid size, padding and item spacing for every
screen in my entire app in one line. Have fun doing that in iOS.

------
cageface
I'm coming around to the point of view that storyboards cause more problems
than they solve but throwing out xibs entirely seems a little extreme. Are
they really doing all their layout in code?

~~~
objclxt
XIBs and programatic layout is the Vim vs Emacs of the iOS world.

There are a lot of pros and cons of both. I used to spend a not insignificant
amount of time trying to moderate debates between iOS engineers who favoured
one approach versus the other.

Doing all your layout in code isn't inherently bad, and there are lot of Apple
written apps that do this (conversely, some of the newer iOS built-in apps
_do_ use NIBs). The main problem that I've found with layout entirely in code
is that whilst it's fine for you, the sole developer, once you bring in more
people onto the project you can have problems with getting people up to speed
on what exactly is going on where.

Of course, the solution to this is to enforce _strict_ coding standards over
how to layout the views themselves in code, which Google clearly do. And as
the article points out, resolving merge conflicts in code is somewhat more
enjoyable than in nibs.

That said, just as programatic layout isn't inherently bad, neither is
leveraging interface builder strategically. Here's a good example: iPhoto on
iPad has a completely custom interface that's mainly laid out programatically,
but certain key elements are actually composited together in IB. For example,
the brushes that slide up when touching up photos are being brought in from
NIBs, but animated and manipulated in code. Using the nib file to load in the
images reduces the code without sacrificing understanding (or at least, that's
Apple's argument. There's a fantastic WWDC 2012 session that covers how the
iPhoto UI is put together in more detail).

The TLDR; - the only risk of programatic layout that I see if developers going
'off piste' and laying out in a non standard way. With the right coding
standards you should be fine.

~~~
morty16
> There's a fantastic WWDC 2012 session that covers how the iPhoto UI is put
> together in more detail).

Do you happen to know the session name or number?

~~~
objclxt
Sure, sorry - I should have put that in my original post. It's Session 243,
_iPhoto UI Progression and Design_ , with Randy Ubillos himself.

------
unwind
_Google are very strict about things like code style guides, so things like
having incorrect spacing, or ivars that aren’t in alphabetical order, or lines
wider than 80 chars, will all get picked up._

Is the part of instance variables having to be sorted alphabetically really
true? I did a quick search but only found the C++ style guide, which says
nothing like that.

It sounds absurd, instance variables should (imo) be grouped logically, not
sorted by their names which are not very relevant when it comes to which
belong together.

~~~
cryowaffle
Did you read the part about how it helps dealloc? I can see how that would be
nice, if you don't have too many instance variables then it wouldn't be a big
deal.

~~~
unwind
No, I missed that part ... I guess it makes some kind of sense, but it seems
weird to assume that all instance variables need deallocation.

If I have a buffer, and a length, I'd like to keep them together in the code
since they both are part of the same thing. The length, however, is likely
some integer type that won't need mentioning when destroying the instance.

~~~
akmiller
But, if you are forced to name alphabetically you might start naming those
related instance variables in a related way (which wouldn't necessarily be
bad). For example in your case you might have: myFileBuffer and
myFileBufferLength which would hopefully be next to each other, no?

------
micampe
_> Best case, your code is approved, you can then merge master into your
branch and push your branch up to master._

Isn't this backwards? The code should be reviewed _after_ I merged master in
my branch, the merge can introduce any number of random issues and conflicts
that may substantially change the code being submitted.

Besides, I think the 80-chars limit (especially in ObjC) is ridiculous,
probably just put there by terminal diehards that make life harder for
everyone else.

~~~
udp
An 80 character limit is great if you like looking at multiple source files
side-by-side.

~~~
micampe
I do that a lot and I found long lines annoying on an 11" MacBook Air, which
has a 1366px horizontal resolution, and I use a fairly large font size at
12pt. I want to believe most developers use a larger display for their day to
day work.

 _(bonch, you’ve been hit by the hellbanning BS: your comments are invisible)_

------
um304
"Which explains things like android’s less-than-beautiful UI". They have
improved their UI a lot in version 4 and above. I really like new artifacts
they introduced such as ActionBars. You can see them implemented in GMail app
and you can't label it "less-than-beautiful".

~~~
lnanek2
I think they've been going the wrong way lately, personally. I have trouble
figuring out all the unlabeled icons myself whenever I use an app I don't use
every day. Took me a while to even figure out what happened to the foursquare
check in button when it became a small tiny unlabeled icon. I know I can tap
and hold, but I've never seen any one else do that, never seen a user do that
in a user study, and it's a pain in the ass doing it for a ton of glyphs in an
interface. I'm more likely to just assume functionality doesn't exist then go
tap and hold on half a dozen icons.

My users in apps I launch with the new style guidelines have horrendous times
due to not noticing the main action is often an unlabeled icon with no chrome
in the top right action bar, etc.. Often they flounder around in the app doing
what they can tapping on content directly and never even try or notice the
action bar icons.

Do flat, chromeless, unlabeled icons look good? Yes, but they are about as
unusable as possible. The worst thing is that we are forced to follow Google
guidelines if we want to get featured, and their design guide is a piece of
crap not backed up by user studies. So we developers end up implementing all
these stupid work arounds, like a tutorial overlay the first time any screen
is shown with a big freaking white arrow and some text pointing to the
otherwise unnoticeable corner icons...

------
nodata
_Luckily, perforce has a fantastic graphical merge tool, which i’ve now
adapted into my post-Google Git tooling._

Anyknow know what he is referring to?

Edit: anyone know what Git tool he is referring to?

~~~
benvd
P4Merge, I would guess.
(<http://www.perforce.com/perforce/products/merge.html>)

~~~
djmdjm
I much prefer Meld (<http://meldmerge.org/>) when I want a graphical tool, but
usually just edit the conflicts in vim.

~~~
nodata
Out of interest, do you have a good way to compare two parts of the same file
using vimdiff without creating two files? Say a huge xml file with two nearly
identical <parts></parts>?

~~~
m0shen
Yank the two parts into two new buffers (:vsplit) and do :diffthis in each

------
drewda
Interesting to look at the product that he was working on:
[http://www.google.com/enterprise/mapsearth/products/coordina...](http://www.google.com/enterprise/mapsearth/products/coordinate.html)

Based on the screenshots, it looks like something developed in-house for
Google security guards. I wonder if Google can actually put the right kind of
expertise and resources into selling these sort of specific IT solutions to
non-technical organizations.

------
Aqua_Geek
> Same with merge conflicts on .pbxproj files - these files weren’t checked
> into source control. Instead, there’s a Google open-source tool called GYP
> that generates your Xcode project from a JSON recipe and recursively
> searching the folders for source files.

Wow. That sounds crazy. I feel that there's an opportunity here to make a
merge tool that would know how to handle .pbxproj files. The most common
scenario I've encountered is when multiple people add files to the project -
they get appended to a section of the .pbxproj file and consequently result in
a (easily-solvable) conflict.

Part of me wonders why nobody at Apple has just gotten fed up with merge
conflicts and solved the problem already.

~~~
evmar
Diffs for pbxproj files are also not especially readable, so just a merge tool
wouldn't be enough to make collaboration easy.

Here's a recent diff of adding some files:
[http://trac.webkit.org/changeset/138661/trunk/Source/WebCore...](http://trac.webkit.org/changeset/138661/trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj)

and the equivalent change in Gyp:

[http://trac.webkit.org/changeset/138661/trunk/Source/WebCore...](http://trac.webkit.org/changeset/138661/trunk/Source/WebCore/WebCore.gypi)

------
doktrin
>> However at Google it was noticeable that designs aren’t really taken
seriously. Which explains things like android’s less-than-beautiful UI, and
google’s generally noticeable lack of focus on design.

This is something I have a hard time wrapping my head around. I am _not_ a
designer, and wouldn't even consider myself particularly _good at_ it.
However, there is no shortage of evidence to support the value and importance
of good design. Therefore, I don't understand why any company or team culture
would marginalize it.

Can anyone comment on the extent of this culture at Google or elsewhere?
Specifically, why it exists and how it's propagated.

~~~
racter
1\. Many engineers are unable to recognize the merits of one design over
another. But they have a finely tuned sense of engineering effort required to
implement certain design features, so they literally see the cost of UX
proposals without seeing the benefit. So they argue.

2\. Many PMs believe that all design is subjective, and therefore it's
perfectly reasonable to substitute their judgement for that of the UX'er. So
they argue.

3\. Google is a uniquely bottom-up culture, where consensus is required to
move forward.

These three things lead to design by committee, and it is extremely painful.

~~~
doktrin
Thank you. This was a very helpful response, and I appreciate you sharing it.

------
TheSmoke
"But, more likely, your code has some mistakes or style violations and needs
to be fixed up. So the reviewer puts comments against the relevant lines in a
web-based review system, ..."

is it rietveld? <http://code.google.com/p/rietveld/source/browse/>

~~~
Evbn
Rietveld is a degoogled fork of it.

------
interpol_p
"Same with merge conflicts on .pbxproj files - these files weren’t checked
into source control."

I use SourceGear DiffMerge as my default Git mergetool. Makes it pretty
straightforward to merge .pbxproj files.

~~~
Tloewald
Good to know. I've merged both xib and pbxproj files and while it's possible
it's not pretty.

------
michael_miller
Regardless of confidentiality issues, the post was definitely in poor taste.
For example, he talks about "android’s less-than-beautiful UI". If I ever
hired a contractor, and he posted something to that effect about one of my
products, you can bet I'd never hire him again. It's extremely unprofessional,
and a breach of trust. It's one thing talking about this stuff between
friends, but another to badmouth your (former) employer to the public
internet.

------
lnanek2
Haha, yeah, I worked with some ex-Googlers and experienced a similar review
system. I often had multiple unrelated sections to work on while something was
being approved, not to mention multiple iterations of the branch stuck in the
approval bottleneck too. I guess other companies like Pivotal Labs get around
this by pair programming, which I never thought of as an alternative to code
review until now. Hmm.

------
nikolakirev
Very interesting read! Thank you for posting!

------
austinl
I'm surprised Google chose to not use ARC for that project. Could anyone
comment on why Google would use ARC for one thing and not another?

------
damniatx
I wish i can work for Google, but hearing their horror interview made me
really afraid.

~~~
kami8845
What's it gonna cost you to apply? Maybe an hour to prepare the CV + cover
letter. Take it from there and if you really want the job solve all the
problems of Cracking The Coding Interview.

------
bornhuetter
Interesting article. I was surprised the author ended it with "I only regret
that i had to terminate my contract early due to out-of-my-control family
reasons." Doesn't seem to me to be a great thing to have on your website for
self promotion.

~~~
jonknee
Why does having an unexpected family problem have to do with being a problem
for future clients? Everyone has had bad things happen, it doesn't mean
anything. If my mom died during my last project I don't think that would harm
my chances of getting a next project.

~~~
bornhuetter
As I have said in another comment: I originally misread the sentence as "out-
of-control family reasons", missing the "my" - and the sentence is not as bad
as I thought (or to put it another way, not necessarily bad at all).

Unfortunately I can't edit or delete the original comment.

------
vibrunazo
Posting just to bookmark it.

