Ternary operators are beyond cool. They’re an easy way to do some if-else logic all on one line. Beyond that, they’re still easy to read and understand, so you don’t have to sacrifice readability for the ‘cool factor’ of using a language’s advanced features. In fact, it’s a great way to keep methods shorter and draw attention to other logic that may be more meaningful to your program.
Take the below code for example. You compare two variables, and print something based on the result.
if variable1 == variable2 {
print("Equality! 🥳")
} else {
print("NO EQUALITY 🤬")
}
The ternary operator consists of 3 parts. …
I’m in my fourth year studying Computer Science (and Engineering 🤷♂️), and I’m certain this was the right move for me. But is a degree in Computer Science the right path for you? Is Computer Science a good major?
For me, the decision was all but obvious once I eliminated some other career options — I love to build things, and I love to work with people. Working as a Software Engineer seems like a natural choice. The most common degree for people pursuing a career in Software Engineering is a B.S. …
Here’s the tweet that I’d been waiting for since I started following Frank back in April.
Frank comes from an IT background, and landed an iOS development job in the middle of 2020. Heck of a year for a career change. About a month ago, he agreed to sit down with me and talk about his journey to becoming a Mobile Software Engineer, and his story is definitely worth sharing.
What was the beginning of your career like? How did you break into tech without a degree?
I actually, funny enough, used to work at Apple. I was a genius at one of the Apple stores. I worked there for about 6 years, starting at sales and working my way up to genius, which is pretty much everything. Towards the end of my time there, I said “You know what, I need a change of pace, I’m going to start coding.” I poked around, initially looking at game development. I started off with all the worst preconceptions of how great I was gonna be, and found out very quickly — “Oh no, this is not easy.” It was super hard. I ended up switching to an IT job, and did that for about two years. …
A lack of self-awareness is poison. Reflection and review is the antidote.
-James Clear in Atomic Habits
While the weekly review takes many forms, it originated with David Allen’s “Getting Things Done” system. He totes it as a time where an individual can
In my eyes, the great thing about a weekly review is it can kind of be whatever you want. What defines a weekly review is really the purpose it. For me, it’s a time when I sit down, journal, and reflect on the week. …
This was originally published in my newsletter, iOS By Night. If you subscribe there, you’ll see more of my writing, sooner than anywhere else.
Being able to devote your full attention to something is fundamental to thriving in any area of life, so why is it so hard?
In Cal Newport’s cult-favorite “Deep Work”, he says
The ability to perform deep work is becoming increasingly rare at exactly the same time it is becoming increasingly valuable in our economy. As a consequence, the few who cultivate this skill, and then make it the core of their working life, will thrive.
For the most part, “Deep Work” is putting all of our energy into one task, to accomplish something that can’t easily be replicated. Think of the last time you had to write a term paper, study for a math exam, or complete a deliverable at work. If you’re anything like me, you probably remember the constant negotiation with yourself to actually work on the task at hand. I often find myself wanting to reach for my phone, grab a snack, water my succulent, honestly anything but what I’ve set out to do. Of course, guilt quickly follows. …
This article was originally published here on my blog, if you prefer to read it there.
I’ve been using an iPad for about 3 years, and I absolutely love it. Too often I hear tech-enthusiasts blast it as an underpowered toy computer for grandmothers — and wow is that underselling it. For the most part, I’ve used my iPad as a leisure device. Since most of my work and education is done on a computer, it’s nice to feel a little separation when I want to unwind with something digital. The more I used it though, the more likely I was to reach for my iPad for professional tasks. When my college went 100% online back in March, it became a precious part of my workflow. Since I almost use my iPad more than my computer (except on workdays.. …
This was originally posted here on my blog.
I’ve been using Chrome since around its release, but ditched it last year over privacy concerns. Google has a really big interest in having its eye on everything you do online so it can find a way to profit off of it, which was a little frustrating for me. After some experimenting, I ended up on Safari, which touted some pretty sweet privacy features, mostly in the area of blocking website’s attempts to follow you across the web. …
If a craftsman wants to do good work, he must first sharpen his tools. — Confucius
In math words, productivity typically is units of output per unit of time. Talking about our own work that way makes us feel like machines, and is a bit too reductionist. When I think of productivity, I think about getting done what I need to get done in time so that I can do what I want to get done. However you define it, productivity matters to you whether you’re a student, knowledge worker, parent, landscaper, or anything in between.
As a freelancer, increasing my productivity has allowed me to increase the amount of money I can make per hour. …
UIKit provides a nifty little spinning wheel we can display to the user when we’re waiting on something that the user can’t see. It’s considered a best practice to pop one of these up when doing something like a network call, so the person using our app isn’t clueless as to what’s going on. Basically, you create the spinner, and add it to your view. Then, just before a background task like an API request, tell it to animate. When the background request finishes, you just tell it to stop animating.
First, declare your spinner in the ViewController
var activityIndicator = UIActivityIndicatorView(style…
So recently I’ve been working on an iOS version of my Mock My Words app. It’s pretty simple in functionality so I wanted to compensate with a nice user interface. The main functionality requires that a user enter (or paste) in text of pretty much any size. Oftentimes iOS text entry with a UITextField, but that only offers single line input. For multi-line input, you have to use UITextView 😔. After throwing that in my app I was rather unimpressed with how it looked. So, I decided to put my own spin on it. …
About