<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bram Adams</title>
    <description>The latest articles on DEV Community by Bram Adams (@bramses).</description>
    <link>https://dev.to/bramses</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F242212%2Fa9cee6bb-f177-45b5-8b74-6ffcbe38723b.jpeg</url>
      <title>DEV Community: Bram Adams</title>
      <link>https://dev.to/bramses</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bramses"/>
    <language>en</language>
    <item>
      <title>Running a Zero Waste Flywheel</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Sat, 18 Nov 2023 22:12:07 +0000</pubDate>
      <link>https://dev.to/bramses/running-a-zero-waste-flywheel-1knk</link>
      <guid>https://dev.to/bramses/running-a-zero-waste-flywheel-1knk</guid>
      <description>&lt;p&gt;In the past, &lt;a href="https://www.bramadams.dev/202304071434/"&gt;I've written that in my view, there is no way to run a sustainable business, especially as a solo provider, without leverage&lt;/a&gt;. Leverage, particularly in the form of a flywheel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preamble
&lt;/h2&gt;

&lt;p&gt;Energy input into the business system lose "heat to entropy" much like friction in physical systems. &lt;/p&gt;

&lt;p&gt;Let's say that for a minimum viable product (MVP) – be it an info product, a car, or a house costs five units of energy to make successfully. Anything under this threshold is considered to be "crap", or unusable. The roof of the house will collapse, the video is unwatchable due to lag or audio issues, or the car's engine light stays on 24/7. &lt;/p&gt;

&lt;p&gt;The math looks something like this: if you provide ten units of energy into your product, and five units are lost to inefficiency, your business will surely suffer. Your baseline entropy loss is 50%. If you are tired one day and can only produce eight units through willpower, you cannot produce a MVP, as you will only capture four units, despite actually providing enough raw energy input units to make the product. Or conversely, to print two MVP widgets, due to your 50% score, you need to put in four times the raw input energy unit just to output two units. Yikes! No wonder burnout among workers is so common.&lt;/p&gt;

&lt;p&gt;The energy lost to entropy is the work devoted to externalities, communication bottlenecks, context switching, poorly attuned business practices, a desire to want to have things be as you imagine versus meeting them as they are, etc. All of these externalities share one thing in common:&lt;/p&gt;

&lt;p&gt;Waste.&lt;/p&gt;

&lt;p&gt;To eliminate waste, we must create systems that have the job of processing waste. The flywheels I produce in my business aggressively seek to manage waste, while maximizing unbounded opportunity. This is key.&lt;/p&gt;

&lt;p&gt;Zero waste flywheels are not flywheels of scale, they are flywheels of waste reduction.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Real World Example
&lt;/h2&gt;

&lt;p&gt;Here is my current, actual, GTM flywheel that powers my business of info products, optimized for minimal energy input and allowing me to do what I like to do while minimizing what I have to do and eliminating what I don't want to do.&lt;/p&gt;

&lt;p&gt;For me, I like to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;write code for silly zero-to-one projects&lt;/li&gt;
&lt;li&gt;read books&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;publish my work (weekly newsletter, open-source repos, SaaS apps, videos, essays)&lt;/li&gt;
&lt;li&gt;market my work (social media, word of mouth)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I don't want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;spend any more time on social media than the bare minimum&lt;/li&gt;
&lt;li&gt;video edit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These lists are not nearly exhaustive, but I hope the point lands. A business is an orchestra, and you are the conductor. Your task is to coordinate and guide without getting in the way. Any energy put in should come out with minimal loss. &lt;br&gt;
Without further ado, here is my current flywheel. Let's go through each node one by one:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wnaa3whT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eg1imi5b3episw4obd6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wnaa3whT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eg1imi5b3episw4obd6f.png" alt="nodes and edges connecting services like social media my website etc to make work product for minimal energy" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the very left is me! I am the well source of ideas, execution and judgement for the business, though in the future I very well may be replaced by an AI, but I digress. As long as I am the beacon for my business, it is my duty as business operator to "protect my golden goose", and to make the best use of my work product, or as Austin Kleon puts it in Show Your Work!:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Once a day, after you’ve done your day’s work, go back to your documentation and find one little piece of your process that you can share. Where you are in your process will determine what that piece is. If you’re in the very early stages, share your influences and what’s inspiring you. If you’re in the middle of executing a project, write about your methods or share works in progress. If you’ve just completed a project, show the final product, share scraps from the cutting-room floor, or write about what you learned. If you have lots of projects out into the world, you can report on how they’re doing—you can tell stories about how people are interacting with your work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;– Show Your Work!: 10 Ways to Share Your Creativity and Get Discovered &lt;/p&gt;

&lt;p&gt;I put raw energy into reading and livestream coding. To maximize the value captured from these two processes, I set up a rain bucket of sorts.&lt;/p&gt;

&lt;p&gt;For reading, I read on Kindle. Every time I highlight a passage, it goes through the Readwise API, and ends up in my own creation, the &lt;a href="https://github.com/bramses/commonplace-bot"&gt;Commonplace Bot&lt;/a&gt;. Using embeddings, I surface these highlights whenever and wherever I need them from my Discord.&lt;/p&gt;

&lt;p&gt;For coding, I use OBS and &lt;a href="https://www.twitch.tv/bramses"&gt;Twitch&lt;/a&gt; to record my process live. The benefits of this are multiple. One, occasionally someone drops by and says hello (this is rare in the software category of a gaming livestream website, but it happens once in a blue moon) – this is equivalent to community building. Two, I get to see my own coding practice and learn how to improve. Much like a weightlifter who reviews his form, seeing my code process shows me where I might improve. Three, I get to use these livestreams to make VODs, which I will discuss later. &lt;/p&gt;

&lt;p&gt;For my newsletter, which I publish every Sunday, my reading and Commonplace Bot nodes come majorly in handy. I usually just lie in bed and spam the /random or /wander endpoint until I come across a quote that inspires me to dive deeper. It's that simple. I'm 35 weeks in and the topics are always varied and interesting due to this method.&lt;br&gt;
From the livestreams, I make timelapse videos. This is trivially easy to do in Final Cut Pro and editing takes me less than fifteen minutes. I get another slam dunk by literally speaking my newsletter in conversational format as a voiceover.&lt;/p&gt;

&lt;p&gt;I should pause here for a second to discuss my "relationship" with YouTube and Twitch. To be frank, I see them merely as two things: free/cheap video hosting, and marketing engines. I have no ambitions whatsoever to become a Twitch streamer or a Youtuber, and in fact such things sound quite miserable as a long term career path. These mega platforms are used by me (and I mean that in the strongest sense of the word) as parts in my flywheel, but if need be can easily be swapped out if need be due to something better cropping up or contract disagreements. If you are considering running your own business, I highly recommend you do the same. The first goal is to own your own domain. Anyway...&lt;/p&gt;

&lt;p&gt;For creative coding projects, I publish my work on GitHub repos. This is also simple to do as I do coding on livestream, as well as writing READMEs. The repo itself is a work product for me, as many of my clients have found me through my open source contributions or SaaS apps.&lt;/p&gt;

&lt;p&gt;Finally, blog posts, which are generally filter fed down from all the other processes, or written from scratch because I happen to be particularly inspired (like this post!). I have also posted my Zettelkasten notes from Obsidian directly to my blog in the past, but recently, I've done that less. That will be coming back though eventually because I enjoyed it.&lt;br&gt;
From the green arrows connecting all of the outputs on the ball of chaos on the right, that is all marketing. Of course, my penultimate "goal" for online creation as it were is to get people to sign up for my &lt;a href="https://www.bramadams.dev/"&gt;newsletter&lt;/a&gt;, as that is where I have the most potent and direct relationship with readers, but I also really like GitHub! &lt;/p&gt;

&lt;p&gt;So!! Have you kept count? Have you seen how the energy applied at the start turns into different products? Videos, GitHub repos, newsletters, blog posts, all from the two actions of reading and coding, which I would do for free? This is the idea of the zero waste flywheel, the nose to tail operation. If I have low energy due to illness, malaise, or just am not able to muster "ten units of energy input" I lean into "filling the grain silo" by lying in bed and reading, or turning on OBS and my favorite tunes and coding for an hour or two. I don't think about what will happen downstream, because I don't need to worry about it. &lt;/p&gt;

&lt;p&gt;Later, I go into my silo and "harvest", creating videos, code repositories and more. Finally, I "pollinate" with marketing, and the cycle "scales" by itself.&lt;/p&gt;

&lt;p&gt;Here's how it breaks down roughly in terms of daily work, split by energy management, goals, and the "internal cooldown" of posting too often on social media:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7I2hVNv5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/afaoy1s19zxybddp9nnx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7I2hVNv5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/afaoy1s19zxybddp9nnx.jpg" alt="how i break down my work week" width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A zero waste flywheel is an aspiration like any other, but one that can always be gotten closer to. By merely being aware of our business processes, goals, and customer base, we can make every unit of work we put in net neutral, if not positive, returns on the rest of the business. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Text Your Web Server - Codex and The New Modalities of Coding Pt.1</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Thu, 19 Aug 2021 15:50:25 +0000</pubDate>
      <link>https://dev.to/bramses/how-to-text-your-web-server-codex-and-the-new-modalities-of-coding-pt-1-453k</link>
      <guid>https://dev.to/bramses/how-to-text-your-web-server-codex-and-the-new-modalities-of-coding-pt-1-453k</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted at: &lt;a href="https://bram.substack.com/p/how-to-text-your-web-server"&gt;https://bram.substack.com/p/how-to-text-your-web-server&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Picture this:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You’re a busy 21st-century developer on the go.&lt;/p&gt;

&lt;p&gt;You take meetings on the go.&lt;/p&gt;

&lt;p&gt;You balance your finances and report to your managers on the go.&lt;/p&gt;

&lt;p&gt;You’re a modern business person, and nothing, nothing, not even the annals of time can stop you from being. on. the. go.&lt;/p&gt;

&lt;p&gt;In fact, you’ve built up so much inertia from being on the go, that you’re afraid your heart may stop if you stop moving.&lt;/p&gt;

&lt;p&gt;I have good news for you &lt;em&gt;(not about the heart thing, you should probably see a doctor about that)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Coding can now be added to your list of things you can do on the go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Twilio, Codex, Live Servers
&lt;/h2&gt;

&lt;p&gt;Coding is one of those activities that traditionally couldn’t be done from your pocket.&lt;/p&gt;

&lt;p&gt;In between code’s rigid syntax, the lack of screen real estate on phones, and the CPUs being ineffective to do any real programming, coding on the go seems DOA.&lt;/p&gt;

&lt;p&gt;If a great idea hits you on a walk, or while you’re waiting in line at a club, your best bet is to open the Notes app on your phone and pseudocode it out.&lt;/p&gt;

&lt;p&gt;However, thanks to &lt;a href="https://openai.com/blog/openai-codex/"&gt;OpenAI Codex&lt;/a&gt;, we can now translate natural language commands into computer-readable code. We can then use a live server on a remote computer to code from iMessage in real-time.&lt;/p&gt;

&lt;p&gt;Want proof? Watch the video below.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/u5eESXNeHkw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Code Blocks
&lt;/h3&gt;

&lt;p&gt;To receive messages from Twilio, we set up an Express endpoint. We pass the message from &lt;code&gt;req.body.Body&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;router.post('/sms', async (req, res) =&amp;gt; {
  const twiml = new MessagingResponse();
  await workflow(`${req.body.Body}`)

  res.writeHead(200, {'Content-Type': 'text/xml'});
  res.end('Message Received');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main workflow is as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Receive a text message&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Read current .HTML and .css files&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is the message changing CSS or HTML?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generate a codex response from the text message&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Write the new .HTML or .css file&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trigger server reload&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const workflow = async function (msg) {

  // read pug and css file we want to update
  let testPug = await fs.readFile('./views/test.pug', 'utf8');
  let testCss = await fs.readFile('./public/stylesheets/test.css', 'utf8');

  let isCSS = false;
  // if message includes the paint emoji, change the CSS file
  if (msg.includes('🎨')) {
    isCSS = true;
    msg = msg.replace('🎨', '');
  }
  else if (msg.includes('🐶')) {
    isCSS = false;
    msg = msg.replace('🐶', '');
  }

  // generate a codex response from a command and rewrite the file with our changes
  if (!isCSS) {
    const tr = await gptCall(testPug, msg, 'pug');
    testPug += "\n" + tr.code.split('\n').map(line =&amp;gt; `    ${line}`).join('\n');
    await fs.writeFile('./views/test.pug', testPug, 'utf8');
  } else {
    const tr = await gptCall(testCss, msg, 'css');
    testCss += "\n" + tr.code.trim();
    await fs.writeFile('./public/stylesheets/test.css', testCss, 'utf8');
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the server updates in real-time to file changes using LiveReload and nodemon. &lt;a href="https://www.youtube.com/watch?v=P4RWMZA4yJo&amp;amp;t=6s&amp;amp;ab_channel=pspi"&gt;Here is a great tutorial on setting this up&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And that’s it! &lt;a href="https://github.com/bramses/codex-live-texting-twilio"&gt;You can fork, star, play with the full repo here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now instead of late-night texts to exes, you can text your server instead. Just don’t text to prod on Fridays.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Use Code to Make Stuff: First Weeks Scripting with SparkAR</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Tue, 25 Feb 2020 19:40:38 +0000</pubDate>
      <link>https://dev.to/bramses/first-weeks-scripting-with-sparkar-2h73</link>
      <guid>https://dev.to/bramses/first-weeks-scripting-with-sparkar-2h73</guid>
      <description>&lt;h1&gt;
  
  
  A Few Examples
&lt;/h1&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Td-AV2E_daA"&gt;
&lt;/iframe&gt;
&lt;br&gt;
&lt;em&gt;an Avatar filter I made that responds to eye "openness"&lt;/em&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Pf7cSJamENk"&gt;
&lt;/iframe&gt;
&lt;br&gt;
&lt;em&gt;a UI controlled pixelation filter I made&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A month or so ago, one of my friends from out of town came to visit. I mentioned to him that I've been doing a lot of creative coding, and showed him some of the &lt;a href="https://www.instagram.com/_bramses/"&gt;Processing scripts I've made&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;During that conversation, he mentioned SparkAR, and I bookmarked it ("neat" I believe was the word I used). Later that week, I downloaded it during a bit of boredom. I was hooked immediately by the potential of the tool.&lt;/p&gt;
&lt;h1&gt;
  
  
  What is SparkAR?
&lt;/h1&gt;

&lt;p&gt;SparkAR is best described as an AR Photoshop + Unity + scripting environment (kinda). It allows creators to make their own filters for Facebook or Instagram, without having too much in the way of technical knowledge. Creators can import 3D assets, textures, and utilize face tracking to make fun effects for IG users.&lt;/p&gt;

&lt;p&gt;For myself though, I was interested in the scripting functionality. I wanted to make cool interactive filters, and use my programming background to make up for my lack of a design skillset. The API is written in Javascript, so I thought it'd be relatively easy to get into.&lt;/p&gt;

&lt;p&gt;And I'll be the first to admit, the API is bad. Like... bad bad. It's not well updated, the documentation isn't clear, the index takes you to a &lt;strong&gt;broken Facebook link&lt;/strong&gt;, and the community on StackOverflow or otherwise is quite small and/or non-existent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3g4IHVcz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/qqneacs2mt29w2yune19.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3g4IHVcz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/qqneacs2mt29w2yune19.png" alt="SparkAR error when you hit the back button" width="800" height="271"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;get used to seeing this really annoying error&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Even with all that, I'd like to impart a few lessons I've learned using SparkAR scripting this past few weeks.&lt;/p&gt;

&lt;p&gt;1) The Native Slider &lt;br&gt;
2) Monitoring Multiple Things&lt;br&gt;
3) The Reactive Paradigm, Variables, and You&lt;/p&gt;

&lt;p&gt;Let's jump into it.&lt;/p&gt;
&lt;h1&gt;
  
  
  The Native Slider
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/bramses/pixelate-slider/blob/master/scripts/script.js"&gt;github example&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SparkAR has a built in slider that allows users to control the "intensity" of your filter. I'm using the slider here to modify the opacity of the pixelation filter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;lastSliderValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;slider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;NativeUI&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slider&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pixelatedMat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Materials&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pixelatedMat&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;slider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;monitor&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;fireOnInitialValue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;lastSliderValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// Choose your desired slider value&lt;/span&gt;
    &lt;span class="nx"&gt;pixelatedMat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;opacity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;lastSliderValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;NativeUI&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;lastSliderValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;NativeUI&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;visible&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  The Reactive Paradigm, and You
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/bramses/sparkar-avatar-state/blob/master/scripts/script.js"&gt;github example&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Spark Studio recommends that you use their reactive programming technique over the traditional imperative method. The problem is, they don't tell you where and where you can't use it!&lt;/p&gt;

&lt;p&gt;Basically what will happen is that it will fire once when the script starts, but it won't "subscribe" to the changes of the eye (blinking for example).&lt;/p&gt;

&lt;p&gt;I've found that reactive value setting &lt;strong&gt;only works in non conditional, left = right&lt;/strong&gt; type statements. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;leftIris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;leftEye&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openness&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Reactive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// works&lt;/span&gt;
&lt;span class="nx"&gt;leftIris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;leftEye&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openness&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;Reactive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// will NOT work&lt;/span&gt;

&lt;span class="c1"&gt;// multi line example&lt;/span&gt;
&lt;span class="nx"&gt;leftIris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;leftEye&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openness&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Reactive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// works&lt;/span&gt;
&lt;span class="nx"&gt;rightIris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;rightEye&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openness&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Reactive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// works&lt;/span&gt;
&lt;span class="nx"&gt;material&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;opacity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;   &lt;span class="nx"&gt;leftIris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;rightIris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// will NOT work&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Monitoring Multiple Things
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/bramses/sparkar-avatar-state/blob/master/scripts/script.js"&gt;github example&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the multi line example above, I was looking for a way to subscribe to two or more elements concurrently. Fortunately, there's a method for that!&lt;/p&gt;

&lt;p&gt;monitorMany() accepts an array of scalars (0.0 -&amp;gt; 1.0) and subscribes to their value. Inside the subscription I've captured and converted the values to my desire:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;leftOpen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;leftEye&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openness&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rightOpen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;rightEye&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openness&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;Reactive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;monitorMany&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;leftOpen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;rightOpen&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nx"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isLeftOpen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newValues&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isRightOpen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newValues&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isLeftOpen&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;isRightOpen&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;arrow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;opacity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Reactive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nx"&gt;arrow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;opacity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Reactive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;SparkAR is a really cool technology with a ton of potential. I hope these tips will save you a bit of hair pulling as you script your filters. Have fun out there!&lt;/p&gt;

</description>
      <category>sparkar</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Use Code to Make Stuff 2: Processing (&amp; a bit of TouchDesigner)</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Tue, 17 Dec 2019 23:11:07 +0000</pubDate>
      <link>https://dev.to/bramses/use-code-to-make-stuff-2-processing-a-bit-of-touchdesigner-lk</link>
      <guid>https://dev.to/bramses/use-code-to-make-stuff-2-processing-a-bit-of-touchdesigner-lk</guid>
      <description>&lt;p&gt;&lt;em&gt;part 1 &lt;a href="https://dev.to/bramses/use-code-to-make-stuff-p5-js-4084"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Storytelling Through Code
&lt;/h2&gt;

&lt;p&gt;This past month, I've been attempting to learn how to use code to tell stories. It's more of an art form than a science, since generative art is too abstract to tell a visual story. &lt;/p&gt;

&lt;p&gt;I've written two short stories, linked below. The rest of this post will discuss a few selected pieces from these stories, and the process of their creation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/adams_bram/status/1198336132787949568"&gt;https://twitter.com/adams_bram/status/1198336132787949568&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/adams_bram/status/1203512289812516864"&gt;https://twitter.com/adams_bram/status/1203512289812516864&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Word Spiral
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BVjU4Nuv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/owu19vu7pgtgukt7gi4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BVjU4Nuv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/owu19vu7pgtgukt7gi4u.png" alt="The Word Spiral" width="800" height="751"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This piece was the second "installment" in the Violet series. In this part, Violet, our protagonist, meets Mahog. Mahog is a magical creature that lives in Violet's book, so I thought it may be cool to have words that have some type of movement, as if they were alive.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;atan&lt;/code&gt; is a powerful rotation tool. If you feed it the height and width offset of an object, it will rotate it by the offset amount of degrees&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Saving frames is much easier in Processing than in p5. I then use &lt;code&gt;ffmpeg&lt;/code&gt; to convert the frame &lt;code&gt;.tif&lt;/code&gt; files to a &lt;code&gt;.mp4&lt;/code&gt; The command to do this is as follows:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffmpeg &lt;span class="nt"&gt;-framerate&lt;/span&gt; 30 &lt;span class="nt"&gt;-pattern_type&lt;/span&gt; glob &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'*.tif'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt;:v libx264 &lt;span class="nt"&gt;-r&lt;/span&gt; 30 &lt;span class="nt"&gt;-pix_fmt&lt;/span&gt; yuv420p out.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Font size can go down to almost 0! The &lt;code&gt;pt&lt;/code&gt; format dictates the height of a letter, and there are ~72pts in one inch. This allows for some really cool effects.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Himalayan Salt Lamp
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q8IsH9lC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/7bpj4auyvmrvjpfa8iog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q8IsH9lC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/7bpj4auyvmrvjpfa8iog.png" alt="The Himalayan Salt Lamp" width="800" height="804"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever seen a Himalayan salt lamp? They're very popular amongst hipster college students. In the story, Violet has a Himalayan salt that acts as an independent observer of the events in her life.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Sketch before you code! When I was a software engineer, I started my day by jumping right into coding. This decision would usually come back to bite me, as I made errors that would take sometimes hours to undo. Pen and paper are extremely powerful, because you can put anything in your head on paper. Even if your sketches are more like scratches, writing will help you clarify your thought process before you commit to coding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Collision detection can be made in a lot of ways! The traditional algorithms used "bounding boxes" but that didn't really work for this piece. Instead, my solution was to check the color of the leading pixel. If the space was occupied by another crack, the crack should stop growing.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;checkForCollision&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;floor&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lastSegment&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;x1&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="n"&gt;floor&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lastSegment&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;y1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
         &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Hills
&lt;/h2&gt;

&lt;p&gt;The final piece today is actually not Processing, it was made in TouchDesigner. For the uninitiated, TouchDesigner is a visual based programming language. Instead of writing code, we connect "nodes", that are then rendered into a final image or video.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ha3PUdO7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/2z64pzkgwkyf5rliay1e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ha3PUdO7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/2z64pzkgwkyf5rliay1e.png" alt="An Example TD Network" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;this is what a TouchDesigner network looks like&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;TouchDesigner allows you to get a fully functioning product out of the door in minutes. The downside is that it is quite proprietary, and knowledge isn't the easiest to come by for free (I highly recommend &lt;a href="https://matthewragan.com/make-some-noise-sf-2017-touchdesigner/"&gt;Matthew Ragan&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;SOPs -&amp;gt; CHOPs -&amp;gt; TOPs -&amp;gt; DATs recurse forever! You'll spend a while getting your head around all the different operator types&lt;/li&gt;
&lt;li&gt;I still go back and forth on if I'm faster in Processing, but it really depends on what I'm attempting to create. 3D is awesome in TouchDesigner. (TouchDesigner is also kinda expensive)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Have Fun with It
&lt;/h2&gt;

&lt;p&gt;The most important thing about Processing (and coding in general) is to &lt;strong&gt;have fun&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Don't worry about the optimal way of doing something.&lt;br&gt;
Don't worry about perfection; &lt;br&gt;
Don't worry about what you don't know.&lt;/p&gt;

&lt;p&gt;I've been learning a ton using these tools. I love that I don't need to write tests, that failure is encouraged, and that I get to use code in a brand new way.&lt;/p&gt;

&lt;p&gt;For those curious about making art with code, please don't hesitate to reach out to me! I'm learning a ton, and the journey is just beginning!&lt;/p&gt;

&lt;h2&gt;
  
  
  Soon there will be a Stream
&lt;/h2&gt;

&lt;p&gt;At the end of this month (after my computer parts arrive lol), I will begin streaming the process of making these pieces. Come hang out sometime! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.twitch.tv/bramses"&gt;https://www.twitch.tv/bramses&lt;/a&gt;&lt;/p&gt;

</description>
      <category>art</category>
      <category>java</category>
      <category>processing</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>The Importance of B(V)logging for New College Grads</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Sun, 27 Oct 2019 22:32:43 +0000</pubDate>
      <link>https://dev.to/bramses/the-importance-of-b-v-logging-for-new-college-grads-k96</link>
      <guid>https://dev.to/bramses/the-importance-of-b-v-logging-for-new-college-grads-k96</guid>
      <description>&lt;p&gt;In a world where everyone has a (&lt;strong&gt;loud&lt;/strong&gt;) voice, how will yours stand out?&lt;/p&gt;

&lt;h2&gt;
  
  
  Started from the Bottom, Now We Here
&lt;/h2&gt;

&lt;p&gt;When you first graduate from college, the "space of concern" of life extends dramatically. &lt;/p&gt;

&lt;p&gt;No longer are your chief concerns passing your coursework while maintaining social relationships with your peers. The problem space widens, as you begin to worry about five and even ten(!) year career goals, the ebb and flow of adult relationships, bills and taxes, and securing your identity out in the real world.&lt;/p&gt;

&lt;p&gt;Some of you will be searching for gainful employment. Others will continue their education. Others yet will decide to start their own businesses.&lt;/p&gt;

&lt;p&gt;For all of you, I'd like to make a simple recommendation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start a blog.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;"A blog? What's the point of that? I already have a &lt;em&gt;Linked-Twitter-book-gram&lt;/em&gt;!", some might say. &lt;/p&gt;

&lt;p&gt;To understand why having a blog is important, we need to understand the difference between a &lt;em&gt;many to many relationship&lt;/em&gt; and a &lt;em&gt;many to one relationship&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Many to Many vs. Many to One
&lt;/h2&gt;

&lt;p&gt;In CS classes, you may have heard about &lt;strong&gt;cardinality&lt;/strong&gt;. Simply put, &lt;em&gt;cardinality&lt;/em&gt; is the relationship of one data point (or table in a database, if we're talkin' bout databases) to another.&lt;/p&gt;

&lt;p&gt;A &lt;em&gt;many to many&lt;/em&gt; relationship is when a large number of nodes interacts with another large number of nodes. Facebook and Twitter employ this model well. You will become "friends" with someone, which means you will see all their posts and they will see yours.&lt;/p&gt;

&lt;p&gt;A &lt;em&gt;many to one&lt;/em&gt; relationship is when a large number of nodes interact with one node. YouTube is a good example of this model. Channels attract thousands or millions of subscribers, but don't need to subscribe to their followers.&lt;/p&gt;

&lt;p&gt;A many-to-many social media site is akin to everyone being allowed a soap box. They scream at each other very loudly, more concerned with what they say than what others said (&lt;em&gt;yo, how many likes did my pic get?&lt;/em&gt;). The resulting cacophony is deafening.&lt;/p&gt;

&lt;p&gt;A many-to-one social media site is akin to turning on the TV and watching one person talk. If you like what they say, you'll follow them. The resulting noise is much quieter, much more focused, and you won't be competing as aggressively with your peers for airwave space. &lt;/p&gt;

&lt;h2&gt;
  
  
  It Doesn't Have to be Good
&lt;/h2&gt;

&lt;p&gt;When you're starting a blog, or a vlog, or whatever, it &lt;strong&gt;doesn't need to be good.&lt;/strong&gt; Just write what you know. Write &lt;strong&gt;what you care about&lt;/strong&gt;. The rest will come as you become a more proficient writer and thinker, and your expertise will grow as well.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What I cannot create, I do not understand." - Richard Feynman&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Tell Your Story
&lt;/h2&gt;

&lt;p&gt;For new college grads, the strongest case I can make for blogging is the ability to distinguish yourself from the pack. As your resume falls onto the pile of 50+ others with similar backgrounds and degrees, it's easy to disappear into the noise, and you run the risk of recruiters passing you like that bus you ran to catch up with but just missed.&lt;/p&gt;

&lt;p&gt;Here's the dish. All twenty two year olds new grads are effectively the &lt;strong&gt;same person&lt;/strong&gt;. Why? Because we all went to the same schools, took the same courses, played the same sports, and watched the same television shows.&lt;/p&gt;

&lt;p&gt;When your resume hits the stack, it may as well be a conversation as follows for recruiters:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Student A got a perfect SAT score, and played tennis for their college team!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Well student B had an internship at a finance company, and they passed their math class with the best grade in class!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Guys, that's nothing! Student C is definitely our best bet. They were involved in student government, and they do opera!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Having a blog gives you an &lt;strong&gt;individual voice&lt;/strong&gt;, and allows you to tell your story. Early on in a career, when competing for entry level work, you want to be a &lt;strong&gt;story&lt;/strong&gt; and not just a &lt;strong&gt;name&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pros of Blogging (succinct)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Improve your critical thinking skills&lt;/li&gt;
&lt;li&gt;Improve your understanding of topics&lt;/li&gt;
&lt;li&gt;A body of work to refer to, and pays over time&lt;/li&gt;
&lt;li&gt;Encourages people to join your network&lt;/li&gt;
&lt;li&gt;Allows you to flex your individuality&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Will&lt;/strong&gt; land you opportunities (trust me on this one, it's happened to me multiple times)&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>beginners</category>
      <category>writing</category>
      <category>career</category>
    </item>
    <item>
      <title>Use Code to Make Stuff: p5.js</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Sun, 20 Oct 2019 02:52:28 +0000</pubDate>
      <link>https://dev.to/bramses/use-code-to-make-stuff-p5-js-4084</link>
      <guid>https://dev.to/bramses/use-code-to-make-stuff-p5-js-4084</guid>
      <description>&lt;p&gt;We developers use code to make stuff. The stuff we make generally revolves around web servers, web development, dev ops, databases etc. That kind of stuff gets repetitive and dry, and "spicing up the relationship" means learning new frameworks and libraries for .06873% improved performance on a production app. &lt;/p&gt;

&lt;p&gt;But what if code could be used for more? What if code could be used to make art?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdnb.artstation.com%2Fp%2Fassets%2Fimages%2Fimages%2F011%2F433%2F087%2Flarge%2Fmanolo-gamboa-naon-copia-de-20180621-001248.jpg%3F1529554616" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdnb.artstation.com%2Fp%2Fassets%2Fimages%2Fimages%2F011%2F433%2F087%2Flarge%2Fmanolo-gamboa-naon-copia-de-20180621-001248.jpg%3F1529554616" alt="Manolo Naon"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;A generative art piece created by Manolo Gamboa Naon&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I recently got into p5.js, a library based off of Processing. The only real experience I had with graphics programming in the past was Java AWT (&lt;em&gt;shudders&lt;/em&gt;), and I kind of avoided it since. What changed my opinion was generative art. &lt;/p&gt;

&lt;p&gt;Generative art is a thing of beauty. It embraces the chaotic nature of the &lt;code&gt;Math.random()&lt;/code&gt; to make works that are inspiring, and never before seen. &lt;/p&gt;

&lt;p&gt;You don't need to be a designer or an artist to make generative art. You &lt;strong&gt;create&lt;/strong&gt; the designer using code.&lt;/p&gt;

&lt;p&gt;In this post, I'd like to discuss a few pieces I've made in the past week and what I learned making them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Color Triangle Pyramid
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fukofetgw40gqnfjas4z0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fukofetgw40gqnfjas4z0.png" alt="color triangle pyramid"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Based off of &lt;a href="https://en.wikipedia.org/wiki/Color_triangle" rel="noopener noreferrer"&gt;Tobias Meyer's 1775 color triangle&lt;/a&gt;, I thought it would be cool to have each triangle represent a different HSB value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you can, and should, use instances of items like you might in React. In this work, I set up a &lt;code&gt;Triangle()&lt;/code&gt; component with a "color" prop&lt;/li&gt;
&lt;li&gt;the nice thing about computer design is if you don't like a background, you can just try another! I also have this piece against a dark blue and gray background&lt;/li&gt;
&lt;li&gt;variables are your friend, store &lt;code&gt;height&lt;/code&gt; and &lt;code&gt;width&lt;/code&gt; of your canvas for later use&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Mythological Disarray
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fofcu4mqpv8nrf2y1foti.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fofcu4mqpv8nrf2y1foti.png" alt="Pixelated mythology work"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This piece is based off of the cubic disarray algorithm. &lt;a href="https://generativeartistry.com/tutorials/cubic-disarray/" rel="noopener noreferrer"&gt;Generative Artistry&lt;/a&gt; has an amazing tutorial I highly recommend you read.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I &lt;em&gt;thought&lt;/em&gt; I would need to manipulate pixel values one by one to get that rotation effect, so I spent a lot of time fiddling with the &lt;code&gt;loadPixels&lt;/code&gt; method. Turns out, an image is just a colored rectangle in p5. This allowed me to chop the image into squares and fiddle with them manually&lt;/li&gt;
&lt;li&gt;When you need to &lt;code&gt;rotate()&lt;/code&gt;, remember to &lt;code&gt;translate()&lt;/code&gt;! Rotating effects the entire canvas, unless...&lt;/li&gt;
&lt;li&gt;You use &lt;code&gt;push()&lt;/code&gt; and &lt;code&gt;pop()&lt;/code&gt;, which create a "temporary state" that reverts after the &lt;code&gt;pop()&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Craigslist Lost Connections
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F2oftqk04z8bl6g156xiy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F2oftqk04z8bl6g156xiy.png" alt="Fake Data Visualization"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This piece was inspired by those cool data visualizations on the internet that show how we're all interconnected. The data, however, is fake :).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an array of connections can be generated very simply. You need two components: 

&lt;ol&gt;
&lt;li&gt;A list of who's connected to who&lt;/li&gt;
&lt;li&gt;An ID for each point&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Circles are amazing. Because they have infinite vertices, you can find any &lt;code&gt;(x,y)&lt;/code&gt; on a circle perimeter using the equations: &lt;code&gt;x = cos(radians(angle)) * radius&lt;/code&gt; and &lt;code&gt;y = sin(radians(angle)) * radius&lt;/code&gt;. Just memorize this, I have no idea how it works either. Something math, I presume.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;draw()&lt;/code&gt; function is called in p5 once per frame, which is &lt;strong&gt;very fast&lt;/strong&gt;. In order to slow the process down and appreciate the outcomes, you can lower the frame rate by calling &lt;code&gt;frameRate(1)&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Code is really powerful stuff. When you're drowning in the web development ocean, or if you need to take a breather from the REST vs GraphQL wars, come over and play around with p5. We have cookies. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Well actually, we have circles. But you can use circles to make cookies.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Quick Tip! Adding Elements to your DOM dynamically</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Sun, 13 Oct 2019 15:05:52 +0000</pubDate>
      <link>https://dev.to/bramses/quick-tip-adding-elements-to-your-dom-dynamically-47jl</link>
      <guid>https://dev.to/bramses/quick-tip-adding-elements-to-your-dom-dynamically-47jl</guid>
      <description>&lt;p&gt;I was playing around with p5.js and blizard.js yesterday, trying to create a fun meme project.&lt;/p&gt;

&lt;p&gt;I wanted the screen to go wild a few seconds into it running, and add divs all over the place. &lt;/p&gt;

&lt;p&gt;Here is the final &lt;a href="https://www.tiktok.com/@bramcodes/video/6747101605105110277?u_code=d7e11hc0e092gh&amp;amp;preview_pb=0&amp;amp;language=en&amp;amp;timestamp=1570932238&amp;amp;utm_campaign=client_share&amp;amp;app=musically&amp;amp;utm_medium=ios&amp;amp;user_id=6719259012707763205&amp;amp;tt_from=messenger&amp;amp;utm_source=messenger&amp;amp;enter_from=h5_m"&gt;result&lt;/a&gt; (&lt;strong&gt;!!headphones warning!!&lt;/strong&gt;)&lt;/p&gt;

&lt;p&gt;This is the code I ended up with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;goCrazy&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;hideAll&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;downTypes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;down&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DOWN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dOwN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dwn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;//[1]&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;upTypes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;up&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DOWN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uP&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;upp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;UP&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fontSizes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;16pt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;24pt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;32pt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;8pt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;72pt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;colors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;black&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;white&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;colorsUp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;green&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;magenta&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// [2]&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;downer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="nx"&gt;downer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;downTypes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;downTypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="nx"&gt;downer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;`font-size: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fontSizes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;fontSizes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)]}&lt;/span&gt;&lt;span class="s2"&gt;; position: absolute; left: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;px; top: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;px; color: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)]}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt; &lt;span class="c1"&gt;//[3]&lt;/span&gt;
            &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;downer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;upper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="nx"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;upTypes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;upTypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="nx"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;`font-size: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fontSizes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;fontSizes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)]}&lt;/span&gt;&lt;span class="s2"&gt;; position: absolute; left: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;px; top: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;px; color: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;colorsUp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;colorsUp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)]}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
            &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;[1] - I used arrays to pick from a selection of choices at random&lt;br&gt;
[2] - You can use &lt;code&gt;let&lt;/code&gt; (not &lt;code&gt;var&lt;/code&gt;!) to successfully use &lt;code&gt;setTimeout&lt;/code&gt; in a regular for loop. This &lt;a href="https://stackoverflow.com/a/31286220/12060701"&gt;Stack Overflow answer&lt;/a&gt; explains it well&lt;br&gt;
[3] - I struggled with CSS class attaching and ended up creating generated inline styles. I'm not sure how well this scales but it worked for me.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Lexical Scoping in Javascript and Improv</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Mon, 07 Oct 2019 01:24:47 +0000</pubDate>
      <link>https://dev.to/bramses/lexical-scoping-in-javascript-and-improv-2d4g</link>
      <guid>https://dev.to/bramses/lexical-scoping-in-javascript-and-improv-2d4g</guid>
      <description>&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; What is lexical scoping?&lt;/li&gt;
&lt;li&gt; What are closures?&lt;/li&gt;
&lt;li&gt; Lexical scoping is a technique used in improv&lt;/li&gt;
&lt;li&gt; Comedic callbacks and Rule of Three&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is lexical scoping?
&lt;/h2&gt;

&lt;p&gt;Lexical scoping is a computer science concept used to manage and read variables. Lexical scoping is used by the parser (the interpreter of our code) to determine which variables belong to which scope. This is best illustrated with an example: Some key words:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  variable: a value that can change over time, not constant&lt;/li&gt;
&lt;li&gt;  function: a block of code that can be run by a computer by "invoking" it using parentheses, like putOnPants()&lt;/li&gt;
&lt;li&gt;  closure: we'll get to that soon ;)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;sayMyName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bram&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// name is a local variable&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;displayName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// displayName() is the inner function, a closure&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hi &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;!`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// use variable declared in the parent function&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;displayName&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// call displayName&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;sayMyName&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// call sayMyName&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;example courtesy of &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures"&gt;Mozilla&lt;/a&gt;&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;You can run this in your Console too! On Chrome you can hit &lt;code&gt;⌘-Option-J&lt;/code&gt; &lt;code&gt;(Ctrl-Shift-J on Windows)&lt;/code&gt; and copy pasta the code above. Feel free to have it say your name instead!&lt;/p&gt;

&lt;h2&gt;
  
  
  What are closures?
&lt;/h2&gt;

&lt;p&gt;Closures are similar to lexical scoping, but provide us different benefits. Above, we called &lt;code&gt;displayName&lt;/code&gt; immediately. However, in Javascript, functions are considered as &lt;em&gt;first class objects&lt;/em&gt;. All this means is that we can treat functions as objects (an object is a complex topic, but it's easiest to think of as an entity, like a person or a car). Lets modify our example above a bit: Key Terms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  return: a return statement is the final line of code in a function. It basically &lt;em&gt;returns&lt;/em&gt; the computation done
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;sayMyNameClosure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// we don't need our local variable anymore since we're passing name as an argument&lt;/span&gt;
  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;displayName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// displayName() is the inner function, a closure&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hi &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;!`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;displayName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// return displayName&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sayBram&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sayMyNameClosure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bram&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sayBradPitt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sayMyNameClosure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Brad Pitt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;sayBram&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// call sayBram&lt;/span&gt;
&lt;span class="nx"&gt;sayBradPitt&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// call sayBradPitt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What's happening here is that we're setting up two separate lexical scopes. These scopes are unique, and both have a different idea of what &lt;code&gt;name&lt;/code&gt; evaluates to. In &lt;code&gt;sayBram&lt;/code&gt; name = Bram, but in &lt;code&gt;sayBradPitt&lt;/code&gt; name = Brad Pitt. Feel free to try these out in your console!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uIuu08uh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/cs6qdzyia5s3mg2h19v2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uIuu08uh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/cs6qdzyia5s3mg2h19v2.jpg" alt="Fight Club" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;First rule of closures: don't talk about closures&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What does this have to do with improv??
&lt;/h2&gt;

&lt;p&gt;I agree, that's enough code, let's focus on comedy here. In improv comedy, the structure usually goes as follows: the audience gives your team a word or a phrase, you spend 20-30 seconds coming up with scenes about it, and then you go wild. The great thing about improv is that it's all based on &lt;code&gt;Yes, and&lt;/code&gt;, which means that everything your team members say is "true" for the scene. Okay, so let's say the word is &lt;em&gt;typewriter&lt;/em&gt;. I might come up with a scene about how I work at a 1950's news company, Mad Men style. My partner and I would act the scene, and pay attention to which bits get laughs. We then would store those away with the character for later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Scene 1&lt;/strong&gt;: (Me and one other person) I'm a distraught house husband whose novels aren't taking off because they're really bad. However, my wife doesn't want to shatter my confidence so she tries to stifle her laughter as she reads my book. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scene 2&lt;/strong&gt;: (Two other people) A completely different timeline where typewriters are falling from the sky, causing mass hysteria. Kind of like Fahrenheit 451 meets dinosaur asteroid extinction. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scene 3&lt;/strong&gt;: (Me and someone from scene 2) We both narrow in on what went well with the audience the last two scenes and really send those jokes to the moon (as in, we make them even bigger and crazier) What we're doing here is lexical scoping! We're remembering who our characters were and what they did, and then were invoking them later, like &lt;code&gt;tellFunnyJokeFromEarlier()&lt;/code&gt;. I won't act as someone else's character and use their jokes, and they won't use mine!&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule of Three
&lt;/h2&gt;

&lt;p&gt;I want to close this out discussing the &lt;a href="https://en.wikipedia.org/wiki/Rule_of_three_(writing)"&gt;rule of three&lt;/a&gt;. The rule of three basically states that jokes are really funny if you use them three times. The rule of three also applies to photography in the Rule of Thirds (another post for another day), and slogans like &lt;em&gt;Stop, Drop and Roll&lt;/em&gt;. Three is just a really memorable number. So using what we've learned above we can write improv comedy as code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;funnyJoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// pass in our person into the scope&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;tellJoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;joke&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// pass in joke when we call funnyJoke&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;joke&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;tellJoke&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bramJoke&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;funnyJoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bram&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bradJoke&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;funnyJoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Brad Pitt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;bramJoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;What&lt;/span&gt;&lt;span class="se"&gt;\'&lt;/span&gt;&lt;span class="s1"&gt;s the deal with airline food?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// first time&lt;/span&gt;
&lt;span class="nx"&gt;bradJoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Q: What is Homer Simpson&lt;/span&gt;&lt;span class="se"&gt;\'&lt;/span&gt;&lt;span class="s1"&gt;s favorite ice cream? &lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s1"&gt;A: Chocolate-chip cookie d&lt;/span&gt;&lt;span class="se"&gt;\'&lt;/span&gt;&lt;span class="s1"&gt;oh!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;bramJoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;What&lt;/span&gt;&lt;span class="se"&gt;\'&lt;/span&gt;&lt;span class="s1"&gt;s the deal with airline food?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// second time&lt;/span&gt;
&lt;span class="nx"&gt;bradJoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Q: Why is the math book always upset?&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s1"&gt;A: Because it has a lot of problems.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;bramJoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;What&lt;/span&gt;&lt;span class="se"&gt;\'&lt;/span&gt;&lt;span class="s1"&gt;s the deal with airline food?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// third time -- audience dies of laughter&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Yes, I was a Digital Nomad. No, it didn't work out like I thought it would.</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Sat, 05 Oct 2019 17:14:47 +0000</pubDate>
      <link>https://dev.to/bramses/yes-i-was-a-digital-nomad-no-it-didn-t-work-out-like-i-thought-it-would-ceg</link>
      <guid>https://dev.to/bramses/yes-i-was-a-digital-nomad-no-it-didn-t-work-out-like-i-thought-it-would-ceg</guid>
      <description>&lt;p&gt;Have you ever been curious about the Digital Nomad lifestyle? Have you seen pictures of laptops on beaches tagged: “#mondays”?&lt;/p&gt;

&lt;p&gt;How twenty-something year old travel bloggers somehow move their entire lives to places like Bali to take advantage of the cheap rent and great weather? &lt;/p&gt;

&lt;p&gt;Let's talk a bit about being a digital nomad.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclaimer&lt;/em&gt;: this is written from the perspective of an American, technologically savvy, young individual. There will be blind spots and assumptions, but all I can speak to is my experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Because the Internet
&lt;/h2&gt;

&lt;p&gt;The world is in an interesting place right now. Thanks to the proliferation of apps like Airbnb, Google Flights, Uber and Google Translate; travel has never been easier. &lt;/p&gt;

&lt;p&gt;It’s trivial to book an entire stay in a foreign country from your couch, just to arrive and find all the amenities you would at home. For a much cheaper price. &lt;/p&gt;

&lt;p&gt;That was the allure for me at least. To be able to do the work that I do without needing to be in a physical office or an expensive place like New York City. To cut my expenses while imbibing in a new culture. &lt;/p&gt;

&lt;p&gt;Then reality reminded me of why plans rarely pan out the way we hope.&lt;/p&gt;

&lt;h2&gt;
  
  
  I was in Mexico for a week
&lt;/h2&gt;

&lt;p&gt;After I left my full time job in &lt;a href="https://usrbinblog.com/2019/08/05/first-month-retrospective/"&gt;July&lt;/a&gt;, I decided that I’d like to live cheaper in order to create a more long-term sustainable lifestyle.  &lt;/p&gt;

&lt;p&gt;I signed up for a nomad site. I involved myself within the Facebook communities. I signed up for Meetups in the city, and planned my days around work and exploration.  &lt;/p&gt;

&lt;p&gt;I found Airbnbs for ~$400 per month in very desirable areas. &lt;/p&gt;

&lt;p&gt;I even downloaded Duolingo again to work on my Spanish! &lt;/p&gt;

&lt;p&gt;I took a quick pit stop to visit my &lt;a href="https://www.instagram.com/theadamsbros/"&gt;cousins&lt;/a&gt; in Los Angeles, and then I grabbed a flight to Mexico.&lt;br&gt;
Almost the very day I arrived, things went south (from LA! &lt;em&gt;ba-dum-psh&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;I got sick. Not like &lt;em&gt;cough cough&lt;/em&gt; sick, more like, &lt;em&gt;I don't feel so good, Mr. Stark&lt;/em&gt; sick. The doctors were concerned enough to send me in for some of the more &lt;em&gt;"involved i.e. intense i.e. intrusive"&lt;/em&gt; tests. What the issue was is not relevant to this post so from here on out it will be referred to as "medical issue."&lt;/p&gt;

&lt;p&gt;Thanks to "medical issue", I spent most of my time in Mexico City lying in bed, trying not to throw up. This obviously sucks. I couldn't even keep down Mexico City's &lt;strong&gt;amazing&lt;/strong&gt; food (and I tried). After my fourth day in the Airbnb, I raised my white flag of surrender and booked a flight home to recover.&lt;/p&gt;

&lt;h2&gt;
  
  
  Physical Health Trumps All
&lt;/h2&gt;

&lt;p&gt;The body is a phenomenal machine, quietly ticking away most of the time. For many of us, our bodies are backdrops to the dramas playing in our heads from the workday, dreams and desires, the he said, she said of the everyday.&lt;/p&gt;

&lt;p&gt;And this is good! It would be exhausting to constantly be in physical pain, to obsess over whether your leg will work tomorrow or not (my heart goes out to those who do experience these problems daily). &lt;/p&gt;

&lt;p&gt;However, there is the other side of the coin as well. Every once in a while, some bacterium will slip past the immune system's defenses, or you'll trip in a way that you can't easily recover from, or some insidious tumor will be quietly growing in some corner of some organ.&lt;/p&gt;

&lt;p&gt;That's when shit gets real.&lt;/p&gt;

&lt;p&gt;In my mind, the physical health of the body is the lowest level of the pyramid, the real driver of how comfortable our temporary stay is here on Earth. &lt;/p&gt;

&lt;p&gt;Much like an actual foundation of a house, we rarely pay attention to it, because it's easier and more efficient to focus on the things &lt;em&gt;in your house&lt;/em&gt; than the things that &lt;em&gt;compose your house&lt;/em&gt;. &lt;br&gt;
And much like an actual house, if the foundation fails &lt;strong&gt;the whole thing comes down&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;While I was lying in bed, staring at the ceiling or squirming to find a comfortable position to drown my pain away in a Netflix binge, I came to appreciate this fact. "Medical issue" had won the day. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Pros of the Digital Nomad Lifestyle
&lt;/h2&gt;

&lt;p&gt;For many, travel is one to two weeks of PTO outside their home country once per year. Some spend it in hotels. Others go camping. Others yet spend it glamping(glamour camping). Their interaction with the target culture may be minimal, and generally transactional in nature.&lt;/p&gt;

&lt;p&gt;I'd like to talk about the benefits of the "digital nomad" lifestyle. I'm defining "digital nomad" as a concerted effort to spend 1+ months in a different country.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros of nomad-ing:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Different foods to try&lt;/li&gt;
&lt;li&gt;Sights to see and awe at&lt;/li&gt;
&lt;li&gt;Generally cheaper cost of living&lt;/li&gt;
&lt;li&gt;New people to meet&lt;/li&gt;
&lt;li&gt;New languages to learn&lt;/li&gt;
&lt;li&gt;Planes are fast, and reliable&lt;/li&gt;
&lt;li&gt;Becoming more open minded&lt;/li&gt;
&lt;li&gt;Learning more about this big blue marble we live on!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These pros are awesome, and for the adventurous among us, worth pursuing. It's a fun lifestyle for a reason, y'all. It's just &lt;strong&gt;fun&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"All that glitters is not gold."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Cons of the Digital Nomad Lifestyle
&lt;/h2&gt;

&lt;p&gt;All those pros said, being a digital nomad isn't exactly a walk in the park, either. The cons of travel can be small or major, depending on your tastes and tolerance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons of nomad-ing:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Being an outsider all the time. Sometimes you'll be viewed as a novelty, other times your interactions with locals won't be as…cute.&lt;/li&gt;
&lt;li&gt;Having to reset all of your daily routines (some view this as a pro)&lt;/li&gt;
&lt;li&gt;The tension of staying in vs. going out&lt;/li&gt;
&lt;li&gt;Your work still has to get done, even when you would rather be sipping margs out of that coconut&lt;/li&gt;
&lt;li&gt;New laws (I can barely remember ours)&lt;/li&gt;
&lt;li&gt;Packing and deciding which of your stuff is worth taking to your new life, and what is worth tossing&lt;/li&gt;
&lt;li&gt;Starting at ground zero with friendships&lt;/li&gt;
&lt;li&gt;New pathogens that your body is all like..."I don't know how to deal with this"&lt;/li&gt;
&lt;li&gt;Motivation either plummets or skyrockets depending on your comfort and anxiety levels&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tips for Wannabe Nomads
&lt;/h2&gt;

&lt;p&gt;Let’s not cut corners here, becoming a digital nomad isn’t a sustainable option for many. These things will generally put you out of the race before you even start:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a job that requires a physical location&lt;/li&gt;
&lt;li&gt;a family with kids&lt;/li&gt;
&lt;li&gt;a mortgage&lt;/li&gt;
&lt;li&gt;anything else that prohibits you from "peacing out" from the US for months at a time &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're curious about getting involved with the lifestyle, I'd like to offer a few tips.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pick up a ”laptop skill”, like coding, blogging, video editing, design. Something that doesn’t require your physical presence to work. Sign up for Fiverr or bother your network by sending annoying emails to find client work to do.&lt;/li&gt;
&lt;li&gt;Pick up materials that are easy to travel with, but provide great quality of life improvements. Some that come to mind: a good external battery, portable laptop stand, Kindle, packing cubes(!)&lt;/li&gt;
&lt;li&gt;Separate your personality from your stuff. The nomad lifestyle is well, nomadic. If you don't like wearing the same four shirts, you're gonna have a bad time.&lt;/li&gt;
&lt;li&gt;Join &lt;a href="https://nomadlist.com/"&gt;nomad list&lt;/a&gt;, there is a ton of great resources there, and an active Slack channel. &lt;/li&gt;
&lt;li&gt;Travel Insurance&lt;/li&gt;
&lt;li&gt;Check Visa requirements for the country you're planning on staying in&lt;/li&gt;
&lt;li&gt;Research the culture before you go! Remember, you're trying to &lt;strong&gt;integrate, not vacay&lt;/strong&gt;, so you're going to have to make a genuine attempt at the &lt;strong&gt;language and culture of your target country&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;A good budget, a good bank, and a good phone plan&lt;/li&gt;
&lt;li&gt;A proclivity for adventure, and being proved wrong about your world view&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The US is expensive. $1000 USD goes much much much farther in Bali than it would in NYC.&lt;/p&gt;

&lt;p&gt;Becoming a digital nomad to escape this reality is enticing. And thanks to the internet, it's easy. Like, really easy.&lt;/p&gt;

&lt;p&gt;But here's the kicker. Your problems won't go away by traveling to a new area. You'll just find new ones to face.&lt;/p&gt;

&lt;p&gt;When I was lying in that bed, staring at the ceiling, I had problems. It's not glorious.&lt;/p&gt;

&lt;p&gt;I asked myself, assuming the worst case scenario, did I want to be 2000 miles from nearest people I know?&lt;/p&gt;

&lt;p&gt;Before you go, ask yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why am I going to where I'm going?&lt;/li&gt;
&lt;li&gt;What do I expect to learn?&lt;/li&gt;
&lt;li&gt;What do I want to get out of this?&lt;/li&gt;
&lt;li&gt;Am I traveling for clout? To post on my social media and brag to my friends?&lt;/li&gt;
&lt;li&gt;How will I stay focused on the tasks at hand for my job?&lt;/li&gt;
&lt;li&gt;What is my contingency plan?&lt;/li&gt;
&lt;li&gt;How does this trip affect my 5 year plans?&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;But here's the kicker. Your problems won't go away by traveling to a new area. You'll just find new ones to face.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you have any questions, please don't hesitate to reach out to me. You can find me on Twitter @adams_bram&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Optimizing your Workday with Simplenote</title>
      <dc:creator>Bram Adams</dc:creator>
      <pubDate>Thu, 03 Oct 2019 19:13:13 +0000</pubDate>
      <link>https://dev.to/bramses/optimizing-your-workday-with-simplenote-7pm</link>
      <guid>https://dev.to/bramses/optimizing-your-workday-with-simplenote-7pm</guid>
      <description>&lt;p&gt;&lt;em&gt;this post is not sponsored, I just really enjoy their software&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR download Simplenote. It’s a well thought out Notes app that supports markdown, syncs between all of your devices, and uses a tagging system to search.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Finding a good note-taking app is critical. Getting stuff out of your head for later processing is key to productive work. &lt;/p&gt;

&lt;p&gt;To me a good note taking app is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;intuitive&lt;/li&gt;
&lt;li&gt;lightweight&lt;/li&gt;
&lt;li&gt;markdown compatible&lt;/li&gt;
&lt;li&gt;searchable&lt;/li&gt;
&lt;li&gt;syncs between all my devices &lt;/li&gt;
&lt;li&gt;secure/private &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I've used a lot of note taking softwares, to various degrees of success. I’ve used Notion, Apple Notes, bullet journaling and I even tried managing notes on Google Docs for a brief stint. &lt;/p&gt;

&lt;p&gt;The problem was, most note taking options were much too heavy. They either took forever to open or were so bogged down with features that it distracted from the note taking experience. &lt;/p&gt;

&lt;p&gt;Before Simplenote my favorite note taking devices were: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Bullet Journaling &lt;/li&gt;
&lt;li&gt;Apple Notes&lt;/li&gt;
&lt;li&gt;Notion&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Bullet Journaling
&lt;/h3&gt;

&lt;p&gt;I love bullet journaling because of the daily format. Each day is unique, and may require drawings and chicken scratch to describe, that text just can’t do. The dots, dashes and circle method is intuitive and makes searching through pages a breeze. And since it’s not put on the internet, it’s private! &lt;/p&gt;

&lt;p&gt;But.&lt;/p&gt;

&lt;p&gt;Carrying around a journal is a pain. &lt;br&gt;
Remembering to write everyday is a pain. Losing a journal is a pain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Apple Notes
&lt;/h3&gt;

&lt;p&gt;Fast. That is the main reason I used Apple Notes. An idea strikes? Open the notes app. Want to clarify an older idea? Notes app. The search functionality is impressive.&lt;/p&gt;

&lt;p&gt;But.&lt;/p&gt;

&lt;p&gt;The Notes app doesn’t support markdown. This makes formatting a pain. Writing longer form content on it is out of the question.&lt;/p&gt;

&lt;h3&gt;
  
  
  Notion
&lt;/h3&gt;

&lt;p&gt;Hyper futuristic writing-organizing-editing-workflow technology that I hope to return to in the future. Linking between pages is a joy, and there are a lot of fun toys to play with.&lt;/p&gt;

&lt;p&gt;But.&lt;/p&gt;

&lt;p&gt;The experience on iPad and iPhone is &lt;strong&gt;awful&lt;/strong&gt;. It lags, it jumps around different parts of the document, editing previous blocks means you have to scroll and tap on them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Simplenote
&lt;/h3&gt;

&lt;p&gt;For me, Simplenote was the solution. I needed something that wouldn't take 500 years to open on my phone to capture quick ideas, but also be flexible enough for longer form content. It is password protected so I feel less nervous expressing my thoughts (still not nearly as safe as paper; given the nature of the Internet). &lt;/p&gt;

&lt;p&gt;Simplenote allows me to organize my thoughts, monitor project completion, and capture ideas when inspiration strikes. And it syncs between all my devices! For free! &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Caveat: apparently some users have ran into &lt;a href="https://www.ctrl.blog/entry/review-simplenote.html"&gt;issues with syncing&lt;/a&gt;. I personally haven't.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At the end of the day, the tool needs to fit the job. If you're more comfortable on Evernote, or with pen and paper, or writing on cave walls, you do you. Find what works.&lt;/p&gt;

</description>
      <category>productivity</category>
    </item>
  </channel>
</rss>
