RSSAmplifier

Blog

radex.io

radex.ioRSS feed ↗21 posts

Latest posts

Jsonnet tutorial

I recorded a 13-minute Jsonnet tutorial. Jsonnet is an excellent choice for a configuration language, such as for Kubernetes IaC (but also, any other complex config that’s hard to maintain by hand). Unlike JSON and YAML, you can easily reuse snippets, create complex templates with logic that determines exact contents based on parameters, import arbitrary files, generate json/yaml/ini/python/etc…

Hermes Hacking: Demystifying JavaScript Engines

I gave the “Hermes Hacking” talk on the (excellent) React Native EU conference. It’s an introduction to how JavaScript engines work, for developers that have no background in parsers, compilers, or interpreters. I briefly cover lexing, parsing, AST interpretation, bytecode generation, garbage collection, with some Hermes-specific topics, and links to articles where you can learn more. Give it a…

I made JSON.parse() 2x faster

Part of my job is to make JavaScript things go fast . Speed is a feature, and when working in an interpreted language, squeezing every last bit of performance can be the difference between a great product and unusable garbage. Anyway, how cool would it be to make JavaScript itself go faster? I’m not a C++ programmer, but that didn’t stop me before, so I thought I’d give it a try anyway! The…

Simultaneous Xcode 7 and Xcode 8 compatibility

You’re an iOS developer. You’re excited about all the great new features iOS 10 brings, and you’re eager to implement them in your app. You want to start working on it right now so that you’re ready to ship on day one. But that’s still a few months away, and until then, you have to keep shipping new versions of your app every few weeks. Does that sound like you? Of course, you can’t use Xcode 8 to…

When (not) to use guard

guard is one of my favorite features of Swift 2. It’s one of those subtle syntactical constructs we could totally do without. And yet having it is such a delightful win. It makes our methods cleaner and easier to read, it helps express the “early exit” intention, and adds a little extra safety. However, it’s important to learn and understand how to use guard properly. It has its place, but it’s…

Statically-typed NSUserDefaults

A year ago, not long after Swift became a thing, I noticed a tendency among programmers to write it the way you’d write Objective-C. I thought that Swift was a different language, with different syntax, philosophy and capabilities, and so we should develop new conventions and approaches to it. I responded with Swifty methods , where I argued for a better, clearer way of naming things. Then, some…

Swifty methods, the talk

Back in March, I gave a talk named “Swifty methods” on the Swift Summit conference in London. It’s a shorter, more compressed and refined version of the arguments I was making in the essay with the same name as well as the Swifty APIs series . I think it went quite well, so I encourage you to give it a watch on the Realm website: 📺 Watch Swifty methods (I wish I could just embed the YouTube video…

Lazy WatchKit tables

In Practical and efficient WatchKit tables with view model diffing , I presented a way of making Apple Watch apps that simplifies application code and results in superior performance by moving UI updating logic to the framework layer and making it smart about pushing updates over the radio. Another way you can reduce iPhone—Watch traffic and make your app faster is by loading tables lazily.…

Converting between Result, Optionals, and Swift 2 errors

Like interactive articles? Download Playground for this article. Before Swift 2, there were three main ways of dealing with errors: Optionals: for the simplest cases when you don’t care about a reason why an operation failed. NSError: used by Cocoa frameworks; upon failure, a method sets an error object to the variable passed as a pointer. This method is undesirable because of its verbosity, and…

Practical and efficient WatchKit tables with view model diffing

In this post, I will show you how to dramatically simplify the architecture of your WatchKit application and improve its performance. We will introduce a thin layer between your interface controller and the views (tables, rows, labels, images…). Together with a small set of additions to the WatchKit framework, this will free you from worrying about updating your UI in an efficient manner. Every…

WatchKit hyphenation

Quick WatchKit Pro-Tip™ today. Text on the Apple Watch can be awkward. You probably saw this when developing or using WatchKit apps: huge gaps left by long words wrapped into a new line, and ugly jagged edges in left-aligned blocks of text. Apple deals with this problem in their own apps by hyphenating text on screen. However, WKInterfaceLabel doesn’t support hyphenation… Or that seems to be the…

Swifty APIs: NSTimer

In the previous installment of Swifty APIs , we took a look at NSUserDefaults and gave it a make-over. I pointed out some of its problems, like verbosity and inconsistent behavior, and tried to fix them. The resulting interface was, arguably, cleaner, easier to use, and felt more at home with Swift’s syntax. Today on my plate is NSTimer . This class has been a pet peeve of mine for a while.…

Rethinking JSON in Swift

Parsing JSON has been a hotly debated topic in the Swift community almost since day one. The staticly typed nature of Swift proved somewhat problematic when facing with this problem. In the world of Swift, the structure and types of data are well-defined and known at compile time. When decoding serialized objects, they’re not. At the same time, the new features of Swift enable different approaches…

Swifty APIs: NSUserDefaults

In Swifty methods , I was arguing that we should resist the temptation to write Swift the way Objective-C used to be written. I argued that we should develop new approaches and conventions to designing interfaces, and that we should, once and for all, abolish Objective-C’s excessive verbosity. Although it was very well received, the issue I’ve had with the essay is that the arguments I was making…

Swifty methods

If you prefer watching to reading, I also gave a talk on the same topic. Most programmers learning and writing Swift now are people with existing experience in Objective-C. Many of them have worked with this language, writing iOS and Mac apps, for years. If you’re reading this, there’s a good chance this also describes you. It’s very tempting for us to write Swift the way we’d write Objective-C.…

Great Swift resources

Witnessing the birth and growing up of a new programming language of any significance is a rare and very exciting opportunity. If you’re reading this, it’s probably because you too want to be a part of this — and I welcome you aboard! But if you’re new here, you might find yourself confused. There’s not a lot of material out there on Swift and not too many people who know any of it. I’ve been…

The future of MacBook

My current Mac, a 15ʺ Late 2013 Retina MacBook Pro is a truly stunning machine. In many ways, it represents the future of a notebook computer. Its display is unbelievably great. The performance is fantastic. It ditches spinning platters in favor of solid-state storage, and legacy IO in favor of USB 3 and Thunderbolt. It’s thin and light, yet works 8 hours on battery. The keyboard and trackpad are…

A little book

On one day in December 2010, I decided to get myself a book in English for Christmas. I had just turned 15 and it would be the first time I ever read a book written in a foreign language. I ordered Rework . I will never know why exactly I chose that one — I only vaguely knew what Rework is about and I had no idea who 37signals is. I thought the book is something on the intersection of business and…

Fall 2013 Apple predictions

2013-09-03 If you’re an Apple nerd, I’m sure you’re as excited as I am about this fall. They used to make product releases throughout the year, but not this time. Aside from minor tweaks and the Haswell MacBook Air, we’ve got nothing so far. I thought it would be interesting to take what we know — the leaks, the rumors, external roadmaps and Apple’s historic choices — and try to predict what they…

Pushing through the dip

I love writing. It’s a fascinating mental exercise. It forces you to think, and do so coherently. Often enough, you think that you have a good argument, it all makes sense in your head, and yet it’s so hard to write it down. You can get away with unstructured thoughts when talking, as it’s unstructured itself, but to put together logical sentences out of it, it’s a big challenge. But boy, I love…

Can you hear me?

I always lacked a place to share my thoughts. I’ve had things to say, but I kept them inside. I’ve had those ideas and rants in my head, but nowhere to put them. I needed a soapbox. So I made a blog. More than once. But writing is hard. Those ideas sounded great in my head, but once I was to make coherent sentences out of them, I would hit the writer’s block. Every time. I would churn out a few…