Square Corner Blog
corner.squareup.com · Company blog · on HN since 2010
Square's engineering team writes about mobile development, open source tools, databases and hiring practices at the payments company.
What HN saysHN commenters cite it for the Shift MySQL migration tool and especially the Android Fragments post, which they use to argue the Android lifecycle is painful.
93HN people shared it
22linked it in comments
102stories submitted
2.5Kstory points
10 years agolast shared
2010people per year2026
Most-shared posts
- 1Shift – Safe and easy online MySQL migrations (a new Square open source project)4 people · 23 points · first shared 2016 · discussion on HN
- 2A Comparison of Go Web Frameworks3 people · 203 points · first shared 2014 · 35 comments on HN
- 3IOS Integration Testing by Square3 people · 133 points · first shared 2011 · 27 comments on HN
- 4Advocating Against Android Fragments3 people · 17 points · first shared 2014 · 5 comments on HN
- 5Why We Pair Interview3 people · 4 points · first shared 2011 · 1 comments on HN
- 6Square Releases Open Source WebSocket Client for Objective-C2 people · 175 points · first shared 2012 · 19 comments on HN
- 7Logging can be tricky2 people · 138 points · first shared 2014 · 74 comments on HN
- 8Ember and D3: Building responsive analytics2 people · 104 points · first shared 2012 · 16 comments on HN
- 9Coding Challenge: The Luhny Bin2 people · 36 points · first shared 2011 · discussion on HN
- 10Protecting infrastructure secrets with Keywhiz from Square2 people · 33 points · first shared 2015 · 9 comments on HN
- 11Shuttle: Powerful cross-platform localization2 people · 8 points · first shared 2013 · discussion on HN
- 12Seven Days of Open Source2 people · 6 points · first shared 2013 · 1 comments on HN
- 13A Short Guide to Kernel Debugging2 people · 6 points · first shared 2015 · discussion on HN
- 14Parliament: A Secret Sharing Service2 people · 6 points · first shared 2013 · discussion on HN
- 15Transparency with JPEGs on Android, from Square2 people · 5 points · first shared 2013 · discussion on HN
What HN people wrote when they linked it
mcpherrinm · 2016-08-02
If you love pt-online-schema-change, you may want to check out Square's tooling around it: https://github.com/square/shift
https://corner.squareup.com/2016/04/shift.html
It provides a job running service, a UI for setting up and monitoring migrations, and an authorization/peer review flow for them.
Maybe it could add support for gh-ost in the future.
zebob123 · 2016-05-16
The great "Advocating Against Android Fragments" post on the Square Corner blog by Pierre-Yves Ricau highlights how horrible the Android lifecycle is.
https://corner.squareup.com/2014/10/advocating-against-android-fragmen…
Also, if you are doing any substantial Android development, you are bound to run into many issues (say, for instance, it's horrible soft keyboard management system). Hackborn can be found on many of these issues trashing developers asking those questions.
https://groups.google.com/forum/#!topic/android-platform/FyjybyM0wGA
Non productive vitriol is the norm for this person.
zserge · 2015-05-11
My first candidate for removal would be fragments. They don't help to componentize apps at all (at least not better than plain old viewgroups), but they can make life much harder with weird hidden bugs.
There is brilliant article from Squareup about that - https://corner.squareup.com/2014/10/advocating-against-android-fragmen…
In Anvil I try to follow Square's approach, e.g. keep components as viewgroups and use a custom backstack to manage them as needed (e.g. back/home navigation, multi-pane layouts etc). Then you get just one activity per application and it's a big relief.
harryh · 2014-09-16
Here is the actual blog post from today announcing a bunch of Pants milestones: http://pantsbuild.github.io/announce_201409.html
This is actually a collaborative project between Twitter, Foursquare & Square. All three companies contributed a ton of work.
Here's the announcement on the Foursquare Eng Blog: http://engineering.foursquare.com/2014/09/16/introducing-pants-a-build…
And here's the one on the Square Eng blog: http://corner.squareup.com/2014/09/trying-on-pants.html
It's a fully open source project so we'd welcome contributions (or jokes) from any and all interested folks! Pants is a great build tool that we hope to grow and use for years to come.
SupermanScott · 2012-04-26
But what about WebSockets in non-browser contexts. I have to wonder if Square does this with its SocketRocket http://corner.squareup.com/2012/02/socketrocket-websockets.html
Think of desktop apps that keep a connection to the server and are awaiting messages from it. I think it might get interesting, maybe not the best application of WebSockets, but interesting. Your Email client wouldn't have to poll every X seconds to see if new mail has arrived.
ezl · 2013-09-25
Thanks, FWIW the link I linked to was an implementation I did a week or so ago.
I'm actually using a similar browser based curve implementation (I'm using the bezier rendering thing instead of a quadratic) -- https://github.com/ezl/signature-pad/blob/master/jquery.signaturepad.j…
The first pad is the original that just draws lines between the sampled points.
The second 2 actually take points and compute a cubic spline that runs through all the sampled points. The problem I have though is that it takes 4 points to compute a bezier curve, which means there are at least 4 sampled points worth of lag in determining what curve to render on the canvas.
For example, 4 sampled points on a line should render a totally linear segment between the points, but then if the 5th points goes off the line, it actually impacts the preceding points -- so you have to lag even further to make draw the right curve.
Even if you wait every 3 points to determine a quadratic that canvas's built-in can render, it creates some lag between the current mouse position and the rendered curve.
If you keep rendering quadratics every 3 points, you'll get funny cusps where you join each of the quadratics (solution seemed to me to compute the spline for the fully determined segments of the curve).
My janky solution is "draw linear segments until I have enough data, then restroke it with pretty curves". I didn't really understand the full implementation under the "responsiveness" section on…
allenc · 2011-12-20
As someone who does a lot of interviews and has switched jobs six months ago, I understand how it feels, on both sides. I've written my fair amount on the topics too (http://allenc.com/2011/04/how-to-score-a-google-onsite-interview/ and http://corner.squareup.com/2011/10/why-we-pair-interview.html).
I think a part of it is ego, especially nowadays - some really good engineers are doing their own startups now, and when these companies start hiring they're looking for people just as good as they are, which means taking a page out of the Google/Facebook style interview process. I've met and worked with people who, while with great intentions, think great software engineering comes from graduate-level CS studies.
That said, resumes and achievements aren't great indicators of success because so many people have good-looking job histories and many can also sound good just talking about their experience. For me, front-end web eng. has become a pain to hire for; too many candidates put down things they don't know enough about, and unless they have fully-viewable source online it's hard to tell whether they accomplished much of anything in their past projects.
I do think our current standard of heavy whiteboard interviews is misleading, though, which is why I prefer pairing interviews when given a choice. Working with an engineer is a great way to measure cultural fit.
And finally, companies are super careful with filling a position because while firing someone is at-will, the…
gte910h · 2011-09-02
If you do the exact same amount of functionality in a shorter period of time, it frees up that time to then go make another part better. More features. More testing. Faster Release. More documentation. Accessibility features.
If you prefer to boil each grain of rice separately for a pilaf, and it tastes the same at the end, you just wasted a lot of time in the kitchen for no good reason other than you've not stopped and learned how to boil them all at once.
Try the new Xcode4 book: http://www.amazon.com/Xcode-Developer-Reference-Richard-Wentk/dp/11180…
It goes into IB's newest incarnation. IB is also fantastic when adding assecessability functions to your app. Another reason to add accessability functions to your app (beyond being a good human being who lets not-fully sighted people use your app) is that it allows kif to work: http://corner.squareup.com/2011/07/ios-integration-testing.html (play the video).
I'm not a IB Zealot, I make views manually when it makes more sense to or IB is just not doing it's job with any speed, but "0" is not the amount anyone should be using it who makes non-game apps.
hdra · 2016-02-25
RyanZAG · 2015-10-22
Instead of manipulating byte code at runtime, wouldn't it make more sense to use an annotation processor to just create a specialized UnsafeArrayList for each input type you need?
With something like JavaPoet, it's fairly easy to do as well. It feels a lot safer than manually creating byte code like that. Let javac do that for you.
EDIT: If you're not familiar with JavaPoet, check it out here: https://corner.squareup.com/2015/01/javapoet.html
crazybob · 2015-07-03
Square's "Luhny Bin" challenge: https://corner.squareup.com/2011/11/luhny-bin.html
amenghra · 2015-04-14
Related blog post: https://corner.squareup.com/2015/04/keywhiz.html
maniksurtani · 2015-02-26
And more details http://corner.squareup.com/2015/02/grpc.html
evan_miller · 2014-09-24
Hi, post author here. The slight difference in i/o (specifically: writes) was the trigger. I talked a little more about that here: http://corner.squareup.com/2014/09/logging-can-be-tricky.html#comment-…
And here: https://news.ycombinator.com/item?id=8359556
Even on the problematic host we only saw this latency issue in the 99th percentile. That is: even on the problem host 99 out of 100 queries were served as expected and only 1 out of 100 saw this additional latency.
dpeck · 2013-08-21
Might be interested in Cube that square released a few years ago. http://corner.squareup.com/2011/09/cube.html
edit: cube, not cuba :)
myko · 2013-05-06
The first of Square's Open Source announcements is OkHttp:
http://corner.squareup.com/2013/05/announcing-okhttp.html
Looks pretty handy, built in caching, response compression, and the ability to point to multiple data centers in case one is being flaky.
jes5199 · 2013-01-27
I worked at a large startup that was trying to migrate from MySQL to Postgres because of how long table migrations take on MySQL. There's a tendency for adding a column in MySQL to a table to be stop-the-world for the whole server, and it can take hours. They had some pretty serious workarounds for that, and some of them were "try to never change the database structure".
There was some thought that there were other problems that Postgres would solve, some advocacy happened here: http://corner.squareup.com/2011/06/postgresql-data-is-important.html
angerman · 2011-07-15
Ok, this might be somewhat dumb; I'm just starting to get into testing. How does KIF[1] compare to Kiwi[2]?
--
[1]: http://corner.squareup.com/2011/07/ios-integration-testing.html
[2]: http://http://www.kiwi-lib.info/
pdevr · 2015-05-19
These are some of the top sites' engineering blogs which I collected over a period of time - I removed those which have already been posted:
Google: http://googledevelopers.blogspot.com/ http://google-engtools.blogspot.com/ http://googleresearch.blogspot.com/
YouTube: http://youtube-eng.blogspot.com/
Baidu: http://usa.baidu.com/category/baidutechblog/
Yahoo: http://yahooeng.tumblr.com/ http://yahoodevelopers.tumblr.com/
Wikipedia (closest I could find): https://blog.wikimedia.org/c/technology/
Amazon: https://aws.amazon.com/blogs/aws/
Twitter: https://engineering.twitter.com/
eBay: http://www.ebaytechblog.com/
Microsoft: http://microsoftengineering.com
FourSquare: http://engineering.foursquare.com/
Apple (closest): https://developer.apple.com/
Paypal: https://www.paypal-engineering.com/ https://devblog.paypal.com/
Dropbox: https://blogs.dropbox.com/tech/
Edit: More (collected from this link: http://www.quora.com/What-are-the-top-startup-engineering-blogs):
Yelp: http://engineeringblog.yelp.com/
Quora: http://engineering.quora.com/
Yammer: http://eng.yammer.com/blog/
AirBnB: http://nerds.airbnb.com/
Square: https://corner.squareup.com/
Flickr: http://code.flickr.net/
Soundcloud: https://developers.soundcloud.com/blog/
Cloudera: http://blog.cloudera.com/blog/
Slideshare: http://engineering.slideshare.net/
Heroku: http://engineering.heroku.com/
Pinterest: http://engineering.pinterest.com/
bradleyland · 2014-10-05
I get that you like Go, but you can't run Go in a web browser. Ultimately, whatever you write will have to be evaluated in a web browser, which means it will be JavaScript at some point. Just like you've observed with CoffeeScript, writing in a different language is just a layer of abstraction on top of JavaScript.
Web apps have a back-end and a front-end. You can definitely write the back-end without touching JavaScript. You can even write it in Go. Square did a nice writeup comparing several:
http://corner.squareup.com/2014/05/evaluating-go-frameworks.html
When it comes to browser side, you're stuck with JavaScript though. Trying to avoid it will only bring more pain and frustration than attacking the problem head-on.
I would point out that programming languages don't make errors, programmers do. I'm no fan of JavaScript. I too avoid it when I can. It's absolutely necessary if you want to write web apps though. As you become more familiar with JavaScript, your error rate will go down.
If JavaScript really puts you off, maybe consider going another direction, like mobile app development. Both iOS and Android applications are developed using compiled languages. You may find them more suitable to your programming style.
gline · 2013-04-17
I'm not totally sure it will have been the right choice in retrospect but it was effectively this blog post:
http://corner.squareup.com/2012/04/building-analytics.html
that lead me to prototype using ember. I believe Square's analytics platform - not a "full" web app but a pretty substantial one - is still in production deployment based on ember. Of course, they're probably using whatever version of ember was around 18 months ago, and there have been radical changes since...
It feels very likely to me that these javascript frameworks represent a substantial component of the future of this kind of development. People smarter than I am seem to feel that angular is 'better technology' than ember, or at least that in looking like extensible html it has more in common with the eventual future than ember does.
I'm actually surprised, in this spate of MVC framework posts, that Meteor hasn't gotten more of a mention. In some ways it's younger than the others, and it has some idiosyncrasies (it doesn't actually require that the client and the serve both be written in javascript but you'd never know if from the web site). But the meteor team is incredibly smart and the company is well financed - and they're spending a lot of time and energy on one of the most interesting aspects of the problem, something ember and angular have not worked out: how to synchronize models and data between the client and the server. Meteor has a special protocol for handling this, such that when…
cmdrkeene · 2010-08-31
To your issues:
1) Yeah, organization is crazy. I think the method comparison is a bit unfair though. In theory, each step should be easily identifiable (like a method) but this is rarely the case given that most steps have complex regex matching (sometimes for grammatical niceness - e.g. (a vs. an), sometimes for other crazy town reasons). This makes not only automated indexing difficult (RubyMine tries...) but trying to keep hundreds of steps in your head is pretty hard. Especially one's you probably didn't write.
The cool thing about steak is that helpers and "reusable steps" are actually just methods! Hello ctags :D
b) Our case was:
And the user "212-555-1234" should receive a text with:
| Some "double quoted" and 'single quoted' text |
Definitely possible in cucumber, but I prefer a string equality assertion:
text.should == "..." (you have to do this anyway in the step_definition)
c) Ben Maeby's email_spec is awesome and provides some steps for clicking on links in email. I still use the library in steak (just the raw rspec matchers though).
The trouble is you have a url:
http://coolsite.org/something/abcde22424aw3324234
The matcher provided says:
I click on the link "Link Title or URL". Since the token is random every time (unless you stub it, which is kinda out of the spirit of acceptance testing, but that's another debate) it's hard to say "Click on the link with the big ass token in it".
You can definitely write a step like:
And I visit the…