<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mary G on Medium]]></title>
        <description><![CDATA[Stories by Mary G on Medium]]></description>
        <link>https://medium.com/@zo-chu?source=rss-e503ca965e37------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X4PZFwObmiHIhuby4HlBcg.jpeg</url>
            <title>Stories by Mary G on Medium</title>
            <link>https://medium.com/@zo-chu?source=rss-e503ca965e37------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 08:16:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zo-chu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[10 somewhat interesting and sometimes fascinating facts about women in tech.]]></title>
            <link>https://medium.com/the-shadow/10-somewhat-interesting-and-sometimes-fascinating-facts-about-women-in-tech-caab5614db8e?source=rss-e503ca965e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/caab5614db8e</guid>
            <category><![CDATA[iwd]]></category>
            <category><![CDATA[feminism]]></category>
            <category><![CDATA[diversity-in-tech]]></category>
            <category><![CDATA[women-in-stem]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <dc:creator><![CDATA[Mary G]]></dc:creator>
            <pubDate>Thu, 25 Feb 2021 23:10:43 GMT</pubDate>
            <atom:updated>2021-03-02T21:26:42.916Z</atom:updated>
            <content:encoded><![CDATA[<h3>10 somewhat fascinating facts about women in tech</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iZRVYQGKPYLD1uQk" /></figure><p>The International Women’s Day is right around the corner and it remains to be a big deal. Well, for some of us at least. And it’s a shame, I think, if it would have been a big deal for most of us, we could be so much closer to gender equality, fairness and total and absolute happiness for all.</p><p>In the meantime, I think this time of year is as good as any to freshen up some knowledge about the state of affairs for women in tech. In order to do this I went away to the deep end of the Internet and came back with 10 somewhat interesting and sometimes fascinating facts related to women in tech not more and not less.</p><p>Some of this facts may make you say ‘Daah’ and some “Whooa?!” — let’s find out!</p><h3><strong>1. Ada Lovelace — first programmer ever?!</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*sYwxt2pRT7Cg4oOh" /></figure><p>That’s right Ada Lovelace was born in 1815 and died in 1852. She is referred to as the first programmer because she had written notes that explained how the notion of a specific engine could transition calculation to computation¹. So, why jeans and a hoodie are considered a programmer’s uniform ?</p><h3><strong>2. WES — Women’s Engineering Society — is a 100 years old! Well, 101 to be precise</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*HvZt-sXz5T1vr6C_.jpg" /></figure><p>Many women joined the effort to electrify homes in the late 19th century, including Alice Mary Gordon, who wrote a book called Decorative Electricity, Electrical engineer and physicist, Hertha Ayrton, was the first woman admitted to the IEE (the Institution of Electrical Engineers) and Katharine Parsons worked on the steam turbine engine and later founded The Women’s Engineering Society — the first of its kind in the world (!) .</p><p>“Several of the women who went on to be founding members of WES were also involved in the women’s suffrage movement”² — this is probably a coincidence.</p><h3><strong>3. Freelance Programmers and discrimination of male programmers</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*pAByShc2l7PIQsSy.jpg" /></figure><p>Steve Shirley founded software a company called Freelance Programmers in 1962 after becoming sick and tired of sexist environment at her workplace. She wanted to create job opportunities for women and mostly employed women, with only three male programmers in the first 300 people in staff. This practice, of course, became illegal with Sex Discrimination Act 1975.</p><h3><strong>4. A good day for a James.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/0*gZiljRJxMmcLE2CU.jpg" /></figure><p>In 2017 New York times came forward with some curious numbers: women were 50.8 % of the U.S. population at the time. There were roughly the same amount of women among chief executives of Fortune 500 companies (~5%) as there were men named James (~5%)… awkward.</p><p>Venture capital investors in the largest tech deals of the previous 5 years were 9% women and 11% men named David, James and Peter³. Gosh, this names are probably very popular.</p><h3><strong>5. There are other valleys</strong></h3><p>Interesting and fascinating, that the gender disparity in IT is not global at all. The ratio of female to male computer scientists is significantly higher in India compared to the western countries and in 2015, over half of tech entrepreneurs in China were women⁴.</p><p>In government universities in Saudi Arabia in 2014, Arab women made up 59% of students enrolled in computer science⁵. United Arab Emirates Mars Mission aims to provide a complete picture of the Martian atmosphere for the first time. Women make up 80% of the program’s scientific team⁶. Way to go!</p><h3>6. We all know that diversity matters, but it also pays out</h3><p>According to a McKinsey study⁷, companies in the top quartile for diversity metrics are 35% more likely to have financial returns above their national industry peers. I mean, I’m not suggesting that everyone should aim to reach diversity at workplaces because giving the same opportunities to people with different backgrounds and features — is fair and bringing these people to the places where decisions are made — makes the world a better place for everyone, what I’m suggesting is — do it for the money!</p><h3><strong>7. I would like to live forever, but at least another 99 years</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OFHn7uF80WLL11oK" /></figure><p>This is Yellowmouth rockfish, oldest one on record was 99 years old. The gap between men and women, measured in terms of political influence, economic gain and health and education, will take another 99 years to disappear, according to the World Economic Forum in 2019. So, it may as well be that the lucky rockfish that will see the bright and equal future has already been born.</p><p>…</p><p>moving on!</p><h3>8.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*dPf_vIajkTEBFwG1ObOIJg.jpeg" /></figure><p>Apparently, 60% of managers who are men in the US and 40% of managers who are men in the UK are uncomfortable participating in a common work activity with a woman, such as mentoring, working alone, or socialising together⁸. And this one is particularly sad one, because not being able to participate in mentoring and generally to do work normally harms women’s careers. No wonder, there are less women in senior leadership, if men feel it’s harder for them to collaborate why would they step forward and promote women? But it shouldn’t be like that and I truly hope that soon, those managers will get used to the fact that women are just people and we as a society we will prosper like never before.</p><h3>9. Subconscious bias — is a beast!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*Ir3-xsHYcGT_bZEJ.jpg" /></figure><p>News for everyone, to be honest: if you think you are not biased, you are probably biased! A recent report by UN found that, almost 90 % of people (!) hold some kind of bias against women, and half of men felt they had more of a right to a job than a woman⁹.</p><p>In another study where managers were asked to give a performance review to some fictional employees, they rated women with the same qualifications lower then men (not news unfortunately), but what is interesting, is that managers who believed that “gender discrimination wasn’t an issue” were the most biased against women!¹⁰</p><h3>10. Don’t believe everything you read in the internet or hear from incompetent sources</h3><p>Programming languages that are loved and adored by women the most are Ruby and Perl because they sound kind of shiny and precious, Closure comes next, because who doesn’t like it and least appreciated is obviously Python because most females aren’t into snakes that much. According to the bathroom wall in the University of Nonsense.</p><p>Ok, these were my 10 somewhat interesting facts for the time being. I hope someone knows more now, then they used to, some want to research further and learn more, some are more aware of the state of affairs with women and not just in tech.</p><p>On a serious note. We all owe each other to try to be better and the things each and everyone can do is to share the knowledge, to open a discussion, to be curious and support the ones that need it, contributing to making the world a tiny bit better place for us all.</p><p>Thank you !</p><p>[1] T. Simonite, 2009. <a href="https://web.archive.org/web/20090327073325/https://www.newscientist.com/blogs/shortsharpscience/2009/03/ada-lovelace-day.html">Short Sharp Science: Celebrating Ada Lovelace: the ‘world’s first programmer’</a></p><p>[2] Wikipedia <a href="https://en.wikipedia.org/wiki/Women%27s_Engineering_Society">https://en.wikipedia.org/wiki/Women%27s_Engineering_Society</a></p><p>[3] NY Times , 2017 <a href="https://www.nytimes.com/2015/03/03/upshot/fewer-women-run-big-companies-than-men-named-john.html">https://www.nytimes.com/2015/03/03/upshot/fewer-women-run-big-companies-than-men-named-john.html</a></p><p>[4] Nü Women: Female entrepreneurs are seizing their opportunities in China’s Entrepreneurial Age <a href="https://nu-women.com/#:~:text=In%202015%2C%2055%20percent%20of,The%20State%20Council%20Information%20Office">https://nu-women.com/#:~:text=In%202015%2C%2055%20percent%20of,The%20State%20Council%20Information%20Office</a>.</p><p>[5] Alghamdi, Fayiq, 2016. Women in computing in Saudi Arabia.</p><p>[6] UAE women scientists lead Arab world’s first space mission to Mars (2020) <a href="https://www.dw.com/en/uae-women-scientists-lead-arab-worlds-first-space-mission-to-mars/a-56513724#:~:text=UAE%20women%20scientists%20lead%20Arab%20world&#39;s%20first%20space%20mission%20to,of%20the%20program&#39;s%20scientific%20team">https://www.dw.com/en/uae-women-scientists-lead-arab-worlds-first-space-mission-to-mars/a-56513724#:~:text=UAE%20women%20scientists%20lead%20Arab%20world&#39;s%20first%20space%20mission%20to,of%20the%20program&#39;s%20scientific%20team</a>.</p><p>[7] V. Hunt, D. Layton, and S.Prince, 2015. Why diversity matters</p><p>[8] LeanIn.Org and SurveyMonkey survey, February 22-March 1, 2019</p><p>[9] UNDP, 2020 <a href="https://www.undp.org/content/undp/en/home/news-centre/news/2020/Gender_Social_Norms_Index_2020.html">https://www.undp.org/content/undp/en/home/news-centre/news/2020/Gender_Social_Norms_Index_2020.html</a></p><p>[10] J. Hamzelou, 2020, NewScientist. Managers who think gender bias isn’t a problem make it worse</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caab5614db8e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-shadow/10-somewhat-interesting-and-sometimes-fascinating-facts-about-women-in-tech-caab5614db8e">10 somewhat interesting and sometimes fascinating facts about women in tech.</a> was originally published in <a href="https://medium.com/the-shadow">The Shadow</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ramda, Lodash, Undescore… Why So Many?]]></title>
            <link>https://medium.com/swlh/ramda-lodash-undescore-why-so-many-92a69f49b0e8?source=rss-e503ca965e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/92a69f49b0e8</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[utilities]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Mary G]]></dc:creator>
            <pubDate>Tue, 20 Oct 2020 21:46:33 GMT</pubDate>
            <atom:updated>2020-10-26T22:33:14.275Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*mU3Dbx64VuvZ72ileiZ4OQ.jpeg" /></figure><p>When I came to a JS project and there were no lodash imported, I was slightly surprised, then I googled filter syntax with plain javascript and was hoping to be over it but then I realised: there was something called Ramda instead! “<em>Is this even legal?!</em>” — I though to myself. But then I started to explore and here it is what I know now, come along!</p><p>“Utility belts” libraries became popular in JS world quite some time ago and it is understandable — you’d use whatever there is to make some parts of javascript life just a bit easier.</p><p>For me, it’s usually the ready made helpers I use the most, stuff that helps me merging two arrays, for example, or making sure whoever reviews my PRs knows that I’m smart because I use pipes and curried functions. I mean, I can write all this utilities myself to fit exactly the term “yet another bicycle inventor” but why to bother if instead I can have a library doing it for me <strong>better</strong> <strong>than I can </strong>and go to lunch instead, right? Ok, I think that’s justified.</p><p>But why so many? If asked, my first answer to that would be why not? In todays coding world it’s considered impolite to have less that one rival alternative doing exactly the same thing and I love it ! There is always space for something new.</p><p>Second answer would be that it gives you new topics to discuss with other “cool kids” in the office cafeteria over a sandwich.</p><p><em>“Hey Bill, have you heard about this new JS library? It’s called Overscore.js and an alias for it is actually a falafel emoji. It looks like this :</em></p><pre>🧆.merge(arr1, arr2)</pre><p><em>Pretty cool, ha?</em>” — and then you can spend the rest of your lunch discussing pros and cons and performance and usability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*jvMfAGVHTVCWyURfBc80sg.jpeg" /></figure><p>A better answer to the question ”Why so many?” would be — well, they do slightly different things in a slightly different way. If I was making a list of important differences for compassion it would be something like this:</p><ol><li>Different utilities covered (not really, but a bit)</li><li>Different styles used (again, not so much, most are fluctuating towards functional programming)</li><li>Dependencies size ( important mainly when running on the client side)</li><li>Maintenance and fan base (usually means a lot, you don’t want to be stuck with a dependancy that goes off support or has no one to answer your questions on SO)</li></ol><p>Let’s talk about couple libraries shall we?</p><p><em>Disclaimer: I’m not going to talk about how great ES6 is and that all this libs are obsolete now, even thought there are people who think that.</em></p><p><em>Also FP — functional programming</em></p><h3>Underscore</h3><p>First released in 2009. Underscore is one of the first wide spread ‘utility belt’ libraries for JS. From the official website:</p><blockquote><em>“Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects.”</em></blockquote><p>Sounds ok. It looks like this :</p><pre>_.contains([1, 2, 3], 3)</pre><p><strong>Fun fact</strong>: there are lot’s of guides on how to migrate to lodash from underscore, just saying .. next!</p><h3>Lodash</h3><p>First released in 2012. From the website:</p><blockquote>“A modern JavaScript utility library delivering modularity, performance &amp; extras.”</blockquote><p>Right off the bat, there is a word performance — me likey. It’s true, lodash is claiming a good performance comparing to other tools and definitely a better one comparing to what ever I’d write ad-hoc. It was created as more focused on performance alternative to underscore.</p><p><strong>Fun fact:</strong> lodash is maintained by original underscore contributors.</p><p>Lodash is nice, solid and big, both in size and capabilities. There are tons of helpers for objects, collections, strings, and functions, whatever you can think of. There is a functional programming flavour and generally it’s available in all kind of shapes and sizes (for those on dependency size diet, haha) there are per method packages, lodash-es, babel-plugin-lodash, lodash-webpack-plugin,lodash/fp, lodash-amd (I don’t know why all of this is needed but I’m intrigued by the variety!)</p><p>It looks like this:</p><pre>_.map([4, 8], square);</pre><p>Or like this if <a href="https://emojipedia.org/curry-rice/#:~:text=%F0%9F%8D%9B%20Curry%20Rice&amp;text=May%20represent%20kare%2Draisu%2C%20or,to%20Emoji%201.0%20in%202015.">🍛</a></p><pre>fp.map(parseInt)([‘6’, ‘8’, ‘10’]);</pre><p>It’s probably clear that lodash is great. Now, let’s talk about the underdog khm, undersheep?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xKwnKrBJ9ODIyKvi" /></figure><h4>Ramda</h4><p>There is no Wikipedia page about it, but I’ve heard it’s from around 2013. From the website :</p><blockquote>“A practical functional library for JavaScript programmers”</blockquote><p>Well, yeah it practically has all an FP aficionado wants to hear : pure functions, immutability and no side-effects, functions are automatically curried. If you think Haskell is a great choice for your next pet project or you really like angry looking baby sheeps — you should definitely check this one out!</p><p>It looks like this :</p><pre>R.map(double, [1, 2, 3]);</pre><p>Size unpacked 1.07 MB but can be imported partially.</p><p>Fun fact: there is a clone called Ram<strong>b</strong>da which claims to be “<em>a smaller and faster alternative to the popular functional programming library Ramda</em>” . I appreciate the competition, but the name situation seems extremely lame to me.</p><p>I used Ramda in the latest project and I feel a great potential in it, combined with streams it looks very clean and powerful, even though it doesn’t have eeeverything that lodash has.</p><h4>Any conclusions?</h4><p>I’m not going to surprise anyone saying that a lot of the difference is just a personal choice! But there is something curious to see before the end.</p><p>One of the really important things when you choose to use a library in a project is how much support and development it has.</p><p>Here is a small table I compiled from github and npm data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OAQ8fmQ0AwC0Y7NQR7AoWA.png" /></figure><p>Lodash is obviously winning and winning big. It’s downloaded &gt; 36 million (!) times a week and it’s the most “depended on” package through all of the npm. It’s practically an industry standard for javascript.</p><p>Understandably, it’s super flexible in capabilities, style and size. But ! I think even though it’s clearly the most popular it doesn’t mean it’s the best for every one and for every case.</p><p>I have to say, I’m inspired by this libraries and by infinite choices that didn’t make it to this article. Now. Should I create a library with a falafel emoji for alias?</p><p>PS.</p><p>I really wanted to talk about performance of this libs, but it appeared to be a really big topic and and it deserves more investigation — so until the next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92a69f49b0e8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/ramda-lodash-undescore-why-so-many-92a69f49b0e8">Ramda, Lodash, Undescore… Why So Many?</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to start writing logs, when you don’t know things?]]></title>
            <link>https://zo-chu.medium.com/how-to-start-writing-logs-when-you-dont-know-things-78f10f53571a?source=rss-e503ca965e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/78f10f53571a</guid>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Mary G]]></dc:creator>
            <pubDate>Mon, 28 Sep 2020 21:17:17 GMT</pubDate>
            <atom:updated>2021-03-02T21:28:44.446Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to finally start writing logs?</h3><p>I was at the same time terrified and feeling adventurous by the idea of writing about programming for a long time. It’s quite overwhelming, I have to say and it should be — there are so many talented and knowledgeable people around, it’s easy to get intimidated. And, of course, there is always someone who knows more than you do. So, what I decided to do is to write about what I don’t know and how I live with not knowing things. Because my favourite character or my life coach, if I may, says: “Dude, sucking at sumthin’ is the first step towards being sorta good at something.” © Jake the Dog</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/0*nGvZFSlnaCNsntTK" /></figure><p>So, without further ado.</p><p>One of the things I didn’t know when I started programming and, by all means, I still don’t know, is how to write a perfect log in your application, or at least how to write considerably helpful logs.</p><p>I’m sure there are lots of useful articles (I’ve read some of them) about it and lots of people write uber effective logs. Their logs follow one precise style guideline, never get abandoned and also somehow make you application run at light speed with less recourses used. We all know those people. Those “I wrote some Haskel before lunch to solve some theoretical CS problem” people. And I’m happy for them, honestly. I’m sure it wasn’t easy and they’ve made some effort to make their logs a masterpiece, but personally I find myself sometimes in a position where I kind of really need to writhe THE CODE and I have no time to reflect “if my logging system is robust enough” — the fact that I have a logging system set up is a big plus already. It’s all about priorities, you know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*szcMgMjXmhrC9bjMn7ZExA.png" /></figure><p>So, what I thought could be wise is it to sketch what people that have no time but a lot of ambition for improvements (like me, he-he) can do about their logging practices.</p><p>I guess the most important question that needs to be answered is — why to log?</p><p>For me the answer would be something like this:</p><ol><li>Debugging</li><li>Monitoring</li><li>Explaining to “future me” what the heck is going on</li></ol><p>It looks pretty simple and may be it is.</p><p><em>Spoiler: Examples are in javascript, but concepts apply to other languages as well and I’m going to talk about free form, old, simple string logs, not even json logs.</em></p><h3>I. Debugging</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*LIW7NTDV7AgBjF4P0LVtdg.png" /></figure><p>Debugging logs are supposed to help you find and fix problems in the code. Cool. So, how to write them then?</p><p>First of all, important to mention, we all know that :</p><pre> console.log(“did it get here?”)</pre><p>and other debugging logs that are important only to a developer and are not helpful in the context of a project should not be committed. We all know we do this but we don’t have to admit it publicly.</p><p>Second, one of the things that must be logged and committed — is error logs, but it’s probably a whole separate topic to cover, so I’ll talk about two things that bother me about logging errors.</p><ul><li>You must indicate that a log is an error ether using your logger’s level or plain text inside logs that is searchable ( “ERROR” should do) or whatever else and serialise the error where possible, so you’d have stack trace for actual debugging</li><li>It’s a hard concept but it’s important to capture failures. For example: you have an app that takes payments like so:</li></ul><pre>const takePaymentFromUser = (user) =&gt; {</pre><pre>   if(!user){<br>      throw new Error(“No user provided”)<br>   }</pre><pre>   //TODO take that sweet money<br>}</pre><pre>const main = () =&gt; {<br>  try {<br>     takePaymentFromUser()<br>  }catch (e){<br>     console.error(e.message)<br>  }<br>}</pre><pre>main()</pre><p>The output will be :</p><pre><em>No user provided</em></pre><p>This is great but not helping anyone. I think that there are two things that would make it better: 1. It should have stack trace, so you know where to look (arguable, apply judgement) 2. It should give more context on what is the consequence of this error.</p><p>There are at least 1538 ways of rewriting this example to fulfil both requirements, I’ll add one:</p><pre>const takePaymentFromUser = (user) =&gt; {</pre><pre>   if(!user){<br>      throw new Error(“Unable to take payment. No user provided”)<br>   }</pre><pre>   //TODO take that sweet money<br>}</pre><pre>const main = () =&gt; {<br>   try {<br>      takePaymentFromUser()<br>   }catch (e){<br>      console.error(e)<br>   }<br>}</pre><pre>main()</pre><p>Output:</p><pre><em>Error: Unable to take payment. No user provided</em></pre><pre><em>at takePaymentFromUser (/home/runner/OurTameChapters/index.js:3:13)</em></pre><pre><em>at main (/home/runner/OurTameChapters/index.js:10:5)</em></pre><pre>.... etc</pre><p>Ok! Now we are talking! By looking at this log you’ll immediately know, that something important (money money money) is very wrong and will know where is it wrong, too. This brings me to the next section</p><h3>II. Monitoring</h3><p>Another thing you want your logs to do is to help to know your app is actually ok even you are not staring at the console and if it’s not ok you’ll know about it. This topic is also waaaay too big to cover in one go, so I won’t even attempt. There are couple things worth mentioning though, like, why to monitor at all? Here is why:</p><ol><li>Allows to make sure app is stable and predictable and if it’s not know it as soon as possible .</li><li>Monitoring is good for you.</li><li>Seriously, it’s what all the cool kids do.</li><li>You can build statistics and alerts and attempt to actually know what’s going on in your app at all times and later plot cool charts and graphs and show off on team meetings.</li></ol><p>Couple things to look out for when you log information that you plan to monitor.</p><ul><li>If it’s something that you plan to monitor through time, like amount of logins per day or error rate or other things, you probably wouldn’t want to change the monitored log after you set it up. So, it’s best to put some more thinking in phrasing this logs. It should have enough context for 3-month-later-you to still understand what it means and find elegant.</li><li>You are probably going to use some service for it and they are probably going to skip/escape some symbols, most likely log “This:///is{not} a “g00d idea”,.&amp;” will not be a good idea, check the docs first.</li><li>On the other hand you very well might want to parse your plain logs into something json-like or at least use custom variables. In this case it can be nice to have a separation between actual values and plain text like “We are now in =&lt;funtion name&gt;= function. Might make some regExp easier.</li></ul><h3><strong>III. Archeology, I mean Information</strong></h3><p>This one is an odd combination of debugging and monitoring, mostly needed for providing context to other logs and generally make sense of them. It may seem silly at first but there are some important events in every application that should be logged even if this is boring. Most of this logs would need to reflect some lifecycle event, like “app started” or “app stopped” or “how many of something is available” you know, whatever is basically the fundament of your app and what in case of “sh*t went down” situation would be the remaining ruins of your app, so future archeologists would have some stones to turn.</p><p>It’s kind of hard to come up with a useful and not too of an obvious example but I will attempt anyway. I believe it goes without saying that when your app starts it should let the world know with something like “app started to listen on port *port*” and all that, but what’s more important is to pin point the most important yet fragile places of your app, like first connection to external resource, bringing up a database, refreshing access tokens, things that don’t happen too often, so you won’t flood your logs with them, but are important enough to know that they are ok.</p><p>Some might say here: “Well, I log my errors, so why log success?” — what I’d say to is this is — when it comes to investigation of a crime scene it’s much nicer to know what definitely has happened good or bad, then guess what may have happen with no evidence to it © Me.</p><p>Conclusion:</p><p>I don’t have any good conclusion here, it was indeed a very brief touch on what’s up with logs. Beside that I would like to wish everyone happy coding, more experiments and less anxiety about imperfect logs/code/world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*Bam2XzHsGcOEHi80iYJCLw.png" /></figure><p>The end… for now.</p><p>PS</p><p>I almost forgot, if you are, my friend, a total nerd and you want to learn even more (!) on logs there are tons of materials! Of course, I’d recommend to get to know classic Uncle Bob’s “Clean code” chapter on logs. Also, I’d strongly recommend to look at JSON logs and logging platforms “best practices” recommendations. And come on! Comment what’s your favourite “ how-to” article on logs and I’ll get offended if it’s not this one!</p><p>Cheers!</p><p>#logs #begginersfriendly</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78f10f53571a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>