<?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>Forem: Amanullah Menjli</title>
    <description>The latest articles on Forem by Amanullah Menjli (@amanullahmenjli).</description>
    <link>https://forem.com/amanullahmenjli</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%2F487337%2Faab5a683-42ab-4f1f-88b5-0592b14d7b7b.jpg</url>
      <title>Forem: Amanullah Menjli</title>
      <link>https://forem.com/amanullahmenjli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/amanullahmenjli"/>
    <language>en</language>
    <item>
      <title>Why Linux is important for you as a developer</title>
      <dc:creator>Amanullah Menjli</dc:creator>
      <pubDate>Wed, 09 Dec 2020 21:11:42 +0000</pubDate>
      <link>https://forem.com/amanullahmenjli/why-linux-is-important-for-you-as-a-developer-6h0</link>
      <guid>https://forem.com/amanullahmenjli/why-linux-is-important-for-you-as-a-developer-6h0</guid>
      <description>&lt;p&gt;Hey, guys! Last week I was talking with my friend about switching to Linux but he was completely refusing changing windows and asked what would be changed in his life if he switched to linux ?&lt;/p&gt;

&lt;p&gt;I was thinking about that last night, so I wrote this post to explain why I think that linux is just better.&lt;/p&gt;

&lt;p&gt;I won't talk about things like open-source or free price, I will only talk about things directly touching my life.&lt;/p&gt;

&lt;h1&gt;
  
  
  1- No Obligations
&lt;/h1&gt;

&lt;p&gt;That's an important point, as a Windows user I had to keep some programs installed in my system even if I don't need them, I had to stay with the same user interface and accept 100% CPU usage&lt;br&gt;
&lt;strong&gt;Simply I had to do what I don't want just because Microsoft wants that.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Linux, that's different. I can remove whatever I want, use my system the way I want and change the system's look easily.&lt;br&gt;
&lt;strong&gt;I become really free&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2- I update what I want when I want
&lt;/h1&gt;

&lt;p&gt;Windows updates aren't an option, they happen without your knowlege and don't give you any choice.&lt;br&gt;
I hate that, I can't accept using my internet for downloading things I won't use. 😡😤&lt;br&gt;
In Linux, I get a polite request informing me about updates and give me control of every single part of them. It's my own decision, not Microsoft's. I don't want to find some new apps downloaded and installed without even telling me, why do I put a password in my computer if I will find new apps installed next time i boot my system.&lt;/p&gt;

&lt;h1&gt;
  
  
  3- Control is simple, fast and effective:
&lt;/h1&gt;

&lt;p&gt;In Linux, I install everything from terminal, I update from terminal ans I live in terminal. Every complicated long task has a one line command, that's all. I don't want to open 10 windows searching for configuration places, that's stupid and productivity killer.&lt;/p&gt;

&lt;h1&gt;
  
  
  4- Terminal Emulators
&lt;/h1&gt;

&lt;p&gt;We can't talk about Linux without talking about terminal, as a developer terminal is a very important part of your job and as we know Windows suffers from a big lack of terminal emulators compared to Linux.&lt;/p&gt;

&lt;h1&gt;
  
  
  5- Better Performance
&lt;/h1&gt;

&lt;p&gt;With Linux you get better performance compared to Windows in the same machine specially with a lightweight distro and that's a fact!&lt;/p&gt;

&lt;h1&gt;
  
  
  6- Ready out of the box
&lt;/h1&gt;

&lt;p&gt;In Linux you can find distros for everything from medicine to running cars and phone, you get an operating system ready with tools, drivers and more with 0 effort, And as developers there are distros ready with IDEs, Compilers, Decompilers, Interpreters... and that saves lot of time and energie.&lt;/p&gt;

&lt;h1&gt;
  
  
  7- Compatibility
&lt;/h1&gt;

&lt;p&gt;Linux can work with any hardware configuration out of the box, and if your computer's components have some problems with Linux, the big supportive community will help you, just ask.&lt;/p&gt;

&lt;h1&gt;
  
  
  8- Security
&lt;/h1&gt;

&lt;p&gt;Linux isn't used by the majority of users that's why it's viruses are really less than Windows's and the majority of them are used to hack specific users or servers, so don't worry about your security.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to write better code</title>
      <dc:creator>Amanullah Menjli</dc:creator>
      <pubDate>Sat, 28 Nov 2020 19:40:30 +0000</pubDate>
      <link>https://forem.com/amanullahmenjli/how-to-write-better-code-4jjf</link>
      <guid>https://forem.com/amanullahmenjli/how-to-write-better-code-4jjf</guid>
      <description>&lt;h1&gt;
  
  
  1- Write comments but only when necessary:
&lt;/h1&gt;

&lt;p&gt;Comments are important but when something is clear there is no need to describe it in a comment.&lt;br&gt;
⭐️ be fast, clear and meaningful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uFwXL-_i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606588463341/p3c3dCctS.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uFwXL-_i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606588463341/p3c3dCctS.png" alt="image.png" width="227" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2- Unformatted Code:
&lt;/h1&gt;

&lt;p&gt;When your code is very compact it won't be clear and readable even with syntax highlighting , use white spaces to have a better spacing and make your code easier to understand.&lt;br&gt;
⭐️ in python you can use pep8 as guidelines and best practices to write better code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K_1h35zw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606589618869/Ql_ccWyC_.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K_1h35zw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606589618869/Ql_ccWyC_.png" alt="image.png" width="880" height="1079"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  3- Use meaningful name:
&lt;/h1&gt;

&lt;p&gt;When naming variables, functions classes or objects using names like a, b c or variable1 is a bad habit because you won't be able to understand why do you have that variable or what is the role of that function and your code will become a big mess and debugging will become impossible.&lt;br&gt;
⭐️ use easy, memorable, meaningful and clear names and you won't be like him 🤦‍♂️👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TAJ1tNqW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606588266713/i0G238H_d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TAJ1tNqW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606588266713/i0G238H_d.png" alt="image.png" width="808" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  4- KISS (Keep It Simple Stupit):
&lt;/h1&gt;

&lt;p&gt;The KISS principle intends to write code as simple as possible. Avoid complexity and try to make a code that everyone can understand. 👍&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U6yqotDx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606591153018/bC1IPaS74.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U6yqotDx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606591153018/bC1IPaS74.png" alt="image.png" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  5- DRY (Don't Repeat Yourself):
&lt;/h1&gt;

&lt;p&gt;these days google and stackoverflow are good places to find solutions for our problems but copy-pasting is a bad habit, sometimes solutions you can find aren't for everyone. First understand your problem then understand given solutions and only get the necessary part for you, if you just use it as it's posted on internet, you will make your code longer, slower and harder to understand and maintain and you will become like him 🤦‍♂️👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r1tZbYOf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i.pinimg.com/originals/70/bc/3b/70bc3b48a9f41e5101ac373a42e64ca8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r1tZbYOf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i.pinimg.com/originals/70/bc/3b/70bc3b48a9f41e5101ac373a42e64ca8.gif" alt="image.png" width="360" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>PyQt5 Tutorial - Hello World!</title>
      <dc:creator>Amanullah Menjli</dc:creator>
      <pubDate>Sun, 01 Nov 2020 11:05:46 +0000</pubDate>
      <link>https://forem.com/amanullahmenjli/pyqt5-tutorial-hello-world-4inj</link>
      <guid>https://forem.com/amanullahmenjli/pyqt5-tutorial-hello-world-4inj</guid>
      <description>&lt;p&gt;For creating GUI in python we have multiple choices like tkinter ,WXPython, Kivy and PyQt5 , a cross platform very famous library for creating Graphical User Interfaces as well as cross-platform applications, in this tutorial we will use it for creating GUIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation:
&lt;/h2&gt;

&lt;p&gt;For Windows :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install PyQt5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Linux &amp;amp; MacOS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip3 install PyQt5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Hello World! The traditional beginning:
&lt;/h2&gt;

&lt;p&gt;In this tutorial we will make a simple app showing "Hello World!" after pressing a button, so let's start.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# importing the required libraries 
from PyQt5.QtWidgets import * 
import sys 

class Window(QMainWindow): 
    def __init__(self): 
        super().__init__() 

        # set the title 
        self.setWindowTitle("Hello World!") 

        # set the geometry 
        self.setGeometry(0, 0, 300, 300) 

        # create label widget 
        # to display content on screen 
        self.label = QLabel("Hello World !!", self) 

        # show all the widgets 
        self.show() 

# create pyqt5 app 
App = QApplication(sys.argv) 

# create the instance of our Window 
window = Window() 

# start the app 
sys.exit(App.exec()) 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Result:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7uGXVuT0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/gTqrZ5S/FU5sb-Qr-L5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7uGXVuT0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/gTqrZ5S/FU5sb-Qr-L5.png" alt="image.png" width="302" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First of all we have created the Window class which inherits &lt;strong&gt;QMainWindow&lt;/strong&gt; class. Within this class we can add widgets which will get displayed on main window, in the next step we have used &lt;strong&gt;setWindowTiltle&lt;/strong&gt; method to set title for our window, &lt;strong&gt;setGeometry&lt;/strong&gt; method to set size and position of the window and , &lt;strong&gt;QLabel&lt;/strong&gt; for displaying message in the window and the &lt;strong&gt;show&lt;/strong&gt; method for showing all the widgets.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;QApplication&lt;/strong&gt; class manages the GUI application’s control flow and main settings. It specializes in the &lt;strong&gt;QGuiApplication&lt;/strong&gt; with some functionality needed for QWidget based applications. It handles widget specific initialization, finalization. For any GUI application using &lt;strong&gt;Qt&lt;/strong&gt;, there is precisely one &lt;strong&gt;QApplication&lt;/strong&gt; object, no matter whether the application has 0, 1, 2, or more windows at any given time.&lt;/p&gt;

</description>
      <category>python</category>
      <category>gui</category>
      <category>tutorial</category>
      <category>pyqt5</category>
    </item>
  </channel>
</rss>
