Mary Dickson Diaz

Code, Life, Learning

Tag: app development

go on now

Hello readers!

It’s been awhile. Look how big my baby is now:

HUGE. And so many teeth. He’s walking all over, including all over his dada, and keeping us on our toes.

But I digress.

Earlier this year I had the opportunity to go to GopherCon. Since I resumed work in March, most of the work I’ve been doing has been in Go:

I rewrote an API service from Java to Go. The service has a handful of endpoints to manipulate filter strings including create, edit, get by id and get (all) by org, and uses some customized middleware based on go-kit for logging and etc.  Figuring out my way around all the company-specific middleware was complicated because it was created by a former employee to make Go development easier for Java developers (I am not a Java dev). Luckily, my very talented co-worker Amy had recently built a similar Go service and I was able to use her work as a template of sorts — while still dealing with a number of unique challenges to the project. Today, this “marketer” API runs in production servicing the marketer platform and a number of additional endpoints and services have been added.

Continue reading

evolution of forms of governance in a rails app

No, this isn’t a history lesson. It’s an observation about the governing political ideologies that a Rails app takes on over time. Witness:

At Birth: Libertarian 

A basic Rails app has some sort of landing page and usually a database with CRUD (create, read, update, destroy) functionality. Without authentication or authorization, any viewer can initiate any of those functions. Visitors have autonomy to navigate and manipulate the site according to individual judgement, which is why I consider this a libertarian state. An example is something like my Robot app, which, who knows what it will look like at any given point. You’ll all been very polite in not destroying all the robots (you’ve probably been tempted, though). In theory, you can edit other people’s robots and add or delete as many as you want. I still get to determine what data gets collected on the robots, which I suppose makes this a minarchy as opposed to anarchy (users can’t alter the database or page itself). Although, if the chief role of minarchism is to protect citizens against theft, this certainly won’t do that. Quite the opposite. I can’t protect your robots, people.

Soon-thereafter: Dictatorship 

It only takes one “poop” post for the app creator to realize that people on the internet can’t be trusted, and some sort of filters are needed. The most basic filter, where most beginning programmers will start, is Admin v. Everyone Else. Using a gem called “devise” (or something similar), Rails developers can add Users, which thus enables user roles. With users enabled and a minimal amount of programing, an app can be set such that an admin user can login and create, edit, and destroy content, and everyone else can read it. This is how my WordPress site is set up: there’s a login link, but it’s tiny and hidden down at the bottom of the page, because I’m the only one who’s ever logging in. Because I’m a benevolent dictator, you may leave a comment (which has to be approved by me if it’s your first one). This page is “marydickson.com,” so no one is really arguing against my authoritarianism, but maybe you want to invite some friends to create content with you. The “I-have-all-power/you-have-none” model isn’t going to cut it.

One last note on dictatorship: I’ve encountered a handful of webpages that require a log-in before you can see any content. I encountered one this week, in fact, clicking a twitter link enticing advertised as “Things I Wish Someone Had Told Me When I Was Learning How to Code.” Notice there is no link, because when I tried to click through I was redirected to a multiple-page application to apply to be an approved reader. That’s totally their prerogative, but I wasn’t up for that at 7am in bed lazy-clicking my way through twitter, and ps I’m unfollowing you.

“We’re Gonna Need a Bigger Boat”: Aristocracy

When multiple people get involved in the content creation, participation and/or maintenance of your app, you’ll probably need to have users enabled and the know-how to manipulate policies (in class we used the gem “pundit”). With these, you can set more sophisticated and personalized access for your Rails app visitors. Perhaps you have admin, “authors,” “moderators,” etc. On a smaller scale, I would like for my portfolio site to have comments enabled such that anyone can access and leave a comment, whether logged in or not, and where anonymous comments are held as “pending” until approved. Comment leavers should be able to edit or delete their own comments, but not other people’s. This is where I’m a bit stuck at the moment, with my default being to revert back to dictatorship until I figure it out.

Eventually: Direct Democracy? Something else?

On a more sophisticated app, you may have not only users, but user pages and *preferences* where users have the power to control their own settings about what other users (& maybe even admin!) can CRUD. This seems like it would put more power into the hands of the users, right? More towards a democracy? Ironically, there seems to be a correlation instead between more privacy settings and controls, and the value of the data being collected and ultimately owned by the app. Read this description and tell me it doesn’t perfectly describe a popular site we all hate to love:

Totalitarianism is a political system in which the state holds total control over the society and seeks to control all aspects of public and private life wherever possible.

I use that site, too, but they’ve basically said as much as the above^^.

An alternative is *diaspora, a social network where users explicitly retain ownership of their data (and which I haven’t heard much about since the sad death of creator Ilya Zhitomirskiy a few years back). Today the diaspora foundation operates according to three key philosophies: decentralization, freedom, and privacy.

This seems like a key question for any app creator to consider from the beginning: What principles and philosophies do you want to guide your app creation? What tools and skills do you need in order to integrate them?

© 2023 Mary Dickson Diaz

Theme by Anders NorenUp ↑