Customized Remote Work Solutions From the World’s Largest Fully Remote CompanyCustomized Remote Work SolutionsLearn More

Toptal Engineering Blog

The Toptal Engineering Blog is a hub for in-depth development tutorials and new technology announcements created by professional software engineers in the Toptal network.

EngineeringIcon ChevronTechnology

An Introduction to Mocking in Python

by Naftuli Kay

More often than not, the software we write directly interacts with what we would label as "dirty" services. In layman's terms: services that are crucial to our application, but whose interactions have intended but undesired side-effects—that is, undesired in the context of an autonomous test run. For example: perhaps we're writing a social app and want to test out our new 'Post to Facebook feature', but don't want to _actually_ post to Facebook every time we run our test suite. The Python `unittest` library includes a subpackage named `unittest.mock`—or if you declare it as a dependency, simply `mock`—which provides extremely powerful and useful means by which to mock and stub out these undesired side-effects.

9 minute readContinue Reading
EngineeringIcon ChevronData Science and Databases

Anti-Patterns in Telecommuting

by Steven S. Morgan

As a veteran telecommuter through multiple jobs in my career, I have witnessed and experienced the many joys of being a remote worker. As for the horror stories, I have more than a few I could tell. With a bit of artistic inclination and a talent for mathematics, I also have a fascination with patterns: design patterns, architectural patterns, behavioral patterns, social patterns, weather patterns—all sorts of patterns! When I first encountered anti-patterns, I discovered a trove of wisdom I wish I had known before I had learned the hard way. Anti-patterns are recognizable repeated patterns that contribute significantly to failure. For example, the manager that keeps interrupting the employee in order to see if the employee is getting any work done is engaging in an anti-pattern that serves to prevent the employee from getting any work done! Based on my own experiences and experiences of friends and co-workers, I am assembling descriptions of anti-patterns related to telecommuting.

16 minute readContinue Reading
EngineeringIcon ChevronTechnology

Great Developers Know When and How To Refactor Rails Code

by Radan Skoric

>If it ain't broke, don't fix it. It's a well known phrase, but as we know, most of the human technological progress was made by people who decided to fix what isn’t broken. Especially in the software industry one could argue that most of what we do is fixing what isn’t broken. Fixing functionality, improving the UI, improving speed and memory efficiency, adding features: these are all activities for which it is easy to see if they are worth doing, and then we argue for or against spending our time on them. However, there is an activity, which for the most part falls into a gray area: refactoring, and especially large scale refactoring.

14 minute readContinue Reading
EngineeringIcon ChevronData Science and Databases

With a Filter Bypass and Some Hexadecimal, Hacked Credit Card Numbers Are Still, Still Google-able

by Gergely Kalman

In 2007, Bennett Haselton revealed a minor hack with major implications: querying ranges of numbers on Google would return pages of sensitive information, including Credit Card numbers, Social Security numbers, and more. While Haselton's hack was addressed and patched, I was able to tweak his original technique to bypass Google's filter and return the same old dangerous results.

6 minute readContinue Reading
EngineeringIcon ChevronWeb front-end

A Step-by-Step Tutorial for Your First AngularJS App

by Raoni Boaventura

If you haven’t tried AngularJS yet, you’re missing out. The framework consists of a tightly integrated toolset that will help you build well structured, rich client-side applications in a modular fashion—with less code and more flexibility. One of the reasons I love working with AngularJS is because of its flexibility regarding server communication. Like most JavaScript MVC frameworks, it lets you work with any server-side technology as long as it can serve your app through a RESTful web API. But Angular also provides services on top of XHR that dramatically simplify your code and allow you to abstract API calls into reusable services. As a result, you can move your model and business logic to the front-end and build back-end agnostic web apps. In this AngularJS tutorial, we'll do just that, one step at a time.

11 minute readContinue Reading
EngineeringIcon ChevronWeb front-end

Introduction to Responsive Web Design: Pseudo-Elements, Media Queries, and More

by Tomislav Krnic

Nowadays, your website will be visited by a wide variety of devices: desktops with large monitors, mid-sized laptops, tablets, smartphones, and more. To achieve an optimal user experience, your site should be adjusting its layout in response to these varied devices (i.e., to their varied screen resolutions and dimensions). The process of responding to the form of the user's device is referred to as (you guessed it) responsive web design (RWD).

8 minute readContinue Reading
EngineeringIcon ChevronTechnology

Why Writing Software Design Documents Matters

by Christopher J Fox

If you're an experienced developer, you've probably progressed from being a humble tester to a senior developer, and if you're a freelancer, you've made another leap, perhaps the biggest of them all, when you started working with clients directly. Some clients aren't in the software business; they're in an entirely different industry that needs a piece of software, and they don't have a clear and precise vision of what they want from you. This is a far greater challenge than it appears, and here's what you can do to improve client communication and project documentation.

8 minute readContinue Reading
EngineeringIcon ChevronTechnology

Hunting Java Memory Leaks

by Jose Ferreirade Souza Filho

Inexperienced programmers often think that Java's automatic garbage collection frees them from the burden of memory management. This is a common misperception: while the garbage collector does its best, it's entirely possible for even the best programmer to fall prey to crippling memory leaks. In this post, I'll explain how and why memory leaks occur in Java and outline an approach for detecting such leaks with the help of a visual interface.

14 minute readContinue Reading

Join the Toptal® community.