Mary Dickson Diaz

Code, Life, Learning

Month: September 2015

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?

a parking garage

don’t mind me, just uploading some pictures to circumvent aws…

parkingSketchparkingUML

I am really bad at drawing cars.

oh what’s this? more pictures that need to be uploaded and not on aws…

20150914_144849

this sketch had such potential…

(since this post is titled parking garage I’m just going to keep sticking photos here that need an html page bc too lazy/exhausted to upload to custom domain.)

Screen Shot 2015-10-06 at 10.48.08 PM Screen Shot 2015-10-06 at 10.49.13 PM

Screen Shot 2015-10-08 at 11.04.38 PM Screen Shot 2015-10-08 at 11.04.55 PM

deb-artvillagerstim-beermalcolm-comichotairballoonscb2fences

 

Digital DocentMary Dickson Fuzzy Searching YouTubeMary Dickson Markov Chains YouTubeScreen Shot 2016-02-23 at 3.16.09 PMScreen Shot 2016-02-29 at 8.57.06 PM

the unhappy path

20150909_163445

Mount Rainier as seen from Seward Park, 9/9/15

(Heads up: this post deals with a health issue of a personal nature, invoking a metaphor from my experience learning Behavior Driven Development (BDD) testing. I felt it was important to share my experience, not only with friends and family but with others, internet searchers, who might be facing something similar. If that makes you uncomfortable or seems too intimate based on our limited relationship, feel free to give this one a pass.)

In my class we’ve been studying behavior-driven development (BDD), a relative of test-driven development (TDD), which takes an approach of: let’s write tests first that describe how we want our app to behave, and then write the code to make those tests pass.

So for example, here’s a simple test excerpt for the main section of my in-progress portfolio page:

feature "CanAccessStaticPages" do
  scenario "on the index page" do
    visit "http://www.marydickson.info"
    page.must_have_content "Mary Dickson Diaz"
    page.wont_have_content "hookers and blow"
  end
end

You can program your tests to click on things and fill in information to test, say, posting a blog post, or a log-in/log-out function. “Or you could just go click on stuff and see if it’s working” –yes but writing the tests in advance, and keeping them updated, saves immense developer time and energy over time, over changes, and when coding on teams and to scale.

Continue reading

the struggle is real

Hey folks, happy Labor Day!

I survived week 1 of the Ruby on Rails bootcamp. We’ve had to do a lot of work and reflection in class about what we’re learning, which makes me less inclined to write about it here. Yet. Stay tuned. In the meantime, you can take a peek at my portfolio site, which is build in Ruby on Rails and uses foundation zurb for the layout elements. It’s served on Heroku and redirected to a custom domain (that I got on sale for $4 from namecheap). Eventually–and in theory–it could replace this WordPress site altogether!

Introducing: marydickson.info

Please, internet, behave yourself around the blog tool until I get user authentication in place (this week probably).

My first week was overall very positive with one small hitch in the form of some medical issues I’m dealing with (remember when I was all, “let’s get the doctor visits etc out of the way before class starts”? Yeah, I did not do that, nor would it have necessarily helped). This means that I haven’t been able to devote 100% to the material and assignments, but this long weekend was a good chance to catch up.

In reflecting on how my health needs might potentially conflict with a high-impact, time-intensive program, I’ve also come to peace with the fact that two months is essentially an arbitrary amount of time and this might take me longer. Which is not to say that I don’t intend to work hard, do my best, and take full advantage of the excellent resources available to me during that time. But if my body is telling me to go take a nap, coding will still be there when I wake up.

It also might not take me longer, which would be great. But I’m prepared for the possibility. As of this moment I’m a member of the Caught-Up Club.

I have to give a lightning talk next week. What should I talk about?!

© 2017 Mary Dickson Diaz

Theme by Anders NorenUp ↑