<?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: Joseph Ochego </title>
    <description>The latest articles on DEV Community by Joseph Ochego  (@thejoernal).</description>
    <link>https://dev.to/thejoernal</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%2F1337242%2F4e18b46b-83ed-4333-8fdb-e11653abad2d.png</url>
      <title>DEV Community: Joseph Ochego </title>
      <link>https://dev.to/thejoernal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thejoernal"/>
    <language>en</language>
    <item>
      <title>Chase it afraid!</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Fri, 18 Jul 2025 06:11:01 +0000</pubDate>
      <link>https://dev.to/thejoernal/chase-it-afraid-dik</link>
      <guid>https://dev.to/thejoernal/chase-it-afraid-dik</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;For us humans, it is easier to articulate the negatives, because they're more concrete, pragmatic  &lt;strong&gt;&lt;em&gt;[Lex Fridman]&lt;/em&gt;&lt;/strong&gt; - &lt;em&gt;"it takes up more time, costs more, I'll miss out on a lot, it seems tough&lt;/em&gt; and this and that..."  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To articulate the positives, and most importantly of the things we are so passionate about is a big ask. With words we can do so little to persuade an audience of the worth of that which we are passionately allied to &amp;amp; desperately want to share. You have to experience it. Otherwise, you end up selling it short.   &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Fear&lt;/strong&gt; and &lt;strong&gt;Passion&lt;/strong&gt; would be defined as opposites if I held the pen to the great English dictionary. Or better put, Fear vs Passion.&lt;br&gt;&lt;br&gt;
Fear is a deterrent to many great things; seeing as the subject today is that of passion, I believe fear to be the biggest killer of passion.&lt;br&gt;&lt;br&gt;
First, it creeps in, gently peeling off the loudness of your passion, and as soon as it is allowed access to the core, bam! it disseminates the joy and meaning out of the passion. What is passion? Is it not meaning?  &lt;/p&gt;

&lt;p&gt;I say this with great conviction and purpose for the subject at hand.  &lt;/p&gt;

&lt;p&gt;As easy as it is to articulate the downsides and shortcomings of pathways we are offered or dreams that gnaw at us, so is it apparent and almost natural to express the negatives that fear births in relation to passion.  &lt;/p&gt;

&lt;p&gt;My field of focus with passion here is that of career and professional opportunities. However, fear is a parasite that actively seeks to destroy prospects in ideas, friendships, relationships, families, hobbies, faith, aspirations and all that we, humans hold dear.  &lt;/p&gt;

&lt;p&gt;I happen to have experienced loss in the hands of fear, I still do; I understand it just as well as I understand my limits in skill and the inadequacies of my character &lt;em&gt;(negatives are so easy to articulate, remember?)&lt;/em&gt;.  &lt;/p&gt;

&lt;p&gt;These are also very easy to point out, to recognize:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The hands I did not raise, to ask or to answer&lt;/li&gt;
&lt;li&gt;The times I bit my tongue so as not to express a contrarian opinion, even though I felt so strongly about it&lt;/li&gt;
&lt;li&gt;The chances I have begrudgingly "gifted" someone else despite me being the person of choice&lt;/li&gt;
&lt;li&gt;The job descriptions I have used as an excuse to escape taking a chance&lt;/li&gt;
&lt;li&gt;The conversations I have held out on&lt;/li&gt;
&lt;li&gt;The people I have pleased that I had no business pleasing and for what?; &lt;em&gt;"Thank you, you're the best???"&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All in all, the negatives have stood tall, staring down at me with oppressive intimidation. They have been so easy to spot, good justifiers of no pursuit at all; they have been too easy, too obvious.&lt;/p&gt;

&lt;p&gt;To look at this now, I am deeply unsettled and disappointed by my indifference to the foe. The allowance I afforded fear.&lt;/p&gt;

&lt;p&gt;The silver lining?&lt;br&gt;
There isn't one!&lt;/p&gt;

&lt;p&gt;Well, there actually is one. &lt;em&gt;Probably not the mood for a joke&lt;/em&gt;.&lt;br&gt;
&lt;strong&gt;"Knowledge is power"&lt;/strong&gt;, an common phrase. Fortunately, none of it's value has been lost as it has echoed so often on the walls of Kenyan classrooms.&lt;/p&gt;

&lt;p&gt;This is it! Despite wielding fear instead of courage, optimism and faith in my career battles, contemplating and writing on the matter has allowed me to re-evaluate what matters most and to allow myself to go for it. Boldly, giving no audience to the naysayers or the inevitable negatives. Truly, &lt;a href="https://dev.to/thejoernal/to-write-is-to-be-free-22kp"&gt;to write is to be free&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Yes you can experience fear and still be passionate. &lt;br&gt;
Can you? &lt;br&gt;
Yes. The concept is that of &lt;em&gt;courage&lt;/em&gt; - &lt;strong&gt;action despite fear.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Chase it afraid!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is a cross-platform post from &lt;a href="https://thejoernal.netlify.app/posts/chase_it_afraid/" rel="noopener noreferrer"&gt;my original blog site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>passion</category>
      <category>fear</category>
      <category>programming</category>
    </item>
    <item>
      <title>Own your goal - Forge the path</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Mon, 10 Mar 2025 03:12:57 +0000</pubDate>
      <link>https://dev.to/thejoernal/own-your-goal-forge-the-path-459</link>
      <guid>https://dev.to/thejoernal/own-your-goal-forge-the-path-459</guid>
      <description>&lt;p&gt;"One of my greatest fears is comfort, and the sense of security it brings along." Of course, I forget I hate it once I'm in that soft, puffy cloud. But an awakening from this state is always appreciated.&lt;/p&gt;

&lt;p&gt;Comfort is mostly entrapping - and the security? That's counterfeit. FAKE! &lt;del&gt;&lt;em&gt;mostly, at least&lt;/em&gt;&lt;/del&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A pleasant disappointment
&lt;/h2&gt;

&lt;p&gt;Unfortunately, I was fortunate enough to have a feel for this "comfort" we so earnestly seek. 2 months in and I was already pitching camp where I now believe I had no business settling. &lt;/p&gt;

&lt;p&gt;Fortunately, it was the unfortunate sudden and unforeseen disruption of this "comfort" that shook me up and back to my ambitious and goal-oriented self (now that I read it, framing myself that way is laughable 😅). &lt;br&gt;
Goals far different from what I was set in line for at that moment.&lt;/p&gt;

&lt;p&gt;Enough of the play with words. What's all this fuss about?&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's press rewind for a little bit...
&lt;/h2&gt;

&lt;p&gt;Imagine asking or leaving it to someone to make a decision, of which the consequence is you (not them) waking up at 5 am in the morning to leave, returning home at 6 pm, 6 days a week of exhaustion for the better part of your life going forward.&lt;/p&gt;

&lt;p&gt;Imagine leaving a decision of this magnitude to someone else. Crazy, right?&lt;/p&gt;

&lt;p&gt;Crazy enough, that's how I landed myself in that zone of "comfort". Luckily, I realized it was more of a trap. Thank God!&lt;/p&gt;

&lt;p&gt;Some paths are best forged singularly. Weigh your options, weigh the risks, understand the rewards and make a decision. The fewer people are involved, the less noisy and confusing decision-making becomes, and there you go, self-trust builds up; making decisions becomes that much easier. Understanding and accepting the consequence of each choice too.&lt;/p&gt;

&lt;p&gt;No internal conflict, because you never went to 100 people, all with varying opinions, to consult on the best course of action.&lt;/p&gt;

&lt;p&gt;No noise. All clear. I bet that's where "clear-headed" came from.&lt;/p&gt;

&lt;h2&gt;
  
  
  To be fair...
&lt;/h2&gt;

&lt;p&gt;When people make choices for us (especially those responsible for our well-being), it's often because they haven't seen the initiative from our end and they run in to help.&lt;/p&gt;

&lt;p&gt;Nevertheless, playing along isn't sustainable. Quite the opposite actually. However, it is the path of least resistance, feels natural to nod and do.&lt;/p&gt;

&lt;p&gt;Not surprisingly though, no wins are to be expected at the end of the paths we are pushed into.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choice is a privilege
&lt;/h2&gt;

&lt;p&gt;For those fortunate enough to have been afforded any amount of privileges in their lives, they would understand that most of the time, although we're grateful to be in such situations, we bear privilege as a burden lined with guilt and shame and sometimes the question "Why me?" Especially if many others are not as fortunate.&lt;/p&gt;

&lt;p&gt;Privilege is a gift and a responsibility. It is only fair to use it, the opposite of which would be ungratefulness.&lt;/p&gt;

&lt;p&gt;Duly noted, you should make haste while you're still party to that privilege of choice.&lt;/p&gt;

&lt;p&gt;In my case, the choice to venture into a path which, although laden with uncertainty, is fuelled by passion, innate curiosity and dedication to lifelong learning and growth.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I do not want to merely exist. I want to live;&lt;br&gt;
I do not want the most exciting moment of my life to be sitting on a chair watching someone experience the most exciting moment of their life", a podcast I can't remember.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this vein, I remind myself that one of the greatest gifts we can offer the people we care so deeply about is by being the best version of ourselves we possibly can across all spaces; physically, career-wise, in our relationships, emotionally and spiritually.&lt;/p&gt;

&lt;p&gt;To offer anything less to them is to betray them, and worse, ourselves.&lt;/p&gt;




&lt;p&gt;This might look like a well-crafted attempt at justifying following the path I want to, and you would be very right.&lt;/p&gt;

&lt;p&gt;But it is also the result of desperation, in my search for freedom; mine and yours (the reader). As we know &lt;a href="https://dev.to/thejoernal/to-write-is-to-be-free-22kp"&gt;"to write is to be free"&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And this my dear friends is an invitation, to &lt;strong&gt;Own your goal and forge the path&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>career</category>
      <category>choice</category>
      <category>developer</category>
      <category>writing</category>
    </item>
    <item>
      <title>To write is To be free</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Sat, 15 Feb 2025 17:50:41 +0000</pubDate>
      <link>https://dev.to/thejoernal/to-write-is-to-be-free-22kp</link>
      <guid>https://dev.to/thejoernal/to-write-is-to-be-free-22kp</guid>
      <description>&lt;p&gt;Picture this:&lt;/p&gt;

&lt;p&gt;"You have an office or study desk. You've been wanting to tidy your space, get the deodorant, comb, rough papers, piles of useless books and a piece of yesterday's chips off the table, give it a proper wipe and get more work done in a clean, clutter-free desk setup."&lt;/p&gt;

&lt;p&gt;Well, believe it or not, that's exactly how your mind works as well. Information clutter brings about confusion, stress, forgetfulness, uncertainty, and the list of negatives goes on and on.&lt;/p&gt;

&lt;p&gt;So let's organize our thoughts here and start from the beginning.&lt;/p&gt;

&lt;p&gt;My name is Joseph Ochego and I am a mechanical &lt;del&gt;engineer&lt;/del&gt; &lt;a href="https://www.google.com/search?sca_esv=bd24083d1d1ff32e&amp;amp;sxsrf=AHTn8zpaSsSCHS7UP0OtXBtronhMpjxv6g:1739640502416&amp;amp;q=draughtsman&amp;amp;si=APYL9btTB54oNzRD0c75DM-v-cL-_ipP_bHKB9RTKBAAEepABJAHi9ZzCxSfIibnt5vg6dYZOsYprpAZl5T-w3CwYgWp_0Ik9t3f4lVt9u8ky_k7PvC3Hgo%3D&amp;amp;expnd=1&amp;amp;sa=X&amp;amp;ved=2ahUKEwjTvrvxmcaLAxUPVKQEHTMeFq0Q2v4IegQIFxAY&amp;amp;biw=1318&amp;amp;bih=642" rel="noopener noreferrer"&gt;draughtsman&lt;/a&gt; - "draftsman"  enUS by day, and a web dev by night. As a consequence of my love for technology, &lt;a href="https://dev.to/thejoernal"&gt;I write about it&lt;/a&gt;. After having some "wins" while getting started in web development as a side venture, I wanted to share my experiences, I needed to. "Maybe people who learn from my experiences will get the thrill of victory I did as well, wouldn't that be nice", I thought.&lt;/p&gt;

&lt;p&gt;So I resolved to writing, from tutorials, to review articles, to personal rants and much more is yet to be explored. This excited me then and excites me even more now. I've written about pieces of technology I've enjoyed using such as &lt;a href="https://dev.to/thejoernal/hey-4kb5"&gt;Hey&lt;/a&gt; - a different take on email by &lt;a href="https://www.hey.com/" rel="noopener noreferrer"&gt;37Signals&lt;/a&gt;; web-dev tutorials such as the one on &lt;a href="https://dev.to/thejoernal/how-to-display-javascript-objects-1jbi"&gt;JavaScript Objects&lt;/a&gt; and another on &lt;a href="https://dev.to/thejoernal/markdown-more-with-less-4kjl"&gt;the Basics of Markdown&lt;/a&gt;; rants such as &lt;a href="https://dev.to/thejoernal/why-i-write-3kpm"&gt;Why I Write&lt;/a&gt;. For me, this is an outlet, more than anything else.&lt;/p&gt;

&lt;p&gt;Although all that is important, veerry important to be precise, let's shift our sights to a particular by-product of writing - clarity, which births the freedom this piece has so tactfully evaded talking about till now. I'd call them, the by-product and the by-by-product.&lt;/p&gt;

&lt;p&gt;My writing is often spontaneous - in the rush of the fanaticism and excitement. Like when I wrote about Hey. Other times, I write when I'm battling a myriad of thoughts like I am currently as I write this piece.&lt;/p&gt;

&lt;p&gt;It is a Saturday afternoon at work, and like the norm, the workload at such a time is reduced to a minimum and the motivation to clear the remainder of the work quashed by the slow moving hours. Today in particular, most offices sit empty in silence and as I pick up my bag to pack and leave as well, I noticed something - silence, peace, finally. So I sit myself back down, pick up and press atop my mechanical pencil for a fresh extension of graphite and the source a fresh sheet of plain A4 paper from my file. With the silence so audible and my mind caught up in the peace, I let my thoughts race and my wrist slide from left to &lt;del&gt;write&lt;/del&gt; right.&lt;/p&gt;

&lt;p&gt;Although there's a touch of spontaneity in my writing, it isn't always about "lightbulb" moment to paper. It's mostly a process of getting an idea, trying to shake it off, some leave, some are quite stubborn and so I get fixated on those ones; continually digesting the concepts and ideas behind the subject matter, which can take a few hours to a day or two. By this time, I'm itching to be listened to and so I get a pencil and paper and I let loose.&lt;/p&gt;

&lt;p&gt;As I pour all my thoughts to the poor sheet of paper, I make the point of pruning the nonsensical ideas that try to sneak into the piece. I determine this by thinking as I write and some ideas are straight up not right while others are heavily based on personal bias. &lt;strong&gt;These have to go.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GPTs and Google&lt;/strong&gt; also lend a helping hand as clarifiers for confusing concepts.&lt;/p&gt;

&lt;p&gt;When I am done with my pencil and paper, I pretty much have a piece supported by facts (mostly 😁) and enriched by personal opinions meant to add and not detract value from my arguments.&lt;/p&gt;

&lt;p&gt;When I am done, the topic is clear, the hypothesis has been tested and the facts are what's left: &lt;strong&gt;Hence Clarity&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When I am done, I am free from confusion, free from the uncertainty of the subject matter: &lt;strong&gt;&lt;em&gt;To think or not to think, to learn or not to learn, to write or not to write, to teach or not to teach.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOW I AM FREE.&lt;/strong&gt; I have learnt, I have written and to those that read, I have taught.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;01010111 01010010 01001001 01010100 01001001 01001110 01000111 = 01000011 01001100 01000001 01010010 01001001 01010100 01011001
//and
01000011 01001100 01000001 01010010 01001001 01010100 01011001 = 01000110 01010010 01000101 01000101 01000100 01001111 01001101
//Hence
01010111 01010010 01001001 01010100 01001001 01001110 01000111 = 01000110 01010010 01000101 01000101 01000100 01001111 01001101

WRITING = CLARITY
//and
CLARITY = FREEDOM
//Hence
WRITING = FREEDOM

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;PS: Even on a good day, I couldn't come up with this code block on my own😂. Thank you Deepseek&lt;/em&gt;. 🙏🏽&lt;/p&gt;

</description>
      <category>writing</category>
      <category>tutorial</category>
      <category>freedom</category>
      <category>learning</category>
    </item>
    <item>
      <title>Markdown: More With Less</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Sat, 03 Aug 2024 19:11:14 +0000</pubDate>
      <link>https://dev.to/thejoernal/markdown-more-with-less-4kjl</link>
      <guid>https://dev.to/thejoernal/markdown-more-with-less-4kjl</guid>
      <description>&lt;p&gt;Every technical writer should use Markdown✍; At the very least, learn it 📖&lt;/p&gt;

&lt;p&gt;Markdown is a lightweight markup language for creating formatted text using a plain-text editor. It is commonly used in blogging, instant messaging (you use it on Whatsapp for bold, italics etc.) and other cooler applications such as &lt;a href="https://github.blog/news-insights/product-news/math-support-in-markdown/" rel="noopener noreferrer"&gt;writing Math articles with expressions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It's best feature? Simplicity 💯&lt;/p&gt;

&lt;p&gt;I use markdown for blogging on dev.to and on my &lt;a href="https://thejoernal.netlify.app" rel="noopener noreferrer"&gt;personal blog&lt;/a&gt; site which is built on &lt;a href="https://gohugo.io/" rel="noopener noreferrer"&gt;Hugo&lt;/a&gt;.&lt;br&gt;
I use it for notes, task lists, reports and of course project documentation. MD(Markdown) is highly extensible and can be used in numerous applications.&lt;/p&gt;

&lt;p&gt;Some important features that I heavily lean into in my workflow include:&lt;/p&gt;
&lt;h2&gt;
  
  
  1.Headings
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;  # heading 1
  ## heading 2
  ### heading 3
  #### heading 4
  ##### heading 5
  ###### heading 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;:  &lt;/p&gt;
&lt;h1&gt;
  
  
  heading 1
&lt;/h1&gt;
&lt;h2&gt;
  
  
  heading 2
&lt;/h2&gt;
&lt;h3&gt;
  
  
  heading 3
&lt;/h3&gt;
&lt;h4&gt;
  
  
  heading 4
&lt;/h4&gt;
&lt;h5&gt;
  
  
  heading 5
&lt;/h5&gt;
&lt;h6&gt;
  
  
  heading 6
&lt;/h6&gt;


&lt;h2&gt;
  
  
  2. Embedding links in text and link references
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;some text&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://some.website&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;: &lt;a href="https://some.website" rel="noopener noreferrer"&gt;some text&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Embedding media such as images and videos
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For images:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;  !&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;alt_text&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;image.png&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;For Videos, there is more than one way to do it. The easiest in my opinion is using the  &lt;code&gt;HTML&lt;/code&gt; &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; tag.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another way is to embed a video using hosting services such as youtube and vimeo which provide you an embed code that you can copy and paste into your markdown file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"560"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"315"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.youtube.com/embed/video-id"&lt;/span&gt; &lt;span class="na"&gt;frameborder=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;allow=&lt;/span&gt;&lt;span class="s"&gt;"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"&lt;/span&gt; &lt;span class="na"&gt;allowfullscreen&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another is using the markdown-specific syntax for embedding videos. There are different syntax for different platforms. For example YouTube and Vimeo etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;![alt text&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://img.youtube.com/vi/video-id/0.jpg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;](https://www.youtube.com/watch?v=video-id)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whichever method you choose to use, keenly consider user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Checkboxes for todos
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;    -&lt;/span&gt; [ ] Write blog
&lt;span class="p"&gt;    -&lt;/span&gt; [ ] Publish blog
&lt;span class="p"&gt;    -&lt;/span&gt; [ ] Create summary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Write blog&lt;/li&gt;
&lt;li&gt;[ ] Publish blog&lt;/li&gt;
&lt;li&gt;[ ] Create summary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note that the checkboxes are rendered on most markdown readers but not all, for example on this site.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Lists
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;    -&lt;/span&gt; item 1
&lt;span class="p"&gt;    -&lt;/span&gt; item 2
&lt;span class="p"&gt;    -&lt;/span&gt; item 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;item 1&lt;/li&gt;
&lt;li&gt;item 2&lt;/li&gt;
&lt;li&gt;item 3&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Quotes/Block Quotes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gt"&gt;    &amp;gt; "Markdown is a simple and efficient language for documentation and note taking", theJoernal.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Markdown is a simple and efficient language for documentation and note taking", theJoernal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7. Code snippets and blocks (I mostly use this in tutorials)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For inline code snippets, use single backticks&lt;/li&gt;
&lt;li&gt;For larger codeblocks, use triple backticks;
Three to open the block and three after the code to close it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkeeicry3nhbnxjd353nb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkeeicry3nhbnxjd353nb.png" alt="screenshot of codeblock" width="800" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Syntax highlighting in codeblocks
&lt;/h2&gt;

&lt;p&gt;To get Syntax highlighting in code blocks, add the language name immediately after the opening backticks:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwdk1ak9sp1cruqthuhf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwdk1ak9sp1cruqthuhf.png" alt="screenshot of codeblock with syntax highlighting" width="800" height="171"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;br&gt;Markdown tooling is not an issue;&lt;br&gt;&lt;br&gt;
You prefer working on VS Code? You can. On Notepad or Vim? You're covered. And now, you can do it on &lt;a href="https://zed.dev/" rel="noopener noreferrer"&gt;Zed Editor&lt;/a&gt; (I am testing it on Linux at the moment), which has inbuilt markdown support.&lt;/p&gt;

&lt;p&gt;Apart from these popular text editors and IDEs, there are also several &lt;a href="https://blog.hubspot.com/website/wysiwyg-markdown-editor" rel="noopener noreferrer"&gt;Markdown-specific editors&lt;/a&gt;, that pack in some goodies.&lt;br&gt;
Some honourable mentions that I've personally enjoyed using in the past include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://obsidian.md/" rel="noopener noreferrer"&gt;Obsidian&lt;/a&gt; (All Platforms)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://typora.io/" rel="noopener noreferrer"&gt;Typora&lt;/a&gt; (Linux, Mac, Win)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.notion.so/" rel="noopener noreferrer"&gt;Notion&lt;/a&gt; (Mac, Win, Android, IOS)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ia.net/" rel="noopener noreferrer"&gt;iA Writer&lt;/a&gt; (Mac, Win, Android, IOS)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://simplenote.com/" rel="noopener noreferrer"&gt;Simplenote&lt;/a&gt; (Linux, Mac, Win, Android, IOS)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.inkdrop.app/" rel="noopener noreferrer"&gt;InkDrop&lt;/a&gt; (Linux, Mac, Win, Android, IOS)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Find out more about markdown here: &lt;a href="https://www.markdownguide.org/getting-started/" rel="noopener noreferrer"&gt;Getting Started with Markdown&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do you use Markdown?&lt;/p&gt;

&lt;p&gt;This is a cross post from the original on &lt;a href="https://thejoernal.netlify.app/posts/more_with_less/" rel="noopener noreferrer"&gt;my blog site&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>markdown</category>
      <category>writing</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Understand Scoping in JavaScript</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Fri, 12 Jul 2024 12:21:54 +0000</pubDate>
      <link>https://dev.to/thejoernal/understand-scoping-in-javascript-2o5b</link>
      <guid>https://dev.to/thejoernal/understand-scoping-in-javascript-2o5b</guid>
      <description>&lt;p&gt;Scoping in JavaScript is an important concept that provides the rules for variable accessibility from different parts of your code. It's a process of checking for a variable from one level to the next, from a block level to the function, and finally searching in the global level. Understanding scoping is important for writing a well-organized, efficient, and bug-free program.&lt;/p&gt;

&lt;h2&gt;
  
  
  Levels of Scoping
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Block Scope
&lt;/h3&gt;

&lt;p&gt;A block scope is an area within curly braces &lt;code&gt;{}&lt;/code&gt;. Variables declared in a block will have block-level scope. This feature was introduced in ES6 using the &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; keywords. Here's an 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="k"&gt;if &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="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;blockVariable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I am inside a block&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blockVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: I am inside a block&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blockVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Error: blockVariable is not defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Function Scope
&lt;/h3&gt;

&lt;p&gt;Variables defined within a function are accessible only within the function in which they are defined, as well as any nested blocks inside of it. This applies to &lt;code&gt;var&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt;, and &lt;code&gt;const&lt;/code&gt;.&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="nf"&gt;user&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;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John Doe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: John Doe&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Error: userName is not defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Global Scope
&lt;/h3&gt;

&lt;p&gt;Variables declared outside of any block or function exist in the global scope. They can be accessed from anywhere in the script.&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;globalVariable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I am global&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;accessGlobal&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;globalVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: I am global&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;accessGlobal&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;globalVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: I am global&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Scope Resolution Sequence
&lt;/h2&gt;

&lt;p&gt;When JavaScript needs to use a variable, it follows the following sequence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Immediate Scope&lt;/strong&gt;: It starts by looking in the current block or function where the variable is referenced.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enclosing Scopes&lt;/strong&gt;: If the enclosed scope is not found, it will move to the higher next scope and so on till it moves up the chain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Global Scope&lt;/strong&gt;: The variable does not exist in any local or enclosing scopes, hence it falls in the global scope.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The search stops the moment it finds the variable at any level and uses the variable. Else, throws a reference error if not found anywhere.&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;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Global User&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;user&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;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Function User&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: Function User&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: Global User&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;user&lt;/code&gt; function in the above example has another variable inside it, called &lt;code&gt;userName&lt;/code&gt;. As the function &lt;code&gt;user()&lt;/code&gt; was invoked, it output the "Function User". Access to global &lt;code&gt;userName&lt;/code&gt; is made, as a reference is available outside the function, and it outputs the "Global User".&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Scoping is Important
&lt;/h2&gt;

&lt;p&gt;Scoping is used to avoid variable conflicts and ensures that variables are accessed in the intended context. If a variable with the same name exists under different scopes, JavaScript considers them as totally different and thus won't have any problem.&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;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Global User&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;user&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;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Function User&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: Function User&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: Global User&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Updated Global User&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: Updated Global User&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variable changes made in one scope are not reflected in any variable that shares the same name but exists in a different scope, unless specified. This ensures separate variables are obtained for clean, more maintainable code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Declare variables within intended scope&lt;/strong&gt;: Use global variables when and only if they are needed by more than one function.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; for block-level scoping&lt;/strong&gt;: This will make accidental re-declaration and scope leakage impossible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the global scope clean&lt;/strong&gt;: Try not to define too many global variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Writing more organized, efficient, and errorless code is possible by understanding and applying the principles of JavaScript scoping. In addition, such an approach guarantees that the debugging and maintenance process will be greatly simplified.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hasta la Vista&lt;/strong&gt; 👋&lt;/p&gt;

&lt;p&gt;This is a cross-post from my original &lt;a href="https://thejoernal.netlify.app/posts/simplified-scoping/" rel="noopener noreferrer"&gt;blog site&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How To Display JavaScript Objects</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Wed, 29 May 2024 11:22:05 +0000</pubDate>
      <link>https://dev.to/thejoernal/how-to-display-javascript-objects-1jbi</link>
      <guid>https://dev.to/thejoernal/how-to-display-javascript-objects-1jbi</guid>
      <description>&lt;p&gt;While primitives in JavaScript are values themselves, everything else, including arrays and functions, &lt;strong&gt;are objects&lt;/strong&gt;. Understanding how to leverage objects in the Document Object Model &lt;em&gt;(DOM)&lt;/em&gt; is vital for effective web development.  &lt;/p&gt;

&lt;p&gt;This is a guide on different methods of displaying Objects when working with the DOM.&lt;/p&gt;




&lt;p&gt;Displaying a JavaScript Object will output &lt;code&gt;[object Object]&lt;/code&gt; by default:&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="err"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mySelf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Joe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bangalore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;  
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innnerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mySelf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//[object Object]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can however be &lt;strong&gt;maneuvered&lt;/strong&gt; and solved with a couple of workarounds:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Displaying Object properties by name&lt;/li&gt;
&lt;li&gt;Displaying Object Properties in a Loop&lt;/li&gt;
&lt;li&gt;Displaying Object using Object.values()&lt;/li&gt;
&lt;li&gt;Displaying Object using Object.entries()&lt;/li&gt;
&lt;li&gt;Displaying Object using JSON.stringify()&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Display the Object Properties
&lt;/h2&gt;

&lt;p&gt;Object properties can be displayed as a string:&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="c1"&gt;// create object&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mySelf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Joe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bangalore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;  
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// display properties&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mySelf&lt;/span&gt;&lt;span class="p"&gt;.&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="s2"&gt;, &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;mySelf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;, &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;mySelf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;city&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Display Object Properties in a Loop
&lt;/h2&gt;

&lt;p&gt;Object properties can also be collected in a loop. &lt;br&gt;
Here, we use an expression(&lt;code&gt;x&lt;/code&gt;):&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="c1"&gt;// Create an Object&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mySelf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Joe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bangalore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;  
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Build a Text&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&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;x&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;mySelf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;mySelf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Display the Text&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; You must use &lt;code&gt;mySelf[x]&lt;/code&gt; in the loop.&lt;br&gt;
&lt;code&gt;mySelf.x&lt;/code&gt; will not work since &lt;code&gt;x&lt;/code&gt; is the loop variable.&lt;/p&gt;
&lt;h2&gt;
  
  
  Display using Object.values()
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Objects.values()&lt;/code&gt; creates an array from the properties' values.&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="err"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mySelf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Joe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bangalore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;  
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// create array&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mySelf&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// display the array using DOM&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Display using Object.entries()
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;Object.entries()&lt;/code&gt; simplifies using objects in loops:&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;pens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;Blue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;Black&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;Red&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;10&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;text&lt;/span&gt; &lt;span class="o"&gt;=&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;pen&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="k"&gt;of&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pens&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;fruit&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//display the count of each pen color&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Display using JSON.stringify()
&lt;/h2&gt;

&lt;p&gt;You can convert JavaScript objects into a string with the JSON method &lt;code&gt;JSON.stringify()&lt;/code&gt;&lt;br&gt;
This method is included in JavaScript and is also supported in most browsers, at least all the major ones.&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;mySelf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Joe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bengaluru&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// use JSON.stringify() method&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;myString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mySelf&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// display the output&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementByID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;myString&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method will output a string a string written in JSON notation:&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="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&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;Joe&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;age&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;city&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;Bangalore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;In summary, effectively displaying JavaScript objects in the DOM is crucial for dynamic web development.&lt;br&gt;&lt;br&gt;
By utilizing techniques such as accessing properties by name, iterating through properties, or using &lt;code&gt;Object.values()&lt;/code&gt; and &lt;code&gt;Object.entries()&lt;/code&gt;, you can present object data meaningfully.   &lt;/p&gt;

&lt;p&gt;Understanding these methods enhances user experience and showcases JavaScript's versatility in web applications. Mastering these techniques empowers you as a developer to create engaging and dynamic web content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have fun learning 😉&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;This is a cross-post from my original &lt;a href="https://thejoernal.netlify.app/posts/display-js-objects/"&gt;blog site&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>dom</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>"Learning Styles: A Myth?"</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Tue, 14 May 2024 12:59:14 +0000</pubDate>
      <link>https://dev.to/thejoernal/learning-styles-a-myth-2gce</link>
      <guid>https://dev.to/thejoernal/learning-styles-a-myth-2gce</guid>
      <description>&lt;p&gt;&lt;strong&gt;Learning styles&lt;/strong&gt;. We all have them, right? Or at least that's what we believe.&lt;br&gt;&lt;br&gt;
There exist several theories about learning styles, one of the most common ones being the &lt;strong&gt;Visual, Auditory, Reading/Writing, and Kinesthetic&lt;/strong&gt; theory, commonly referred to as &lt;strong&gt;&lt;em&gt;&lt;a href="https://vark-learn.com/"&gt;VARK&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;"I am a visual learner", I've said this countless times; When speaking with friends, looking for learning resources, or looking for a way out of reading a book, "I am a visual learner."&lt;br&gt;&lt;br&gt;
It is because I enjoy watching, from movies to tech news and even more when learning a new language or technology. Which is how I have learnt most of what I know in web development. But what does this mean?&lt;/p&gt;

&lt;p&gt;The buzz in this generation's education system is that students learn better with their preferred learning styles.&lt;br&gt;&lt;br&gt;
If that's the case in a class of 50, then the teacher needs to do these two things:&lt;br&gt;&lt;br&gt;
  i) Learn each student's preferred learning style, then&lt;br&gt;&lt;br&gt;
  ii) Teach each student by their learning style&lt;br&gt;&lt;br&gt;
Is that feasible?  &lt;/p&gt;

&lt;p&gt;Dr. Derek Muller explains in his &lt;a href="https://youtu.be/rhgwIhB58PA?si=o_s-lyjLLgASXLa2"&gt;&lt;strong&gt;Veritasium&lt;/strong&gt; video&lt;/a&gt; how music is best learnt by listening, graphics design through images and videos, painting through painting &lt;em&gt;(kinesthetic mode)&lt;/em&gt; and poetry through reading.&lt;br&gt;&lt;br&gt;
These subjects all have their optimum methods/modes of delivery. That is why when you're learning Geography and the teacher uses images and maps, you understand it better than without. It's not really because the teacher used your preferred learning style, visual, but because it's the most effective mode of delivery for such a concept.  &lt;/p&gt;

&lt;p&gt;When I use video tutorials to learn about UI Design, I get a hold of the ideas faster than I do when I read articles or a book about the same. In this case, is it because I am a "visual learner" or is this the most effective way to learn about such a visual subject/concept? And after the fact, I might be like, videos really do it for me.&lt;br&gt;&lt;br&gt;
Such an instance may reinforce your belief in your "preferred learning style" if you don't know any better, just as it happened to me 😬. Fortunately, now you know😉.&lt;/p&gt;

&lt;p&gt;Think about it this way, what is your preferred learning style? Then think about, what mode you actually employ when doing deep study and research for an upcoming test.&lt;/p&gt;

&lt;p&gt;You need to consider that all these preferred learning styles might be constructs, and based on &lt;a href="https://www.go1.com/blog/myth-learning-styles"&gt;studies carried out&lt;/a&gt;, they don't actually exist. &lt;/p&gt;

&lt;p&gt;You feel that void now, don't you? That's good. Fill it with this;&lt;br&gt;&lt;br&gt;
There is a singular mode that has been studied and concluded to be the most effective mode of learning. That is the &lt;a href="https://www.workramp.com/blog/multimodal-learning/#:~:text=Multimodal%20learning%20uses%20multiple%20modes,engage%20multiple%20sensory%20systems%20simultaneously."&gt;&lt;strong&gt;multi-modal approach&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This approach combines all the modes used in the &lt;strong&gt;VARK&lt;/strong&gt; theory to convey information.&lt;/p&gt;

&lt;p&gt;This learning method engages multiple sensory systems simultaneously allowing us to understand and remember more. This is why videos are very powerful tools for learning - when a narrator complements the visuals with words of explanation. This is the &lt;strong&gt;&lt;a href="https://www.linkedin.com/advice/1/how-do-you-balance-cognitive-load-multimedia-effect#what-is-the-multimedia-effect?"&gt;multi-media effect&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That is why those YouTube tutorials you've been following have been effective in whatever you've been learning. Well, at least if the videos were made right. And adding note-taking to that results in an even more impressive outcome.  &lt;/p&gt;

&lt;p&gt;The multi-modal learning approach has always been around, used even without our knowledge. Now that we know, applying it more &lt;a href="https://www.workramp.com/blog/multimodal-learning/"&gt;consciously and properly&lt;/a&gt; is assured to give us better outcomes in our learning or teaching.  &lt;/p&gt;

&lt;p&gt;Live Long and Prosper 🖖  &lt;/p&gt;

&lt;h4&gt;
  
  
  Main Ref Links
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://youtu.be/rhgwIhB58PA?si=JlzhMCr793fVKkWa"&gt;Veritasium Video&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://youtu.be/djg69yaJL64?si=wPAOor0MWDFoW6vj"&gt;General Musings Podcast&lt;/a&gt; - Kevin Powell  &lt;/p&gt;

&lt;p&gt;This is a cross-post from the original in my &lt;a href="https://thejoernal.netlify.app/posts/learning-styles/"&gt;blog site&lt;/a&gt;&lt;/p&gt;

</description>
      <category>learningstyle</category>
      <category>multimodal</category>
      <category>vark</category>
    </item>
    <item>
      <title>"A delightfully fresh take on email." HEY👋</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Wed, 08 May 2024 05:01:27 +0000</pubDate>
      <link>https://dev.to/thejoernal/hey-4kb5</link>
      <guid>https://dev.to/thejoernal/hey-4kb5</guid>
      <description>&lt;p&gt;Just wrapped up an amazing week and a half using the &lt;a href="https://www.hey.com/" rel="noopener noreferrer"&gt;Hey&lt;/a&gt; email by &lt;a href="https://37signals.com/" rel="noopener noreferrer"&gt;37signals&lt;/a&gt;, and I can't help but share the love! 🚀&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://www.hey.com/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.hey.com%2Fassets%2Fimages%2Fgeneral%2Fopengraph.png" height="auto" class="m-0"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://www.hey.com/" rel="noopener noreferrer" class="c-link"&gt;
          HEY — A delightfully fresh take on email + calendar, from 37signals
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Gmail, Outlook, and Apple got complacent and took their eye off the ball. Then along came HEY.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.hey.com%2Fassets%2Fimages%2Fgeneral%2Ffavicon-32.png"&gt;
        hey.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Their "delightful fresh take on email" has given me a clutter-free, efficient inbox with privacy in mind. The Screener tool lets me decide who gets into my inbox—keeping it personal and important.&lt;br&gt;
The Imbox, Feed, and Paper Trail organization make my email life a breeze. The Feed turns long-reads into a casual news feed, making newsletters from the likes of &lt;a href="https://world.hey.com/dhh" rel="noopener noreferrer"&gt;David Heinemeier Hansson&lt;/a&gt; and &lt;a href="https://world.hey.com/jason" rel="noopener noreferrer"&gt;Jason Fried&lt;/a&gt; a joy to read. Plus, importing emails from my previous service was seamless.&lt;/p&gt;

&lt;p&gt;Blogging is as easy as emailing &lt;a href="https://www.hey.com/world/" rel="noopener noreferrer"&gt;world@hey.com&lt;/a&gt;—"write, send, and it's posted"! Perfect for fellow writers and bloggers.  &lt;/p&gt;

&lt;p&gt;And let's talk about Hey Calendar—designed around how we think and plan in days and weeks.&lt;/p&gt;

&lt;p&gt;The timeline-based day view and the innovative "maybe" feature in &lt;a href="https://www.hey.com/calendar/" rel="noopener noreferrer"&gt;Hey Calendar&lt;/a&gt; have revolutionized how I plan. Plus, you get handy features like importing from Google, Outlook, and Apple, sharing calendars with other Hey users, adding events directly from email invites, and full multi-time zone support. It's a planner's dream!&lt;/p&gt;

&lt;p&gt;Aside from its sleek design, what really sucked me in is the official support for a Linux desktop client. As a daily Linux user, the pain of not having native clients for some of the apps I like and use daily is real. Having the calendar and mail in the same app, just an icon-click away, is a game-changer.&lt;br&gt;
As my free trial wraps up in 3 days, I'm already contemplating setting up a piggy bank and saving up for the $99 personal subscription. Privacy and efficiency are priceless, and Hey has won me over. 🌐✉️&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is from my original post on &lt;a href="https://www.linkedin.com/posts/joseph-ochego_a-delightfully-fresh-take-on-email-calendar-activity-7166318201948110851-iPN2?utm_source=share&amp;amp;utm_medium=member_desktop" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; 2months ago.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>hey</category>
      <category>email</category>
      <category>37signals</category>
      <category>innovation</category>
    </item>
    <item>
      <title>Bridging the Gap: Basic Design Principles for Developers</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Sat, 27 Apr 2024 06:59:03 +0000</pubDate>
      <link>https://dev.to/thejoernal/bridging-the-gap-basic-design-principles-for-developers-ipg</link>
      <guid>https://dev.to/thejoernal/bridging-the-gap-basic-design-principles-for-developers-ipg</guid>
      <description>&lt;p&gt;Developers typically focus on the coding and development aspects of a project. Clarity in roles is essential, with designers handling tasks from theme selection to UI design, passing the completed work to developers for implementation.&lt;/p&gt;

&lt;p&gt;While this workflow has its advantages, it's crucial for developers to grasp basic design principles. Personally, I've experienced both approaches but lean towards involvement in both design and programming phases.&lt;/p&gt;

&lt;p&gt;Here, I'll share resources to help developers grasp fundamental design principles, enhancing their ability to create significantly better products. I've curated beginner-friendly documentation covering areas such as color theory, typography, iconography, layout design, and general-purpose guides.&lt;/p&gt;

&lt;p&gt;Think of these resources as references; there's no need to absorb everything at once. Instead, choose what's relevant to your current needs and revisit for additional guidance later on.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Colour (&lt;em&gt;Color&lt;/em&gt;)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57qqcw5r5edwgfoieava.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57qqcw5r5edwgfoieava.jpg" alt="color palette" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Understanding color theory is crucial for developers to create visually appealing designs. Concepts like color harmony and contrast enhance usability and aesthetics. The following guides delve into these concepts:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.flux-academy.com/blog/how-to-strategically-use-color-in-website-design#:~:text=To%20start%2C%20I%20recommend%20choosing,and%2010%25%20the%20accent%20color."&gt;How to strategically use color in website design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://elementor.com/blog/color-theory-web-design/"&gt;Color Theory Fundamentals Every Web Designer Should Know&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can jump into the following sites for designer-curated color palettes or even create your own:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://colorhunt.co/"&gt;Color Hunt&lt;/a&gt; - "Color Hunt was created with the goal of celebrating the beauty of colors, and to serve as a go-to resource for color inspiration."&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://coolors.co/"&gt;Coloors&lt;/a&gt; - Create or choose the perfect palette, and use a range of tools, from image-color picker, contrast checker and palette visualizer.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Typography
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekr5q668erkf67lb2gcv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekr5q668erkf67lb2gcv.jpg" alt="yellow typography book cover" width="800" height="534"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Typography plays a significant role in user experience and interface design. Developers need to learn about font selection, sizing, and spacing to ensure readability and accessibility in their projects.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.hubspot.com/website/website-typography"&gt;The Beginner's Guide to Typography in Web Design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bootcamp.uxdesign.cc/the-ultimate-guide-to-best-free-font-for-ux-ui-design-abfea103e79"&gt;The Ultimate Guide To Best Free Font For UX UI Design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://careerfoundry.com/en/blog/ui-design/typography-ui-design/"&gt;How To Use Typography In UI Design: A Beginners Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Icons
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F607tu7f7dlm3stq60ncj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F607tu7f7dlm3stq60ncj.jpg" alt="icon set in black and white" width="800" height="534"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Icons are essential elements of UI design, aiding in navigation and communication of information. Developers should familiarize themselves with iconography principles to effectively integrate icons into their applications and websites.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.openreplay.com/using-icons-in-web-development/"&gt;Using Icons In Web Development&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Access icons for your websites, ranging from free to premium, on these top icon sites:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://fontawesome.com/"&gt;Font Awesome&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://icons8.com/"&gt;Icons8&lt;/a&gt; for icons and more &lt;em&gt;(illustrations, 3D assets, AI photo gen)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://icon-sets.iconify.design/"&gt;Iconify Design&lt;/a&gt; - Find popular open source icon sets&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Layouts
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0cao55kngkk8ni022la.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0cao55kngkk8ni022la.jpg" alt="design sketch of an app layout" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The layout of a user interface influences how users interact with a product. Developers need to understand layout design principles such as grid systems, alignment, and spacing to create intuitive and visually pleasing interfaces.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.toptal.com/designers/ui/web-layout-best-practices"&gt;Web Layout Best Practices: 12 Timeless UI Patterns Analyzed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ramotion.com/blog/web-design-layout-guidelines/"&gt;In-depth Guidelines to Web Design Layout&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Explore these two exemplary resources for general guidelines and best practices in exceptional web design:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://blog.hubspot.com/blog/tabid/6307/bid/30557/6-guidelines-for-exceptional-website-design-and-usability.aspx"&gt;9 Guidelines &amp;amp; Best Practices for Exceptional Web Design and Usability&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://bootcamp.uxdesign.cc/decoding-apples-design-magic-what-it-teaches-us-about-typography-images-and-icons-ed8e6e760f2d"&gt;Decoding Apple’s Design Magic: What It Teaches Us About Typography, Images, and Icons&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Treat this as a reference; select what you require and revisit as necessary. Understanding these fundamental principles is crucial for web developers, regardless of their involvement in the design process.&lt;/p&gt;

&lt;p&gt;This is a cross-post from the original in my &lt;a href="https://thejoernal.netlify.app/posts/design-principles-for-developers/"&gt;blog site&lt;/a&gt;&lt;/p&gt;

</description>
      <category>uidesign</category>
      <category>typography</category>
      <category>webdev</category>
      <category>improve</category>
    </item>
    <item>
      <title>Why I Write.</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Sat, 20 Apr 2024 07:23:19 +0000</pubDate>
      <link>https://dev.to/thejoernal/why-i-write-3kpm</link>
      <guid>https://dev.to/thejoernal/why-i-write-3kpm</guid>
      <description>&lt;p&gt;&lt;em&gt;"You can build a prison of stone and steel, but you merely present the prisoner with a challenge. Any truly determined man will find a way out. But love, love is a perfect prison"&lt;/em&gt;, Wilson Fisk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inescapable!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As the heart is held hostage by love, so is my mind by creativity. The yearning to create, the itch, the desperation - &lt;em&gt;desperation can be an ally&lt;/em&gt;. I write, not only because I love to, but the &lt;strong&gt;need&lt;/strong&gt; pushes even harder; I have to!&lt;/p&gt;




&lt;p&gt;Before I dive deep into today's main topic, here is something I noticed when preparing a draft on paper for this post. I dislike pens, ball-points, gel, fountain pens, whatever writes in ink. Journaling, when I do, is in pencil. From cover to cover, writings in pencil, sketches, design wire-frames, quotes, random thoughts, nonsense, I don't discriminate, all in pencil, all on plain-sheet notebooks.&lt;/p&gt;

&lt;p&gt;Alas! The restrictions are gone, freedom beyond lines and ink.&lt;/p&gt;

&lt;p&gt;My writing may not be as legible or pretty to look at as that written by say a Bic on a single rule sheet, heck it barely befits the description, "handwriting". But the gold here is the ideas hidden in the mush put down by my pencil. Sometimes, I can't, for the life of me figure out what I wrote while I'm trying to read, but that beats writing beautifully and letting ideas disappear as I try to perfect my penmanship. The freedom of pencil on plain sheets of papers/books, as trivial as it might seem, does wonders to my workflow and I can't recommend it enough.&lt;/p&gt;




&lt;p&gt;Now back to the subject matter; I write for many reasons, some of which I'll share here.&lt;/p&gt;

&lt;p&gt;To begin with, I only write short-form material, stuff like articles, blog posts, tutorials here and there and documentation for my development projects.&lt;br&gt;&lt;br&gt;
Books? Na-ah, I don't think I would fancy that. The thought of it alone - no thank you! I prefer the shorter bursts of ideas, kinda instant feedback, then on to the next thing.&lt;/p&gt;

&lt;p&gt;Short-form materials have been the core building blocks of my development journey and I owe lots of credit to them for this passion. There are too many authors and sites to mention, but the pieces from &lt;a href="https://world.hey.com/dhh"&gt;DHH&lt;/a&gt; and &lt;a href="https://world.hey.com/jason"&gt;Jason Fried&lt;/a&gt; on &lt;a href="https://www.hey.com/world/"&gt;Hey World&lt;/a&gt; have been key players in my love for the art. Their conciseness, straight to the point approach and the personalisation they put into every piece they write is a breath of fresh air.&lt;/p&gt;

&lt;p&gt;Another factor that pushes me to write is the excitement I get when I have really interesting newfound knowledge. It might not be in the slightest bit interesting to you, but I'll ramble about it anyways, my friends go through it, sorry 😁.&lt;br&gt;&lt;br&gt;
Writing about it and sharing it, grounds me a bit more in that respect, knowing that someone else out there will be thrilled to bits when they encounter that bit of information, just as I was.&lt;/p&gt;

&lt;p&gt;The reason I haven't been so fond of &lt;em&gt;lecture, listen and leave&lt;/em&gt; type classes is the lack of passion in the information delivery. I meet it once in a while and I just want such lectures to go on and on; It might not even be a subject that I'm deeply interested in but that sparkle in the speaker's eyes and the depth of their words as they share their knowledge is profound. Written pieces stir up the same emotion when the writer cares deeply about what they're delivering.&lt;/p&gt;

&lt;p&gt;Let me be biased but honest here for a second. My father's &lt;strong&gt;Swahili&lt;/strong&gt; classes, back when he taught the language, and my mother's performing-arts training sessions in school are exactly the kind of experiences that would be best described with phrases such as &lt;em&gt;full of depth&lt;/em&gt; and &lt;em&gt;passionate&lt;/em&gt;. Without a doubt, they're a major influence on my love for art.&lt;/p&gt;

&lt;p&gt;That was a prelude to the point that another reason I write is to share knowledge with depth. Putting in that extra effort to ensure that it is clear and concise so everyone gets the point. If you're passionate about it, the passion and care will be evident in the information you share; At least I hope that's the case for my pieces. Is it?&lt;/p&gt;

&lt;p&gt;I think as a gift for sharing knowledge, there's a peace that I am rewarded with. Two to three lines into writing a piece and my thoughts are flowing, smoothly, peacefully. I isolate the sound of my fingers hitting the keys on my keyboard and just like that, I'm gone. Some sort of trance, peaceful, tense in a good way and productive of course - a good piece at the end.&lt;/p&gt;

&lt;p&gt;There has to be a selfish reason too, right? There always is &lt;em&gt;[grinning]&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;During a week as hectic as this one, I find relief and rest in writing. I type my thoughts on things I care about and my computer listens, keen to register every key-press, then it displays its response on the screen. I add more and more lines, and it keeps listening, it keeps responding and here you are, reading the result.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;"This man sounds nuts"&lt;/strong&gt;, we all are! Most of us just don't write about it 😄.&lt;/p&gt;

&lt;p&gt;So I write for lots of reasons, some personal and selfish, some relatable and helpful to others. The baseline being that I love doing it; Not enough to sell a limb for it, but just enough to keep writing, enjoying every bit of it.&lt;/p&gt;

&lt;p&gt;Even knowing that sometimes I'm just rambling on and on, circling the same idea, I don't decide when to stop, where it ends, &lt;strong&gt;&lt;em&gt;it just does!&lt;/em&gt;&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;This is a cross-post from the original in my &lt;a href="https://thejoernal.netlify.app/posts/why-i-write/"&gt;blog site&lt;/a&gt;&lt;/p&gt;

</description>
      <category>writing</category>
      <category>blog</category>
      <category>story</category>
      <category>passion</category>
    </item>
    <item>
      <title>"Just Start!" - A double-edged sword.</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Wed, 17 Apr 2024 02:25:07 +0000</pubDate>
      <link>https://dev.to/thejoernal/just-start-a-double-edged-sword-3285</link>
      <guid>https://dev.to/thejoernal/just-start-a-double-edged-sword-3285</guid>
      <description>&lt;p&gt;The best way to start a project is to &lt;strong&gt;"just start,"&lt;/strong&gt; right? &lt;strong&gt;WRONG!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you've ever turned to motivational videos or pieces for that extra push to start a project, you know the phrase &lt;strong&gt;"just start"&lt;/strong&gt;. Not to say it doesn't work, no, it actually does, mostly. But there is so much lost in that slogan that it can be just as destructive as it is motivational.  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;"You do not rise to the level of your goals, you fall to the level of your systems"&lt;/em&gt;, James Clear.&lt;/p&gt;

&lt;p&gt;This applies especially in tasks that require a process, a flow, a system for the best outcomes like programming, design, and the like. Jumping right into the thick of it and &lt;strong&gt;just starting&lt;/strong&gt; is not the way to go. The planning phase is just as important, if not more than the execution phase, and I had to be cornered by a recent project to come to this epiphany.&lt;/p&gt;

&lt;p&gt;While creating &lt;a href="https://ochego.netlify.app/"&gt;my new web portfolio&lt;/a&gt;, I had it all well laid out, planned in my head; I could see the outcome, the result; I could see all who set their eyes on it after I was done in awe. Although I started off well by creating a wire-frame then a high-fidelity design in Figma, I did so only for the homepage. I was supposed to do the same for all the other pages, but boy did my fingers itch for some typing action. Before I knew it, I was in too deep, visualising the design in my head as I implemented it in code.&lt;/p&gt;

&lt;p&gt;It took getting stuck on the contact page to remind me that there's a reason we plan, there's a reason we have processes we follow, systems in place. This page just wasn't looking like the one in my head. I spent 3 days on the contact page, trying out all the layouts I could think of, flex, grid, but I just couldn't reproduce the page from my thoughts.&lt;/p&gt;

&lt;p&gt;It took a Figma ad on Instagram to remind me that I was actually going about it all wrong. How timely?&lt;/p&gt;

&lt;p&gt;There's a reason programs like &lt;a href="https://www.figma.com/"&gt;Figma&lt;/a&gt; and &lt;a href="https://adobexdplatform.com/"&gt;XD&lt;/a&gt; were created. These are design software &lt;em&gt;(yes, not software*&lt;em&gt;s&lt;/em&gt;*)&lt;/em&gt;, creative playgrounds, where you translate the ideas you have in mind on paper. And revise them over and over and over and over again, until you're satisfied, which is usually &lt;strong&gt;never&lt;/strong&gt;, mostly just &lt;strong&gt;settling&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Then with the well-laid-out design, we move to development.&lt;/p&gt;

&lt;p&gt;I was doing it all wrong, designing and developing on the fly, using the same tool - &lt;a href="https://code.visualstudio.com/"&gt;VScode&lt;/a&gt;; Making one step forward and ten back when I mess up with good code while trying to get rid of the bad. I had gotten away with it for three pages, but it had finally caught up with me.&lt;/p&gt;

&lt;p&gt;It took really fighting with my code to remember a process I learned during my internship at Metanoia Web Labs from my mentor.&lt;br&gt;&lt;br&gt;
I woke up the next morning after battling with the contact page for 3 days, prepared a strong cup of lemon tea with honey and sat down at my desk. With pen and paper, I wrote down the process I was going to follow &lt;em&gt;(web design and development)&lt;/em&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Plan (languages, timeline...)&lt;/li&gt;
&lt;li&gt;Wireframing&lt;/li&gt;
&lt;li&gt;Low-fidelity design (Figma)&lt;/li&gt;
&lt;li&gt;High Fidelity design in Figma&lt;/li&gt;
&lt;li&gt;Prototyping - &lt;em&gt;optional&lt;/em&gt; (didn't do it)&lt;/li&gt;
&lt;li&gt;Collecting and organizing assets from designs&lt;/li&gt;
&lt;li&gt;Programming&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Looks like a lot, right? Yes, it does, but it isn't. It's just a rough outline of what you'll be doing, one after the other. You don't even have to do them all. A low-fidelity design might be enough for you to translate into code without a hitch, while others might be required to go all the way, finishing with a prototype.&lt;/p&gt;

&lt;p&gt;If you're only a web developer and not a designer, then by all means start from number seven. You'll probably receive the design from a designer who will do most of the earlier work, from wire-framing to high-fidelity designs or even rapid prototyping.&lt;/p&gt;

&lt;p&gt;So this process/system is not set in stone and can be tweaked extensively to accommodate the nature of your work and the expectations or outcomes of you and your team.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Phew, finally! The plane has landed..."&lt;/em&gt; I get it. But I had to take us all the way for the depth and the need for a process to be seen, felt, appreciated.&lt;/p&gt;

&lt;p&gt;I listened to someone and I "just started", as advised.&lt;/p&gt;

&lt;p&gt;I could easily have finished up my web portfolio by the time my previous blog post dropped; Excitement and impatience, however, got the better of me and I paid for it in time - &lt;strong&gt;days wasted&lt;/strong&gt;. I don't want to go into the rabbit hole of &lt;em&gt;could haves&lt;/em&gt; and &lt;em&gt;should haves&lt;/em&gt; as I don't regret this shortcoming. We probably wouldn't have had this piece if everything had gone smoothly. &lt;strong&gt;But we learn every day, hey?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have fun learning 😁&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is a cross-post from the original in my &lt;a href="https://thejoernal.netlify.app/posts/kart_horse/"&gt;blog site&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>process</category>
      <category>webdev</category>
      <category>story</category>
      <category>success</category>
    </item>
    <item>
      <title>Add basic animations to your site using Animate.css and wow.js</title>
      <dc:creator>Joseph Ochego </dc:creator>
      <pubDate>Wed, 17 Apr 2024 02:19:35 +0000</pubDate>
      <link>https://dev.to/thejoernal/add-basic-animations-to-your-site-using-animatecss-and-wowjs-5hni</link>
      <guid>https://dev.to/thejoernal/add-basic-animations-to-your-site-using-animatecss-and-wowjs-5hni</guid>
      <description>&lt;p&gt;I have been working on my &lt;a href="https://ochego.netlify.app"&gt;personal portfolio&lt;/a&gt; website &lt;em&gt;(although not complete)&lt;/em&gt; for the past few weeks, taking it really slow, revising designs and ensuring I get my persona represented accurately. One of the visual elements I've had to have from the beginning was &lt;strong&gt;animations&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You might have just shrugged, thinking, "Another complex guide on implementing web animations...". Far from it. This is probably the simplest way you can use animations in your site using &lt;strong&gt;&lt;em&gt;CSS classes&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's it? - Most definitely! And I'll cover, albeit very briefly, how you can implement this right in your &lt;code&gt;.html&lt;/code&gt; file and see your beautiful lifeless &lt;em&gt;(for dramatic effect :D)&lt;/em&gt; site brought to life. For this, you need two libraries, &lt;strong&gt;&lt;a href="https://animate.style/"&gt;Animate.css&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href="https://wowjs.uk/docs.html"&gt;wow.js&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://animate.style/"&gt;Animate.css&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;"&lt;strong&gt;Animate.css&lt;/strong&gt; is a library of ready-to-use, cross-browser animations for use in your web projects. Great for emphasis, home pages, sliders, and attention-guiding hints.", as they say it on their site. Plain and simple.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;There are three ways of installing &lt;strong&gt;animate.css&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using npm&lt;/li&gt;
&lt;li&gt;Using yarn&lt;/li&gt;
&lt;li&gt;Using cdn, directly in our file &lt;em&gt;(our way)&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Based on the promise of simplicity, we'll use the &lt;code&gt;CDN&lt;/code&gt; method, adding the link directly into out head tag as shown:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt;
    &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt;
    &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"&lt;/span&gt;
  &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;Once you've installed &lt;strong&gt;animate.css&lt;/strong&gt;, add the &lt;code&gt;animate__anmated&lt;/code&gt; class to your target element, followed by the class-name of the animation you wish to use; always starting with the &lt;code&gt;anmate__&lt;/code&gt; prefix.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"image.png"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"animate__animated animate__fadeInLeft"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;This adds a fade-in from the left animation to our image element.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Note that these animations are displayed only when the page loads; forcing you to have the element in the viewport during loading to see it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;However!!&lt;/strong&gt; There is a way to delay the loading of each animation and only load it and display it when the target element is scrolled into the viewport. We use a JavaScript library called &lt;strong&gt;&lt;a href="https://wowjs.uk/docs.html"&gt;wow js&lt;/a&gt;&lt;/strong&gt; to achieve this. And as promised we'll still do it simply:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://wowjs.uk/docs.html"&gt;Wow JS&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Wow.js reveals animations when you scroll and the animated elements come into the viewport. Using it ensures that your visitors don't miss your wiggles, fades, bounces and spins.&lt;/p&gt;

&lt;p&gt;Wow.js is very animate.css friendly. Exactly why we're working with both in this turorial.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;Installing wow.js is as simple as adding a &lt;code&gt;script&lt;/code&gt; at the the end of the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; in your &lt;code&gt;.html&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script
    &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdnjs.cloudflare.com/ajax/libs/wow/1.1.2/wow.min.js"&lt;/span&gt;
    &lt;span class="na"&gt;integrity=&lt;/span&gt;&lt;span class="s"&gt;"sha512-Eak/29OTpb36LLo2r47IpVzPBLXnAMPAVypbSZiZ4Qkf8p/7S/XRG5xp7OKWPPYfJT6metI+IORkR5G8F900+g=="&lt;/span&gt;
    &lt;span class="na"&gt;crossorigin=&lt;/span&gt;&lt;span class="s"&gt;"anonymous"&lt;/span&gt;
    &lt;span class="na"&gt;referrerpolicy=&lt;/span&gt;&lt;span class="s"&gt;"no-referrer"&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WOW&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!--make sure you have the latest version at the time of implementation--&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although wow.js can also be installed using &lt;strong&gt;npm&lt;/strong&gt; and &lt;strong&gt;yarn&lt;/strong&gt;, I opted for the simplest way - using a &lt;strong&gt;CDN&lt;/strong&gt; link.&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;Simply add the &lt;code&gt;wow&lt;/code&gt; CSS class to the element and it will be hidden until the user scrolls it into the viewport.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"image.img"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"wow"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!--Then add your animation class--&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"image.img"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"wow animate__animated animate__bounce"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you're done!&lt;/p&gt;

&lt;p&gt;There are a few more cool customizations you can do with the wow script, which you can check out on &lt;a href="https://wowjs.uk/docs.html"&gt;wow.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have Fun Learning 😁&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is a cross-post from the original in my &lt;a href="https://thejoernal.netlify.app/posts/animate_css/"&gt;blog site&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>animation</category>
      <category>html</category>
      <category>css</category>
    </item>
  </channel>
</rss>
