 So how is everyone doing? So thanks for coming to my talk. I'm really excited to be here at RailsConf. My name is Emily, and I am a software engineer at Wayfair. But I come from an art history background, which you probably guessed from the topic. So today, I'm going to explore how we think about the act of programming. And one of the ways we do it is through metaphor. Two powerful metaphors are code as art and code as craft. And although we often equate the two, as they are both about how we make things, they have completely different implications. Code as craft is widely popular and has really taken strong root already. Code as art is more of an emerging fringe metaphor. And since you don't hear about it as often as it's overshadowed by and sometimes confused for the craft movement, I wanted to build a case for it and show you why it's different and why it deserves to be its own separate thing. And hopefully, this can help you answer the question of what is code, art, or craft? But most of all, I just kind of wanted to spark discussion and get people to think about what coding and creating means to them. Even if they don't think it's one or the other, or something else entirely different. Cool. So let's start with metaphors. As we all know, metaphors are direct comparisons of one thing to another. And now the language of computing abounds with metaphors. Garbage collection is the term for automatic memory management. We have folders, directories, and pages, none of which are actually any of those things. Meanwhile, in object-oriented programming, you have parents and children and ancestors and descendants. And when you connect to an outside program, you perform a handshake to agree on a connection protocol. And I'm sure all of you can think of many more. But the point I'm trying to make is that we can see how on even these smaller levels, metaphors help us quickly conceptualize and understand something complex by comparing it with something really familiar. Though packaged into so few words, they can conjure up an entire story and express a multitude of meaning all at once. Metaphors matter because they shape the way we think about things for ourselves and how others might also think about them too. And that's why I wanted to talk about the larger metaphor to describe coding. Because that's what we do for a living. We spend 40 hours a week doing it. That's most of our waking hours, right? So we should be thinking about what it means to us and those around us, right? So the metaphor we use to describe coding provides guidance and a framework to understand it and helps us comprehend the answer to the hows and the whys. So the first movement I wanted to talk about is code as craft. And I wanted to talk about what the metaphor entails, how it's been applied, and then I'd like to think about how it's influenced our community. So what is craft? In pure folk definition as sociologist Howie S. Becker puts it, craft consists of a body of knowledge and skill used to produce useful objects. But there is a huge history to craft which predates us hundreds of years and its strong history and traditions deeply inform and underlie what the term means to us today. So if we were to hop back into a time machine into the medieval ages, we'd find craft skills, which were associations of makers. Now, every single craftsman belonged to a guild and they were a vastly important part of civic life. And they supported the central mode of production for everyday needs. You had silversmiths and stone masons and lace makers and cobblers and bakers and every single specialization of handmade good you could think of. And these guys trained their entire lives to become masters of their trade. And they did this through a really defined accomplishment system. Your typical craftsman started out as an unpaid apprentice, usually super duper young. You see the guy in the back there? He's an apprentice and he's probably like 12 years old. So super young. And he would move into this master to train. And although he was only learning the basic technical aspects, his life 100% revolved around his work. He lived, breathed and slept his craft. The apprentice would claw his way up to the ranks of a journeyman when he was finally good enough to produce stuff and get paid for his labor. Now, he could stay at this level or spend the next several years gunning for the rank of master. And as a master, he was a highly competent craftsman who could set up his own shop and take on apprentices to pass on the traditions. So you see the parallels here? Yeah, cool. And while guilds functioned as forums for nurturing competence, they also emphasized a sense of community. In addition to the strong tradition of mentorship, guilds involved close collaboration. Members worked really close to one another teaching each other stuff and giving advice. Craftsmen also really cared about their customers. They wanted to produce a good quality end product. So they inspected the workmanship quality of all items and regulated prices and supply to ensure fairness. And they also developed relationships in general with their customers. So the Code as Craft movement has gained quite a bit of momentum in recent years and you can really see how it's been able to draw from the distinct history and traditions of craftsmanship. We can trace the movement back as early as 1999 when Andrew Hunt's book, Pragmatic Programmer from Journeyman to Master, made a pretty enthusiastic nod towards craft, even in his title. In 2002, Pete McBreen coined the term software craftsmanship with his book of the same name and proclaimed that to produce quality software, we should think of what we do as a craft and adopt a guild-like model that emphasizes community and learning and mentoring. So in the late 90s and early 2000s, we saw the Code as Craft movement slowly but surely coalescing. As we started seeing books like these, as well as gatherings and blog posts and online discussion boards. But by December of 2008, attendees of the Software Craftsmanship Summit in Chicago discussed what it meant to be a developer craftsman and drafted the software craftsmanship manifesto. And here it is, don't worry about reading it because the font's pretty small. But they laid down the principles as they wrote, we have come to value not only working software, but also well-crafted software. Not only responding to change, but also steadily adding value. Not only individuals in interactions, but also a community of professionals. Not only customer collaboration, but also productive partnerships. And this manifesto really made the rounds with several thousand signatures in the first few months, that's a lot. It's also since then been translated into at least seven other languages. So this document effectively crystallized the software craftsmanship principles as we know it by putting it down on virtual paper and thus stamping them into existence. And today, the movement's effects are really far-reaching. And I think it's really percolated into programming culture. For example, this conference has an entire track devoted to this topic. And you are in fact listening to a talk under that category right now. You'll find a bunch of groups on meetup.com rallied around the cause. Meanwhile, many companies are adopting the apprenticeship model. I myself went through one at Wayfair. Etsy's engineering department brands what they do as craft and likes to blog all about it. The software craftsmanship conference in Budapest dedicates three days to it. Many do see code as craft today and our vocabulary is laced with references to it. We see coding like craft because we believe in continual learning, skill mastery, mentorship, customer relationship, collaboration, and building useful things. So this movement really allowed for us to start thinking more about coders as makers as opposed to the older understanding of programmers as executors, as these black boxes that take in a set of specs and then spit out an app, right? And because of this, it naturally paved the path for discussion on creativity. Especially in the Ruby community, I've started hearing words like pretty and creative. For example, in an essay in the 2007 anthology Beautiful Code, Matz describes what makes code aesthetic and beautiful. Meanwhile, in his 2014 book Geek Sublime, Chandra directly poses the question when he says of code, quote, we are now unmistakably in the realm of human perception, taste, and pleasure, and therefore of aesthetics. Can code itself as opposed to the programs that are constructed with code be beautiful? So, taste, pleasure, human perception, aesthetics, and beauty. Now, none of this really fits so much into the traditions of craft, especially the kind that our software craftsmanship movement is grounded in. Medieval makers weren't concerned about this. Again, they emphasized skill, collaboration, and wanted to produce things that people needed, things that were useful. So, I think instead, what is happening is that progressively, we are likening code to art. So in this next part, I'll talk a little bit about what the metaphor of art encompasses and illustrate a snapshot in history where our modern definition of art originates, and then talk a bit about how this analogy applies to coding. Cool, so art is a pretty complicated thing, but the thing is, we all know art when we see it, right? We tend to think of things like the visual arts, like sculpture, and painting, and installation work, but in its essence, art is anything that moves us. It's beautiful, it's an outward expression of human creativity and emotion. It's about ideas, human imagination. It makes us think. So that's a widely accepted definition. And interestingly enough, one could say that our modern understanding of art really arose from what was craft. Right at the height of the medieval guilds in the 14th century, an intellectual movement drawing on Roman and Greek classics called Renaissance Humanism, swept across Europe, revolutionizing how people perceived their roles in society. So while the medieval era was characterized with a utilitarian approach to thinking and making, and following doctrines to produce useful stuff, mostly for religious purposes, humanists instead stressed the importance of human dignity. They glorified the individual. They prized creativity and ingenuity. And soon, the Renaissance was in full bloom, and before we knew it, certain craftsmen began questioning the nature of their professions. Some, like Leon Battista Alberti, famously wrote treatises on the topic, framing what they do not as an applied skill, like craft, but as a liberal art. Gregorio Vasari's influential book, The Lives of the Artists, similarly illustrated his subjects as creative virtuosos. And Michelangelo himself said that a man paints with his brains and not with his hands. And soon, within a lifetime, the general populace's conception of what is art took shape. And things like drawing and painting and sculpture were no longer considered crafts, but celebrated and recognized as art, as these creative cerebral endeavors that were made for intrinsic meaning. Sure, applied skill was still a part of it, but it grew to be much more than that. So, I think history has a pretty funny way of repeating itself. With all this talk of creativity and expressiveness in code, I think, in a way, we are in the middle of our own Renaissance, where just like the 14th century humanists, we are slowly re-envisioning what we do as a profession, what it means to us, and how we brand ourselves to the outside world. Just like how makers in the Renaissance started seeing what they did as art, in a sense, so too have we. So, you might find literature on code as art in the books I mentioned, among some others, or in some posts on Quora or Medium, but for the most part, the arguments for this aren't yet as well known or adopted into popular discourse. So, I'd like to take some time to demonstrate the ways in which code is a lot more like art than you might think, both in its creation process and in the end result. So, let's begin with the creation process. To begin making something, you first need to choose a medium. So, in art, a medium is the material used by an artist to create their stuff. An example might be pastel, or watercolor, or clay, or canvas. So, if we were to apply this to programming, our medium might comprise of the text editor or the language we choose to write in. My language of choice is Ruby, and I like Ruby because it's particularly expressive. I tend to think of it like acrylic paint. It's elegant and rich in so many ways, but even so, it's clear and crisp. Each stroke of acrylic leaves such defined borders, much in the same way that a Ruby method delineates boundaries with those definitive depths and ends. And like acrylic paint, Ruby is also pretty beginner-friendly, but once you get the hang of it, you'll find that there's many more advanced techniques for you to conquer and discover. And sometimes, just as artists prefer one medium over another, coders have their own preferences. These days, I write a lot in PHP, which I admittedly don't love. It reminds me of pen ink in its simplicity. To express something, it requires a million strokes, which kind of ends up looking squiggly and convoluted with all those curly brackets. And then you get these conspicuous semicolons that look like ill-placed ink blots. It's not as rich, it's not as vivid, and at times it can be really messy and all over the place, but it gets the job done. But hey, some people like working with that medium. As the saying goes, quite literally, different strokes for different folks. I think Paul Graham sums it up quite well in his famous essay, Hackers and Painters. When he says that, quote, Hackers need to understand the theory of computation about as much as painters need to understand paint chemistry, end quote. And he makes a good point. Just as painters need to understand in depth and appreciate the medium they work with in order to compose something effectively, so too do programmers. There's quite a bit of science behind both. We must experiment with what we're working with and go through a process of trial and error to fully understand the material. Cool. So once you have the medium selected, you then have to go through the creation process. So how many of you here have made art? Can I get a show of hands? Quite a few of you. So for those of you here who have made art, I think you'd agree with me that it's a whole lot like writing code. In fact, I think a lot of famous artists would say the same. For example, Francis Bacon, a famous artist, says, quote, the creative process is a cocktail of instinct, skill, culture, and a highly creative feverishness. It is a particular state where everything happens very quickly, a mixture of consciousness and unconsciousness of fear and pleasure. So in fact, I feel like what Bacon describes is almost this trans-like state of flow that is so intrinsic to the creative process that can be very well applied to coding. Because when you code, it does happen fast at times. You register keystrokes without much reflection, but at the same time, there is a highly conscious element to it in which you are working through your thoughts and trying to channel it concretely onto your text editor, like an artist splashing paint onto his canvas. And you develop techniques and unconscious habits. For example, I constantly type git status after just about every single operation I perform. Looks like you guys do too. And the way you solve programming problems does involve quite a bit of skill, intuition, and risk-taking. So code is also engrossing. You feel very much in the present. Sometimes I find myself sitting down at 9 a.m. only to look up and find that an entire day has flown by. You get entirely lost in your own thoughts, so transfixed with what you're doing that you sort of tune the world out. It's a very individual thing, super personal. It's almost like you enter this different state of mind. They say Michelangelo painted the Sistine Chapel in this kind of state, totally unaware of the world around him and many times forgetting to eat, sleep, and drink. At the same time, coders make aesthetic choices. How you choose to program an algorithm may be entirely different from how someone else does it. For example, in Ruby, there are many ways to print out the numbers one through 100. A minimalist may choose to do it this way. She might like how simple and elegant it is. Or a maximalist who loves trolling might write out one through 100. Or someone coming from a C background may find comfort and familiarity in using the traditional for loop. A student excited by object-oriented programming may want to wrap it on a class and use instance variables. Or maybe a moonlighting poet likes how it reads just like English when you do it this way. Or maybe someone who loves the graceful flourishes of curly braces may choose to do it like this. So what I'm saying is that in art, the artistic process is a translation of the creator's personality, preferences, individual style, and cultural influences externalized into a concrete form. The same goes for coding. Everything that we do from how we approach a programming problem down to the very ways in which we indent our code is influenced by who we are, what we like, and past experiences behind us. When we code, we are constantly infusing our personal taste and constantly making aesthetic choices. And that's why it's such an artistic, creative process. Once you finish, you'll find that what you made can be appreciated in much of the same ways as a work of art. Here is a painting of a factory by the abstract impressionist Van Gogh next to a factory class from the factory girl repo. Now take this in stride and bear with me. But I see a lot of similarities here. Van Gogh's paint strokes tuck away details so that things are just abstracted into lines and blobs of colors and shapes. Yet its parts collectively come together to depict this larger abstraction of a factory. The Ruby code does this too. It hides complexity by abstracting it on to a class so that these individual parts, the functions and the instance variables come together to illustrate a holistic idea of what this factory is all about. Abstraction in art and programming is very similar. At the same time, code is like art in that we can admire its formal qualities and visual structure. But if we scroll down a bit, it starts looking like an Alexander Calder sculpture. The code's cleanliness, the orderly indentations and spacing, the occasional verticality of the or operators and the horizontalness of each line and the way it all gracefully cascades downwards and tapers off to the left kind of reminds me of this sculpture and I like it. And I notice a systematic, careful character to each of these that I like. I even find the ratio and dispersion of colors in both aesthetically pleasing. Even more so, we have the coding language Piet, whose code is pixels of colors and pays homage to Piet Mondrian's famous neoplasis paintings. Do you guys know who Mondrian is? Yes, seems to be. Okay, so to the left is an example of a prime number tester. To the right is a Mondrian painting and they look very much the same. In fact, it's hard to tell the difference. So what you are seeing is computer code that to the greatest extent is quite literally a work of art. Again, my point is we can treat our code like an art object appreciating the finished project in much of the same ways as art. And if you aren't convinced, many members of the art community seem to be. Just one month ago, the founders of Rue's laboratories arranged the algorithm auction at the Cooper Hewitt Smithsonian Design Museum, which was the first ever auction of computer code. It was a pretty big deal and it attracted the likes of big art dealers like Larry Gagosian. And in this auction, patrons purchased these algorithms for the same reasons they might purchase art, such as historic reasons, like with this printout of the source code from which President Barack Obama wrote a line of code marking the first president in the history to program. Some pieces of code were seen as embodiments of culture, such as this O.K. Cupid compatibility calculation algorithm, which is a cultural snapshot or relic demonstrating the ways in which we as a modern era have embraced technology as a means to connect with one another. Like art, code at this auction was also praised for the nostalgic meaning it holds. A framed handwritten function printing out Hello World by Brian Kernighan carries sentimentality for many of its viewers, as we all know these are some of the first lines of code one ever writes. And like art, when we look at code, for example, during the code review process, we also bring with us a sense of personal taste. We have a visceral personal reaction to what we see. For example, I personally find procedural spaghetti code as messy and hard to follow as this Jackson Pollock. It's all over the place and doesn't really make any sense to me. And I find metaprogramming to be cool and marvel at how self-referential the concept is. Some people hate it. And I also like recursion because it's fun and powerful. I marvel at how in just four lines of code you can express infinity like with just this one picture. Although I understand that some just prefer plain old iteration, but above all, art critic Arthur Donto famously defined art as something that compels the beholder to interpret. So he says, quote, art work has semantic character. It involves the possibility and necessity of interpreting the work, a theory of what it is about and what the subject is. And I would argue that code precisely asks us this. We must identify the subject of just about any code we come across. For example, is this code about a database or is it about a recommendation engine? You need to consider all the comments and all the little details to determine the author's intent. Just like art, the end goal of coding is to be personally interpreted and understood, whether by another human beholder during a code review process, a code review, or in a very literal sense, at runtime by the Ruby interpreter. At the end of the day, what you code and what you make in art is all about the ideas you're trying to get across. So I hope I was at least somewhat convincing to you in demonstrating all the ways in which coding is like art. Like artists, we choose a medium and go through a unique creative process to breathe life into an idea that results in aesthetic beauty, historic, cultural, and personal meaning, and a basic need for interpretation. So I started by stressing the importance of metaphor and how it shapes what things mean to us. And I talked about the popular analogy of craft and how it meant thinking about continual learning and applied skill to produce a useful end product and how it's influenced our community. Then I talked about how the concept of making stuff as introduced by craft opened up the discussion to this notion of creativity in coding, which results in this new fangled code as art metaphor, which is about expressiveness and ideas and creating something for its own sake. And along the way, I showed you how craft and art are a bit different in the meanings they take on. So now comes the question of which is it? Is code art or is it craft? So not to cop out or anything, but it's both. They each carry a different set of history and meanings, but they both apply. From the top, coding is an applied skill like craft, but it also requires creativity and out of the box thinking like art. Sometimes you need to choose the right tool for the job, but sometimes you can pick your own medium. It's collaborative, but it's also highly personal and individual. Code has utility and function, but it also has aesthetic value. There are traditions of doing like in craft and personal preferences in ways to do things like in art. And so much more, coding is such a complex thing that sometimes we need more than one metaphor to understand it fully. Even in the art world, when we consider whether something is art or craft, it's not mutually exclusive. This Mondrian chair has elements of craft because it has the purpose of being sat in, but it's also a work of art in its neoplastist style, which itself is a cultural critique. The thing is we are allowed to see things in multiple ways and we can mix metaphors to best suit how we want to think about and frame things. I think people tend to forget this. People tend to think in binaries, especially programmers. But in preparing this talk, I read a lot of blog posts about how programming isn't this thing or isn't that. It doesn't entirely fit into this metaphor, so it can't be this and it's this one instead. But the thing is you don't have to adopt a metaphor wholesale and abandon one in lieu of the other. With the Renaissance art revival, it's not like the idea of craft was abandoned, but rather it existed in parallel with art and existed in parallel with this redefined notion of art and both led to some awesome things. But however, I think we should give the code as art metaphor more weight than we currently do, as it's still rather fringe, but has the potential to provide some good paradigms. Sure, it's a bit out there, but maybe if programmers saw themselves as artists, they might feel further empowered to take risks, to break from the mold and innovate. Or who knows, maybe if we branded our field as art, we'd inspire a new demographic of people with creative interests to join the field and increase the diversity of thought. Or maybe we'd start more readily attaching the names of creators to the stuff they make, like how artists get rock star recognition. And though we already have some modern day Rembrandts like mats or Frida Kahlo's like sandy mats, perhaps we'd move even further in this direction and start giving programmers the creative capital they deserve. Or maybe we'd start following art's higher ideal of art for art's sake and focus less on the program's utilitarian purpose and more on the code itself, resulting in more clearly written, more maintainable code. I mean, who knows, maybe. The thing is there was a massive paradigm shift that resulted in adopting the popular code as craft metaphor in recent years. So consider the possibilities of adding a new one to that. My point is metaphors have a lot of potential to influence and we want a great diversity of ways to frame about and think about the things that we do. Having multiple perspectives never hurts. So I introduced myself earlier as a software engineer. A quick search on LinkedIn and Twitter reveals how by now thousands of people title themselves as craftsmen. But I think it'd be kind of cool if one day people started introducing themselves at events like these as software sculptors. So that's all I have. Hopefully this sparks some discussion. Here is a thank you slide for everyone who's given me feedback so far, thank you all for that. And a bibliography, I'll be posting that online so you can take a closer look. And now I'd like to thank you guys. That's my Twitter handle, feel free to tweet at me, agree, disagree, thoughts. And conveniently enough, it looks like we're out of time. So if you have any questions or comments.