Swift and general programming topics, Agile software development, soft skills

There are many programmers, good and, let’s be honest mediocre. However, all of them will find their place in this world ruled by IT, though most will stay unnoticed despite the fact they’re doing their job. If you want to outstand, it’s not sufficient to just close tasks in Jira

All active Swift community members have already learned about the new, built-in, concurrency support. This time I wanted to explore it in a useful to me context — a problem that has risen not once during my career: API calls with an automatic retrial mechanism.

Retriable API Calls with Modern Swift
Photo by Brett Jordan on Unsplash

First of all, let’s figure…

What is the real use for @autoclosure?

Thanks for the post Zafar! However, I think it doesn’t explain what @autoclosure really does and how it can be useful.

In your example you can pass functions directly as arguments: makeDecision(condition: true, actionTrue: action1, actionFalse: action2) without using @autoclosure.

Though, assume an action has a different set of parameters which are known beforehand: func action1(parameter: Int). Passing the function as an argument is no longer possible. What you can do is to wrap the call with a clojure: makeDecision(condition: true, actionTrue: { action1(parameter: 1) }, actionFalse: action2).

This is exactly what @autoclosure does for you automatically. Having the makeDecision function declared as in your example, you can now call it like this: makeDecision(condition: true, actionTrue: action1(parameter: 1), actionFalse: action2()), which is essentially the same as calling it like makeDecision(condition: true, actionTrue: { action1(parameter: 1) }, actionFalse: action2).

Photo by Matthew Henry on Unsplash

One of the programmer newbies that I’ve met said to me once (brooding deeply): I thought that the bigger the class, the better… You know, then it can do more!

Time goes by, newbies become experienced, and big mighty classes lose their attraction. Programmers start realizing that they need to…

Often referred as the project management triangle, the model is widely known by both software managers and engineers. Though, through my career, I’ve met a lot of people who either don’t know it, or don’t understand it, or even don’t pay much attention to it.

This blogpost tries to explain…

I’ve heard a couple of times kind words about me, that I’m effective and productive. Maybe I’m too naïve, but I took the words seriously. So, this time I decided to share with you a few things that help me stay effective. The most crucial thing is staying sane, happy…

This blogpost is the sequel to my Books That Will Boost Your Programming Skills where I share my absolute top list of books that any software developer should read. The list was not exhaustive, none can be. This time I want to share with you my further reading experience.

Photo by Jason Leung on Unsplash

1. General Computer Literacy — How Networks Work

Introduction to Networking: How the Internet Works by Charles Severance

Let’s…

Joshua Bloch’s Effective Java is commonly recognized among the top books about programming in Java. The book itself is a set of advices how to improve Java code’s maintenability, readabiliy, performance and reliability. It was said not once that Kotlin, the main Java’s successor, was developed with the Effective Java

Nikita Lazarev-Zubov

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store