<?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 lsmod on Medium]]></title>
        <description><![CDATA[Stories by lsmod on Medium]]></description>
        <link>https://medium.com/@lsmod?source=rss-534f90f5aac2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oR55vBsoTdr7_JrygW6OCQ.png</url>
            <title>Stories by lsmod on Medium</title>
            <link>https://medium.com/@lsmod?source=rss-534f90f5aac2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 19:25:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lsmod/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[Practice, then study: another way of learning programming and the developer’s job]]></title>
            <link>https://lsmod.medium.com/practice-then-study-another-way-of-learning-programming-and-the-developers-job-72a6530e555a?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/72a6530e555a</guid>
            <category><![CDATA[computer-science-student]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Fri, 30 Jun 2023 08:47:03 GMT</pubDate>
            <atom:updated>2023-06-30T08:47:03.224Z</atom:updated>
            <content:encoded><![CDATA[<p>Having a computer science degree is great 🎓. It opens a lot of doors.<br>I wish I had one when I was knocking at companies’ door asking for a developer job in my early 20s.</p><h3>Practice != theory</h3><p>But here are a few stuffs that school won’t probably teach you:</p><ul><li>debugging</li><li>multi thread programming</li><li>asynchronous programming</li><li>dangling pointer error</li><li>any modern technique like css-in-js with styled component, tailwind</li><li>code smells and refactoring</li><li>the pain of having to maintain poorly written code</li><li>talk with the customer / client</li><li>making estimates (or better: no estimate)</li><li>evaluate if a project is doable given resource and skills</li><li>picking the right tech for the job</li><li>digging through the docs to find the right answers</li><li>learning by yourself to stay up to date / employable</li><li>typewriting, keyboard shortcut, github copilot, chatgpt, and other productivity tricks</li><li>and at last but not at least: understand the business you are helping to build with software</li></ul><h3>Practice first</h3><p>It is my conviction that programming discipline is taught the wrong way. <br>I think we should start by learning a low level programming language like C, or even better rust and how computers work (CPU, RAM, disk, network).<br>So we get a deep understanding of what the code we write is doing on the machine.</p><p>From there, after a few months of practicing, It could be appropriate to move to a higher level programming languages that got a garbage collector.</p><p>And after having wrote enough spaghetti 🍝 code to start feeling the pain of unmaintainable code, it would time to start learning about maintainable code, design pastern, code smells, and such.<br>If you felt the pain, you will enjoy the solutions, and get why they exist in the first place.</p><h3>Real work environment and tools</h3><p>Then it should be time to really get close to a real work environment and to use:</p><ul><li>git</li><li>github / bitbucket / gitlab</li><li>slack</li><li>notion</li><li>jira / clickup / trello / assana</li></ul><h3>Team Work</h3><p>And more importantly, learning about team working:</p><ul><li>english</li><li>gitflow</li><li>making PR</li><li>pair programming</li><li>use a code formatter tool</li><li>sprints / tasks / estimates</li></ul><h3>Academic content, and high level skills</h3><p>Finally, with that solid foundation, students could start digging into more academic content such as:</p><ul><li>sprints / tasks / estimates</li><li>software architecture,</li><li>database modeling,</li><li>management,</li><li>algorithmic,</li><li>calculus,</li><li>cloud computing,</li><li>business funding,</li><li>fintech.</li></ul><p>There is enough academic free online content that you could learn all that by yourself 📚 (KhanAcademy, coursera, even on youtube). <br>Having the foundation to write maintainable code, to work within a team and to be able to learn by yourself, you will be ready to work, and you will have all your career long to learn “high level” skills and discipline.<br>But learning software architecture, without having a good feel of what unmaintainable code feel likes, seems like an antipattern to me.</p><h3>Conclusion</h3><blockquote>“He who wants to learn to fly one day must first learn to stand and walk and run and climb and dance; one cannot fly into flying!” — Friedrich Nietzsche</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72a6530e555a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NestJS: Setting up file logging daily rotation with winston]]></title>
            <link>https://lsmod.medium.com/nestjs-setting-up-file-logging-daily-rotation-with-winston-28147af56ec4?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/28147af56ec4</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[logrotation]]></category>
            <category><![CDATA[winston]]></category>
            <category><![CDATA[logging]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 21:40:44 GMT</pubDate>
            <atom:updated>2023-06-30T07:28:09.792Z</atom:updated>
            <content:encoded><![CDATA[<p>Nest Provides a default logger and that’s fine when developing.<br>But if you want to go further, I recommend using winston, and with nest-winston package we can easily replace the default logger.</p><h3>Installing nest-winston</h3><pre>npm install --save winston<br>npm install --save nest-winston</pre><h3>Using winston logger instead of NestJS’s one</h3><p>We configure the logger used by our App when bootstrapping:</p><p><strong>main.ts</strong></p><pre>import { NestFactory } from &#39;@nestjs/core&#39;;<br>import { ValidationPipe } from &#39;@nestjs/common&#39;;<br>import { WinstonModule } from &#39;nest-winston&#39;;<br>import { transports, format } from &#39;winston&#39;;<br><br>import { AppModule } from &#39;./app.module&#39;;<br><br>async function bootstrap() {<br>  const app = await NestFactory.create(AppModule, {<br>    logger: WinstonModule.createLogger({<br>      transports: [<br>     // let&#39;s log errors into its own file<br>        new transports.File({<br>          filename: `logs/error.log`,<br>          level: &#39;error&#39;,<br>          format: format.combine(format.timestamp(), format.json()),<br>        }),<br>        // logging all level<br>        new transports.File({<br>          filename: `logs/combined.log`,<br>          format: format.combine(format.timestamp(), format.json()),<br>        }),<br>        // we also want to see logs in our console<br>        new transports.Console({<br>         format: format.combine(<br>           format.cli(),<br>           format.splat(),<br>           format.timestamp(),<br>           format.printf((info) =&gt; {<br>             return `${info.timestamp} ${info.level}: ${info.message}`;<br>           }),<br>          ),<br>      }),<br>      ],<br>    }),<br>  });<br>  await app.listen(3000);<br>}<br>bootstrap();</pre><p>This configuration will output:<br>- error logs into logs/error.log<br>- all logs (info, warning, debug, error…) into logs/combined.log<br>- also also logs level into the console.</p><p>Nice! But what about file rotation ? Let’s see it now ↓</p><h3>Adding log rotation</h3><h4>Install winston-daily-rotate-file package</h4><pre>npm install winston-daily-rotate-file</pre><p>Now, let’s change main.ts to add log rotation:</p><pre>// we need to import it to make transports.DailyRotate is available<br>import &#39;winston-daily-rotate-file&#39;; <br><br>async function bootstrap() {<br>  const app = await NestFactory.create(AppModule, {<br>    logger: WinstonModule.createLogger({<br>      transports: [<br>        // file on daily rotation (error only)<br>        new transports.DailyRotateFile({<br>       // %DATE will be replaced by the current date<br>          filename: `logs/%DATE%-error.log`, <br>          level: &#39;error&#39;,<br>          format: format.combine(format.timestamp(), format.json()),<br>          datePattern: &#39;YYYY-MM-DD&#39;,<br>          zippedArchive: false, // don&#39;t want to zip our logs<br>          maxFiles: &#39;30d&#39;, // will keep log until they are older than 30 days<br>        }),<br>        // same for all levels<br>        new transports.DailyRotateFile({<br>          filename: `logs/%DATE%-combined.log`,<br>          format: format.combine(format.timestamp(), format.json()),<br>          datePattern: &#39;YYYY-MM-DD&#39;,<br>          zippedArchive: false,<br>          maxFiles: &#39;30d&#39;,<br>        }),<br>        new transports.Console({<br>         format: format.combine(<br>           format.cli(),<br>           format.splat(),<br>           format.timestamp(),<br>           format.printf((info) =&gt; {<br>             return `${info.timestamp} ${info.level}: ${info.message}`;<br>           }),<br>          ),<br>      }),<br>      ],<br>    }),<br>  });<br>  await app.listen(3000);<br>}</pre><p>That it for logs rotation.<br>Now at the root of your app when you run it you should see a folder named “<em>logs</em>” containing `<em>YYYY-MM-DD-error.log</em>` and `<em>YYYY-MM-DD-combined.log</em>`. <em>YYYY-MM-DD</em> being replaced by the actual date. So as I’m writing this post we are the 10th of mars 2023, my error log file will be named : <em>2023–03–10-error.log</em></p><h3>Logging 404 , 401, 400 errors</h3><p>By default Nest doesn’t log Bad Request, 401 Unauthorized, nor 405 Method Not Allowed. And that’s a shame 😛!</p><p>The simplest way I found to get those logged is to use a middleware:</p><p><strong>request-logger.middleware.ts</strong></p><pre>import { Injectable, Logger, NestMiddleware } from &#39;@nestjs/common&#39;;<br>import { Request, Response, NextFunction } from &#39;express&#39;;<br><br>@Injectable()<br>export class RequestLoggerMiddleware implements NestMiddleware {<br>  private readonly logger = new Logger();<br><br>  use(req: Request, res: Response, next: NextFunction) {<br>    res.on(&#39;finish&#39;, () =&gt; {<br>      const statusCode = res.statusCode;<br>      if (statusCode === 401 || statusCode === 404 || statusCode === 405) {<br>        this.logger.warn(`[${req.method}] ${req.url} - ${statusCode}`);<br>      }<br>    });<br><br>    next();<br>  }<br>}</pre><p>Now let’s apply our middleware to our app module:</p><p><strong>app.module.ts</strong></p><pre>import { MiddlewareConsumer, Module } from &#39;@nestjs/common&#39;;<br><br>import { AppController } from &#39;./app.controller&#39;;<br>import { RequestLoggerMiddleware } from &#39;../middleware/request-logger.middleware&#39;;<br>@Module({<br>  controllers: [AppController],<br>  providers: [],<br>})<br>export class AppModule {<br>  // let&#39;s add a middleware on all routes<br>  configure(consumer: MiddlewareConsumer) {<br>    consumer.apply(RequestLoggerMiddleware).forRoutes(&#39;*&#39;);<br>  }<br>}</pre><h3>Conclusion</h3><p>File logging isn’t too hard to setup and improves our NestJs API by:<br>- helping with debugging<br>- monitoring performance (if you put metrics you can track)<br>- improving security by monitor unauthorized access attempts</p><p>That’s it! Thank you for reading</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28147af56ec4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Nest.js and TypeORM work with multiple databases]]></title>
            <link>https://lsmod.medium.com/making-nest-js-and-typeorm-work-with-multiple-databases-3ce54b438e5e?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ce54b438e5e</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[multiple-datasources]]></category>
            <category><![CDATA[multiple-database]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 13:06:18 GMT</pubDate>
            <atom:updated>2023-03-03T13:06:18.442Z</atom:updated>
            <content:encoded><![CDATA[<p>NestJS and TypeORM gave me a hard time the other day while trying to figure out how to make an API work with multiple databases.</p><p>I have two modules, each one using a different database.</p><p>The solution was pretty simple tho… But the official NestJS documentation is missing one little detail on this matter: You have to <strong>specify a name</strong> when creating the datasource (TypeOrmModule.forRoot — this is in the doc) <strong>AND</strong> <strong>at the repository injection</strong> (which is not specified in the documentation 🤦)!</p><p>The documentation speaks about specifying the name when injecting a datasource or an entity manager, though.</p><p>Anyway, here’s an example of setting up two databases, one per module:</p><h3>Creating two Datasource:</h3><pre>// app.modules.ts<br>import { Module } from &quot;@nestjs/common&quot;;<br>import { TypeOrmModule } from &quot;@nestjs/typeorm&quot;;<br><br>import { CourseModule } from &quot;./course/course.module&quot;;<br>import { CourseEntity } from &quot;./course/course.entity&quot;;<br>import { StudentModule } from &quot;./student/student.module&quot;;<br>import { StudentEntity } from &quot;./student/entities/student.entity&quot;;<br>import { AppController } from &quot;./app.controller&quot;;<br><br>@Module({<br>  imports: [<br>    TypeOrmModule.forRoot({<br>      // no name: by default datasource will be named &quot;default&quot;<br>      entities: [StudentEntity],<br>      ...moreOptions,<br>    }),<br>    TypeOrmModule.forRoot({<br>      // we name the second DB datasource<br>      // so we can use it later in CourseModule<br>      name: &quot;coursesDB&quot;,<br>      entities: [CourseEntity],<br>      ...secondDBOptions,<br>    }),<br>    StudentModule,<br>    CourseModule,<br>  ],<br>  controllers: [AppController],<br>  providers: [],<br>})<br>export class AppModule {}</pre><h3>Using default Datasource:</h3><pre>// student.module.ts<br>import { Module } from &quot;@nestjs/common&quot;;<br>import { TypeOrmModule } from &quot;@nestjs/typeorm&quot;;<br><br>import { StudentController } from &quot;./student.controller&quot;;<br>import { StudentEntity } from &quot;./entities/student.entity&quot;;<br>import { StudentService } from &quot;./services/view.service&quot;;<br><br>@Module({<br>  // using default datasource<br>  imports: [TypeOrmModule.forFeature([StudentEntity])],<br>  controllers: [StudentController],<br>  providers: [StudentService],<br>})<br>export class StudentModule {}</pre><h3>Using second database (at module level)</h3><pre>// course.module.ts<br>import { Module } from &quot;@nestjs/common&quot;;<br>import { TypeOrmModule } from &quot;@nestjs/typeorm&quot;;<br><br>import { CourseEntity } from &quot;./entities/course.entity&quot;;<br>import { CourseController } from &quot;./course.controller&quot;;<br>import { CourseService } from &quot;./services/course.service&quot;;<br><br>@Module({<br>  // here we specify the name of the datasource<br>  // otherwise it will use the default one...<br>  imports: [TypeOrmModule.forFeature([CourseEntity], &quot;coursesDB&quot;)],<br>  controllers: [CourseController],<br>  providers: [CourseService],<br>})<br>export class CourseModule {}</pre><h3>Make our service works with 2nd database</h3><pre>// course.service.ts<br>import { Injectable } from &quot;@nestjs/common&quot;;<br>import { InjectRepository } from &quot;@nestjs/typeorm&quot;;<br>import { Repository } from &quot;typeorm&quot;;<br><br>import { CourseEntity } from &quot;../entities/course.entity&quot;;<br><br>@Injectable()<br>export class CourseService {<br>  constructor(<br>    // we need to name it here as well<br>    // I didn&#39;t find anything about this detail in the docs<br>    @InjectRepository(CourseEntity, &quot;coursesDB&quot;)<br>    private repository: Repository&lt;CourseEntity&gt;<br>  ) {  }<br>}</pre><h3>Conclusion</h3><p>Well that’s it! I hope this post will help someone encountering the same issue. <br>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ce54b438e5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Typewriting an unloved ability]]></title>
            <link>https://lsmod.medium.com/typewriting-an-unloved-ability-a149ccb4b8de?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/a149ccb4b8de</guid>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[typing]]></category>
            <category><![CDATA[typing-speed-increase]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Thu, 19 Jan 2023 14:55:57 GMT</pubDate>
            <atom:updated>2023-01-19T14:55:57.316Z</atom:updated>
            <content:encoded><![CDATA[<p>Little things matter a lot when trying to increase productivity.</p><p>My job is to take in information, process it and produce processed information back. I develop, I type code all day long. I write email, slack messages, and sometimes I write posts…<br>And it’s probably the same for you whether you are a CEO, a Designer, a Product Owner, a Developer, a CTO. Chances are that you spend a lot of time typing every day.</p><h3>Doing it wrong</h3><p>Me, I used to type slowly. I was making a lot of mistakes while typing. I used to stare at my keyboard, not seeing what was happening on my screen. The problem with that is that I would only notice the mistakes I made after I had finished my sentence and look back at my screen.<br>With practice, I eventually became better. I didn’t need to look at my keyboard anymore. Except for certain characters like: @ , . ! $ € 1234567890 ( ).</p><h3>Typing mistakes has a cost</h3><p>And what about you? Are you comfortable while typing on your keyboard?<br>Nothing to be ashamed of having to look down at your keyboard, really… It would not matter if you were to type once or twice a day. But what if, just like me, it’s what you do all day long? Day after day, what would be the total amount of wasted time in a year?</p><h3>Secretary can type!</h3><p>Back in the days people would take typewriting lesson to become secretary on the noisy writing machine. <br>These days we have better keyboard that are pretty silent, except if you use a mechanical keyboard like I do… Hardware got better, but still most of people can’t type properly. <br>Back then, secretary had to type as fast as the speaker and shouldn’t make any spelling mistakes. Because fixing mistakes would look really bad on paper. So they were fast and accurate!<br>One test to ensure you were good enough to get the job was to type your name with closed eyes without making mistakes.<br>But nowadays most people have forgotten that typing is a skill and that doing it fast and accurately has value.</p><h3>Learning typewriting by yourself</h3><p>But it is never too late to learn! <br>Personally, I’ve learned back in 2008 by myself while working as a software engineer, thanks to a game on a CD-ROM called: Taptouch. It took me about two weeks to learn an get used to typing with my 10 fingers without ever looking back at my keyboard. <br>It was hard at the beginning to undo my bad typing habits. I wanted to go back to my old way. But after struggling a few days, I finally adopted this new habit. And it’s been rewarding me every day since.</p><p>Anyway, software on CD-ROM that’s history now… <br>I thought developing a Web App to help people learn typing would be a good pet project for me until my next freelance contract begins. So I went on google searching for “taptouch” images to get inspirational material… And I had the nice surprise to find out it still exists, and has become way better! It’s a web app now. Of course!</p><p>So I would like to share it with you, perhaps for your professional growth or even for you kids so they can learn while still being young:<br><a href="https://www.taptouche.com/">https://www.taptouche.com</a></p><h4><em>Note:</em></h4><p><em>I believe that If you took the time to read this, you’re not like most people because you care about improving yourself. And I hope this share will be useful to you.</em></p><h4>PS:</h4><p><em>This is not affiliate sell at all. I’m not linked whatsoever with Taptouch. I just have good memories associated with this product, from the time when we had big computer screens (not flat at all) and when my former boss’s cat would be sleeping on screens (enjoying the heat coming from it).</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a149ccb4b8de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why a developer should not be considered as a simple coder?]]></title>
            <link>https://lsmod.medium.com/why-a-developer-should-not-be-considered-as-a-simple-coder-97f13c4db1e7?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/97f13c4db1e7</guid>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[product-design]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Tue, 10 Jan 2023 13:51:51 GMT</pubDate>
            <atom:updated>2023-01-10T13:55:09.520Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction: Developer &gt; Coder</h3><p>A good developer can provide way more value than just writing code to produce software that meets the specifications.</p><p>From a technical perspective, a good developer can prevent costly mistakes by identifying early on what can be easily built, what will take more time, and what can be reused for a minimal cost.</p><p>Aside from the technical aspect, a developer has seen a lot of software, web apps, and mobile apps for many different businesses and has probably worked on similar products. <br>Its true that often, as advanced computer users, he/she can sometimes forget how certain things are hard for most users. <br>But still, a good developers has also experienced good and bad UI, poorly designed features, and can intuitively recognize a lot of do’s and don’ts.</p><h3>Empathy an ability that provide value</h3><p>All that to say that a good developer has developed a strong empathy over the years.</p><p>That empathy can help the business grow 📈, because it produces feedback before clients do. <br>It can also generate ideas that even the product owner might not have thought of. When discussing with a product owner who shares ownership with the “techies” on the team, a good developer can offer valuable ideas and input on everything: <br>- UI/UX design improvements, <br>- new feature ideas,<br>- CTA text improvements, <br>- feedbacks about the new landing page… <br>About pretty much anything!</p><h3>Conclusion</h3><p>Startups often don’t have the time nor the resources to conduct user research or implement A/B testing. <br>I believe that they have a lot to gain to welcome us developers into the product design process. Some do, and some don’t.</p><p>Personally, throughout my developer journey, I have always been willing to share my thoughts and ideas with any part of the company. <br>I believe it’s part of my job to advise as well as to code. Without this empathy and sharing, I would just be a coder, definitely not a developer.</p><p>I enjoy coding and focusing on how to implement well-written, maintainable code that meets the requirements as quickly as possible. <br>However, I enjoy it even more when I am a part of helping a product and business grow 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97f13c4db1e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Typescript “never” type example usage with React | Mutually exclusive props]]></title>
            <link>https://lsmod.medium.com/typescript-never-type-example-usage-with-react-mutually-exclusive-props-4683445d42c7?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4683445d42c7</guid>
            <category><![CDATA[typescript-with-react]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Mon, 02 Jan 2023 22:40:27 GMT</pubDate>
            <atom:updated>2023-01-03T11:11:31.032Z</atom:updated>
            <content:encoded><![CDATA[<h3>Typescript “never” type usage example with React | Mutually exclusive props</h3><p>Let’s say we have a Button that is either primary or secondary .</p><p>Here how we could implement it ⬇️</p><pre>type ButtonVariant = &quot;primary&quot; | &quot;secondary&quot;;<br><br>type ButtonProps = React.ComponentProps&lt;&quot;button&quot;&gt; &amp; {<br>  variant: ButtonVariant;<br>};<br><br>export const Button = ({ children, variant, ...rest }: ButtonProps) =&gt; {<br>  return (<br>    &lt;button {...rest}&gt;<br>      {variant}<br>      {children}<br>    &lt;/button&gt;<br>  );<br>};</pre><p>We would use that component like this:</p><pre>&lt;Button variant=&quot;primary&quot;&gt;I&#39;m primary&lt;/Button&gt;;<br>&lt;Button variant=&quot;secondary&quot;&gt;I&#39;m secondary&lt;/Button&gt;;</pre><p>And we should get type safety with the following refusing to compile:</p><pre>&lt;Button variant=&quot;tertiary&quot;&gt;I&#39;m not valid&lt;/Button&gt;;</pre><p>Indeed we got:</p><blockquote>Type ‘“tertiary”’ is not assignable to type ‘ButtonVariant’.<br>Did you mean ‘“primary”’?</blockquote><h3>Using never type:</h3><p>What if there is a better way? I don’t really want a variant prop…<br>What I want is to simply say if my button is primary or secondary .</p><p>Let’s see how to do it ⬇️</p><pre>type SecondaryButton = React.ComponentProps&lt;&quot;button&quot;&gt; &amp; {<br>  secondary: boolean;<br>  primary?: never; // on this type primary shouldn&#39;t never be set<br>};<br><br>type PrimaryButton = React.ComponentProps&lt;&quot;button&quot;&gt; &amp; {<br>  primary: boolean;<br>  secondary?: never; // this time, primary shouldn&#39;t be set<br>};<br><br>type ButtonProps = SecondaryButton | PrimaryButton;<br><br>export const Button = ({<br>  primary,<br>  secondary,<br>  children,<br>  ...rest<br>}: ButtonProps) =&gt; {<br>  return (<br>    &lt;button {...rest}&gt;<br>      {primary &amp;&amp; &quot;primary&quot;} {secondary &amp;&amp; &quot;secondary&quot;}<br>      {children}<br>    &lt;/button&gt;<br>  );<br>};</pre><p>And we would use it like this:</p><pre>&lt;Button primary&gt;I&#39;m primary&lt;/Button&gt;;<br>&lt;Button secondary&gt;I&#39;m secondary&lt;/Button&gt;;</pre><p>While still having the same type safety:</p><pre>// This shouldn&#39;t &quot;compile&quot;:<br>&lt;Button primary secondary&gt;<br>  I&#39;m not valid<br>&lt;/Button&gt;;</pre><p>And indeed typescript is complaining:</p><blockquote>Error: Type ‘{ children: string; primary: true; secondary: true; }’<br>is not assignable to type ‘IntrinsicAttributes &amp; ButtonProps’</blockquote><h3>Conclusion:</h3><p>Better right ? I prefer the latter too.</p><p>That’s it. Thank you for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4683445d42c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Which one is better: “React or Angular?” | React VS Angular]]></title>
            <link>https://lsmod.medium.com/which-is-better-react-or-angular-react-vs-angular-15625352769a?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/15625352769a</guid>
            <category><![CDATA[framework-vs-library]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Tue, 27 Dec 2022 22:22:39 GMT</pubDate>
            <atom:updated>2022-12-27T22:49:21.738Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*08Cn3R4v4SV4D4yAx8JgBg.jpeg" /></figure><p>React &gt; Angular!</p><p>You’ve probably heard the debate over and over. Which is better: “React or Angular?” But really, you can’t compare those two. Here’s why:</p><h3>Angular Framework</h3><p>Angular is a framework that provides everything you need to build web applications, including software architecture, dependencies injections, CLI to generate code…</p><p>It is battery included:<br>- comes with typescript<br>- component rendering<br>- routing <a href="http://twitter.com/angular/router">@angular/router</a><br>- dependencies injection<br>- state management with services<br>- form validation FormControl, ReactiveForm<br>- HTTP client for making REST API calls<br>- boiler code command line generator</p><p>When starting a project with Angular, you don’t have to make many software architecture choices. Basically you can just go with “the angular flow” follow the documentation, and things shouldn’t go wrong.</p><h3>React.js component rendering library</h3><p>On the other hand, React is just a library for rendering UI components. It’s up to you to pick and combine other libraries to build and architecture your application. Such as:<br>- adding typescript or to stick with javascript,<br>- react-router, hookrouter, universal-router, …<br>- state management with context, redux, hookstate, rematch, redux ToolKit, useQuery, …<br>- form validation with Formik, Final Form, hand made validation, …<br>- HTTP client with: Axios, Superagent, Fetch api, …</p><p>A more appropriate comparison would be between Angular and Next.js, a framework built on top of React.</p><h3>Angular or React which one to pick ?</h3><p>As a junior developer, Angular might be a good choice because it can help you avoid making bad architectural choices. <br>However, with the guidance of an experienced React developer, there’s no reason a junior developer should avoid React. <br>Personally, I prefer React (with typescript). Mainly because I feel it give me a better workflow. But I have also seen poorly architectured React projects that were costly to refactor…</p><p>It’s up to you! <br>Just be aware that with React not all answer are provided and you will have to take architectural decisions, and to pick up the right library as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15625352769a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What separates a junior from a senior developer?]]></title>
            <link>https://lsmod.medium.com/what-separates-a-junior-from-a-senior-developer-4898cfa35806?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4898cfa35806</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[junior-developer]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Fri, 09 Dec 2022 11:49:56 GMT</pubDate>
            <atom:updated>2022-12-09T12:25:00.156Z</atom:updated>
            <content:encoded><![CDATA[<p>What separates a junior from a senior developer? <strong>Time, experience, and knowledge</strong></p><p>To become a senior faster, you should:<br>- Experiment,<br>- Gain more knowledge,<br>- Take time to do so.<br>That’s it!</p><p>Here is how to do it:</p><p><strong>Learn more by studying regularly:</strong><br>There is plenty of free material online: youtube, coursera.org, blog posts, documentations, tutorials… More hours of free online content than in your life span. Otherwise, you could also buy a book or take an Udemy course once in a while.<br>It is also rewarding to talk with seniors and other juniors, to ask for advice, and to listen!</p><p><strong>Experiment with what you have learned:</strong><br>Try different techniques. Don’t forget to analyze your previous works. What could you have done better? <br>Do work on side projects, apply there your newly acquired knowledge.</p><p><strong>Reserve time for yourself:</strong><br>Consider the time you spend learning and experimenting as an investment. It’s an investment that will carry on interest for the rest of your life.<br>And because it’s never gonna be urgent to learn and experiment, you have to make it a priority. Otherwise, you won’t feel the urge to do so. <br>So! Do cancel the TV shows you plan on watching tonight, and start enjoying getting better every day!</p><p>🐢 Better be a junior that constantly takes time to improve than a know it all senior!<br>Slow and steady wins the race.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4898cfa35806" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discovering Ceramic Network: a new framework for Web3 developers]]></title>
            <link>https://lsmod.medium.com/discovering-ceramic-network-a-new-framework-for-web3-developers-17a9da78184f?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/17a9da78184f</guid>
            <category><![CDATA[dapps]]></category>
            <category><![CDATA[ceramic-network]]></category>
            <category><![CDATA[p2p-data-storage]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[ipfs]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Mon, 18 Jul 2022 17:02:28 GMT</pubDate>
            <atom:updated>2022-09-02T08:08:41.660Z</atom:updated>
            <content:encoded><![CDATA[<p>As I’m building a web app to fight against scams and fake news related to cryptocurrency, I have got the chance to work with ceramic network. And I would like to share with you about this new web3 framework.</p><h3>Ceramic Network what’s it?</h3><p>Well, it can be seen as a P2P database, fully decentralized.<br>It’s based on <a href="https://www.w3.org/TR/did-core/"><em>DID</em></a> and <a href="https://ipfs.io/"><em>IPFS</em></a> (DID stands for <strong>Decentralized IDentifier</strong>).</p><p>On ceramic network a user authenticate with his/her <em>DID</em>, and is the <strong>only one allowed to update</strong> his/her documents data while <strong>everyone can read it</strong>.</p><p>A DID is a public identifier associated with an asymmetric key. <br>Knowing your DID identifier, I can fetch and read what you put online into ceramic’s network and <strong>be sure you wrote it</strong>.<br>It’s kind of like a smart contract where only one address can write data into it.</p><h3>Ceramic network under the hood</h3><p>Ceramic rely on <em>IPFS</em> to duplicate data across nodes, and <em>DIDs</em> to inspect who holds what and is authorized to update content.</p><p>Documents on the ceramic network employ <em>json-schema</em>. It provides <strong>discoverability</strong> and ensures <strong>updates are valid</strong>.</p><p>While <strong>you don’t need tokens</strong> to store data onto this network in the end there is data anchoring occurring (currently with Ethereum). <br>But end users don’t even have to know about it!</p><h3>Isn’t IPFS enough for web 3 Dapp?</h3><p><em>IPFS</em> is great, but the file identifiers change when you update a document (file hash is not the same anymore). It makes it hard to link data to a particular user.</p><p>Instead Ceramic uses <em>DID</em> and documents identifier (called Stream Id). Those <strong>identifier don’t change</strong>, data does. Its just like with good old <em>URL</em>.</p><h3>To summarize</h3><ul><li>Documents are discoverable, thanks to <em>json-schema</em></li><li>Data are owned by their creator</li><li>Everything is cryptographically signed</li><li>No token required</li></ul><p>I’m betting big on ceramic’s framework, by building this new tool to make the web a little safer, it’s called <a href="https://swearby.io/">swearby.io</a>.<br>Ceramic is really promising and will give Web3 apps a proper decentralized database.</p><p>Thanks for bearing with me! Please tell me if you would be interested in a tutorial about developing with ceramic network (<em>typescript+node</em>).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17a9da78184f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Bitcoin works? | Where to learn in details about Bitcoin?]]></title>
            <link>https://lsmod.medium.com/how-bitcoin-works-where-to-learn-in-details-about-bitcoin-47a51ede2e19?source=rss-534f90f5aac2------2</link>
            <guid isPermaLink="false">https://medium.com/p/47a51ede2e19</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[bitcoin-course]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[free-course]]></category>
            <dc:creator><![CDATA[lsmod]]></dc:creator>
            <pubDate>Wed, 23 Feb 2022 18:32:27 GMT</pubDate>
            <atom:updated>2022-02-24T20:47:25.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Seashells money grows on beachs" src="https://cdn-images-1.medium.com/max/1024/0*14o4jQVPqiUP6dlF" /><figcaption>Seashells money grows on beachs, BTC don’t — Photo by <a href="https://unsplash.com/@ingvar_erik?utm_source=medium&amp;utm_medium=referral">Igor Karimov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you are asking yourself questions like :</p><ul><li>Won’t new miners joining the network result in a price decrease ?</li><li>What will happen when all bitcoins are mined?</li><li>I’ve lost my phone, are my bitcoins lost too?</li><li>Where are my bitcoins located?</li></ul><p>It’s probably that you don’t know Bitcoin well enough and that you are eager to <strong>learn more</strong> about it. <br>But… How and where? <br><strong>Where</strong> ? Here! <strong>In this post</strong> is here to help you on your <strong>quest</strong> <strong>for knowledge</strong>. <br><strong>How</strong>? By giving you a <strong>method</strong> get your head around Bitcoin and links to free and qualitative and free <strong>learning material</strong>.</p><h3>Bitcoin complexity</h3><p>Bitcoin is a<strong> complex system</strong> composed of <strong>many pieces </strong>working together.</p><p>You can compare it with a car. And if you want to understand how your car works, you better learn about:</p><ul><li>Brake</li><li>Wheel</li><li>Combustion engine</li><li>Transmission</li></ul><p>Then <strong>learn</strong> how all those <strong>pieces work together</strong>.</p><p>With Bitcoin, it is quite the same. <br>Here are some of the bitcoin’s ‘pieces’:</p><ul><li>Hashing function</li><li>Asymmetric cryptography</li><li>P2P Network</li><li>Transaction</li><li>Mining</li><li>Difficulty adjustment</li></ul><h3>Bitcoin courses</h3><h3>Coursera</h3><p>I recommend this <a href="https://coursera.org/learn/cryptocurrency?action=enroll">free course</a> from the University of Princeton on <a href="https://coursera.org/">coursera</a>. <br>It’s totally <strong>free</strong> (<em>just have to choose to follow as a free attendee</em>). I personally watched it years ago and it was <strong>illuminating</strong>.<br>I particularly like this course because it decomposes bitcoin as I described before, and gives you real knowledge about all the pieces of this complex system.</p><h3>Andreas Antonopoulos</h3><p>There is also Andreas Antonopoulos <a href="https://www.youtube.com/c/aantonop/playlists">youtube channel</a> where you can find many playlists.<br>A. Antonopoulos is the author of <a href="https://bitcoinbook.info/">Mastering Bitcoin book</a> and his Youtube channel goes way <strong>beyond technical knowledge</strong> about bitcoin.</p><h3>KhanAcademy</h3><p>I would be damned if I didn’t mention <a href="https://www.khanacademy.org/economics-finance-domain/core-finance/money-and-banking/bitcoin/v/bitcoin-what-is-it">KhanAcademy course on bitcoin</a>.</p><h3>Conclusion</h3><p>There is <strong>no easy way</strong> to learn about Bitcoin. <br>You have got to <strong>take the time</strong> to really learn how it works. But all the information is out there waiting for you.<br>Take the time! I can promise you it will be really <strong>rewarding</strong>.</p><p><em>PS: if you got other interesting resources don’t hesitate to post them in the comments</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47a51ede2e19" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>