DEV Community 👩‍💻👨‍💻

danielpdaniel
danielpdaniel

Posted on

Flatiron Phase 1 Blog

Coming into coding from a creative background, I thought that I might someday use coding to make artistic projects. So far, though, I've been surprised by just how much coding for its own sake feels the same as making art does. The mediums and end products may be vastly different, but there's something about working on my phase 1 project that feels much the same as working on a standalone animation or short story. Maybe it is just that creating anything requires the same parts of the brain to be used and so will feel like a similar process, but I think there's something shared within the end goals of both coding and art that makes them feel like two sides of the same coin. Working on my project was a constant search for "what do I want the user to experience?" And I think that's what working on an art project is like too. At the heart of both lies communication. Sending information from one place to an audience somewhere else. But what's interesting about coding, at least in the case of the Phase 1 API project, is that it's not just about conveying an idea from one artist to an audience, but an artist acting as a vehicle to convey existing information from a source outside themselves to the audience, and then taking information back from the audience to update that original source. My phase-1 project... is not some beautiful globe-spanning collaborative art piece (it only has one patch event!), but it is deeply exciting to me to see the seeds that are there and recognize what could be possible down the line as I learn more and more and expand my coding knowledge.

My current project uses json-server to make fetch requests to a db.json file containing information and images for 5 dogs. This is pretty straightforward, but what excites me most about is the way the user activity can update and affect the original db.json file!
Here I have the condition for when the game has been won, as well as a patch request to update the number of times won:

if (boneCount === 3){
                            bonesCrunched.textContent = `Bones Crunched: 3, Congrats! You've Crunched all the bones!`
                            let currentDog = dogOptions[document.querySelector("select").options.selectedIndex]
                            currentDog.wins += 1;
                            document.querySelector(`h4#${currentDog.name}Wins`).textContent = `Wins: ${currentDog.wins}`
                            console.log(currentDog)
                            patchDogWins(currentDog)
                        }`
Enter fullscreen mode Exit fullscreen mode
function patchDogWins(dog){
        fetch(`http://localhost:3000/dogs/${dog.id}`, {
        method: 'PATCH',
        headers:{
            'Content-type': 'application/json'
        },
        body: JSON.stringify(dog)
        })
        .then(res => res.json)
        .then(data => console.log(data))
    }
Enter fullscreen mode Exit fullscreen mode

When the games is won (all 3 bones have been crunched), the player's selected dog that they used to win has their win count increased. It's a very small thing, but its potential is so exciting to me. For example with this game, I've thought about making the win number affect game play somehow, like maybe the size of the player image is related to how many games have been won with that dog, making it easier the more games have been won. But more broadly I think it's so cool just to have something I've made be interacted with like this. Usually with art projects, you make it, put it out there, and then that's it! someone might make something inspired by it or iterate on it in someway, but for the most part it's just there for other people to consume. But with a coding project like this one, interactivity and changeability based on user activity are built into the very code itself, it can even be the whole point of the application. That's so exciting! And gives me a whole newfound appreciation for the digital systems that surround us. Like social media platforms. I'd never really thought about it, but many social media sites are almost like these giant scrapbooks that exist on a global scale, with everyone posting and sharing their favorite things or their personal thoughts. Giant databases of stuff that people care about and want to communicate to the world. That's really cool! It makes it doubly sad that so much of the social media world has been overtaken by corporate greed, misinformation campaigns, and bigotry, but maybe there's a way back to these kinds of idealistic forms of social media through looking at it through this lens, at the very least as a user if not as a coder.

I've learned a lot throughout phase 1 of this program. That includes the technical side of things, like the coding know-how that allowed me to make my dog walker project, but it also includes these more conceptual, philosophical ideas that I've started thinking about. What can coding be used for? How do its applications relate to my own interests? What are its strengths as an artistic medium and how might it bring people together? I definitely don't have satisfying answers to those questions just yet, but I'm excited to continue pondering these questions as well as new ones as I work through future phases of the program!

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.