Anitra and I arrived a little bit before the starting time, 6:00 p.m., and had the back patio all to ourselves:
The crowd arrived soon after, the sun set, and we got down to the business of talking about all sorts of things, from ChatGPT to a business idea so crazy it just might work to Tampa’s growing scene of tech events to cycling clubs to music, and so on.
Coders, Creatives, and Craft Beer is a pretty good summary of what this meetup group is all about. There are no presentations, lectures, or workshops. Instead, it’s just people getting together at an interesting Tampa Bay venue, tasting what comes out of the taps and kitchen, and talking about what interests us, what we’re working on, and what we’d like to work on.
I like to refer to the meetup’s general philosophy as “All conversations, no presentations.” The goal is to make new friendships and maintain current ones, exchange information, help each other solve problems, and if we’re really lucky, Tampa Bay’s next great endeavor — maybe a technological one, maybe a creative one, maybe even both — will come about because people met here.
The Corner Club is one of Seminole Heights’ many hidden gems. They’re a neighborhood café with lots of great food prepared from scratch (we recommend the papas bravas potatoes), an interesting drinks selection — with and without alcohol, including some really good coffee — and even local artists’ works on the wall for sale. I really like their outdoor space in the back, which is generally where we hold events when we’re there.
We hold Coders, Creatives, and Craft Beer meetups monthly, and we’ll announce the March event shortly. Thanks to everyone who came out last night — and yes, we’ll have more get-togethers soon!
Converting a number into its word form — for example, converting 1,234,456 into one million, two hundred and thirty-four thousand, four hundred and fifty-six — used to be a really painful exercise in programming. These days, there are libraries that save you from having to do this, and in the case of Swift, this functionality is built into its standard library in the form of the NumberFormatter class. Not only will it convert numbers into words, but it will also do so for many languages!
Open a Swift playground in Xcode and enter the following code:
// Swift
let formatter = NumberFormatter()
formatter.numberStyle = .spellOut
let number = 87654
let spelledOutNumber = formatter.string(for: number)!
print("\(number) spelled out is \(spelledOutNumber).")
Run the playground code, and you’ll see this:
87654 spelled out is eighty-seven thousand six hundred fifty-four.
Having come from the world of C, where you format strings using printf() and formatting strings, and later from other languages where you use whatever formatting method its string class provides, I’ve ignored most of Swift’s classes that derive from Formatter — with one notable exception: DateFormatter, which is indispensable when working with dates and times.
I’m now looking for an excuse to use this capability.
As I typed “DateFormatter” a couple of paragraphs above, I remembered that DateFormatter had a locale property. It’s for ensuring that any dates you present are in the correct form for the locale:
I wondered:
Does NumberFormatter have a locale property?
What happens if I changed it to something other than my system’s default of US English?
So I changed the code in my playground to the following:
// Swift
let formatter = NumberFormatter()
formatter.numberStyle = .spellOut
formatter.locale = Locale(identifier: "fil_PH")
let number = 87654
let spelledOutNumber = formatter.string(for: number)!
print("\(number) spelled out in Filipino is \(spelledOutNumber).")
I ran the code and saw this…
87654 spelled out in Filipino is walóng pû’t pitóng libó’t anim na daán at limáng pû’t ápat.
…and my response was “Ay nako!” (translation: OMG!)
How about Korean?
// Swift
let formatter = NumberFormatter()
formatter.numberStyle = .spellOut
formatter.locale = Locale(identifier: "ko_KR")
let number = 87654
let spelledOutNumber = formatter.string(for: number)!
print("\(number) spelled out in Korean is \(spelledOutNumber).")
The output:
87654 spelled out in Korean is 팔만 칠천육백오십사.
My response: 세상에 (“Sesange!”, which is pretty much Korean for OMG!)
She was recently the subject of an article in the Financial Times on January 24th (barely over a month ago) titled The rise of Esther Crawford in Elon Musk’s ‘hardcore’ Twitter. It tells the story of how she managed to become one of the few pre-Musk employees to parley their way into becoming one of “Space Karen’s” trusted lieutenants and in charge of several initiatives to make the company profitable, including Twitter Blue.
Her “sleeping bag” tweet raised a lot of eyebrows, including this short, yet spot-on response from Grady Booch, one of the patron saints of software development (and object-oriented programming in particular):
Crawford followed up with a multiple-tweet response:
[1] Since some people are losing their minds I’ll explain: doing hard things requires sacrifice (time, energy, etc). I have teammates around the world who are putting in the effort to bring something new to life so it’s important to me to show up for them & keep the team unblocked.
[2] I work with amazingly talented & ambitious people here at Twitter and this is not a normal moment in time. We are less than 1wk into a massive business & cultural transition. People are giving it their all across all functions: product, design, eng, legal, finance, marketing, etc
[3] We are #OneTeam and we use the hashtag #LoveWhereYouWork to show it, which is why I retweeted with #SleepWhereYouWork — a cheeky nod to fellow Tweeps. We’ve been in the midst of a crazy public acquisition for months but we keep going & I’m so proud of our strength & resilience.
[4] I love my family and I’m grateful they understand that there are times where I need to go into overdrive to grind and push in order to deliver. Building new things at Twitter’s scale is very hard to do. I’m lucky to be doing this work alongside some of the best people in tech. 💙
And it was great to see this follow-up from her supportive husband. I’m a firm believer that a marriage is a team, and kudos to Bob Cowherd for this tweet:
I have nothing but respect for Crawford’s drive, determination, and willingness to put in “crunch time.” I have nothing but praise for Cowherd’s supportiveness. Having worked for similarly careless, callous, and capricious bosses — they just didn’t come up from apartheid emerald money — I believe that Crawford’s intense dedication was wasted on Elon Musk.
My recommendation to any Twitter employee back in November was to leave, as I said in my November 7 post (5 days after Crawford’s “sleeping bag” tweet), Advice to laid-off Twitter employees being asked to come back. It even ends with the “sleeping bag” photo and this line:
If you can afford not to, don’t go back. You’re being asked to go back to Hell.
Some people on Twitter were more blunt — and in hindsight, prescient:
Loyalty to a company
I’ve had more than a few conversations — often over drinks, so these are backed by in vino veritas — where someone says that loyalty to a company is a sucker’s game. I think the truth is a little more nuanced than that.
A certain degree of loyalty to an employer who has earned it is actually a good thing. You’re more likely to be happy at work, and that’s important, as you’re that’s how you’re going to spend half your waking life from Monday through Friday. With this kind of loyalty comes two-way trust, and as Steven Covey puts it: Without trust, we don’t truly collaborate; we merely coordinate or, at best, cooperate. It is trust that transforms a group of people into a team.
I like and trust the company I work for and the team I work on. In fact, looking at the teams I’ve worked with in the past decade, the current one is my favorite. I like my manager, my manager’s co-managers, my “skip-level” manager, and the various C-level people, most of whom I’ve had the chance to meet (and even play accordion for). They have my loyalty — within reason — because I know that I also have their reciprocal loyalty — also within reason.
It’s clear to me that the organization isn’t a family. It’s a publicly-owned corporation that operates in the present-day economy. My relationship with the company is pleasant, cordial, and thanks to its culture, convivial, but I know it’s also transactional. Implicit in the employment contract between me and the company is the understanding that the basis of our relationship is that I give them my time and effort and they give me money.
Even with co-workers, managers, and C-level execs who I feel conduct themselves with decency and honor, my loyalty — which is considerable; I have Auth0 stickers on my accordion — is given with reasonable limits.
I would not extend that same loyalty to less decent, less honorable people. And I would most certainly not extend that loyalty to a vaingloriously venal weasel like Elon Musk.
When Musk first came to the San Francisco headquarters just before the deal closed, Crawford introduced herself in the Perch, Twitter’s on-site coffee shop, and secured a one-on-one meeting to discuss her ideas around payments and creators, according to multiple people familiar with the encounter.
And that “sleeping bag” photo? In the well-lit conference room? That’s somehow pristine clean even though everyone was in crunch mode? That ain’t no candid shot.
Also consider that Crawford grew up in a cult. In that kind of environment, you probably learn a couple of tricks on how to handle leaders who think they are the spokespeople for a higher power, or worse still, think they are that higher power.
I have worked at places whose mission I believed in, but whose management I did not. I believe that Crawford’s was a similar situation. And I took a similar approach, all the while readying not just Plan B, but the additional Plans C through G.
Keep this in mind…
Many people are going to dunk on Crawford for the next couple of days. Some of them will be from the Elon Musk fan club, who will say that she simply failed to deliver. Others will be Musk detractors, who will say that it’s what you get for working an egomaniacal autocrat.
Many of them will be the sort whose tendencies are to punish women for the sin of being ambitious. Keep that in mind.
So what are the lessons here?
Even if the purpose of this post was to dunk on Esther Crawford — and it isn’t — I would still be “punching up.”
Crawford came to Twitter by way of acquisition. Twitter bought the video chat startup she founded, Squad, in late 2020. While the amount wasn’t disclosed, a look at Twitter acquisitions shows that they haven’t bought any company for less than double-digit millions. She has a great resume, she can always point to that profile in Financial Times,and she’ll likely be featured in a “What Next?” piece in some other tech or business publication very soon. She can even trade on the story that she worked with tech’s biggest jackass.
Simply put: Crawford will most likely be fine.
This article is not really about her, nor is it for her. It is, most likely, for you, especially if you don’t have a six- or seven-figure cushion to fall back on when the going gets brutal at work.
In my opinion, the lessons to take away are:
If you can help it, don’t work for assholes. If the option is available to you, try to work for and with people with at least some character. And try not to work for self-serving, whim-governed, spoiled emperors.
If it can’t be helped and you have to work for an asshole, learn to manage them. And while you’re at it, formulate a plan to minimize your exposure from said asshole, or get away from them altogether.
Favor high-trust environments over low-trust ones. Yes, there are a number of high-paying low-trust environments out there. In fact, the high pay is often used as a way of making up for the low trust. They might be great for your bank account in the short term, but they’re terrible in the long term.
There’s a fine line between singing your company’s praises and bootlicking. Each of us has a different idea of where that line is drawn. And some of us will talk pretty loudly about it.
Build a support network. A supportive spouse or partner can be a great help if you’re working at someplace like the current Twitter, and a network of peers can often be your key to escaping to a different organization.
Here’s the “official unofficial” list of tech, entrepreneur, and nerd events for Tampa Bay and surrounding areas for the week of Monday, February 27 through Sunday, March 5, 2023. That’s right, we’re heading straight into a brand new month!
Coders, Creatives, and Craft Beer is having its monthly get-together on Tuesday at Corner Club in Seminole Heights at 6:00 p.m.! Find out more and register here.
Masterminds Tampa Bay is having a social night on Tuesday at Sparkman Wharf at 6:30 p.m..Find out more and RSVP here!
The Mainframe is a group dedicated to helping Florida’s Black techie talent launch and grow their careers. They’re presenting “The Mix,” their monthly social series, on Wednesday at 6 at Sal Y Mar restaurant. Find out more and register here!
On Thursday, Rapid7 and High Tech Connect are teaming up to have a tech fest in Rapid7’s new office starting at 5:15 p.m.! If you’re looking for work, you’ll want to check this out, as there’ll be networking, an open resume review and Rapid7 hiring update and overview. Find out more and register here!
Group
Event Name
Time
Wesley Chapel, Trinity, New Tampa, Business Professionals • Wesley Chapel, FL
If you’d like to get this list in your email inbox every week, enter your email address below. You’ll only be emailed once a week, and the email will contain this list, plus links to any interesting news, upcoming events, and tech articles.
Join the Tampa Bay Tech Events list and always be informed of what’s coming up in Tampa Bay!
// Kotlin
class ProgrammingLanguage(
var name: String,
var creator: String,
var yearFirstAppeared: Int,
var remarks: String,
var isInTiobeTop20: Boolean) {
fun display() {
println("${name} was created by ${creator} in ${yearFirstAppeared}.")
println("${remarks}")
if (isInTiobeTop20) {
println("This language is in the TIOBE Top 20.")
}
println()
}
}
Creating an instance is pretty straightforward:
// Kotlin
val currentLanguage = ProgrammingLanguage(
"Pascal",
"Nikalus Wirth",
1970,
"My first compiled and structured language. Also my first exposure to pointers.",
false)
When you run the code currentLanguage.display(), you get:
Pascal was created by Nikalus Wirth in 1970. My first compiled and structured language. Also my first exposure to pointers.
Suppose you want to change all the properties of currentLanguage and then display the result. If you’re used to programming in other object-oriented programming languages, you’d probably do it like this:
// Kotlin
currentLanguage.name = "Miranda"
currentLanguage.creator = "David Turner"
currentLanguage.yearFirstAppeared = 1985
currentLanguage.remarks = "This was my intro to functional programming. It’s gone now, but its influence lives on in Haskell."
currentLanguage.isInTiobeTop20 = false
currentLanguage.display()
For the curious, here’s the output:
Miranda was created by David Turner in 1985. This was my intro to functional programming. It’s gone now, but its influence lives on in Haskell.
Now, that’s a lot of currentLanguage. You could argue that IDEs free us from a lot of repetitive typing, but it still leaves us with a lot of reading. There should be a way to make the code more concise, and luckily, the Kotlin standard library provides the with() function.
The with() function
One of the first programming languages I learned is Pascal. I cut my teeth on Apple Pascal on my Apple //e and a version of Waterloo Pascal for the ICON computers that the Ontario Ministry of Education seeded in Toronto schools.
Pascal has the with statement, which made it easier to access the various properties of a record (Pascal’s version of a struct) or in later, object-oriented versions of Pascal, an object.
Kotlin borrowed this trick and implemented it as a standard library function. Here’s an example, where I change currentLanguage so that it contains information about BASIC:
// Kotlin
with(currentLanguage) {
name = "BASIC"
creator = "John Kemeny and Thomas Kurtz"
yearFirstAppeared = 1964
remarks = "My first programming language. It came built-in on a lot of ‘home computers’ in the 1980s."
isInTiobeTop20 = false
}
This time, when you run the code currentLanguage.display(), you get…
BASIC was created by John Kemeny and Thomas Kurtz in 1964. My first programming language. It came built-in on a lot of ‘home computers’ in the 1980s.
…and the code is also a little easier to read without all those repetitions of currentLanguage.
Suppose you wanted to print the string “Hello there!” three times. In any language that borrows its syntax from C, you’d probably use the classic for loop, as shown below:
// C99
for (int i = 0; i < 3; i++) {
printf("Hello there!\n");
}
// JavaScript
for (let i = 0; i < 3; i++) {
console.log("Hello there!");
}
With Kotlin’s for loop, you have a couple of options:
// Kotlin
// Here’s one way you can do it:
for (index in 0 until 3) {
println("Hello there!")
}
// Here’s another way:
for (i in 1..3) {
println("Hello there!")
}
If you’re used to programming in a C-style language, you’ll probably reach for a for loop when you need to perform a task a given number of times. The Kotlin language designers noticed this and came up with something more concise: the repeat() function:
repeat(3) {
println("Hello there!")
}
As you can see, using repeat() give you a shorter, easier to read line than for. And in most cases, shorter and easier to read is better.
Do you need to know the current iteration index? Here’s how you’d get that value:
fun main() {
repeat(3) { iteration ->
println("Hello there from iteration $iteration!")
}
}
Remember, you can use whatever variable name you want for that index, as long as it’s a valid name:
fun main() {
repeat(3) { thingy ->
println("Hello there from iteration $thingy!")
}
}
Note that repeat() is for performing a task a known number of times, without exceptions. It’s a function that takes a closure, not a loop structure. This means that the break and continue statements won’t work:
// This WILL NOT compile!
fun main() {
repeat(3) { iteration ->
// 🚨🚨🚨 You can’t do this 🚨🚨🚨
if (iteration == 1) {
break
}
// 🚨🚨🚨 You can’t do this, either 🚨🚨🚨
if (iteration == 2) {
continue
}
// “break” and “continue” work only
// inside a loop, and repeat()
// *isn’t* a loop...
// ...it’s a *function*!
println("Hello there from iteration $iteration!")
}
}
@kotlin.internal.InlineOnly
public inline fun repeat(times: Int, action: (Int) -> Unit) {
contract { callsInPlace(action) }
for (index in 0 until times) {
action(index)
}
}
To summarize: If you need to perform a task n times in Kotlin — and only n times — use repeat instead() of for!