<?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 Lampros Papadimitriou on Medium]]></title>
        <description><![CDATA[Stories by Lampros Papadimitriou on Medium]]></description>
        <link>https://medium.com/@lambrospd?source=rss-1e6b92a05027------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PdbXV1eBcqXTRJG8jhzAIw.jpeg</url>
            <title>Stories by Lampros Papadimitriou on Medium</title>
            <link>https://medium.com/@lambrospd?source=rss-1e6b92a05027------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 21:26:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lambrospd/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[Dinosaurs in IT]]></title>
            <link>https://medium.com/@lambrospd/dinosaurs-in-it-e100cc1056c4?source=rss-1e6b92a05027------2</link>
            <guid isPermaLink="false">https://medium.com/p/e100cc1056c4</guid>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[waterfall-methodologies]]></category>
            <category><![CDATA[agile-development]]></category>
            <dc:creator><![CDATA[Lampros Papadimitriou]]></dc:creator>
            <pubDate>Sat, 05 Mar 2022 13:01:48 GMT</pubDate>
            <atom:updated>2022-03-05T13:01:48.190Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g3IPStnCDuyDU2xC" /><figcaption>Photo by <a href="https://unsplash.com/@barney_dew?utm_source=medium&amp;utm_medium=referral">Nate DeWaele</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As an IT developer I have seen several monsters at work. These monsters were applications, databases, projects and sometimes … yes… people!</p><p>Today I am going to describe a kind of people who were actually the “dinosaurs” in our development teams.</p><p>The only difference between them and the real ones is that dinosaurs were victims of a global catastrophe. The IT dinosaurs are a catastrophe themselves.</p><p>Are you a fresh padowan in IT? Just relax and hear some advice from an old developer:</p><blockquote>Never become an IT dinosaur!</blockquote><h3>Beware of the project tyrannomanagerus 🦖</h3><p>This is a dangerous species of colleagues lurking in many IT companies. These kind of dinosaurs do have something more lethal than big teeth and appetite. They have a title they feel proud of: IT project manager.</p><p>Shush! No, not all project managers are dinosaurs are bad. But the “middle-tier” IT project manager is definitely a dinosaur of the old ways IT companies used to work.</p><p>How can you distinguish them from the others in five simple steps?</p><ul><li>He <em>feels</em> and <em>is</em> a tyrant in project</li><li>He lives next to waterfall projects 😉</li><li>He considers communication between customers and developers BAD</li><li>His project plan is more important than deliverables</li><li>He finger-points responsibilities if something goes wrong</li></ul><p>The key characteristic of this project manager is <em>centralised communication</em>. And this is done for two reasons. First, he <em>wants</em> to control and considers as work <em>controlling</em> others. Second, he wants to <em>manipulate</em> information for <em>his benefit</em>.</p><p>If I am hard with these points, just relax and ask yourself:</p><ul><li>How often were delivery dates decided <em>without</em> you being asked?</li><li>How often requirements changed and you hear about it too late?</li></ul><p>Tyrannosaurus managers <em>know</em> they should not decide without asking you. But they do it nevertheless and since they control information they manipulate it and try to trick you.</p><p>A typical case: They want to satisfy customers, promise them something and they come back with an impossible delivery date. Typical excuse: customers decided about delivery date.</p><p>Yes. I have been in this position. A manager comes to you to provide urgently a non-binding estimation about a project you barely heard of. They take this estimation, cut it in half to make costs “more appealing” and a week later you hear about a delivery date for this project which was already yesterday.</p><p>Another big issue with them is they prioritise project planning above product value. This is actually totally against customers. Actually they even forget there is a <em>product</em> behind a <em>project</em>. I consider this the main reason why these kind of people will not even try to understand <em>agile</em> ways to build software.</p><p>It is even sad when all people on <em>company level</em> operate project-based and forget about products. In the end, all software products will be doomed to bad support, outages and the constant feeling “this is not what I ordered”. I am sorry to tell you but this is the result of bad project management, not development.</p><p>Of course tyrannosaurus will happily finger-point you if anything goes wrong. Is it lack of time that forced you to patch a bug in code with a gum and a coin? Is the customer unsatisfied because features are missing you were not aware of? No worries, he will tell everyone that <em>you</em> missed it. Do not forget, he controls communication and does everything to get his big fat bonus.</p><p>Another great example is this big scandal about manipulating gas emissions in cars. I can imagine those big managers and CEOs <em>blaming in court</em> the development team that they implemented this cheat in code <strong>without their acknowledgement</strong>. Can the developers prove them wrong? Managers can control people and communication and abused them the perfect way.</p><h3>Countermeasures 💪</h3><p>If you feel there is nothing you can do about it and you feel too small for turning the wheel in a project, let me give you three simple tips:</p><ul><li><strong>Speak out!</strong> I spoke about some issues I had with a manager to my team. No comments, just facts. And guess what? All of them had the same experience. In the end with a team decision we threw him out from a project! And people say miracles never happen!</li><li><strong>Logs</strong> As a small test, simply ask your manager to forward you his requests by email. If he is hesitating about it, there is something rotten in this dinosaur.</li><li><strong>Persistence</strong> He is a project manager and you are developer. <strong>So what?</strong> Do you feel his position as manager is stronger? It is simply not. Companies need months or years to find good developers. HRs are paying lots of money in headhunters ands ads. If you do your job right, you actually have the upper hand. If you have a different opinion about something and he plays his title as an argument, throw it back to his face. Don’t let him intimidate you.</li></ul><h3>Conclusion</h3><p>These dinosaurs are far from extinction. I still find them every day in many big companies, which are trying to find themselves in the modern <strong>agile</strong> era. They are afraid of agile working because they think it will be their “ice age” and force them to extinction. They usually speak for it and work against it.</p><p>But a new species has evolved from the agile age: the product owners. The amazing thing when I work with them is that we have a common goal. We both want to see a product evolving and becoming better and better. If projects still exist in a company, they work only as a way to finance our common goal.</p><p>Hopefully one day we will only learn about Project Tyrannomanagerus in computer science history class together with COBOL and oracle. Their waterfall projects and stories will live only as fairy tales and legends to scare the next generation of developers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e100cc1056c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best practices in Vue.js and Jest]]></title>
            <link>https://medium.com/@lambrospd/best-practices-in-vue-js-and-jest-514e6eebe1c2?source=rss-1e6b92a05027------2</link>
            <guid isPermaLink="false">https://medium.com/p/514e6eebe1c2</guid>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[jest]]></category>
            <category><![CDATA[vuex]]></category>
            <dc:creator><![CDATA[Lampros Papadimitriou]]></dc:creator>
            <pubDate>Sun, 26 Dec 2021 16:23:37 GMT</pubDate>
            <atom:updated>2021-12-26T16:23:37.103Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A blurry image depicting unit tests written in Jest" src="https://cdn-images-1.medium.com/max/1024/1*QTJj_q7zBUN5DsnE_Wf0JA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@flowforfrank">Ferenc Almasi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">unsplash</a></figcaption></figure><p>In this tutorial we are going to go through the process of writing unit tests in Jest for a Vue.js application. I am going to use my personal website which is made in Vue.js 3.</p><p>Please notice Im going to use the following technologies</p><ul><li>Vue.js (3)</li><li>Typescript</li><li>Jest</li><li>Vuex</li><li>eslint</li></ul><p>I am writing this guide because it is hard to find good full examples on the internet using all technologies mentioned above together. I will also mention all parts where it took me the most time to find a solution.</p><p>In this code I am using unit tests I wrote while developing my personal website. All code is available <a href="https://github.com/trelo-bifteki/www.trelobifteki.com/">here</a></p><p>You may also find this post on my personal website <a href="https://www.trelobifteki.com/blog/jest-vue-typescript">here</a></p><h3>Eslint configuration</h3><p>I am currently using the following rulesets in eslint:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fdf4f4a94af551a2ec239f8e34c81cf9/href">https://medium.com/media/fdf4f4a94af551a2ec239f8e34c81cf9/href</a></iframe><p>I also suggest that everyone to use them from the very beginning especially if you are migrating a project into Typescript. The following rules took me quite some time to correct in code:</p><ul><li>typescript-eslint/no-explicity-any</li><li>typescript-elint/explicit-function-return-type</li></ul><h3>Recipe for stateless components</h3><p>A <em>stateless</em> component is the one that does not include any bindings or states from <em>Vuex</em> or other resources. Inputs and outputs are only defined either as <em>properties or events </em>respectively.</p><p>Let’s assume we have the following small component:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/443a6693ec9cde1260f7be6cd652b1a4/href">https://medium.com/media/443a6693ec9cde1260f7be6cd652b1a4/href</a></iframe><p>For the component above I created the following unit tests:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f9a356d0f9f88270d3c32bfc40f10ff/href">https://medium.com/media/6f9a356d0f9f88270d3c32bfc40f10ff/href</a></iframe><p>The basic important rules that I used were the following:</p><ul><li>I am trying to use only once expect in each function</li><li>I keep my unit tests stateless as much as possible</li><li>I create the function createWrapper with all required inputs</li><li>I introduced defaultProps with the default and required values</li><li>I use defaultProps as the default parameter for createWrapper</li></ul><p>It took me some time to find VueWrapper&lt;ComponentPublicInstance&gt; as return type for createWrapper function. I also introduce the defaultProps in order to have autocompletion, avoid DRY and ensure type checking.</p><p>A createWrapper function is always invoked by every single test. Our goal is to make each test completely <em>stateless </em>this way. I make sure that all variables are initialised for each test, so that tests can be executed concurrently</p><h3>Recipe for stateful components</h3><p>A <em>stateful</em> component is a component in my application that uses <em>Vuex</em> for inputs and outputs.</p><p>Let’s take the example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/663228096c2e7951eb7a19356545fd59/href">https://medium.com/media/663228096c2e7951eb7a19356545fd59/href</a></iframe><p>I implemented the following unit test for it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/41a831b63dc843b709eeec0e327620f0/href">https://medium.com/media/41a831b63dc843b709eeec0e327620f0/href</a></iframe><p>Basic rules for creating this file are the following:</p><ul><li>I only make stateful <em>view</em> components. I prefer any other dependencies to this component to be <em>stateless</em></li><li>I instantiate wrapper in every unit test</li><li>I instantiate store in every unit test</li><li>All action methods are mocked using jest.fn()</li><li>All getter methods are mocked using jest.fn()</li><li>I reset all mocked functions using mockReset()</li></ul><h3>Recipe for mocking dependencies</h3><p>Another case is the need to mock a service (most usually a http service) that we use inside a vue component. Let’s take the example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ac9a78cb04ded6fe81233f1865efdf3/href">https://medium.com/media/8ac9a78cb04ded6fe81233f1865efdf3/href</a></iframe><p>And this is the unit test I have written for this:</p><p>The function mocked <strong>is actually the one that really matters here</strong>. It extends the type of the injected dependency and allows you easily working with it. It took me a lot of time to find this function, but it made my code much cleaner.</p><p>This function is actually the main reason for writing this post, since it is almost necessary for writing unit tests with typescript and jest.</p><h3>🥊Challenges</h3><p>The challenge I usually find when I write unit tests:</p><ul><li>Mocking dependency injection</li><li>Mocking custom events</li><li>Interacting with wrapper.vm object in typescript</li></ul><p>My quick tips there:</p><ul><li>Dependencies shall always return functions, so I can mock them</li><li>Create mocks.ts file containing functions for generating necessary mock objects</li><li>When testing component uses other ones, refer to them using wrapper.findComponent() and wrapper.vm.$emit()</li><li>I avoid using wrapper.vm and focus in testing DOM elements instead.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=514e6eebe1c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Η μοναξιά μου]]></title>
            <link>https://medium.com/@lambrospd/%CE%B7-%CE%BC%CE%BF%CE%BD%CE%B1%CE%BE%CE%B9%CE%AC-%CE%BC%CE%BF%CF%85-906aa707c9d?source=rss-1e6b92a05027------2</link>
            <guid isPermaLink="false">https://medium.com/p/906aa707c9d</guid>
            <category><![CDATA[poetry-on-medium]]></category>
            <category><![CDATA[greek]]></category>
            <category><![CDATA[poetry]]></category>
            <dc:creator><![CDATA[Lampros Papadimitriou]]></dc:creator>
            <pubDate>Mon, 20 Dec 2021 17:33:03 GMT</pubDate>
            <atom:updated>2021-12-20T17:33:03.000Z</atom:updated>
            <content:encoded><![CDATA[<p>Η μοναξιά μου δεν είναι καράβι σε βουβά νερά, ούτε βρεγμένο ρούχο. Η μοναξιά μου είναι το άρρωστο δέρμα μου. Γεμάτο υγρές πληγές που δεν λεν να κλείσουν και σε τρώνε επίμονα. Κάθε μέρα δεν περνά χωρίς να σου φαγουρίζει τις σκέψεις σου. Σου δίνουν ένα διάλειμμα για να σε παραμυθιάσουν. Και μόλις πεις “Μόνος μου μπορώ” τότε κοιτιέσαι στον καθρέφτη με τις πληγές στα χέρια, στο πρόσωπο και στα πόδια και απελπίζεσαι.</p><p>Και βοήθεια; Να μην την περιμένεις! Κάθε αλοιφή παρηγοριάς απάνω της βοηθά για λίγο. Και πρόσεχε να μην την βάζεις την παρηγοριά πάνω σου για πολύ καιρό! Έχει παρενέργειες και είναι τοξική για την καρδιά σου.</p><p>Οι γιατροί πρώτοι και καλύτεροι την γρήγορη λύση σου προτείνουν. “Με τον χρόνο θα φύγει” σου εύχονται καθώς ενδόμυχα εύχονται σε γρήγορο χρόνο να φύγεις. Πράγμα που επαληθεύει την μοναξιά σου.</p><p>Και εσύ αβοήθητος εκεί να ντρέπεσαι για αυτήν και να την κρύβεις. Όμως αυτό το ξύσιμο δεν σε αφήνει ποτέ ήσυχο. Τον κόσμο δεν τον κοροϊδεύεις: Το βλέπουν! Σε κάθε κίνησή σου βλέπουν μόνο αν θες να ξύσεις την μοναξιά σου. “Μην το ξύνεις, το κάνεις χειρότερο” σου λένε επιπληκτικά, μα βλέπουν μόνο τις πληγές και ξεχνούν ότι υπάρχεις πίσω από αυτές. Το μάτι μόνο μέχρι εκεί φτάνει, στις πληγές.</p><p>Και το νου σου! Όσο εύχεσαι με τον καιρό να φύγει και δεν φεύγει, όσο θες να το ξεχάσεις και επιμένει, όσο θες να πιστέψεις ότι δεν υπάρχει και σε τρώει από μέσα, τόσο γιγαντώνεται αυτή μέρα με την μέρα. Μέχρι που μια μέρα θα ξυπνήσεις σε ξένο τραχύ δέρμα σε ετοιμόρροπο σώμα και έντρομα μάτια. Με τα μάτια που πρώτη φορά κατάλαβαν ότι η μοναξιά σου σε μεταμόρφωσε σε αυτό εδώ το ετοιμοθάνατο τέρας.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=906aa707c9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 simple rules to data visualization with Vue.js and D3.js]]></title>
            <link>https://medium.com/@lambrospd/5-simple-rules-to-data-visualization-with-vue-js-and-d3-js-f6b2bd6a1d40?source=rss-1e6b92a05027------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6b2bd6a1d40</guid>
            <category><![CDATA[d3js]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Lampros Papadimitriou]]></dc:creator>
            <pubDate>Fri, 17 Apr 2020 07:23:51 GMT</pubDate>
            <atom:updated>2020-04-17T07:23:51.534Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*muU0JbkzU73J_u6if0mNXw.jpeg" /></figure><p><em>D3.js </em>is a visualization library providing all necessary functions and methods needed to create charts and diagrams. <em>Vue.js </em>is a MVC framework for creating single page applications (SPA).</p><p>The real challenge comes where both D3 and Vue.js are able to manipulate DOM elements. In this guide, we focus on only using D3 for calculating all rendering parts required, but we let Vue.js create and modify the DOM.</p><p>This is also a walkthrough how I first implemented a graph component in Vue.JS using D3 library and how I improved it afterwards.</p><h3>😖 The wrong way</h3><p>This is actually the first implementation I did inspired by most examples found on the internet:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50e78e3347e37df2e21ce6d9f6e6a3dd/href">https://medium.com/media/50e78e3347e37df2e21ce6d9f6e6a3dd/href</a></iframe><p>This can work quite well in the beginning, but:</p><ul><li>graph is <strong>not responsive</strong></li><li>data is <strong>static</strong></li><li>it renders the graph <strong>once</strong></li><li>styling is <strong>hardcoded</strong></li></ul><p>In this end, this component is actually not reusable.</p><h3>🧙‍♂️ 5 simple rules</h3><h4><strong>Rule 1:📜 Prefer <em>viewBox </em>against <em>width &amp; height</em></strong></h4><p>We want to make our SVG images responsive. Width and height limit our implementation to the dimensions defined. By setting <em>viewBox </em>instead, we are able to scale the SVG image to fill a container.</p><h4><strong>Rule 2: 📜 Write SVG template in <em>template</em></strong></h4><p>Most D3js examples on the internet prefer to use append function and attach DOM elements to already existing ones. Since we use Vue.js now it is better now to use <strong>only</strong> template section instead.</p><h4><strong>Rule 3:📜 Write stylings in styling section</strong></h4><p>As SVG supports adding classes and styling elements in CSS and it is better to write styling in style section than having hardcoded values on the Javascript code.</p><p>In this rule there is an <strong>exception</strong>, if you want to introduce a styling as <em>property</em> to the component.</p><h4>Rule 4: 📜 Use props to provide data</h4><p>Of course we want our component to be reusable and dynamically assign data into our graph! As most examples with Vue.js and SVG found on the internet, we set some properties to the component in order to make it dynamic.</p><p>Like this example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/27d2ddc4fa5fff0ae38d2f29f7f56de8/href">https://medium.com/media/27d2ddc4fa5fff0ae38d2f29f7f56de8/href</a></iframe><p>Now that we set a parameter in props area we can also do the following:</p><p>&lt;SvgDemo title=&quot;John Snow&quot;&gt;&lt;/SvgDemo&gt;</p><p>And we are all set!</p><h4>Rule 5: 📜 Use computed to provide D3 calculations</h4><p>The biggest challenge here is to render the graphs everytime props changes.</p><p>I first tried to use the append and attr methods from D3 library to render during mounted. In order to render after each change I had to introduce watchers, remove all elements and re-render again. This solution was already confusing enough for developers and does not work well together with Vue.js. In the end, tt is better to perform only the calculations in D3js and bind them with Vue.js instead.</p><p>All calculation can be bound directly to DOM using the computed functions. This way the calculation will be invoked every time data information changes.</p><p>No worries. Vue.js is smart enough to invoke functions only when needed 😉.</p><h3>😇 The right way</h3><p>After applying all rules above the result to the previous example should look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7e56f32c7dd6c11ee60a1ac0530a5c4/href">https://medium.com/media/d7e56f32c7dd6c11ee60a1ac0530a5c4/href</a></iframe><p>Check all these functions in computed area! They can be directly used in template now. The most important one is line, which actually draws the chart thanks to <em>D3.js</em>. Every time we change data, other functions will be reinvoked and a new value for line will be returned. The chart will be rerendered with the new graph!</p><p>Now, in this example:</p><ul><li>graph is <strong>responsive</strong> (like every SVG must be!)</li><li>a property <em>data</em> can be used to <strong>dynamically load data</strong> into graph</li><li>graph will <strong>render any changes</strong> into the data automatically</li><li><strong>CSS classes</strong> can be used to override styling (not suggested but possible)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6b2bd6a1d40" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>