1,206 karma · joined February 10, 2016
> Unicode, formally The Unicode Standard,[note 1][note 2] is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems
People write smiley faces, but there was already a code point for basic smileys.
I think standardized emoticons are a good thing, but I don’t think the Unicode spec is where they best belong.
I definitely didn’t give deep enough into proper color theory for my algorithm—I just use the Euclidean distance between (R,G,B) colors to determine similarity. I’d also like to add checks for contrast/legibility between colors maybe.
Funnily enough, the podcast was ATP, wherein Marco Arment frequently discusses his podcast app Overcast.
Theoretically it would be probably be optimal in terms of the science of visual perception to flood my room with the brightest white light possible, instead of using my usual dimmed yellow lights. It would also make me feel subjectively terrible (like my eyes were bleeding) so I don’t do it, and I don’t need a study to back it up.
I'm curious, how many of my fellow dark-mode users also struggle with migraine headaches? Perhaps this and other light-sensitivity afflictions can explain why dark mode seems to be so contentious...
I moreso meant in terms of the high-level features of Rust and how they integrate FP-style patterns into a C-style imperative language. Like tuple-based structs as discussed above, or control flow as expressions, like if and match.
The alternatives to the latter in Swift are
A) defining a dedicated function for the control flow, using return statements
B) defining but not initializing a let constant before the control flow statement
C) using the ternary operator, which is concise but doesn’t really allow for destructuring complex types
all of which are more verbose, less clear in intent, and IMO don’t embody’s Swift’s mantra of “clarity at the site of use” as well as Rust’s approach.
I could just use rawValue as the field name every time, but foo.rawValue is a lot less readable, IMO, than foo.0
Watch either of Ang Lee’s HFR movies (Billy Lynn/Gemini Man) and you’ll understand what I mean. HFR breaks suspension of disbelief. I didn’t want this to be true but I’ve come to accept that it doesn’t really have a place in cinema at least for now.
I often find myself thinking of Swift as a not-quite-fully-baked attempt at making a Rust, and this reinforces my impression.
So if I have two types, both of which can be represented by an underlying Int, but have entirely different semantics or methods (for instance, LosslessStringConvertible or various computed fields based on the underlying Int), I have to wrap the underlying type in either an enum with a single case or a struct with a single field, obscuring the meaning of the type and requiring awkward duplicate naming of the struct field/enum case.
The ExpressibleBy*Literal protocols are some help here, allowing Int/String/Array literals to be directly assigned to the type, but this only helps for assignment and not for retrieving the underlying value (and only applies when the type can be initialized from the literal without any failure cases).
It’s not a huge deal, but a simple newtype statement would make the generics system far more general and easy to use imo.
You led me to finally track down the name of this feature in Bash: "brace expansion"! I often wish my non-techie friends recognized this syntax, along with sed replacement syntax for fixing typos.
> I was very excited with it at the beginning, but the few times I dipped my toe it was frustrating and slow.
Okay, it definitely can be slow to compile, especially with large blocks of type-inferencing ResultBuilder DSLs like SwiftUI or RegexBuilder. I find this mostly occurs when there's a type error within the DSL, and it often takes forever for the compiler to stop trying to do inference and give up with "Type of expression is ambiguous without more context" or simply "The compiler is unable to type-check this expression in reasonable time". But in practice I rarely run into this issue unless I'm creating a massive hierarchy that should be split into smaller components anyway. And I haven't really run into issues with runtime performance yet, though I haven't made anything too performance-critical with it. In any case, Swift makes it decently easy to call out to C/C++/Objective-C if you had a performance-critical routine.
What I like about the language:
It gives me the satisfaction of languages like Rust that let me express types and logic in a way that feels "correct". I rarely feel like I'm hacking stuff in due to deficiencies in the language. Swift encourages a standard approach of record types with polymorphism but still supports legacy NSObject-based stuff in a logical way, so I never feel like I have to jump through too many hoops if I need to touch dusty old frameworks.
I like the type inference, even if it's not perfect category-theoretic Hindley-Milner magic and gets stuck sometimes as mentioned previously.
I like the `guard` statement as someone who's done a lot of Go programming and always instinctively used early returns even when my CS professors told me it was a bad practice ;)
SwiftUI is really nice to use and is the only UI framework that I've ever enjoyed using (and am hoping to write it for my job soon)--it sometimes feels more like a UI prototyping tool to me because it's so straightforward, except that at some point while prototyping, you realize you've already made the finished UI without writing a dreadful mountain of glue code and interface files!
I really like the syntax in general, though I also appreciate Rust's terse symbol-based approach, I think the English-like labels actually work really well despite being a bit verbose. It definitely benefits from an editor with autocompletion, but I wouldn't say it's strictly necessary.
I appreciate the strict Unicode-correctness of the language that makes it harder to do bad stuff with strings.
I think the ARC-based approach to memory management is a good balance between Go's GC and Rust's borrow checker that makes Swift feel like a very pragmatic choice for lots of different problems (though UI was obviously first in mind).
I really like the ArgumentParser and RegexBuilder frameworks, and I think they're the best implementations of each in any language I've used.
In general, Swift just feels good to write and easy to read while being extremely powerful in what you can create with it, and coupled with the ease of use and fast feedback of SwiftUI, feels like a very complete approach to creating many different sorts of software, for my own use or to sell.
I write Go for work and my all-time favorite language is probably still Rust, but I find that a ton of really thoughtful and smart choices have gone into Swift-the-language as well as how it’s used to build apps.
Happy to expand more on what I like about using Swift if you’re curious.
[1] which you can now write as the same codebase using SwiftUI
Didn’t they mean “implemented in Chrome and therefore forced into the CSS standard due to browser monoculture”?
I also find that combined ibuprofen and acetaminophen has the best results, though if I had to choose one for a desert island I’d take Advil Liqui-Gels since they don’t hurt my stomach if I haven’t eaten/am unable to eat.
But if I’m searching for e.g. a “simple monitor hardware brightness control for Mac” without extra nice-to-have features or GUIs, a project that describes itself as “simple” gives me a useful clue that the developers might have priorities that match my needs.