<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohcin Bounouara</title>
    <description>The latest articles on DEV Community by Mohcin Bounouara (@bn_geek).</description>
    <link>https://dev.to/bn_geek</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F23664%2F5742c066-bc72-4e3f-8d6d-1aca8c055abe.jpg</url>
      <title>DEV Community: Mohcin Bounouara</title>
      <link>https://dev.to/bn_geek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bn_geek"/>
    <language>en</language>
    <item>
      <title>It’s ok to feel afraid when working to fill your knowledge gaps as a developer</title>
      <dc:creator>Mohcin Bounouara</dc:creator>
      <pubDate>Fri, 22 Nov 2024 16:36:19 +0000</pubDate>
      <link>https://dev.to/bn_geek/its-ok-to-feel-afraid-when-working-to-fill-your-knowledge-gaps-as-a-developer-565k</link>
      <guid>https://dev.to/bn_geek/its-ok-to-feel-afraid-when-working-to-fill-your-knowledge-gaps-as-a-developer-565k</guid>
      <description>&lt;p&gt;I have been dealing with this feeling for years, and I still do. In the beginning, it was really frustrating for me, day by day, step by step, I learned to “TRY DEALING WITH IT”, not fully “DEALING WITH IT” yet, because I’m not at that level.&lt;/p&gt;

&lt;p&gt;Let me share a story that might be similar to you or to your experience.&lt;/p&gt;

&lt;p&gt;A web developer/software developer who loves this field and has always tried to learn as much as possible. In the past, he made many mistakes by not being serious about focusing and learning the right way. Actually he didn’t know how to learn effectively, even though he was eager to grow and improve in this domain.&lt;/p&gt;

&lt;p&gt;Now, while trying to correct those mistakes, he finds it challenging, a lot of tech stacks, and many technical knowledge gaps to fill, all while needing to maintain his work as a source of income.&lt;/p&gt;

&lt;p&gt;Well, the story above is mine, I was exactly describing my own journey.&lt;/p&gt;

&lt;p&gt;well,&lt;/p&gt;

&lt;p&gt;How I’m dealing with this right now.&lt;/p&gt;

&lt;p&gt;Work on the psychological blockers:&lt;/p&gt;

&lt;p&gt;1- I identified the root cause of my fear: I’m afraid of looking wrong or stupid. I realized I was wrong, everyone has their own intelligence in one way or another. It’s just a matter of experience and how you approach solving problems.&lt;/p&gt;

&lt;p&gt;2- Respect yourself and appreciate your failures, they are something you MUST go through. Otherwise, you’re not truly living in this world, you’re in heaven.&lt;/p&gt;

&lt;p&gt;3- Don’t always expect to deliver that great work always, be prepared to receive constructive or not soo positive feedback.&lt;/p&gt;

&lt;p&gt;4- You might find yourself in an environment where others seem better than you. It’s normal, it’s ok, even if you’re a senior developer. Don’t discuss that feeling too much, focus on your own path.&lt;/p&gt;

&lt;p&gt;5- Value any tasks that you will take, give them your emotion.. concentrate on it even if it boring task or a very simple&lt;/p&gt;

&lt;p&gt;6- Remember that you were hired for a reason. Keep doing your best to make a living and push away the worst-case scenarios. I know it’s hard, but focusing on those scenarios will only block you from doing your best. It will not help you in the future, even if they do happen.&lt;/p&gt;

&lt;p&gt;Work on technical/professional blockers:&lt;/p&gt;

&lt;p&gt;1- List your technical gaps one by one. But remember, don’t try to address them all at once on the learning side, or you’ll end up dropping them all at once.&lt;/p&gt;

&lt;p&gt;2- Set a time to learn what you’ve listed as gaps, even if it’s just 30 minutes per day. You will see significant improvement over time.&lt;/p&gt;

&lt;p&gt;3- Don’t be shy to ask technical questions&lt;/p&gt;

&lt;p&gt;4- Show up, share your knowledge even if it looks basic for you, share it with the community that you admire, also share it with your team, don’t say it is too basic for them.. it will help.&lt;/p&gt;

&lt;p&gt;4- Learn to communicate effectively, talking and writing.&lt;/p&gt;

&lt;p&gt;5- Start small. I know it’s hard to fill your gaps by focusing on the basics of JavaScript (for example) or creating simple functions, especially after having more than 3 years of experience. It’s mentally challenging, but trust me, this will pay off in the near future.&lt;/p&gt;

&lt;p&gt;6- Remember, anything you add to your knowledge or skills will make you more valuable and help the team around you. You may not notice it right away, but it will come.&lt;/p&gt;

&lt;p&gt;I have not completed all of these steps above yet, I’m still working on myself. But I’m following what I’ve mentioned. I used to share the process only when finish something, but now I’m sharing as I go, because I might not have the chance later.&lt;/p&gt;

&lt;p&gt;I’m sharing this in my way to become a less afraid, more confident software developer.&lt;/p&gt;

&lt;p&gt;See you.. &lt;/p&gt;

&lt;p&gt;Originally posted on my blog: &lt;a href="https://mohcinbounouara.com/its-ok-to-feel-afraid-when-working-to-fill-your-knowledge-gaps-as-a-developer/" rel="noopener noreferrer"&gt;https://mohcinbounouara.com/its-ok-to-feel-afraid-when-working-to-fill-your-knowledge-gaps-as-a-developer/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>The Joy of Understanding One Line of Code</title>
      <dc:creator>Mohcin Bounouara</dc:creator>
      <pubDate>Sun, 18 Aug 2024 16:09:15 +0000</pubDate>
      <link>https://dev.to/bn_geek/the-joy-of-understanding-one-line-of-code-2ip9</link>
      <guid>https://dev.to/bn_geek/the-joy-of-understanding-one-line-of-code-2ip9</guid>
      <description>&lt;p&gt;In your software development career, you’ve probably experienced the joy of truly understanding a line of code, right?&lt;/p&gt;

&lt;p&gt;On the other hand, there’s that feeling of not fully grasping the code, whether it’s something you wrote or code written by others. Let’s dive into the value I want to share through out this blog post.&lt;/p&gt;

&lt;p&gt;I used to copy and paste code, this is a common practice in software development. It’s a pattern and part of our daily work in this field. But even when the copied code worked, I often felt like I was missing something, or maybe something like psychological dissatisfaction.&lt;/p&gt;

&lt;p&gt;Don’t get me wrong, I’m not advocating for reinventing the wheel. If you can leverage existing code snippets, scripts, or libraries, do it without hesitation. It’s actually a sign of seniority and experience. You’re bringing value to the project by applying knowledge efficiently, saving time and effort.&lt;/p&gt;

&lt;p&gt;Let me give you an example of when coding becomes a joyful experience. Imagine you find a solution on StackOverflow or from one of the popular AI tools today. Instead of simply copying and running it, you take the time to read, understand, and adapt the code to your specific use case. You might add or remove lines, making it more adaptable to your project. This process can sometimes be harder than writing the code from scratch, but it’s satisfying because you’ve not only saved time but also bring value to your work/team.&lt;/p&gt;

&lt;p&gt;Here’s another example: You take a simple SQL query, spend time fully understanding it, and then integrate it into your codebase. You feel accomplished because you didn’t just use a copied SQL statement or an auto-generated ORM query. You truly understood what you were doing.&lt;/p&gt;

&lt;p&gt;In general, the message I want to pass in this post is to take advantage of existing code to move your project forward. It’s perfectly fine not to understand every single detail in your codebase, and it’s okay to use this approach to save time and money. But whenever you have the chance to deeply understand a line of code, EMBRACE IT. It’s a rewarding feeling.&lt;/p&gt;

&lt;p&gt;Keep learning…&lt;/p&gt;

&lt;p&gt;Originally posted on my blog: &lt;a href="https://mohcinbounouara.com/the-joy-of-understanding-one-line-of-code/" rel="noopener noreferrer"&gt;https://mohcinbounouara.com/the-joy-of-understanding-one-line-of-code/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>learning</category>
      <category>career</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>A Quick Guide to Creating Laravel Factories and Seeders</title>
      <dc:creator>Mohcin Bounouara</dc:creator>
      <pubDate>Mon, 01 Jul 2024 18:50:02 +0000</pubDate>
      <link>https://dev.to/bn_geek/a-quick-guide-to-creating-laravel-factories-and-seeders-3o09</link>
      <guid>https://dev.to/bn_geek/a-quick-guide-to-creating-laravel-factories-and-seeders-3o09</guid>
      <description>&lt;p&gt;I often find myself back to the Laravel documentation whenever I need to create new factories and seeders for my projects, whether they’re learning exercises, hobby projects, or real-world applications (bored doing the same actions every time). To make this process easy, I’ve decided to create a guide that I can refer to whenever needed, saving time and avoiding the need to search through extensive documentation. If this guide helps someone else, that would be a great thing!&lt;/p&gt;

&lt;p&gt;Let’s assume we have a User/Posts relationship, meaning each user can have one or more posts, and each post belongs to a user.&lt;br&gt;
What is a Factory?&lt;/p&gt;

&lt;p&gt;A Factory in Laravel is a class to generate test data for your application. This is useful for local development and staging environments, providing a lot of benefits. Laravel allows you to create a factory for each model you have.&lt;br&gt;
What are Seeders?&lt;/p&gt;

&lt;p&gt;Seeders in Laravel are used to populate your database with data using seed classes, which is especially useful for testing purposes.&lt;br&gt;
Generating New Factories&lt;/p&gt;

&lt;p&gt;To create a new factory, run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:factory PostFactory&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You will find your factory class under the database/factories directory. Here is an example of defining your factory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function definition(): array
{
    return [
        'title' =&amp;gt; $this-&amp;gt;faker-&amp;gt;sentence,
        'content' =&amp;gt; $this-&amp;gt;faker-&amp;gt;paragraph,
        'user_id' =&amp;gt; User::factory(),
    ];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generating Seeders&lt;/p&gt;

&lt;p&gt;To create a new seeder, run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:seeder PostSeeder&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You will find the seeder class under the database/seeders directory. Here is an example of the run function within this class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function run(): void
{
    Post::factory()
        -&amp;gt;count(20)
        -&amp;gt;create();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the same directory, you will find the DatabaseSeeder class. Ensure it includes all your seeders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function run(): void
{
    // \App\Models\User::factory(10)-&amp;gt;create();

    // \App\Models\User::factory()-&amp;gt;create([
    //     'name' =&amp;gt; 'Test User',
    //     'email' =&amp;gt; 'test@example.com',
    // ]);

    $this-&amp;gt;call([
        PostSeeder::class,
        ..,
        ..
    ]);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running Migrations and Seeding the Database&lt;/p&gt;

&lt;p&gt;First, run the database migrations:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan migrate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, seed the database:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan db:seed&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you have test data in place. Enjoy!&lt;/p&gt;

&lt;p&gt;Originally posted on my blog!&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
    </item>
    <item>
      <title>PHP note: For Loop Performance</title>
      <dc:creator>Mohcin Bounouara</dc:creator>
      <pubDate>Tue, 23 Nov 2021 14:45:41 +0000</pubDate>
      <link>https://dev.to/bn_geek/php-note-for-loop-performance-10eh</link>
      <guid>https://dev.to/bn_geek/php-note-for-loop-performance-10eh</guid>
      <description>&lt;p&gt;About a year ago I started to writing code “BUT NOT JUST FOR WRITING IT”, I focused on to trying to fully understand what I’m about to write, in the whole software life cycle and I was giving attention to the performance, speed, and clean code.&lt;/p&gt;

&lt;p&gt;So I was trying to improving my “PHP For Loop”.&lt;/p&gt;

&lt;p&gt;I was repeating myself and write for loop on this way below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$array = [0, 1, 2, 3, 4];

for($i = 0; $i &amp;lt; count($array); $i++) {
      print_r ($i);
      echo '&amp;lt;br/&amp;gt;';
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above way of writing for loop is WRONG. Why?&lt;/p&gt;

&lt;p&gt;In every loop the Count function is called, and that is code overhead, we have just 5 items in the the array, imagine that we have hundred that will absolutely affect the performance of the script.&lt;/p&gt;

&lt;p&gt;Let’s try to improve our loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$array = [0, 1, 2, 3, 4];
$j = count($array);
for ($i=0; $i &amp;lt; $j; $i++) {
  print_r ($i);
  echo '&amp;lt;br/&amp;gt;';
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s calculate for loop execution time in seconds and do comparison;&lt;/p&gt;

&lt;p&gt;The first script: Executed in 4.0531158447266E-6 seconds&lt;/p&gt;

&lt;p&gt;The second script: Executed in 3.0994415283203E-6 seconds&lt;/p&gt;

&lt;p&gt;Those notes is about small scripts, try to imagine working on large-scale apps or websites. Making attention to these things will improve your code and totally improve your vision as a software developer or web developer.&lt;/p&gt;

</description>
      <category>php</category>
      <category>softwareengineering</category>
      <category>software</category>
    </item>
    <item>
      <title>Create Dark Mode functionality with pure JavaScript</title>
      <dc:creator>Mohcin Bounouara</dc:creator>
      <pubDate>Mon, 21 Jun 2021 17:09:44 +0000</pubDate>
      <link>https://dev.to/bn_geek/create-dark-mode-functionality-with-pure-javascript-332c</link>
      <guid>https://dev.to/bn_geek/create-dark-mode-functionality-with-pure-javascript-332c</guid>
      <description>&lt;p&gt;I was using front-end Framworks as Vue Js and jQuery, but I discover that I have some problems that I must fix in JavaScript basics (and I’m proud to fix and learn new things always) because at all you will use Js in your Frameworks based project necessarily.&lt;/p&gt;

&lt;p&gt;I decided to learn some principal in Js with deeply way because I’m not learned it correctly in the beginning, and I will share some simple Implementations as blog posts maybe it will help someone in somewhere.&lt;/p&gt;

&lt;p&gt;Let’s start with creating a feature that is very common in websites this days, “Dark Mode functionality” .&lt;/p&gt;

&lt;h2&gt;
  
  
  The HTML page structure:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Dark Mode&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt;
      &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt;
      &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"&lt;/span&gt;
    &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"fas fa-sun"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Pure Javascript Dark Mood&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"date"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;May 7, 2021&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

      &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Pure Javascript Dark Mood&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"date"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;May 7, 2021&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

      &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Pure Javascript Dark Mood&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"date"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;May 7, 2021&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

      &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Pure Javascript Dark Mood&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"date"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;May 7, 2021&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  We will use this simple CSS style for the page:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;article&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#ccc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.darking-mode&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#374151&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The JavaScript function that will handle the click and switching between normal and dark mode, I will try to explain every line of code clearly. I used to comment my code so its already commented but I will try to explain it also.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// get the element to be clicked&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;buttonToBeClicked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// addEventListener() method to execute the main function&lt;/span&gt;
&lt;span class="nx"&gt;buttonToBeClicked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;darkMode&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// our dark mode function&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;darkMode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;//console.log('Clicked!!');&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;theBody&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;theBody&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toggle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;darking-mode&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;//console.log('switched to dark mode!');&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;darking-mode&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;icon&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;i&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="c1"&gt;//console.log(icon);&lt;/span&gt;
     &lt;span class="nx"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fa-sun&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="nx"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fa-moon&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;icon&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;i&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="nx"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fa-moon&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="nx"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fa-sun&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Function explaining:
&lt;/h2&gt;

&lt;p&gt;I used an addEventListener() method to handle click to execute the function that will do the work.&lt;/p&gt;

&lt;p&gt;After that I stocked the body element in “theBody” variable.&lt;/p&gt;

&lt;p&gt;And I used “Element.classList” a property that return a live class “darking-mode” that is responsible on changing elements color and body background color.&lt;/p&gt;

&lt;p&gt;Finally I use an if statement to handle toggle fontawesome icons.&lt;/p&gt;

&lt;p&gt;The blog post has originally posted on my personal blog. Hope that will helps someone, somewhere.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>About code smells</title>
      <dc:creator>Mohcin Bounouara</dc:creator>
      <pubDate>Sun, 25 Oct 2020 19:00:12 +0000</pubDate>
      <link>https://dev.to/bn_geek/about-code-smells-3eg4</link>
      <guid>https://dev.to/bn_geek/about-code-smells-3eg4</guid>
      <description>&lt;p&gt;In software engineering field you are probably heard about “Code Smell” before right?, the name comes from Martin Fowler and Kent Beck. So let me explain a little about this concept.&lt;br&gt;
What is and for what code smell?&lt;/p&gt;

&lt;p&gt;Code smell in software engineering point on sick code in the deep system of an software, simply is the problems that actually exist in the system but It doesn’t prevent the software from completing its tasks.&lt;br&gt;
Smells are the structures in the code that not respect the fundamental design principles and negatively impact design system quality. So it’s not “BUGS”.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A code smell is a surface indication that usually corresponds to a deeper problem in the system.&lt;br&gt;
    — Martin Fowler&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  For what?
&lt;/h2&gt;

&lt;p&gt;Software engineers use code smells to analyze the existing code using Unit Test and Testing Life Cycle test of the software, after finding the code smells who need of more refactoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code smell: common examples
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Long methods: Most developers think the complex methods gives them the great image, but NO, do it simple and do it short. Long methods make code hard to maintain and debug.&lt;/li&gt;
&lt;li&gt;Duplicate Code: don’t repeat yourself!&lt;/li&gt;
&lt;li&gt;Lazy Class: Remember that lazy classes do the work, but in the future it’s hard to fix in bug cases.&lt;/li&gt;
&lt;li&gt;Dead Code: Delete it don’t just comment it or let it without doing anything. Make it clean.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Code smell tools
&lt;/h2&gt;

&lt;p&gt;If we take PHP as a use case, we will found that there is a lot of tools using to do that work, some of them that listed next:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/adamculp/php-code-quality"&gt;https://github.com/adamculp/php-code-quality&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://phpmd.org/"&gt;https://phpmd.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/squizlabs/PHP_CodeSniffer"&gt;https://github.com/squizlabs/PHP_CodeSniffer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FriendsOfPHP/PHP-CS-Fixer"&gt;https://github.com/FriendsOfPHP/PHP-CS-Fixer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And I will come with a practical example of code smell when I have time.&lt;/p&gt;

&lt;p&gt;Code smells can be in any system written by programmers, even experienced, so try to use code smells tools to detect the smells and try to refactoring it.&lt;/p&gt;

&lt;p&gt;Note: This post is originally posted on my personal blog&lt;/p&gt;

</description>
      <category>codesmell</category>
      <category>beginners</category>
      <category>computerscience</category>
      <category>programming</category>
    </item>
    <item>
      <title>Implement Hover in Vue</title>
      <dc:creator>Mohcin Bounouara</dc:creator>
      <pubDate>Sun, 26 Apr 2020 18:52:06 +0000</pubDate>
      <link>https://dev.to/bn_geek/implement-hover-in-vue-2n8a</link>
      <guid>https://dev.to/bn_geek/implement-hover-in-vue-2n8a</guid>
      <description>&lt;p&gt;We used to implement showing something on hover using JQuery or pure CSS but if you are starting using Vue Js and you wanna do the same you will face the problem, there no  functionality built in or pre-defined so we will try to make this simple implementation for that.&lt;/p&gt;

&lt;p&gt;Let us first make a reminder of this functionality in JQuery and css.&lt;/p&gt;

&lt;p&gt;Here is a Jquery example using mouseenter() and mouseleave():&lt;br&gt;
&lt;iframe src="https://jsfiddle.net/Mohcinbn/sdy5gz21//embedded//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Here is a Jquery example using pure css:&lt;br&gt;
&lt;iframe src="https://jsfiddle.net/Mohcinbn/abnqm895//embedded//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;After this simple reminder about this common functionalities I will do the same using Vue Js.&lt;br&gt;
Ok!, to do that in vue we will use &lt;a href="https://vuejs.org/v2/guide/events.html"&gt;Vue events&lt;/a&gt; to listen to DOM events when the mouse enters and leaves, and update our state based on that.&lt;br&gt;
We will use v-on directive to listen to the mouse moves. we can just write @event to define v-on:event.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
    Hover on me to show text
  &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
   This the text who shown after hover
  &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;el&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;toShowOnHover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now any element with property "toShowOnHover" will be shown on hover after we setup the methods&lt;/p&gt;

&lt;p&gt;We will use v-show to show the element who have the vue property on hover.&lt;br&gt;
So our code will transform to something bellow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;mouseover=&lt;/span&gt;&lt;span class="s"&gt;"mouseEnter"&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;mouseleave=&lt;/span&gt;&lt;span class="s"&gt;"mouseLeave"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    Hover on me to show text
  &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;v-show=&lt;/span&gt;&lt;span class="s"&gt;"toShowOnHover"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   This the text who shown after hover
  &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;el&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;toShowOnHover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;mouseEnter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toShowOnHover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toShowOnHover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;mouseLeave&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toShowOnHover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   
        &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The mouseEnter() function let us show the element p who had already the property "toShowOnHover"&lt;/li&gt;
&lt;li&gt;The mouseLeave() function let us hide the element p to return to the base state&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  DEMO IN ACTION
&lt;/h2&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/Mohcinbn/s6m2tvby//embedded//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

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

&lt;p&gt;Now you have the start up keys to achieve any thing you wanna show when users hover an element in your next vue app. &lt;/p&gt;

&lt;p&gt;Go ahead and happy coding&lt;/p&gt;

</description>
      <category>vue</category>
    </item>
    <item>
      <title>Absolute fixed and relative the difference!</title>
      <dc:creator>Mohcin Bounouara</dc:creator>
      <pubDate>Sun, 26 Apr 2020 01:32:06 +0000</pubDate>
      <link>https://dev.to/bn_geek/absolute-fixed-and-relative-the-difference-29e1</link>
      <guid>https://dev.to/bn_geek/absolute-fixed-and-relative-the-difference-29e1</guid>
      <description>&lt;p&gt;Let’s talk about &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position"&gt;the position property&lt;/a&gt; in CSS in my humble view.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is?
&lt;/h2&gt;

&lt;p&gt;The position property are responsible for the positioning of the any HTML element in the whole document.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS Position:
&lt;/h2&gt;

&lt;p&gt;There are more than one type of positioning: static, relative, absolute, fixed, sticky, initial, and inherit.&lt;br&gt;
But I’ll talk in particular about relative, absolute and fixed and the difference between them , so let us know what are those types with this simple definition to each of these concepts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relative: a relative position without other attributes means that element is relative to it self so it should not had any effect on his positioning.&lt;/li&gt;
&lt;li&gt;Absolute: this type of positioning like a superpower in CSS, it gives you the possibility to place any page element where you want and over any element you want on the page where you want.&lt;/li&gt;
&lt;li&gt;Fixed: it’s like absolute position but not for a relative element but for the whole document. If the element have an fixed position will not disappear when you scroll in the page.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cases In action:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Position absolute, this example gives you a clear view about absolute position. &lt;a href="http://jsfiddle.net/macloo/aw9m2vyu/"&gt;Check HERE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Position fixed, this example gives you a clear view about fixed position. &lt;a href="http://jsfiddle.net/WSZXL"&gt;Check HERE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Position relative, no need for an example. If you didn’t applied attributes (Top, right..) on the element and you just used position: relative you will not have any changes on the element.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The difference in this short summary:
&lt;/h2&gt;

&lt;p&gt;The position: relative means the element position will be based on his starter and current position without changing, the position: absolute you have the right to place the element in any place provided that have a parent element with relative position, position: fixed will give your element the position over the other elements of the page even on the scroll.&lt;/p&gt;

&lt;h2&gt;
  
  
  Avoid to use:
&lt;/h2&gt;

&lt;p&gt;The absolute position is one of the best CSS property that is easy to use, especially for junior developers because it solve a lot of problems, personally I used to work with it in several works haha, but I learnt what I'am trying to explain for you now..&lt;/p&gt;

&lt;p&gt;Problem 1 :&lt;/p&gt;

&lt;p&gt;Let’s suppose that you are working on project that required to be responsive and should be accessible in different machines, it will cause a problem.. you will be required to work in all the resolution using &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries"&gt;Media Queries&lt;/a&gt;, and this isn’t a practical process.&lt;/p&gt;

&lt;p&gt;Problem 2:&lt;/p&gt;

&lt;p&gt;When we use absolute position a several CSS Properties who using with pixels like margin or padding will don’t be shown the same when you’re changing the resolution or break the browser point.&lt;/p&gt;

&lt;p&gt;So try to use absolute position in special and necessary cases, you will learn to do that with practice.&lt;br&gt;
And don’t use “pixels” when you’re using “absolute” position.. use “%” you will save a lot of work and time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position"&gt;More Information&lt;/a&gt;&lt;br&gt;
&lt;a href="http://bounouara.me/2020/04/25/absolute-fixed-and-relative-the-difference/"&gt;Originally posted on my blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's all, thank you!&lt;/p&gt;

</description>
      <category>css</category>
      <category>a11y</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Learning without Educational System</title>
      <dc:creator>Mohcin Bounouara</dc:creator>
      <pubDate>Fri, 16 Mar 2018 19:29:50 +0000</pubDate>
      <link>https://dev.to/bn_geek/learning-without-educational-system--107</link>
      <guid>https://dev.to/bn_geek/learning-without-educational-system--107</guid>
      <description>&lt;p&gt;When I was learning and I'm still, regularly I always notice that our teacher keep in the old method of teaching,, except some wonderful teachers.. The theoric courses after that some issues explanation and finally a practice of all those thing you already learned them..&lt;/p&gt;

&lt;p&gt;In such fields as Internet Technology, maybe that will works all the time, and maybe will not work.. but personally I believe in learning without processes or pre-plans, DO YOU?&lt;/p&gt;

&lt;p&gt;Come, I will explain my simple point of view..!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The learning Academic norms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm not an expert at Learning domain but also I'm a developer who knows google and googling things very well, so with a simple search in google using keywords like, 'learning' 'Academic' 'norms' 'system' I found this very clear result as, the education system is an process that allow student to learn anything form basics to professional and facilitate that using specific methods.&lt;/p&gt;

&lt;p&gt;An Academic progress: is monitored by the teacher but is driven by the individual student. A student’s progress from one level to the next is based on academic readiness, not chronological age or “seat time.” Upper School students may complete their transcript work in three years, four years, or five years. Counterpane refuses to advance or graduate a student who has not proven academic readiness by an end-of-course grade of at least “75” in all college preparatory work.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Without academic processes (Plan)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To start from my experiences, I learned a lot of things and in different technologies without any pre-processes or pre-plans, also, I learned a lot of technologies without theory.. maybe looks strange but this is truth, during my 2 to 3 last years I worked as IT developer and a freelancer for a lot o people and startup, also I worked with an web agency as senior web developer and at "SEO" Team in the some agency.. there is things stuck in my mind more than others, as "You LEARN, DISCOVER, FORCED TO KNOW, TRY A LOT, KNOW NEW TECHNOLOGIES" When you NEED THEM!!&lt;/p&gt;

&lt;p&gt;Lets told you who I learn a lot of new technology, tips and skills without plans or processes. I will use this square list to do that because I'm not too good in English :' guys :D :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Working with a team is always makes you learn new things "Without Processes", because if a friend or work-mate explain a tips to you he will be more brief and useful&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Falling into technical problems during you're working on a real-time project makes you learn new skills or tips "Without Processes"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When project Manager asking from you to use a specific technologies to do this project you will not say "NO" so even you are never know about it you will go to documentation and you will be able to work with that even hardly, so you are learn and learned "Without Processes"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you are on a Side-Project you try to use new thing so you just need a documentation and some blog posts or guide without keeps in order, so you are going to do it "Without Processes"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you are going to search for a tutorial to know a new technology,, you will find a lot of them on the net, you choice one.. yo read it.. you learn from it.. REMEMBER that its not a teacher or someone who are using an academic processes to teach you that.. he's just an guy who share with you what he already knows so you learn "Without Processes" Even that!!.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;REMEMBER You are able teach us what you KNOW so we can learn without processes :D&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I shared you guys what I think from my view.. lets know yours :)&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
