<?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 Lula Leus on Medium]]></title>
        <description><![CDATA[Stories by Lula Leus on Medium]]></description>
        <link>https://medium.com/@opheliaandcat?source=rss-9fcfe9a48f1e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZkWLXXoh9pL3hcUJEseotA.jpeg</url>
            <title>Stories by Lula Leus on Medium</title>
            <link>https://medium.com/@opheliaandcat?source=rss-9fcfe9a48f1e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 02:47:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@opheliaandcat/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[An Engineer’s Toolkit for continuous upskilling]]></title>
            <link>https://medium.com/@opheliaandcat/an-engineers-toolkit-for-continuous-upskilling-555f9e6ab23b?source=rss-9fcfe9a48f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/555f9e6ab23b</guid>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[upskilling]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[self-learning]]></category>
            <dc:creator><![CDATA[Lula Leus]]></dc:creator>
            <pubDate>Sun, 27 Aug 2023 17:14:05 GMT</pubDate>
            <atom:updated>2023-08-27T17:14:05.856Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M8o0BXl3mv_HvGm11upY4A.jpeg" /><figcaption>The owl symbolizes wisdom. Photo by <a href="https://unsplash.com/@pete_nuij?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Pete Nuij</a> on <a href="https://unsplash.com/photos/jUsuh8ZZyNo?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>Software engineering is ever-evolving. The best practices and tools available for developers today differ from those of just 5 years ago. And they will similarly differ from what will be available in the next 5 years.</p><p>In this shifting landscape, one constant is the engineers. Those that are building software today are likely to continue building software in 5 years time. In order to do so successfully, we should know the new tools and promote the usage of best practices of the day. But how can we keep our knowledge up-to-date and our skills relevant all the time? The answer is simple: we must become <strong><em>“lifelong learners” </em></strong>out of necessity.</p><p>In this article, I’ll detail my approach to continuous learning and upskilling in software engineering. I will spotlight learning resources that I find most helpful. I’ll also share a strategy to track learning progress and offer advice on how to keep going when learning doesn’t have strict deadlines.</p><h3>Choosing Learning Materials to Use</h3><h4><strong><em>Newsletters</em></strong></h4><p>Newsletters are curated collections of recent engineering news, articles, and open-source projects. They are great for answering the question “What’s new out there?”. I am a regular reader of the following three newsletters:</p><ul><li><a href="https://www.infoq.com/reginit.action"><strong>InfoQ Weekly</strong></a>: A comprehensive roundup of software engineering news and articles. It is worth noting that all articles mentioned there have almost academic qualities air to them. Heavy on knowledge, light on engaging storytelling, emojis or jokes.</li><li><a href="https://go.libhunt.com/newsletter"><strong>Awesome Go Weekly</strong></a>: Since Go is my main programming language at work, I like to stay updated with the Go development.</li><li><a href="https://blog.bytebytego.com/"><strong>ByteByteGo</strong></a>: A bite-sized system design and architectural articles. System design is a fascinating topic. It is also a topic in which most engineers are rarely directly involved at work.</li></ul><p>My main reason for reading these newsletters is to get up-to-date with a constant flow of news and identify new emerging topics I can explore in more depth later.</p><p>It’s easy to get carried away and subscribe to numerous newsletters. But remember, reading newsletters, unlike subscribing, demands time. It’s better to read and benefit from a couple of weekly newsletters than to be overwhelmed with many, leading you to question your subscription choices.</p><h4><strong>Articles</strong></h4><p>I primarily come across articles I want to read either through recommendations in newsletters or while searching for answers to specific, well-defined questions.</p><p>Articles are useful resources for following use cases.</p><ul><li><strong>Quick broad Overviews</strong>: An introductory overview of a topic. Take, for example, <a href="https://www.maxcountryman.com/articles/a-framework-for-prioritizing-tech-debt?utm_source=tldrnewsletter">“A Framework for Prioritizing Tech Debt”</a>. This article provides a clear understanding of what tech debt is and presents a possible structured approach to deciding whether to eliminate it must be a priority. You do not need specific pre-existing knowledge to get value out of the article.</li><li><strong>Detailed Exploration of specific issue</strong>: Intensive focus on specific and very narrowly scoped issue. For example, the article <a href="https://preslav.me/2023/02/06/golang-do-we-need-struct-pointers-everywhere/">“User or *User — Do We Need Struct Pointers Everywhere?”</a> dives into nuances of passing structs either by value or by reference in Golang. You need a lot of pre-existing knowledge of Go and its type system in order to get value out of the article.</li></ul><p>Articles help you to go very broad or very deep once you identified the topic</p><h4><strong>Books</strong></h4><p>Books offer a huge amount of knowledge on their subjects. One good book can take you on a journey from zero knowledge to expert-level knowledge on the subject.</p><p>I divide all engineering books into two categories: <em>“Practical”</em> and <em>“Conceptual”</em>.</p><p><strong>Practical Books</strong> usually contain many executable code examples. The books teaching programming languages are the most obvious examples of “practical” books. For example, <a href="https://learning.oreilly.com/library/view/head-first-kotlin/9781491996683/">Head First Kotlin</a> contains many executable examples, as well as many pen-and-paper exercises for the readers.</p><p><strong>Conceptual Books</strong> lean heavily on illustrative diagrams and are sparse on executable code examples. Consider <a href="https://www.amazon.co.uk/Software-Architecture-Modern-Tradeoff-Analysis/dp/1492086894/ref=asc_df_1492086894/">Software Architecture: The Hard Parts</a> as an example. Getting familiar with concepts like <em>“Architectural Decomposition”</em> or <em>“Distributed transactions” </em>is vital for being a knowledgeable engineer, but it is not something you can immediately practice by running a code example.</p><p>Conceptual books are perfect for reading on the go when you are away from your laptop. Think commute or periods of waiting. Got a spare 15 minutes and a seat? That’s a reading opportunity right there.</p><p>When it comes to picking the next book, it can be challenging. Sure, there are the well-known engineering <em>“must-reads”</em> like <a href="https://learning.oreilly.com/library/view/clean-code-a/9780136083238/">Clean Code</a> and <a href="https://learning.oreilly.com/library/view/domain-driven-design-tackling/0321125215/">Domain Driven Design</a>. Their reputation precedes them, and they certainly deserve your time. But what about the latest releases? I have a few suggestions.</p><ul><li>Social media, particularly Twitter, can help. If you follow industry leaders or fellow engineers, you’ll inevitably come across book recommendations. A Social media osmosis in action.</li><li>Job-based initiatives like “engineering libraries” in the office or a Slack channel functioning like a book club. Both can provide valuable and relevant reading suggestions.</li><li>Occasionally browsing new releases sections of major publishers such as <a href="https://www.oreilly.com/whats-new.html">O’Reilly</a>, <a href="https://www.manning.com/">Manning</a>, and <a href="https://www.packtpub.com/">Packt</a> can be a direct source for filling your to-read list.</li></ul><p>Be conservative in estimating how many books you can read in a year. If not sure, aim for 2–3 books. Technical books aren’t easy to read. While I might breeze through a novel in two weeks, I never managed to do the same with an engineering book.</p><h4><strong>Video Courses</strong></h4><p>They combine auditory and visual learning, distinguishing them from text-based articles and books.</p><ul><li><a href="https://frontendmasters.com/">Front End Masters</a> excel in their ‘code-along’ recorded workshops on various topics, often beyond the scope of front-end development. For example, <a href="https://frontendmasters.com/courses/rust/">The Rust Programming Language</a> is one of such courses.</li><li><a href="https://www.udemy.com/">Udemy</a> has a huge number of courses, but they can be hit or miss depending on the instructor. One example of a hit is a bestselling course <a href="https://www.udemy.com/course/pragmatic-system-design/">Pragmatic System Design</a>.</li><li><a href="https://www.linkedin.com/learning/">LinkedIn Learning</a> curates a broad spectrum of courses catering to various professional domains.</li></ul><p>When on the hunt for a new course, I usually skim through the platforms mentioned above, searching for specific topics related to my current learning area of interest, which can be something like <em>“learning intermediate and advanced SQL”</em> or <em>“Event-driven architecture”</em>.</p><h4><strong>Conference Talks</strong></h4><p>Most of the talks presented at any given tech conference become available online a few weeks or months after the event. Conference talks have a dual role of educating and entertaining. They are valuable for broadening your knowledge horizons. As with any learning material, not all talks are equally interesting. While some presentations shine due to the excellent combination of visuals and narration, others might fall short when watched in isolation, without the context of the tech conference at which they were presented.</p><p>My recently watched favorites include <a href="https://www.youtube.com/watch?v=x2-rSnhpw0g&amp;t=1s">Visualizing software architecture with the C4 model — Simon Brown, Agile on the Beach 2019</a> and <a href="https://www.youtube.com/watch?v=ZPIPPRjwg7Q">Debugging Treasure Hunt — Suzy Mueller, GopherCon 2021</a></p><p>To curate a list of talks for future viewing, I visit websites like <a href="https://confs.tech/">confs.tech</a> or <a href="https://dev.events/">dev.events</a>, focusing on Backend engineering and Golang conferences. From there, it’s a dive into individual conference websites to choose the talks to my “watch later” list. I give preference to conferences with shorter 30-minute talks over longer 50-minute sessions. As I think they provide better value to time ration.</p><h4><strong>Hands-on Project</strong></h4><p>Active practice is an essential form of learning. While acquiring information is vital, applying it ensures that it’s converted into a skill that stays with you.</p><p>Sometimes, the newly acquired knowledge can be immediately used in daily engineering tasks at work. Unfortunately, it is not always the case. So you need to find other ways to practise.</p><p>In my early days as an engineer, I frequently worked on mini projects to improve and practise my skills. I still do such mini-projects, but less often. However, I do recommend it as the most straightforward way to practice, especially for junior engineers.</p><p>At the current stage of my career, activities such as writing articles or preparing engineering talks also serve as practical, hands-on learning for me. I reinforce my own knowledge by sharing it with others.</p><h3><strong>Finding Time</strong></h3><p>First, stating the obvious, finding time for studying when you have a full-time job and various outside-of-work responsibilities is hard. And It will never be easy. But it is necessary as the key to successfully learning anything lies in continuity. Regular, even if brief, learning intervals can lead to significant progress over time.</p><p>Some employers recognize the value of continuous learning and upskilling and have initiatives like<em> “Half-Day Learning Fridays”.</em> If you’re fortunate to work for such an employer, it’s a boon. However, if not, you’re in the majority, and it’s up to you to carve out time for personal upskilling.</p><p>Taking myself as an example, I dedicate 6–12 hours weekly, outside of work, to learning. This might seem like a big number, but it doesn’t feel like a chore most of the time, thanks to my general passion for learning.</p><p>I’ve found that bundling these hours over 3 days from Friday to Sunday — works best for me. My previous attempts to study in the evenings after work often made me miserable. Attempts to wake up early and study before work resulted in me being sleepy and starting the work day while already tired.</p><p>Choosing your learning days and hours around what feels most sustainable for you is essential. There’s no one-size-fits-all approach. Remember, the continuous learning journey is about personal growth at your own pace, free from external timelines.</p><h3><strong>Tracking Progress</strong></h3><p>With tangible goals like <em>“preparing for a job interview”</em>, you have a clear objective and a deadline. However, when you’re aiming <em>“to stay reasonably up-to-date with the state of software engineering”,</em> the goal is vague, and there’s no set timeframe to achieve it.</p><p>To manage the ambiguity of ongoing learning, I came up with the idea of a <a href="https://www.notion.so/e5b39a4bf27b4ebfac4283186628598b?pvs=21"><strong>Learning board on Notion</strong></a><strong>,</strong> inspired by a kanban methodology. I’ve been using my board successfully for the past two years. The board uses columns to represent progress stages and rows for categorizing the learning medium. I want to particularly note that there are no <em>“sprints”</em> on my board. I use the same board for an entire calendar year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*U5lzY8zt95BvQDz8eRhmiA.png" /><figcaption>The essential structure of a learning board</figcaption></figure><p>Here’s how I interact with my board:</p><p><strong>On-the-Fly Updates</strong>: Whenever there’s a change in the status of a learning item, I move the card. For instance, when I start a video course or finish an article, I update its status.</p><p><strong>Weekly Board Check</strong>: Every Sunday, I dedicate 20 minutes to review the board. This routine helps in:</p><ul><li>Assessing my progress, like how many pages of the current-read book I read this week.</li><li>Thinking about the upcoming week and picking out items I plan learn.</li><li>Evaluating the “No status” column, either promoting items to “Not started” or removing ones that no longer align with my interests.</li><li>Hunting for the new materials. if I have some topic on my mind that I want to learn more about. Or if my “No status” column looks particularly empty.</li></ul><p>The learning board offers a clear snapshot of my activities. It helps me plan what I want to learn and how. It also provides a log of what I’ve learned so far in the current calendar year.</p><p>If you like my learning board approach, you can <a href="https://lulaleus.notion.site/lulaleus/e5b39a4bf27b4ebfac4283186628598b?v=4338c76020b94de296e5b7f179cddd01">duplicate it as a Notion template</a> and create your own unique learning board based on it.</p><h3><strong>Conclusion</strong></h3><p>I believe that commitment to continuous learning and upskilling is a non-negotiable requirement for being a great software engineer. So, crafting an efficient and structured approach to learning is crucial. Through trial and error, I’ve arrived at the method shared above.</p><p>Although my learning process is already well-defined, I’m always looking for ways to refine it even further. I welcome any suggestions or feedback you can give me in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=555f9e6ab23b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 3 Design Patterns for a Large Go Codebase]]></title>
            <link>https://medium.com/@opheliaandcat/top-3-design-patterns-for-a-large-go-codebase-79a324003b47?source=rss-9fcfe9a48f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/79a324003b47</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Lula Leus]]></dc:creator>
            <pubDate>Tue, 04 Jul 2023 16:38:26 GMT</pubDate>
            <atom:updated>2023-07-05T17:42:32.432Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sXUKmWSgrPFEYQ-Vwdp2A.jpeg" /></figure><h3>Design Patterns that help to solve real problems</h3><h4>Introduction</h4><p>Design patterns are often considered to be fundamental knowledge every good software engineer should possess. Maybe it is true. However, not all theoretical knowledge is useful for day-to-day work.</p><p>I felt uncertain about the applicability of design patterns to my day-to-day work in a large microservice-based codebase, servicing millions of users. So I decided to investigate.</p><p>I don’t aim to describe all classical software design patterns. I concentrate on the top 3 design patterns, the usage of which I notice regularly. I’ll explain what particular real-world problem each of these patterns solves.</p><h4>A very brief history of design patterns</h4><p>Let’s refresh our knowledge of how software engineering design patterns came about. In 1994, four authors — Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm published a book “<a href="https://www.oreilly.com/library/view/design-patterns-elements/0201633612/">Design Patterns: Elements of Reusable Object-Oriented Software</a>”. This book earned the nickname “The Book by the Gang of Four,” later abbreviated to “the GoF book”.</p><p>The GoF book contained 23 patterns categorized into three groups: Creational, Structural and Behavioural patterns. The examples for the book were written in C++ and Smalltalk. As could be expected, the described patterns were influenced by these specific languages and by software engineering needs of the time. However, the concept of patterns proved to be enduring.</p><p>Today, we still refer to these 23 patterns grouped into three categories as the classic software design patterns. Example implementations for all these patterns are written in all the popular languages, including <a href="https://golangbyexample.com/strategy-design-pattern-golang/">an implementation in Go</a>. The latest is of particular interest to me since I mostly work with Go myself.</p><h4>Why use design patterns?</h4><p>So design patterns exist, but why use them? They help engineers avoid reinventing the wheel when tackling commonly known or repetitively recurring problems. Additionally, design patterns help to communicate ideas between software engineers efficiently.</p><p>Knowledge of patterns may help engineers in the process of getting accustomed to an unfamiliar codebase too. The codebase, no matter its size, becomes less overwhelming if what happens in it can be mind-mapped with something familiar and universal. Design patterns provide frameworks for such mapping.</p><h4>Strategy: A plan for clarity and readability</h4><blockquote>“Strategy: a plan that is intended to achieve a particular purpose”<br><em>Cambridge dictionary</em></blockquote><p>In software engineering, Strategy is a behavioural design pattern that allows objects to have a set of interchangeable behaviours and the ability to choose one of them at runtime according to the current needs.</p><p>The typical use-case for a Strategy pattern is an endpoint request handler. The handler’s behaviour must differ according to the request parameters, yet the complexity does not warrant separate endpoints for each case.</p><p>Let’s consider a microservice called <strong>authorisations-report</strong> as an example. It has a single endpoint <em>/get-report</em>, which generates well… a report. Different types of reports can be requested, such as authorisation roles, authorisation policies or assignments (connections between users and their authorisations).</p><figure><img alt="Strategy design pattern diagram" src="https://cdn-images-1.medium.com/max/1024/1*mDGyF9KkjaFOTMyQmaU_XA.png" /><figcaption>Strategy design pattern diagram</figcaption></figure><p>The code for this example divided between two packages — <em>handler</em> and <em>report</em>. handler function <em>GetReport </em>calls Build method exposed by the report package and passes to it a requested report type. The report type can be either “roles”, “policies” or “assignments”.</p><pre>package &quot;handler&quot;<br><br>func (h *Handler) GetReport(ctx context.Context, body *reportproto.GetReportRequest) (*reportproto.GetReportResponse, error) {<br> // Generate report<br> result, err := report.Build(ctx, body.ReportType)<br> if err != nil {<br>  return nil, error<br> }<br><br> return &amp;reportproto.ReportResponse{report: result}, nil<br>}</pre><p>And there is a <em>report</em> package. When <em>Build</em> functions is called, it selects a strategy for report building based on the type provided.</p><pre>package &quot;report&quot;<br><br>func Build(ctx context.Context, reportType string) (Report, error) {<br> // We choose strategy to build report<br> var reportBuilder reporter<br> switch reportType {<br> case constants.ReportTypeUsers:<br>  reportBuilder = allUsersReporter{}<br> case constants.ReportTypeRoles:<br>  reportBuilder = roleReporter{}<br> case constants.ReportTypePolicies:<br>  reportBuilder = policyReporter{}<br> default:<br>  return nil, fmt.Errorf(&quot;invalid_report_type: Invalid report type provided&quot;)<br> }<br><br> report, err := reportBuilder.build(ctx, w)<br><br> return report, err<br>}</pre><p>The Strategy pattern is a simple and clean way to create different behaviours without overloading the code with numerous if/else conditions, thereby maintaining clarity and readability.</p><h4>Facade: a way of communication with 3rd-party service providers.</h4><blockquote>“Facade (false appearance): a false appearance that makes someone or something seem more pleasant or better than they really are”<em><br>Cambridge dictionary</em></blockquote><p>In software engineering, by using a facade, we can hide an inner complexity of an actual entity implementation behind a simplified outer interface, which exposes only methods needed by the external system. This provides a simple and user-friendly interface to communicate with.</p><p>In microservices-based architecture, I saw this pattern being used many times for communication with 3rd party services. For example, DocuSign for managing documents or GreenHouse to assist with recruiting. Each facade is an autonomous microservice that bridges internal company services and external 3rd party API. This offers the flexibility to construct generic integrations that can be scaled up and down, monitored like any internal service, etc. I’ll look at microservice<strong> hr-system</strong> as an example of the facade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Us2YGqAm2yJXbZYxskJHpw.png" /><figcaption>Facade design pattern diagram</figcaption></figure><p>The code example demonstrates one endpoint handler <em>ReadEmployee</em>, responsible for getting employee by ID from external HR system using client.GetEmployee. The employee data is then transformed into a protobuf object shape using <em>marshaling.EmployeeToProto</em>, before being returned to the requester.</p><pre>package handler<br><br>func (h *Handler) ReadEmployee(ctx context.Context, body *hrsystemproto.GETReadEmployeeRequest) (*hrsystemproto.GETReadEmployeeResponse, error) {<br> if body.EmployeeId == &quot;&quot; {<br>  return nil, validation.ErrMissingParam(&quot;employee_id&quot;)<br> }<br><br> // client is based on Go net/http package and does request to 3rd party system<br> employee, err := client.GetEmployee(ctx, body.EmployeeId)<br> if err != nil {<br>  return nil, fmt.Errorf(&quot;failed to read employee&quot;)<br> }<br><br> marshalled, err := marshaling.EmployeeToProto(ctx, employee)<br> if err != nil {<br>  return nil, fmt.Errorf(&quot;failed to marshal employee&quot;)<br> }<br> return &amp;hrsystemproto.GETReadEmployeeResponse{<br>  Employee: marshalled,<br> }, nil<br>}</pre><p>The use of facades provides a few benefits. Engineers are offered a limited subset of strongly-typed endpoints, where intricacies associated with request authentication, optional parameters, or object transformation are already addressed.</p><p>When the need in onboarding new 3rd party integration arises, to build it is becomes a quick and easy task because comprehensive blueprint for doing so already exists.</p><h4>Fan-out/Fan-in: Leveraging concurrency for getting results faster</h4><blockquote>“Fan-out: to spread out over a wide area”<br><em>The Cambridge dictionary</em>.</blockquote><p>This design pattern belongs to the concurrency patterns group and is outside of the The GoF book. However, the pattern is ubiquitous in distributed systems. Hence I want to discuss it.</p><p>The concept of this pattern is to divide a data retrieval task into multiple chunks, execute them concurrently, and then aggregate the results.</p><p>An array of items, where each item should be processed somehow, is a simple but realistic example. Imagine that the array is very large or processing of items takes a long time (For example, every item produces/requires an HTTP call).</p><figure><img alt="Fan-in/Fan-out design pattern diagramm" src="https://cdn-images-1.medium.com/max/1024/1*YAGqqd3071Z1JrY47-PNKg.png" /><figcaption>Fan-in/Fan-out design pattern diagram</figcaption></figure><p>I will look at microservice<strong> authorisations-report</strong> as an example of the use of the Fan-in/Fan-out pattern. We already discussed this service in Strategy design pattern section. Noting prevents the service from implementing more than one design pattern at once.</p><p>Let’s say that the service received a request to produce an “assignments” report. In this service domain, assignment means a connection between company employee and authorisations granted to this employee. And assignments report is expected to provide information about all company employees and all authorisations currently granted to them.</p><p>Creation of such a report requires a lot of network requests, and doing it sequentially, on employee after employee basis, took around 30 minutes to complete.</p><p>Fan-out/Fan-in pattern comes to the rescue. It’s worth noting that in snipped of code, we do not spawn a Goroutine per employee since it would create more than one thousands goroutines and unhealthy spike in requests for all downstream services. We use a semaphore to limit our fanning-out width to 100 goroutines.</p><pre>func createReportRows(ctx context.Context, employeeProfiles []profile) (map[string]reportRow, error) {<br> numOfEmployees := len(employeeProfiles)<br> rowsChan := make(chan reportRow, numOfEmployees)<br> concurrencyLimiter := semaphore.NewWeighted(100)<br><br> // Fan-out stage, create rows of assignment report concurrenty<br> for _, employee := range employeeProfiles {<br>  // Acquire a &quot;token&quot; from semaphore, block if none available.<br>  if err := concurrencyLimiter.Acquire(ctx, 1); err != nil {<br>   return nil, err<br>  }<br><br>  go func(curProfile profile, rowsChan chan&lt;- reportRow, concurrencyLimiter &lt;-chan struct{}) {<br>   // Release the &quot;token&quot; back to semaphore<br>   defer concurrencyLimiter.Release(1)<br><br>   rowsChan &lt;- newRow(ctx, curProfile)<br>  }(employee, rowsChan, concurrencyLimiter)<br> }<br><br> // Fan-in stage, all created rows go into one data structure<br> // As we know the exact number of rows, we can use a simple for loop<br> // and wait for all of them to be created and sent to the channel.<br> rows := make(map[string]reportRow, numOfEmployees)<br> for i := 0; i &lt; numOfEmployees; i++ {<br>  assignment := &lt;-rowsChan<br>  rows[assignment.id] = assignment<br> }<br><br> return rows, nil<br>}</pre><p>Fan-out/Fan-in is one of the most useful and ubiquitous patterns in a modern software engineering landscape because processing things one by one is just not enough.</p><h4>Recap of Discussed Design Patterns</h4><p>The demonstrated use of design patterns proves that these patterns are more than theoretical constructs. They are integral to a production codebase and help maintain high coding standards by reapplying established effective patterns for solving recurrent problems.</p><p>In addition to classical design patterns, concurrency patterns have become a vital part of contemporary software development. I quickly looked at this group of patterns with the widely used Fan-out/Fan-in pattern.</p><p>That’s my take on design patterns that can be applied to software engineers’ day-to-day work. I’ve explored the top 3 from my experience, but the exploration doesn’t stop there. Design Patterns have evolved beyond the original 23 from The GoF, and beyond the addition of concurrency patterns. There are architectural patterns, messaging patterns, and so much more to explore!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79a324003b47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Table-driven and individual subtests in Golang: which one to use]]></title>
            <link>https://medium.com/@opheliaandcat/table-driven-and-individual-subtests-in-golang-which-one-to-use-360b5de39d?source=rss-9fcfe9a48f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/360b5de39d</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Lula Leus]]></dc:creator>
            <pubDate>Sun, 14 Aug 2022 16:07:33 GMT</pubDate>
            <atom:updated>2022-08-14T16:07:33.033Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Beach huts in different colourings, but with the same shape" src="https://cdn-images-1.medium.com/max/1024/1*NEqPOf2vsdBKfba7dhyxtg.jpeg" /><figcaption>Row of beach huts on the East Kent coast, near Broadstairs, UK</figcaption></figure><h3>Intro</h3><p>Unit tests are an essential part of any code base, including the one at my workplace. When an engineer adds a piece of new logic into the codebase, they are expected to add unit tests that will cover, at least, the most common scenarios of the new logic usage. Perhaps with a couple of edge cases as a cherry on the top.</p><p>Testing different scenarios is important, but requires writing fairly repetitive tests. Let’s look at approaches Golang offers for this.</p><h3>Testing packing of a doughnuts box</h3><p>We’ll look at two different ways to write unit tests in Golang. We will use a playful example of packing a doughnuts box. The flavours of the doughnuts in the examples, are all inspired by <a href="https://www.crosstown.co.uk/">Crosstown doughnuts</a>. Let’s look at the code, for which we’ll write tests.</p><p><em>Implementation of a doughnut box</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/823d32223323f3bcdc9d71c9c0d63523/href">https://medium.com/media/823d32223323f3bcdc9d71c9c0d63523/href</a></iframe><p>Now, after we familiarised ourself with the doughnut box implementation, let’s discuss how we can tests it.</p><h4>Testing packing the doughnuts box with table-driven tests</h4><p>Table-driven tests are the common way to write unit tests in Golang. You’ll find this style everywhere.</p><p>Table tests offer a condensed way to write test scenarios while keeping code repetition to a minimum. The syntax density is coming with the drawback of poor readability. The tests may feel elegant to write, but they are often hard to read and reason about.</p><p>The table-tests are shining in situations, where the intention is to test a large number of scenarios, with clear<br><em>input x produces output y</em> expectations.</p><p>For our doughnut box example, we wrote a set of scenarios in the shape of anonymous struct testCases. Then we run all of them as subtests with t.Run method, inside a familiar for loop.</p><p><em>Implementation of doughnuts box tests as table-driven subtests</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/345ef46bfd1d19b6dba2125840bb9846/href">https://medium.com/media/345ef46bfd1d19b6dba2125840bb9846/href</a></iframe><p>We looked at the “happy path” test case and two test cases for errors we expect to be common — trying to put too many doughnuts into a box and an attempt to put something that isn’t doughnut into the box.</p><p>Next, we’ll look at how we can re-write the same tests in different style.</p><h4>Testing packing the doughnuts box with individual subtests</h4><p>Writing tests scenarios as an individual subtests is less common in Golang. This fact is regretful, in my opinion. But still there are enough of examples of this syntax.</p><p>Individual subtests syntax, unlike table tests, favours readability overall “code dryness”. The tests may look more repetitive, but each individual subtest represents an individual “story”. As such, it is easier to follow behaviour-driven testing principles with individual subtests than with table-driven tests.</p><p>In our small example, all arrangements are made within the individual subtests. In more complex examples, the state shared between subtests can be initialised in the body of the parent test. And repetitive setup/teardown can be extracted into helper functions.</p><p><em>Implementation of Donuts box tests as individual subtests</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f8986c0a67be3ff327071b60535fd722/href">https://medium.com/media/f8986c0a67be3ff327071b60535fd722/href</a></iframe><p>We wrote the same three test cases — happy path and two common error scenarios as individual sub-tests. In our example, they even took approximately the same number of code lines. 58 lines for individual subtests, comparing to 63 lines of table-driven tests example.</p><h3>Conclusions</h3><p>Now, when examples for two styles for unit tests are presented, it is time to decide which one to use and when.</p><p>As an engineer, you should exercise your better judgement on how to write unit tests and what syntax suits best. You can use the following little diagram to help you to decide, which syntax to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*Bjbt5V58g3WPe2C9tfx88A.png" /></figure><p>I hope the diagram helps. If you have a strong opinion for one syntax over another or have your own way of writing Golang unit tests, please share in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=360b5de39d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing integration tests with Cypress for React app behind Okta authentication]]></title>
            <link>https://medium.com/condenastengineering/writing-integration-tests-with-cypress-for-react-app-behind-okta-authentication-9664f538331?source=rss-9fcfe9a48f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9664f538331</guid>
            <category><![CDATA[integration-testing]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[cypress]]></category>
            <dc:creator><![CDATA[Lula Leus]]></dc:creator>
            <pubDate>Mon, 11 Nov 2019 11:44:56 GMT</pubDate>
            <atom:updated>2019-11-11T16:12:56.598Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to test UI in a box</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OXgSeyfrDSrWlsBa" /><figcaption>Photo by <a href="https://unsplash.com/@weblounge?utm_source=medium&amp;utm_medium=referral">Kristof Van Rentergem</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Introduction</h4><p>Recently I worked on a new front-end feature for the project at work. I was ready to declare my work completed when I noticed that one of the tests, not even related to the feature I developed, is failing.</p><p>I am used to Jest tests failing in React apps because I forgot to pass a new prop to a component in test, to update a snapshot or whatever. So I was really surprised when I found out that <a href="https://www.cypress.io/">Cypress</a>, the test runner I recently added to the project testing toolset, caught an actual bug which I introduced during my feature development and failed to notice.</p><p>I was so excited with this proof that Cypress prevented me from shipping bugged code, that I decided to write a post about how to start testing React app, complicated by Okta authentication, with Cypress. Actually… it is really easy to do.</p><h4>Overview of Front end testing strategies</h4><p>Nowadays, there are many ways to test Front end applications. Let’s reiterate on some of them and their use-cases.</p><ul><li><strong>Unit tests</strong>. They help enormously with writing code with testability in mind. They keep us confident that small units of functionality are working correctly. Unfortunately, the usefulness of unit tests is low after the development stage is completed. The defacto default way to write unit test for React app today is <a href="https://jestjs.io/">Jest</a> plus <a href="https://airbnb.io/enzyme/">Enzyme</a> or a newer <a href="https://github.com/testing-library/react-testing-library">React-testing-library</a>. I personally still prefer Enzyme because it has richer toolset.</li><li><strong>Visual regression tests</strong>. They help to avoid visual differences in how UI looks. <a href="https://percy.io/">Percy.io</a> is the tool I use at work for this kind of tests.</li><li><strong>End-to-end tests </strong>are undoubtedly effective, but time-consuming and complicated to setup. A good way to start with the e2e is <a href="https://github.com/GoogleChrome/puppeteer">Puppeteer</a>.</li><li><strong>Integration tests</strong>. It is the type of tests I will concentrate on in this article, and more precisely on how to write them with <a href="https://www.cypress.io/">Cypress</a>.</li></ul><h4><strong>Integration tests in more details</strong></h4><p>The definition of integration tests is vague. Even the following most basic example, written with Enzyme, can be considered an integration test.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c23bfec78ecbc27b3a1f778bd66ef39d/href">https://medium.com/media/c23bfec78ecbc27b3a1f778bd66ef39d/href</a></iframe><p>The test asserts that when user clicks a button in `ParentComponent`, `ChildComponent` is rendered within it. When another button, in `ChildComponent`, is clicked, the `ChildComponent` will be removed from the DOM.</p><p>So we wrote an integration test. Integration between two components only, but integration nonetheless. Great? Not really.</p><p>There are two major problems, which may look insignificant in this tiny example but become real obstacles in more complex scenarios.</p><p><strong>First</strong> —In the test, we are constructing a chain of user interactions with visual elements without actually seeing them. I need to imagine these two components in DOM, the buttons, appearance, and disappearance of a piece of HTML in my head. It is feasible with two component example, but orchestrating more complex user interactions without seeing them does not sound like a great idea. Even worse, what if someone else constructed such a test some time ago? And you are only trying to understand what change broke this invisible flow of UI interactions. It would be so much nicer to be able to see what are you doing.</p><p><strong>Second</strong> — What happens when a set of components we are testing, interacts with Browser APIs like cookies, page URL or local storage, which cannot be easily included in Enzyme or React testing library. Testing even the simple action of “user clicked on link powered by react-router and app transitioned to the new route” requires quite a bit of work to replace actual APIs with mocks and test.</p><h4>Cypress to the rescue</h4><p>Cypress resolves these problems. It is an Electron application that runs tests in environments of Electron app, Chrome browser or headless.</p><p>Simply by having our code in the instance of a browser, we can see our tests visually and get access to all Browser APIs. But Cypress offers more. It gives us a detailed and visual report about what is going on in every test, step by step.</p><p>Cypress gives easy programmatical way to interact with Browser APIs. I can clean browser localStorage with `cy.clearLocalStorage( )` or set cookies as part of tests setup or teardown with `cy.setCookie()`.</p><p>Cypress is also able to communicate with web servers with `cy.request()` and stub request to a backend with `cy.route()`.</p><p>Cypress presents itself as a platform for end to end tests. There are also plugins that can extend Cypress functionality even further and allow us to do more with it. We will discuss only a tiny subset of what Cypress can do — integration tests of UI with all communication to the server stubbed by Cypress. You may think about these tests as “UI in a box”.</p><h4>Cypress setup</h4><p>In this section, we will add Cypress into an imaginable app. It is based on the project I currently work on, but with a twist. Who’s interested in discussing an obscure internal dashboard? Most likely, nobody. So instead, our app is called “Michelin-starred recipes”. Users of the app can browse recipes and filter them according to ingredients and cuisine type. There is also an important toggle of “show only vegan recipes”. The whole app is behind Okta because it is available only for chefs in Michelin-starred restaurants. When the restaurant awarded its first star, the chef gains access to the application via Okta. It’s all top secret stuff :). Let’s take a look at how we can test it!</p><p>In the root folder of our project, we will run two following commands</p><pre>$ npm install cypress --save-dev</pre><pre>$ npx cypress open</pre><p>Cypress adds the following structure of folders into the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*jVP_xjGqzixo4m_Wp9lRwg.png" /></figure><p>For the sake of convenience, we will add the following piece of configuration into <strong>cypress.json </strong>file</p><pre>{<br>  &quot;baseUrl&quot;: &quot;http://localhost:3000&quot;<br>}</pre><p>The baseUrl depends, on which host and port your application runs. Mine is localhost: 3000. Thanks to this we will be able to use “/recipes” url instead of daunting “http://localhost:3000/recipes” to load the recipes page.</p><h4>Getting behind Okta authentication in Cypress</h4><p>Fist challenge presented by “Michelin-starred recipes” is authentication. One of the Cypress limitations (or features) is that every test can visit only one domain level URL.</p><p>So I cannot start my test from the login page in my app, go to a third-party-domain (Okta), log in here and be redirected back to my app. The moment I will leave my app page, Cypress will throw an error.</p><p>Cypress documentation offers two solutions. First — to mock authenticated state of a user. Second — to login programmatically with `cy.request()`.</p><p>We will implement the first option. It is blazing fast — no request is sent and no waiting for a response. Our app uses <a href="https://www.npmjs.com/package/@okta/okta-react">okta-react package</a>, so the following snippet shows how to mock authentication in this specific case.</p><p>Mocked authentication also means, that any request to the server, if it requires user to be authenticaticated, should be mocked too. And Cypress will help and happily stub any requests to the server for us, with `cy.route()` function.</p><p>We will obtain everything we need for mocking okta logged-in state by logging into application in a browser, as any user will do, and checking DevTools. We will wrap all we need to do in one function, which will do the following</p><ul><li>Set two Okta related cookies. We just copy-paste them from our browser.</li><li>Create a datestamp, which will be one-day in the future, every time the code is run. We name it appropriately “oneDayFromNow”,</li><li>Set two Okta related items in LocalStorage. They are also copy-pasted from the browser but require some editing. Instead of simple strings, we will use `Template literals`. Inside them, we need to find and replace every instance of expiresAt property, with expiresAt:${oneDayFromNow}</li><li>Finally, we start a cypress server and say it to a stub a <a href="https://dev-382196.okta.com/oauth2/default/v1/userinfo">https://dev-382196.okta.com/oauth2/default/v1/userinfo</a> route. We know that this is the route to get user information for our okta user.</li></ul><p>Let’s add this code into <strong>./cypress/support/commands.js </strong>file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff2923be76eb0c94238252d9f88e585e/href">https://medium.com/media/ff2923be76eb0c94238252d9f88e585e/href</a></iframe><p>We added a new “Command” — a function, which can be invoked anywhere within Cypress.</p><p>Now let&#39;s use it. We will add another command, into the<strong> ./cypress/support/commands.js</strong> file. This one will call mockOktaLoggedState command we defined earlier, stub the API endpoints called by recipes page use and finally visit the “/recipes” page of our app.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ad13c96ad4821eb343c46843925fe26/href">https://medium.com/media/8ad13c96ad4821eb343c46843925fe26/href</a></iframe><p>Both these commands use fixtures. Fixtures are plain JSON files and in our case, nothing more than saved HTTP response. Let’s take a look at okta-user-mock.json.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*9IfiXZkRf4LJ8c93i09l9Q.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/95b92cf13c20e7599eb4337f9f5b0d99/href">https://medium.com/media/95b92cf13c20e7599eb4337f9f5b0d99/href</a></iframe><h4>Close up on one test</h4><p>Now we will take a look at one test,which checks how recipe’s filtering with Vegan-only toggle works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QHOjEnj0rjjfKNcUEbSSnQ.png" /><figcaption>Cypress — test passing</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4cff2fd0fe2828304d3fb3cd281173e/href">https://medium.com/media/a4cff2fd0fe2828304d3fb3cd281173e/href</a></iframe><p>The test does the following</p><ul><li>loads the whole react application and navigate to `/recipes`.</li><li>sends HTTP request to `/api/recipes’ on page load` to get recipes (mocked response returned by Cypress).</li><li>assert that not every recipe contain vegan badges</li><li>toggles the toggle, sends HTTP requests to `/api/recipes?vegan=true` (response returned by Cypress again)</li><li>asserts that now every recipe contain vegan badges</li><li>and finally, checks that changes in toggle state reflected in the page URL.</li></ul><p>As you can see the list is long, but the actual code snippet is quite concise. This test is also similar to the broken test I mentioned at the beginning of the post. What was broken in that test, is a connection between the state of the toggle and state or the page URL.</p><h4>Conclusion</h4><p>Cypress is an exciting tool because it makes testing so much more understandable and far more visual than ever before. In this article, we didn&#39;t even scratch the surface of integration tests in Cypress, not to mention all other things it can do. My main motivation was to show how easy it is to start writing tests in Cypress for the application behind Okta authentication. And if it will inspire someone working with React and Okta to give Cypress a try, I couldn’t wish for more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9664f538331" width="1" height="1" alt=""><hr><p><a href="https://medium.com/condenastengineering/writing-integration-tests-with-cypress-for-react-app-behind-okta-authentication-9664f538331">Writing integration tests with Cypress for React app behind Okta authentication</a> was originally published in <a href="https://medium.com/condenastengineering">Product and Engineering at Condé Nast</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keeping up with web development]]></title>
            <link>https://medium.com/@opheliaandcat/keeping-up-with-web-development-31e98409a462?source=rss-9fcfe9a48f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/31e98409a462</guid>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Lula Leus]]></dc:creator>
            <pubDate>Tue, 01 Jan 2019 15:35:06 GMT</pubDate>
            <atom:updated>2019-01-01T15:35:06.239Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFeXP228u_3dvwpsA2Pdbg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/NPFu4GfFZ7E?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mārtiņš Zemlickis</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4>The introduction</h4><p>Many developers share the feeling that web development moving fast. So fast actually, that to keep up with it feels like a hard job in itself.</p><p>In my own constant effort of staying up-to-date, I came up with a few approaches, which I want to share in hope, that these ideas can be useful for others.</p><h4>Creating and maintaining To-learn list</h4><p><strong>To-learn </strong>list helps me to keep track of my learning plans and ideas. My list is nothing more than a note in the note-taking app, divided into a few sublists of items — links to resources I plan to read/watch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JtLLTJnpbZEw4UyKkFI_8A.png" /><figcaption>Snapshot of the list, circa winter 2018</figcaption></figure><p><strong>To-learn</strong> list example is quite self-descriptive. Only “General ideas” requires explanation. It may contain any item, language (Kotlin), paradigm (microservices) or note to myself (dedicate some time to Java, take a look beyond Node.js). For any programming idea, I want to explore deeper — I add an item to my<strong> To-learn list</strong>.</p><p>Sometimes when I really into learning big new topic — let say a “Frontend unit testings” is our example idea I want to learn about, I create a special named list for this topic. My “Frontend unit testings” list may contain links to resources of any type (books, talks, courses) about Jest, Enzyme, JavaScript unit testing best practices and more.</p><p>After describing how I keep track of what I want to learn, I`ll share where I hunt for the ideas to populate my <strong>to-learn</strong> list.</p><h4>Staying up to date with technology I am already familiar with and spotting trends</h4><p>Keeping an eye on changes and updates in tech stack I am already well familiar with, is relatively easy. For this, I am subscribed for a <a href="https://javascriptweekly.com/">JavaScript Weekly</a> and <a href="https://nodeweekly.com/">Node weekly</a>. My main challenge alas, is to read them regularly, and not just to receive them into my inbox.</p><p>From reading newsletters I get the news like which interesting features are added into latest versions of the well-known library or what is the current approach to well-known challenges like error logs collection and monitoring, front-end resources bundling or code snippets sharing.</p><p>Newsletters also helpful in spotting tech trends on the rise. For example, after months of seeing links to tutorials with names like “Getting started with a GraphQL” and “Apollo vs Relay” — it is logical that one day I added GraphQL it to my<strong> To-Learn</strong> list.</p><h4><strong>Gaining a broader perspective on how different pieces work together</strong></h4><p>The topic of System design and architecture caught my attention only this year. And I am still experimenting with how and where to learn about this topic.</p><p>Engineering blogs of big companies or companies with the products that serve large number of users are good places to start. The blogs often contain articles about how miscellaneous scalability and design real-world challenges were solved at these companies.</p><h4>Peeking out of the box — learn about things I didn’t know I need to learn</h4><p>Getting new inspirations, often totally out of my day to day development scope, is a serious challenge. Where I can look for something if I don&#39;t know what it should be.</p><p>What works for me, in this case, is watching talks from the recent tech conference on YouTube or from the specific conference website. Talks can be very effective for getting exposure to new concepts, ideas or technologies in a short amount of time.</p><p>Attending the conference in person is probably far more awesome, and the value of networking would be added to the value of learning. But as a humble human being employed by the company without annual training budget benefit, watching recorded videos is what I do.</p><p><a href="https://www.infoq.com/">InfoQ conference website</a> is a good first stop for this type of content. Another very useful website is <a href="https://confs.tech/">Find your next tech conference</a>. It is basically a collection of future tech conferences. Luckily, conferences, in general, are recurrent events. So you can get an idea what conferences are available and check for the recordings of the previous year for the one you like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLOgXbTvT63ATfPUMGA6aA.jpeg" /><figcaption>Trying to figure out what to learn and how is tiring. Photo by <a href="https://unsplash.com/photos/JWycY09PIos?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Andrew Seaman</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4>Conclusion</h4><p>I described a few different methods which work for me. I use them in mix&amp;match fashion. Sometimes my<strong> To-Learn</strong> list becomes so bloated that I spend most of my dedicated-to-learning time working through it. Sometimes I am fully on the hunt for new inspirations.</p><p>My methods for tech-related learning help me to keep up with web development and develop myself further as a programmer. It’s much more efficient than what I was able to do before I organized my efforts according to the principles I presented in the article.</p><p>However, everything is work in progress, and I continue to work in improving my approaches to learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31e98409a462" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorithms: befriend your enemy]]></title>
            <link>https://medium.com/@opheliaandcat/algorithms-befriend-your-enemy-6d2c78f0c128?source=rss-9fcfe9a48f1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d2c78f0c128</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming-interviews]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Lula Leus]]></dc:creator>
            <pubDate>Tue, 15 May 2018 15:26:31 GMT</pubDate>
            <atom:updated>2018-05-15T15:26:31.153Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Why we need algorithms at all</strong></h4><h4>Why we need algorithms at all</h4><p>Knowledge of algorithms and data structures in general, and ability to come up with a good solution for algorithm question in the strictly limited time of interview settings, is very important to even a mildly ambitious programmer.</p><p>Good thing is that everyone can acquire and develop these skills. You don`t need a prerequisite of having BSc in computer science or a natural predisposition to Math, to become reasonably good at solving algorithmic questions. The things that are required are motivation, persistence, and patience with yourself.</p><p>For me the moment of understanding that I should put efforts into algorithms happened a few years ago, after I didn`t pass a job interview for a company I wanted to work for. I was a junior web developer and I was good at coding. But as the self-taught developer, I lacked the background in CS.</p><p>It was a white-board on-site interview. My interviewer asked if I can sort an array for him in O(n log n) time. I didn`t know what the O(n log n) time means. I didn`t know what the Big O is. My interviewer said that Merge sort will sort the array in this time complexity. I was unable to write a merge sort algorithm for him. To be honest, to implement a merge sort on a whiteboard is not an easy task, even when you remember this algorithm in general.</p><p>I finished the interview being sad, embarrassed and determined to fill the gaps in my knowledge. I wanted to do better in future interviews.</p><p>During my path to teach myself algorithms and data structures, I discovered some tricks, tried to use many resources available online and created my own learning flow. I want to share it, in hope that it will be useful for others. For people who are good at practical coding, but suck at algorithms.</p><h4><strong>Follow the progression of growing complexity, when possible</strong></h4><p>Algorithms are easier to learn in progression from easy to medium, to hard. Following the progression, will decrease the amount of time you spend feeling like you are banging your head against the wall. “The coins change” problem is a hard one, but if you aren`t familiar yet with Fibonacci sequence and concept of memoization, it will be even harder.</p><p>If you are not sure yet how effectively solve the question “what is the most often appearing character in the string”, it is not the best time to attack question “For given array of strings, find which strings in the array are palindromes”.</p><p>And so on. I hope two example above illustrate my point.</p><h4><strong>Learning path: from zero to something</strong></h4><p>For starting practicing Algorithms from zero, Khan Academy has very mild introduction course <a href="https://www.khanacademy.org/computing/computer-science/algorithms"><strong>“Algorithms”</strong>.</a> All the examples are in JavaScript. It is a great place to start.</p><p>There is also a course from Udemy <a href="https://www.udemy.com/coding-interview-bootcamp-algorithms-and-data-structure/learn/v4/"><strong>“The Coding Interview Bootcamp: Algorithms + Data Structures”</strong></a>, which is a good warm up to follow after Khan Academy course. All the examples are in JavaScript as well.</p><p>At this point, you may feel that you need to learn more about Data Structures. If you are familiar with Java,<a href="https://courses.edx.org/courses/course-v1:PennX+SD2x+2T2017/course/"> <strong>“Data Structures and Software Design”</strong> </a>course from Edx is good one. It is the least academic course about Data Structures in Java I was able to find.</p><p>Next step toward Algorithms mastery is another easy to understand course from Udemy <a href="https://www.udemy.com/11-essential-coding-interview-questions/learn/v4/"><strong>“11 Essential Coding Interview Questions”</strong></a>. This course is good and engaging, but I wish there were more question, 11 is just not enough. Author of the course also has <a href="https://www.youtube.com/channel/UCxX9wt5FWQUAAz4UrysqK9A"><strong>his own channel on Youtube</strong></a>, where he does his best to explain CS concepts in funny and engaging manner.</p><p>So it is a short path from “I don`t know what a Big O” to “I can have a conversation about Big O and I have the fundamental understanding how to approach algorithms related tasks at work and to solve algorithmic questions in the interview”.</p><h4><strong>Practice leads to perfection</strong></h4><p>Everybody knows, when you plan to run a marathon or half marathon, or to jog a 3km around the neighborhood without feeling totally winded and out of breath, you must regularly practice towards the set goal. The same is true for algorithms. Practice is the key.</p><p>I dislike running and I am not a big fan of solving Algorithms on weekends. When I started with both activities, my mind screamed: “I don`t want to do this, just stop”. But when the practice became a habit, a routine, it stops to be mentally uncomfortable. And I really like the results I get from practicing both activities.</p><h4><strong>Know when to fight and when to quit</strong></h4><p>Initially, I tried to solve algorithm questions on my own for hours before I gave up and checked the solution. After some time of this exhausting way of practicing, I understood that yes, I learn something this way, but it is not the most effective way to learn for me.</p><p><strong>Following, is my current flow:</strong></p><p>I give myself from 30min to 1hour to try to find the solution on my own. Often I start to work with a pen on paper, and only if I find something that looks like it may work, I move to writing code in IDE.</p><p>If I find the solutions which works, I compare it with the right solution.</p><p>If I tried to solve the questions, tried the different approaches I already know, but they didn’t work, its fine too. Also sometimes I just look at the questions and feel like “It doesn`t resemble any question I solved before, I don’t know what approach can be useful here”, then I quit even faster, after 20 minutes or so.</p><p>After time allocated for finding solution on my own, especially if I had no success, I read through the solution.</p><p>Sometimes I cannot understand the solution only from code and text describing it. Then I search for video on Youtube of someone describing how to solve this question. Ordinarily I find a list of relevant videos easily. I watch the one I find the easiest to understand. Sometimes I watch it twice. I am a visual learner. Then I re-read the code and check myself if I understand it now. After this process, if I see the similar type of algorithm later, I am able to do better than previous time.</p><p>In general, it takes me from 20min (when I already know the answer well enough) up to 2 hours, to solve one question. Sometimes, it is better to split the 2 hours tough question into two sessions of 1 hour each. It is strange to leave question not completely understood, but when I return to the same question after some break or even next day — it magically becomes easier.</p><h4><strong>Where to practice:</strong></h4><p>There are different sites, which allow you to practice algorithms and which one to use, is a matter of personal preference.</p><p>Lately, I opted for <a href="https://leetcode.com/"><strong>LeetCode</strong></a>. For less formal and more gamified expirience, there is a <a href="https://www.codewars.com/">C<strong>odeWars</strong></a>. There are many more, such as <a href="https://www.hackerrank.com/"><strong>HackerRank.com</strong></a> and <a href="https://www.geeksforgeeks.org/"><strong>GeeksForGeeks</strong></a><strong>.</strong></p><h4><strong>Conclusion</strong></h4><p>I shared my ways of learning and practicing algorithms. They are likely not the best ways or the only right ways how to do it. But they work for me, and for sure made me a better programmer in general and better algorithms-solver than I was before. Hopefully, my experience may be useful for someone else.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d2c78f0c128" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>