Here are my notes from Day 2 of CodeConf 2011. You can also check out my notes from Day 1.
Projects, community, and GitHub - Andy Lester
[Slides]
Andy is the guy who wrote ack, and he got to his main point right away: GitHub is great for developers, but itâs not great for end users. Itâs important that we take those users into account, because there are many more possible users of our software than there ever will be developers or community.
Itâs important that we realize that newcomers do not care about source code. They want to see three things:
- Whatâs it do
- Whatâs it look like
- Do I want to use this or not?
Therefore, your project should have a project site. It needs a URL; theyâre cheap, and they let you change stuff later if you want to move hosts. This page needs to have these three things on it, to help your newbies.
A good and bad thing is that GitHub has such a low barrier to entry, that tons of new people are doing it. This means we need to be extra encouraging of our new users, and help them get involved in our projects. You should be extra gentle with patches from new people: brevity will be perceived as harsh. You should only accept patches that help your project, but accept patches from new people if at all possible, even if itâs a small or trivial change. That magical feeling of getting accepted will draw them in.
Make a project guide for your project: it needs to break down the project into small chunks, and provide direction and standards and a preferred workflow.
Also, donât forget to monitor your fork network, sometimes people build cool things and donât send you a pull request!
Finally, it all really boils down to this: put yourself in a newbieâs shoes. Make things good for them.
The Ethics of Abandoning Software - Seth Fitzsimmons
âIâm Seth, I abandon software. specifically oauth.â Seth talked a lot about the lifecycle of open source software, and the hows and whys of handing a project off to someone else.
The Life and Times of Software
Hereâs the outline of the four stages of the software development lifecycle, and the motivations for each step:
- Writing
- scratch an itch
- money
- self promotion
- The Releasing
- no reason, because itâs so easy to share
- goodwill, itâs good to help others!
- self promotion
- tool to be recruited by employers,
- The Maintaining
- community
- Money
- demonstration of responsibility
- The end
This process happens in stages.
- No longer interested
- active disinterest
- denial and neglect
- Letting go, and moving on
Itâs so easy to share code now, everyone is doing it, which leads to more abandoned projects. We need to examine the consequences of this, and learn how to give up projects gracefully.
Farmville on iOS - Amanda Wixted
âFarmville - Your Mom Loves This Shitâ
The beginning of this talk was one big ad for Farmville, frankly. âHereâs what Farmville is, hereâs why itâs awesome, we wrote an iOS client, it works the same way!â
She did talk at the end a little bit about things that are different from the web to iOS. Sprites were encoded from .swfs to .pngs. They use Cocos2D, which gives you a nice framework for building games on iOS.
One big thing that changes when you develop for an embedded device is memory constraints. Their biggest issue with this revolved around the animal sprites, which take up a lot of space. So they needed to be paged in and out, sometimes often.
They still used UIKit on top of the EAGLView that Cocos2D gives you, so that they could use UIKit to provide the usual kinds of menus and such.
For an alternate set of notes on this talk, John Garza sent us an email:
Amanda covered basic social gaming concepts, and why, she thought these types of games were important in the social landscape (the evolution of fbâs poke to an fb gameâs âgive a giftâ system). And the idea of connecting to your friends and family who you might not have time to connect with in the normal social way (messages, email, phone calls). Coming from Namco, and her work with launch game titles for iOS devices, she was tasked with creating the same easy of use experience in a native game client in order to preserve the type of gameplay that so many users already were used to
on fb.
Farmville itself, is a basic isometric build-your-own-farm which makes use of the painterâs algorithm (or priority fill) to project a 3d scene onto a 2d plane.
Their plan was to go about creating a client that would not require a change of backend server code or the underlying server game code. One of the early roadblocks they came across was the obvious network latency with working with cell devices. To overcome that road block, they abstracted a transaction manager system to queue any type of
specific game transaction and transport them to the game server in a non-blocking way so the game client wouldnât hold up with user.
Another obstacle was the sprites discussion mentioned in the summary, and the need to make sure some (but not all) graphics were cached locally on the device, and how they implemented a feasible way of pushing updates to sprite graphics as updates to in-game items are often large and frequent (monthly or sometimes every other week).
They ended up with an update xml file pointing to changed/added assets stored on game serves which were hashed-named graphics packages for each asset (using a weird not-so-good-quality sprite graphic format called ~PVR? - My notes are sparse on this point). Amanda spent a few moments lamenting on how xml was a poor solution for this job and in hindsight, json wouldâve been much better.
In the implementation side, besides the mentioned Cocos2d, Amanda also mentioned the development of FontLabel for incorporating custom fonts into pre-4.0 iOS applications, and how this package is still used today for backwards compatibility (post-4.0 now has this feature)
https://github.com/zynga/FontLabel
Building & engineering around startup uncertainty - Mike Krieger
[Slides]
Confusion sinks startups, so we need to fight it. First thing that needs to be handled is the product itself, and what needs to be built. The second part is the technical challenges that happen with building said product.
Instagram came out of a project called burbn. It was an HTML5 app that did social/mobile/location stuff. The most asked question was âwhat are you guys?â You have to actually focus on something. And it took them three months to get less confused.
They did this by doing four things:
- ideate
- validate
- build
- send out & iterate
Ideation is about creating your original ideas. They donât code until they sketch out a UI. And theyâve built and thrown away entire features on paper. This is an example of âmaking wrong less painful.â
Validation is about getting feedback from users, to confirm that your thoughts are true. Every social app should go through âthe bar exam.â If you canât explain it to someone at a bar, then you need to simplify it.
Building is pretty obvious, but there are still some tricks. You still have to be able to learn while you build stuff. You can do this with a tight feedback loop, iterating on one week cycles.
You need to be âproud but embarassedâ about your first launch. Do a few features, and do them really well, to build your âminimalist viable product.â
âOne day out in the real world is worth one month of guessing.â
âUse your friends and make some new onesâ (for your beta)
All of this is about product uncertainty. As for technical uncertainty, the main question is âAre we building it the right way?â
Focus, and keep your team small. Ask yourself what your company is actually about. Your framework is not going to be the most important bottleneck. Stand on the source code of giants. Experiment with quick projects. The anti-pattern is âLetâs re-write our entire site.â An interesting way to think about features is âCould we rip this out in 20 minutes if itâs bad?â
Can Code Be Like Literature - Jeremy Ashkenas
If people were talking about Codaâs talk on Day 1, everyone was excited about Jeremy for Day 2. I think a lot of people were blindsided, they didnât know what was coming, but Convore BLEW UP for this talk. I canât hope to do it true justice, but hereâs what I managed to pull out. Oh, and you can also see some other notes here, too.
Luckily, I managed to get my hands on a copy of the audio recording of my talk. Please give it a listen.
EDIT: Jeremy posted his slides.
âWhat makes code strange?â Thereâs lots of interesting things about code that we take for granted. Any given MacBook has 50 years of software history running on it at different times.
We use languages like Ruby Python or JS because they let us write code like literature. It fits the way we think. Letâs be honest, we donât use Ruby for engineering reasons.
Dijkstra gives us lots of reasons to treat code as something different than other kinds of literature. âI do not know of any other technology covering a ratio of 10^10.â
How big is the spec for you code when you print it out? If youâve never run code, is it still code?
âBy evoking the need for deep conceptual hierarchies, the automatic computer confronts us with a radically new intellectual challenge that has no precedent in our history.â Code is a fundamentally new thing.
Code is logic. Haskell, no IO, did it ever run? Knuthâs definition of software.
Code as Law. We set up constraints on the variables and objects in our code, and it defines the possible space of our bits. When we write code, weâre taking the infinite blank space of our hard drives and CPUs and narrowing them down into something meaningful. In the machine, code is the only possible law.
Code as Art. Knuth was all about this. âScience is knowledge which we understand so well we can teach it to a computer; and if we donât understand something it is an art to deal with it.â Concrete arts vs Abstract arts.
Code has a dual audience. The machine and the reader.
âThe competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humilityâŚâ - Dijkstra
The history of programming languages is all about âhow do we address both audiences.â
Dijkstraâs Structured Programming vs Knuthâs Literate Programming.
Code as literature. âMeaning belongs to a text or to a program to the extent that it acts upon intelligence in a particular way.â We say that a textual work is âliteraryâ if it contains a high density of meaning.
âWhile we count the lines of code we use, the battles here are fought, won, or lost on how much power of meaning lies under the syntactic forms.â - Alan Kay
Code is still writing. We use literary abstractions in code. He gave three or four examples, but I couldnât really take notes fast enough to do them justice. My bad!
Object Orientation is an explicit Biological Metaphor.
Code as Commons. We are participating in a society, reading and writing code is about being a participant in a civic society.
âSome programs are elegant, some are exquisite, some are sparkling. My claim is that it is possible to write grand programs, noble programs, truly magnificent ones.â - Knuth
Our best practices are killing us - Nicole Sullivan
She was checking out duplication in CSS of big websites. Facebook was one, Salesforce was another. For example, Salesforce has 3,668 padding declarations. She started wondering how many other people were being sloppy with CSS, and she looked at the Alexa top 1000 websites. !important is a code smell, and the biggest site had 518 declarations of it! float usually means that you havenât build up the proper abstractions for your design. Use grids instead. font-size is also something that people use far too many of. 13px bold is basically the same as 14px. The worst offender for this was 889. 25% had over 100.
Insanity: doing the same thing over and over and expecting different results.
Three best practice myths:
- Donât add extra elements
- Donât add classes
- Use descendent selectors exclusively
She talked about CSS specificity, which is still black magic to me, because Iâm a CSS noob. She then talked about ways to modify elements in certain parts of the page in the best way. Frankly, Iâm not sure what the best way is to summarize these slides, so hopefully someone else will have a better one for this talk. :)
She did end up bringing up something we all do, but feel bad about it: coding via Firebug.
Once you get really deep into CSS, you can easily end up in a very hostile environment for your code: youâve got two layers to develop, and itâs really hard to tell which rules take precedence, and it becomes basically impossible to get the look and feel that youâre going for.
How do we solve all of these problems?
- Add non-semantic elements judiciously
- Keep specificity as low as possible
- Abstract repeating visual patterns
- Use specificity to define your architecture
By doing the right thing, Facebook was able to cut their average CSS bytes per page by 19% after gzip and html bytes per page by 44% before gzip.
Farming vs. Mining - Will Shipley
Will was a last minute addition in the lineup, so he didnât have slides.
âThey always say to start with a joke, so: git submodule support.â
He pretty much gave a slightly extended version of his latest blog post, Farming vs Mining. So Iâll just leave that up as summary.
Thatâs it!
All thatâs left is dinner and drinking, so Iâm out! I hope youâve enjoyed these summaries, and Iâm really looking forward to an awesome CodeConf next year.