I like to try to write things iteratively, so to start, I just want to put a thing up here, or over there. So, I guess I want CSS?
Well, I want some concepts of CSS, but do I actually want CSS? I definitely do not want the baggage, but I do want simple and familiar.
Thinking About Layouts
One night, as I was working on margins/padding and trying to remember which one does which, I called up a coworker to talk about it, as well to discuss some other ideas. As I was describing how I thought I needed to implement lots of these specific CSS features, we started discussing really what layouts are and what they set out to accomplish.
I do not believe we resolved the margin vs, padding question, but it did get me thinking. I sat with a notebook and just wrote out "Layouts," then stared.
Eventually, more words appeared on the page:
"Layouts programmatically put things somewhere.”
I went further to define "somewhere" as the top, bottom, left, right, and center. This seemed as simple as I could make it.
So, Scenic, in my opinion, could really use a layout engine. I mean… how hard can that be?
What does a layout engine need to do? Position things. What are the possible positions? Top, bottom, left, right, center. That’s it. All we need to know now is the perspective of those positions.
That’s really it, right? Layouts are so easy! Okay, so what more might be nice? Columns? That gives us a good place to start.
Creating a Layout Library for Scenic
The above is the story of how I decided to create Layout-O-Matic, a layout library for Scenic. It incorporates both simple grids as well as complex. As my experience is specifically in web, I took all of my learnings from that domain. Ultimately, I set out to provide the most intuitive and simple API to help you “layout” your Scenic apps. The lessons learned here in API design deserve another post on how we can all be better.
The Layout-O-Matic has lots of sharp edges, but it is a starting point that took me on an engineering journey that resulted in confidence as a developer and a deeper knowledge of programming.
While I hope the library will be used, I, more importantly, hope it starts some conversations around how the community wants to use Scenic and how we want layouts to work. Do we want to start over? Will we suffer adoption if our API is not familiar? Do we want to adapt known and familiar APIs, or will we end up unhappy with continuing a pattern of frustration with the way things are?
Whatever we choose, it is exciting to have a framework like Scenic to get us thinking about the basics in all-new ways.
Looking for a development team that likes to dive deep into questions like these? Tell us about your project today.