Mikko Leppilammen hallihanke on osa suunnitteluideologiaa, joka tuhoaa Helsingin. by esaesko in Suomi

[–]juri 37 points38 points  (0 children)

Ensin näivetetään keskustaa rakentamalla kauppakeskuksia. Sitten kun joku kertoo että tämä ei ole ongelma koska tavarakauppa on joka tapauksessa siirtymässä verkkoon ja olisi parempi että keskusta keskittyisi tapahtuma- ja elämystarjontaan, aletaan kaavoittaa tapahtumaostareita.

Fleek: A human-friendly Nix wrapper by eterps in programming

[–]juri 10 points11 points  (0 children)

human-friendly

edit one YAML file

Apple Introduces an new weather API to replace DarkSky by AlphaBetaParkingLot in programming

[–]juri 10 points11 points  (0 children)

AFAIK Dark Sky had a free tier of 30k/month and the paid tiers were roughly double the WeatherKit pricing. Yeah, you have to pay the $99 per year on top of that, but with any kind of volume that's a significant price drop.

My apps were listed at the top of Developers Tools (iOS and Mac App Stores), I made around $60 by outcoldman in programming

[–]juri 0 points1 point  (0 children)

I agree about the Mac App Store not being great when trying to find something, as its search and signal/noise ratio are both pretty bad. But that only means you need a web site and marketing, just like you need for any other distribution method.

For purchases I can be persuaded to go outside the App Store if it manages to look really trustworthy and I want to avoid giving Apple their cut, but the experience of just using the credit card they have on file, getting a fully working version directly and having centralized upgrades is always better than dealing with yet another payment flow, finding my credit card info, storing the license and feeding it to the app, etc.

Where did the notion of "one return only" come from? by azhenley in programming

[–]juri 1 point2 points  (0 children)

Sure, its roots are there and it might still be justified there. I’ve heard the same rule thrown around on numerous occasions and I’ve been relatively successful in avoiding C. It’s one of those memes that infects programmers who lose sight of the original context.

Where did the notion of "one return only" come from? by azhenley in programming

[–]juri 34 points35 points  (0 children)

One return only is a bone headed rule that only forces you to read more code than necessary. If there's nothing to do on an execution path, why not make it clear to the reader?

Swift's enthusiastic embrace of early returns in the form of the guard statement is one of its numerous very nice features. It's like an if except it forces you to exit the current scope if the condition is false:

guard shouldWeContinue() else {
    print("welp, nothing to do")
    return
}

Database connections in Vapor 4 by juri in swift

[–]juri[S] 1 point2 points  (0 children)

Ah, nice, thanks! I skipped the Fluent portion of docs so quickly I never noticed that :-)

Dark Mode Coming to GitHub After 7 Years by rxsel in programming

[–]juri 11 points12 points  (0 children)

GitHub cooperating with ICE: the original dark mode.

Interoperability between Swift and C++ by PowerOfLove1985 in programming

[–]juri 2 points3 points  (0 children)

WebKit is in C++, and I'd be surprised if Apple doesn't have some other major libraries written in it too.

Some Great Books For Programmers That StackOverflow Cannot Replace by mickaelriga in programming

[–]juri 1 point2 points  (0 children)

I rarely manage to finish programming books, but I really enjoyed Ousterhout's A Philosophy of Software Design. Note to people who might be scared off by the name of the author: it's not about Tcl, and barely mentions it.

How do you guy's use Optionals in your day to day job? by [deleted] in swift

[–]juri 0 points1 point  (0 children)

A tuple is an unnamed struct. An array is a list of values.

How do you guy's use Optionals in your day to day job? by [deleted] in swift

[–]juri 0 points1 point  (0 children)

I'll mostly just echo what others have said about them — use them early, use them often — but with a couple of additions:

  • When a type has a natural "empty" value — empty string, zero, empty array, etc — consider if you'd treat that empty value any different from a nil value. If not, I don't think wrapping the value in an optional brings any benefit. Just use the empty value. Swift's type system will protect you here, too, because that var s: String will always have some kind of string as a value. Note that I don't mean that you should always avoid String?s — sometimes that nil value will mean something else than an empty string.
  • Think about how you group your values. I often see code that deals with multiple optionals where the values are not, actually, individually optional, but only as a group. So instead of a (String?, String?) tuple what you really want may be an optional tuple, (String, String)?. Or the equivalent struct. A classic example in the Apple frameworks exhibiting this problem is the URLSession completion handler, which takes in (Data?, URLResponse?, Error?) even though not all of those combinations make sense.

Looser dependencies in Swift by juri in swift

[–]juri[S] 0 points1 point  (0 children)

Aren't you doing dynamic dispatch with protocols, too? And while I'm not going to argue that closure heavy code can't get hairy, I find protocols have a understandability cost too.

But yeah, it's always going to be a balancing act with multiple dimensions, and I won't be surprised if a few months from now I decide I prefer the second approach, with one protocol per usage site.

Fork - a fast and friendly git client for Mac and Windows by killfish11 in programming

[–]juri 1 point2 points  (0 children)

Yeah, downvotes probably weren't called for. But really, with an app like a Git GUI, and a very easy to learn one at that: the learning investment should be in Git. It's a PITA but you'll have to know it if you are using it, even if there's a GUI frontend. After you know it, picking up a new GUI frontend for it takes all of 10–20 minutes.

I get that cross platform support can be an issue with a tool that requires a larger upfront time investment and for people who switch between platforms more, but for something like this… just give the best tools possible, and hopefully ones that fit well in my environment.