MacBook, defective by design banner

title:
Put the knife down and take a green herb, dude.


descrip:

One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com

Using 89% of the same design the blog had in 2001.

FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white.

As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green.

x

MarkUpDown is the best Markdown editor for professionals on Windows 10.

It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support.

Features you won't find anywhere else include...

You've wasted more than $15 of your time looking for a great Markdown editor.

Stop looking. MarkUpDown is the app you're looking for.

Learn more or head over to the 'Store now!

Sunday, October 20, 2019

I installed Catalina on a partition so I could play around with SwiftUI. I certainly like how clean the syntax is, and figured if this was the future of the AppleOSes (all of ’em), it might be a good time to break down, throw away the Xamarin, and learn Swift “for real”.

Problem is, though the tutorial on Lists in SwiftUI at Apple renders amazingly, it’s ultimately a pretty crappy intro that assumes that you’re already familiar with Swift. That might not be insanely unfair for most reading about SwiftUI, but it’s not super helpful to me. How do you set up reading from that local json file in a fresh project? What’s an underscore mean in these contexts? What’s the difference between private and fileprivate and is its use as anti-pattern as it looks?

This tutorial on Medium covers exactly the same material in a much more novice-friendly fashion, ending exactly at the same place. It might be improved if it had the slick rendering in the right column of Apple’s, but if I have to chose one tutorial over the other, it’s the one that starts slow and ramps up painfully deliberately over the flash-bang, everyone already understands most of this tutorial every time.

Labels: ,


posted by ruffin at 10/20/2019 10:46:00 AM
Saturday, November 24, 2018

From an introduction to Swift I find myself reading today:

But what if we forget the verification like below?

var stockCode:String? = findStockCode("Facebook")
let text = "Stock Code - "
let message = text + stockCode!  // runtime error

There will be no compile-time error. The compiler assumes that the optional contains a value as forced unwrapping is used. When you run the app, a runtime error is thrown with the following message:

fatal error: Canโ€™t unwrap Optional.None

Huh?!! Then what’s the point?

We’re far enough along in 2018 that a language could have come with forced linting. The compile-time error should be, “Use of a force unwrap on an optional without a nil check is not allowed.”

I’ll admit I’m glad Swift exists. I thought it’d be fun to research SpriteKit and hack up a quick 2D game to relax, and Objective-C looks a little bit more of a head rethread than my usual [stolen] line that “all programming languages are just dialects of the same language”.

But it’s a pain that Swift’s let means the opposite of what it does, so to speak, in JavaScript, and this “Hey, we force one level of null checks in the language, but then reintroduce the ability to have run-time null errors just like you had before,” doesn’t seem really well thought out.

Linters ftw, imo.

Labels: , ,


posted by ruffin at 11/24/2018 04:16:00 PM

<< Older | Newer >>


Support freedom
All posts can be accessed here:


Just the last year o' posts:

URLs I want to remember:
* Atari 2600 programming on your Mac
* joel on software (tip pt)
* Professional links: resume, github, paltry StackOverflow * Regular Expression Introduction (copy)
* The hex editor whose name I forget
* JSONLint to pretty-ify JSON
* Using CommonDialog in VB 6 * Free zip utils
* git repo mapped drive setup * Regex Tester
* Read the bits about the zone * Find column in sql server db by name
* Giant ASCII Textifier in Stick Figures (in Ivrit) * Quick intro to Javascript
* Don't [over-]sweat "micro-optimization" * Parsing str's in VB6
* .ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture); (src) * Break on a Lenovo T430: Fn+Alt+B
email if ya gotta, RSS if ya wanna RSS, (?_?), ยข, & ? if you're keypadless


Powered by Blogger etree.org Curmudgeon Gamer badge
The postings on this site are [usually] my own and do not necessarily reflect the views of any employer, past or present, or other entity.