How to Spot Fake News Online

Not sure which sources to trust when you’re online? These browser plug-ins and online tools can help you figure out how to detect fake news sites. Fake news has become a pervasive problem on the…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




A Taxonomy of Dependencies

Control Flow and Data Flow in Software

As someone who writes code during the day, I’ve spent a fair amount of my waking hours thinking about dependencies. You know, those pesky things that make it so hard to make your change without breaking whole swaths of the application, but are also oh-so-hard to get rid of because they are too-darn useful.

In the course of managing and grappling with such beasts, I developed a taxonomy for describing dependencies in software systems. I’ve already found the terminology to be helpful in my own designs, and want to share it widely. Hence, this post.

Let’s start with a definition of Control Flow and Data Flow. These terms are core to the rest of this post, so I want to start by establishing an understanding of my meaning of these terms.

To get a picture of control flow, imagine you could see all of your code laid out in large space. When your program executes, the CPU is a spotlight shining its execution power onto sections of code, and that the spotlight moves or “flows” over time to shine on different sections. (If you have multiple cores working, you have multiple spotlights). The spotlight will jump around over time, flitting from one function to another, one file to another, one application to another.

Thus, when I say Thing A is upstream in control flow, that means its code is being executed before Thing B (and maybe afterwards too; i.e. if B returns, and A continues executing afterwards).

To get a picture of data flow, instead imagine your code as a series of pipes. Each function could be a section of pipe, or even a junction. Then imagine the data of your application (database rows, request payloads) as free floating balls in space around the pipes. Each code-pipe takes a data-ball as input and produces data-balls as output. We can then ask: over time, where does the data move from and move to? Equivalently, when does a module give vs receive a pointer to a value?

Thus, when I say Thing A is upstream in data flow, that means data flows from Thing A into Thing B. More mechanistically, that means Thing A is the first to have a pointer to certain data, and then gives a copy of that pointer to Thing B.

Add a comment

Related posts:

Milestones

Growing up is hard. I feel like we don’t get prepped enough for adulthood. You just figure out this stuff as you go. Each stage of growing up the goal post is constantly being shifted. There are…

Breathe Green Charcoal Bags

If you could naturally rid your home of odors, mold, bacteria and allergens without lifting a finger, would you do it? Millions of Americans are doing just that, thanks to the brand new Breathe Green…

iOS Custom Universal Framework

Create new project. “iOS Custom Universal Framework” is published by Supapon Pick Pucknavin.