I’ve been an active IT and programming trainer and teacher for more than 15 years… and a lot has changed during this time. I still remember my first PhoneGap course that was conceived for an important software agency in Rome to reach the most popular goal of that era: developing mobile cross-platform apps using existing programming languages.
Is this goal becoming meaningless or impossible to reach today?
Even if it may sound weird, things are quite similar to when I developed my first app using Cordova/PhoneGap and jQuery mobile (yes!). Technology brought a lot of hardware innovation if you check smartphone and tablet capabilities, but if you look at the software engineering side, the only real advancement is that tools, programming languages, frameworks, stacks, IDEs, and everything connected to software development are just better. …
It may sound weird. It may sound extreme. It may sounds unconventional. But extracting random documents from a MongoDB collection is actually a common behavior that sooner or later every programmer must be able to implement and reproduce.
After all, you really need to be able to randomize documents extraction.
Imagine a use case or an app where you have to randomize information to show, even with a basic algorithm and not necessarily purely casually. Apps show randomic or pseudorandomic data more often than you think to cycle content and to make them appear always fresh.
Instagram, itself, uses an approach not much different than that to select pictures to show in their Explore section. …
As with any OOP language, there is a correct way to compare objects and clear up any confusion about the
== and the
=== operators. In this brief guide, I’ll explain those operator semantics and how to implement the
Equatable protocol to customize your comparison result and behavior.
In Swift, the equals operator has almost the same goal it has in other object-oriented programming languages: It compares objects by reference. First of all, keep in mind that the expected boolean depends on what kind of things you’re comparing. In Swift, variables can be value types or reference types. The first “family” of variables holds values, whereas the second holds memory references. So if you’re using objects instantiated by a class schema, the
== operator compares references and not values. …