<?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: Ali Aryani</title>
    <description>The latest articles on DEV Community by Ali Aryani (@aliaryani-dev).</description>
    <link>https://dev.to/aliaryani-dev</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%2F3506074%2F8cc12566-77ba-4b62-a82b-a7110da8a587.jpg</url>
      <title>DEV Community: Ali Aryani</title>
      <link>https://dev.to/aliaryani-dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aliaryani-dev"/>
    <language>en</language>
    <item>
      <title>First Steps into Darkness: My First Malware Analysis Experience</title>
      <dc:creator>Ali Aryani</dc:creator>
      <pubDate>Tue, 07 Oct 2025 13:35:05 +0000</pubDate>
      <link>https://dev.to/aliaryani-dev/first-steps-into-darkness-my-first-malware-analysis-experience-5h7a</link>
      <guid>https://dev.to/aliaryani-dev/first-steps-into-darkness-my-first-malware-analysis-experience-5h7a</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;First step into the dark realm is the hardest to take, it starts with pure blindness, but slowly gives you sight.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I spent one day on learning Assembly basics, and another on C basics, as I knew these two form this reality. Then it was time to begin this new not-ever-seen-before journey! I needed a map, so I chose &lt;a href="https://nostarch.com/malware" rel="noopener noreferrer"&gt;&lt;strong&gt;Practical Malware Analysis Book&lt;/strong&gt;&lt;/a&gt; as my guide.&lt;br&gt;
I read about 100 pages that day, I had to be ready. I also needed safety and security, so I chose &lt;a href="https://www.virtualbox.org/" rel="noopener noreferrer"&gt;Oracle VirtualBox&lt;/a&gt; to be the bridge between me and the dark realm. I personally use Linux, but for this purpose I had to use a Windows machine and I installed one on VirtualBox. &lt;br&gt;
Such trip also needs tools, So I chose these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Windows SysInternals&lt;/code&gt;: some of these might and will come in handy.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PE Bear&lt;/code&gt;: This one helps me see what's inside a malware, like a flashlight in darkness.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PEiD&lt;/code&gt;: Nice tool for understanding the locks that might show up on my way.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ResHacker&lt;/code&gt;: Shows the resources of the dark forces! Helps me see if there's any picture, binary, etc. inside a file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything seems ready so far, doesn't it? Let's begin the journey!&lt;/p&gt;
&lt;h2&gt;
  
  
  First Lab: Pure Confusion!
&lt;/h2&gt;

&lt;p&gt;As I started the first lab, I was so goddamn confused about it! I didn't know what to look for, or even where to look for things!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can access the labs &lt;a href="https://github.com/mikesiko/PracticalMalwareAnalysis-Labs" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Strings
&lt;/h3&gt;

&lt;p&gt;I opened &lt;code&gt;PowerShell&lt;/code&gt; inside the lab folder, and used &lt;code&gt;strings&lt;/code&gt; (which is a part of sysinternals) to extract any string found in the lab malware :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;\Lab01-01.exe&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result was a huge list of nonsense character combinations, except for some who actually made sense:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CloseHandle
UnmapViewOfFile
IsBadReadPtr
MapViewOfFile
CreateFileMappingA
CreateFileA
FindClose
FindNextFileA
FindFirstFileA
CopyFileA
KERNEL32.dll
malloc
exit
MSVCRT.dll
_exit
_XcptFilter
__p___initenv
__getmainargs
_initterm
__setusermatherr
_adjust_fdiv
__p__commode
__p__fmode
__set_app_type
_except_handler3
_controlfp
_stricmp
kerne132.dll
kernel32.dll
.exe
C:\*
C:\windows\system32\kerne132.dll
Kernel32.
Lab01-01.dll
C:\Windows\System32\Kernel32.dll
WARNING_THIS_WILL_DESTROY_YOUR_MACHINE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feeling confused? So did I! But I was not afraid of these, I started searching for some of them on the internet, mostly in &lt;a href="https://developer.microsoft.com/en-us/" rel="noopener noreferrer"&gt;Microsoft Developers Network&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is it packed?
&lt;/h3&gt;

&lt;p&gt;Then I checked the file using &lt;code&gt;PEiD&lt;/code&gt; to make sure it's not packed or anything, and it wasn't.&lt;br&gt;
So I immediately took the next step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources and Imports
&lt;/h3&gt;

&lt;p&gt;I used &lt;code&gt;ResHacker&lt;/code&gt;, only to see that it doesn't have any resources! So I used &lt;code&gt;PE Bear&lt;/code&gt; to analyse it a bit. I checked the dependencies and imports, and also headers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connecting the Dots
&lt;/h3&gt;

&lt;p&gt;I could understand that this malware does something, but I didn't know what. I looked more carefully, and I finally found something. There where to files mentioned in the &lt;code&gt;strings&lt;/code&gt; result: a) a &lt;code&gt;Kernel32.dll&lt;/code&gt; and b) a &lt;code&gt;Kerne132.dll&lt;/code&gt;, and the latter was spelled with a &lt;em&gt;one&lt;/em&gt; instead of an &lt;em&gt;l&lt;/em&gt;. Considering this and imports, I guessed that this malware tries to create a file with a name similar to a system file, and hides it somewhere. It could be a backdoor.&lt;br&gt;
There was also another file: &lt;code&gt;lab01-01.dll&lt;/code&gt;, most interesting parts of which were the imports. It was obvious that this file would create a process and add maybe add it to the system startup.&lt;br&gt;
&lt;strong&gt;It was definitely a backdoor-installing malware.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;This was just a beginning, there were and there are many other labs to try! I'll write about them soon...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create. Love. Improve.&lt;/strong&gt;&lt;br&gt;
--A. Aryani&lt;/p&gt;

</description>
      <category>malware</category>
      <category>analysis</category>
      <category>programming</category>
      <category>security</category>
    </item>
    <item>
      <title>Microsoft: An Open-Source Comedy</title>
      <dc:creator>Ali Aryani</dc:creator>
      <pubDate>Sat, 20 Sep 2025 08:17:59 +0000</pubDate>
      <link>https://dev.to/aliaryani-dev/microsoft-an-open-source-comedy-26m4</link>
      <guid>https://dev.to/aliaryani-dev/microsoft-an-open-source-comedy-26m4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;O' What may man within him hide, though angel on the outward side!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since the beginning of opensource ideology, Microsoft has been one of those companies that no one ever expected to join the cause.&lt;br&gt;
Weirdly enough, They did! By making &lt;strong&gt;PowerShell&lt;/strong&gt; opensource, and more important than that: by introducing &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Visual Studio Code&lt;/strong&gt;&lt;/a&gt; to the world of programming. Microsoft &lt;code&gt;vscode&lt;/code&gt; is one the fastest text editors out there and, thanks to its massive list of extensions, one of the best most-used IDEs in the world!&lt;br&gt;
Let's thanks Microsoft, eh? Not so fast! Read this article first, as it might (and will) change your mind.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Wolf in Sheep's Clothing
&lt;/h2&gt;

&lt;p&gt;One of the main ideas of opensource, is that &lt;strong&gt;when you can see the code, your can see if the program tries stealing your data&lt;/strong&gt;. You might not see any &lt;strong&gt;telemetry&lt;/strong&gt; code in &lt;a href="https://github.com/microsoft/vscode" rel="noopener noreferrer"&gt;vscode's source code&lt;/a&gt;, but Microsoft adds telemetry code to it before compiling it (&lt;a href="https://code.visualstudio.com/docs/configure/telemetry" rel="noopener noreferrer"&gt;as mentioned here&lt;/a&gt;). &lt;br&gt;
That's not a good thing, is it? So there came a community-driven version of vscode, called &lt;a href="https://vscodium.com" rel="noopener noreferrer"&gt;&lt;strong&gt;vscodium&lt;/strong&gt;&lt;/a&gt;. Vscodium is freely-licensed binary distribution of vscode that does not have the telemetry part &lt;em&gt;(and things like &lt;code&gt;copilot&lt;/code&gt;)&lt;/em&gt;.&lt;br&gt;
Many of us programmers moved to vscodium, and were living freely there, until recently, when Microsoft did some evil moves against us.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing C/C++? NO MORE!
&lt;/h2&gt;

&lt;p&gt;If you're a C/C++ programmer like me, then you're gonna need &lt;strong&gt;Microsoft C/C++ Extension&lt;/strong&gt; in order for vscode to debug and help you write your code.&lt;br&gt;
Since the &lt;em&gt;version 1.24.5, which was released April 3, 2025&lt;/em&gt;, this extension is blocked on non-Microsoft products, meaning it's no longer available/installable on vscodium (or any other fork of vscode). It's get more interesting if I tell you that people tried forking this extension (which is opensource) and removing the check, but they found out that this extensions consists of opensource TypeScript code, and &lt;strong&gt;a few proprietary closed-source files&lt;/strong&gt; (&lt;a href="https://github.com/VSCodium/vscodium/issues/2300" rel="noopener noreferrer"&gt;Read more here&lt;/a&gt;)!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 If you've faced this problem as I did, you can install and use &lt;a href="https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd" rel="noopener noreferrer"&gt;&lt;strong&gt;clangd&lt;/strong&gt;&lt;/a&gt; extension which is much faster and better than Microsoft C/C++ extension.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Access the Market? NEVER
&lt;/h2&gt;

&lt;p&gt;Microsoft vscode's &lt;em&gt;Marketplace&lt;/em&gt; is where you can find extensions, themes, etc. and basically it's what turns vscode from a simple text editor to a powerful IDE. A few weeks ago I noticed that marketplace has stopped working on vscodium, and as a result I can't install new extensions or update the ones I had already installed.&lt;br&gt;
I did some research, and I realised it's not a bug, it's a new evil move from Microsoft. Marketplace is no longer accessible from non-Microsoft products like vscodium! And that was it! I moved to &lt;a href="https://neovim.io" rel="noopener noreferrer"&gt;&lt;strong&gt;Neovim&lt;/strong&gt;&lt;/a&gt; forever.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 You can still install extensions on vscodium using &lt;a href="https://open-vsx.org" rel="noopener noreferrer"&gt;Open VSX Registry&lt;/a&gt;, which is an opensource project by &lt;a href="https://eclipse.org" rel="noopener noreferrer"&gt;Eclipse Foundation&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Final Words
&lt;/h2&gt;

&lt;p&gt;Honesty is invaluable. If you want to create an opensource project, fine, but be real; If you want to create a proprietary project, still fine, but be real.&lt;br&gt;
Open-Source is not a costume you wear when convenient, either wear it with honesty, or never wear it at all.&lt;br&gt;
We will make a brighter future together, never doubt that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create. Love. Improve.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A. Aryani&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>microsoft</category>
      <category>vscode</category>
      <category>vscodium</category>
    </item>
    <item>
      <title>Rust vs. C++ : An Unbiased Comparison</title>
      <dc:creator>Ali Aryani</dc:creator>
      <pubDate>Fri, 19 Sep 2025 12:05:28 +0000</pubDate>
      <link>https://dev.to/aliaryani-dev/rust-vs-c-an-unbiased-comparison-4jcg</link>
      <guid>https://dev.to/aliaryani-dev/rust-vs-c-an-unbiased-comparison-4jcg</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The old warrior stood, scarred but unbroken. The young challenger raised his sword, burning with ambition. Yet the elder’s eyes whispered a truth: strength forged over decades does not fall easily to youthful fire.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since the beginning of time (i.e. creation of &lt;strong&gt;C&lt;/strong&gt;), the world has introduced thousands of warriors to challenge, defeat, and replace C and his mighty son, &lt;strong&gt;C++&lt;/strong&gt;. Yet no one really succeeded, except for who did not win, but at least, survived. The name is &lt;strong&gt;Rust&lt;/strong&gt;, a language that tries to be safe by default, unlike &lt;strong&gt;C/C++&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Rustaceans &lt;em&gt;(I personally call them &lt;code&gt;rust-people&lt;/code&gt;)&lt;/em&gt;, have taken this fight so seriously that things are getting a bit out of control!&lt;br&gt;
But, regardless of all my love for C/C++ and the point that I'm not much of a Rust fan, I'm going to do an unbiased realistic comparison between the two greatest warriors of the lands of &lt;strong&gt;system-level programming&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's begin with an introduction of each.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a System-Level Programming Language is
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;system programming language&lt;/strong&gt; &lt;em&gt;(also called a low-level programming language)&lt;/em&gt; is, as the name suggests, a programming language used for system programming. I'm not going to explain it in detail here, just a brief introduction.&lt;br&gt;
A system programming language gives you the ability to speak directly to hardware, allocate and free the memory as you need, talk to your graphic card and ask it to render a game in full resolution for you. C, C++, and Rust are considered low-level programming languages.&lt;br&gt;
On the other side of the table, we have &lt;em&gt;high-level&lt;/em&gt; programming languages. While using these, you don't have to worry about memory as you do not have access to hardware anymore. These languages use tools like &lt;em&gt;garbage collectors (GC)&lt;/em&gt; to manage memory and prevent risks. Python, Ruby, etc. are examples for high-level languages.&lt;/p&gt;

&lt;p&gt;Enough of this, let's talk about the Titans.&lt;/p&gt;

&lt;h2&gt;
  
  
  C/C++: The Beginning of Time
&lt;/h2&gt;

&lt;p&gt;In 1970s, a successor to &lt;a href="https://en.wikipedia.org/wiki/B_(programming_language)" rel="noopener noreferrer"&gt;B programming language&lt;/a&gt; was created by &lt;a href="https://en.wikipedia.org/wiki/Dennis_Ritchie" rel="noopener noreferrer"&gt;Dennis Ritchie&lt;/a&gt;. This great successor was &lt;strong&gt;C programming language&lt;/strong&gt;, a low-level language  that is still widely used today for programming kernels, drivers, operating systems, other programming languages, and many more things. We can say that many programming languages we have today are, directly or indirectly, created by C.&lt;br&gt;
In 1985, &lt;a href="https://en.wikipedia.org/wiki/Bjarne_Stroustrup" rel="noopener noreferrer"&gt;Bjarne Stroustrup&lt;/a&gt; introduced &lt;strong&gt;C++&lt;/strong&gt; as an extension of C, adding &lt;a href="https://en.wikipedia.org/wiki/Object-oriented_programming" rel="noopener noreferrer"&gt;object-oriented (OOP)&lt;/a&gt; features to C. Unlike C (which is simple and has a few keywords), C++ is a very, very huge language with so many abilities and is getting bigger every year (beginners consider it a nightmare!). C++ is so powerful that you can do anything you want with it. let's take a little look at pros and cons.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pros
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;C/C++ are mature old languages, with thousands (if not millions) of libraries and frameworks.&lt;/li&gt;
&lt;li&gt;Amazing for designing GUI applications, thanks to &lt;a href="https://www.qt.io/" rel="noopener noreferrer"&gt;Qt&lt;/a&gt;, &lt;a href="https://github.com/ocornut/imgui" rel="noopener noreferrer"&gt;Dear ImGui&lt;/a&gt;, and many more.&lt;/li&gt;
&lt;li&gt;Strong and huge communities, solutions can be found easily.&lt;/li&gt;
&lt;li&gt;Lots of learning resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cons
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Most important: Not being &lt;strong&gt;memory safe&lt;/strong&gt; by default. Safety relies entirely on you.&lt;/li&gt;
&lt;li&gt;C++ has a steep learning curve due to  vastness.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's talk about Rust.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rust: The New Warrior on the Field
&lt;/h2&gt;

&lt;p&gt;In 2015, &lt;a href="https://en.wikipedia.org/wiki/Mozilla" rel="noopener noreferrer"&gt;Mozilla Foundation&lt;/a&gt; introduced &lt;strong&gt;Rust&lt;/strong&gt;, a programming language designed with performance and safety in mind. &lt;br&gt;
When it comes to memory, there are basically two points of view: a) relying entirely on the programmer and/or b) using a garbage collector. Rust offers a third view: &lt;a href="https://en.wikipedia.org/wiki/Rust_(programming_language)#Ownership_and_references" rel="noopener noreferrer"&gt;&lt;strong&gt;Ownership&lt;/strong&gt;&lt;/a&gt;. By the help of ownership system, your code is memory safe without relying on you or using a GC, and that's amazing! Let's analyse it in more detail:&lt;/p&gt;

&lt;h3&gt;
  
  
  Pros
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Rust implements best practices as it's default, so it's safe.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;An example I can give you for this, is that a good way of keeping your program safe in C++ is by using constants instead of variable, unless you need to change the value:&lt;/p&gt;


&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="c1"&gt;// instead of int number {12};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;But Rust is different. In Rust every variable is immutable by default, and if you need to change the value later, you must explicitly declare that using &lt;code&gt;mut&lt;/code&gt; keyword:&lt;/p&gt;


&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// immutable&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;number2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// mutable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Uses &lt;code&gt;cargo&lt;/code&gt; package manager, and makes it much easier to manage dependencies&lt;/li&gt;
&lt;li&gt;Thanks to the borrow-checker and ownership system, your code is almost always safe (I'll tell you how it can be unsafe in the next section)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cons
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Rust is still young, and therefore it doesn't have a huge community like C/C++ (though the community is growing bigger day by  day).&lt;/li&gt;
&lt;li&gt;Still not good for GUI applications due to the small community and lack of native libraries.&lt;/li&gt;
&lt;li&gt;Does not have as much libraries and frameworks as C/C++ have.&lt;/li&gt;
&lt;li&gt;Steep learning curve due to complications caused by ownership system and borrow-checker.&lt;/li&gt;
&lt;li&gt;Slower compile time due to compiler's borrow-checking and making sure of safety.&lt;/li&gt;
&lt;li&gt;Coding in Rust can take longer as you need to write more code due to ownership rules.&lt;/li&gt;
&lt;li&gt;By default, no direct access to hardware is given, but access can be achieved using &lt;code&gt;unsafe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Can become unsafe by the developer. See the next section.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Direct Hardware Access
&lt;/h2&gt;

&lt;p&gt;When it comes to low-level programming languages, direct hardware access is essential, otherwise low-level programming will be meaningless.&lt;br&gt;
C/C++ provide this access, but Rust doesn't. Rust does not trust you with memory and hardware as you might cause huge problems with such power!&lt;br&gt;
Still, Rust knows the need for hardware access, so it provides you with &lt;strong&gt;&lt;code&gt;unsafe&lt;/code&gt;&lt;/strong&gt;. In Rust, you can declare an unsafe code block in with you can access memory without any limits, this way your program has only one dangerous part which is only implemented if direct access is necessary &lt;em&gt;(most of the times it isn't)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So far you can see that Rust is much safer to use than C/C++, so why earlier on this article I said I don't like it? Let's find out!&lt;/p&gt;

&lt;h2&gt;
  
  
  The Rustacean War: A Rewrite Massacre
&lt;/h2&gt;

&lt;p&gt;Since the creation of Rust, the idea of moving from C/C++ to Rust for better safety has become popular and more people are doing so. An example is implementation of Rust code in Linux Kernel (which is entirely written in C).&lt;br&gt;
I don't believe this is a bad thing. Actually I sometimes support this idea as it tries to make the world of code safer. The biggest problem here is that some Rustaceans are so focused on proving that Rust is better than C/C++ that all they do is rewriting every already-existing safe-coded useful programs (regardless of the language their written in) with Rust! Projects like &lt;code&gt;sudo-rs&lt;/code&gt; as a replacement of the good old &lt;code&gt;sudo&lt;/code&gt; (that has been around for years and has never had a memory problem!) are a good example of this.&lt;br&gt;
Rust can be used for amazing projects, &lt;code&gt;kitty&lt;/code&gt; terminal, &lt;code&gt;mdbook&lt;/code&gt;, &lt;code&gt;zed&lt;/code&gt; IDE, etc. are examples of creative Rust code.&lt;/p&gt;

&lt;p&gt;This is why some people (I myself included) cannot accept Rust. Because programming is about creativity, not trying to prove others that your language is better.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Create, don't re-invent the wheel&lt;/strong&gt;!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Real Safety and Security
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Matters of safety and security, though seem alike, are quite different (I'll write about them in detail in another article). Language is a tool like a surgery knife, it can take your life or it can give it to you. The most important element, the key element of a safe and secure program is &lt;strong&gt;you, the programmer&lt;/strong&gt;.&lt;br&gt;
Rust tries to be safe by default, but you can turn it into a mess. C/C++ is unsafe by default, yet you can write it safe. If you want safety of your program, read and learn. Remember, &lt;strong&gt;you're all that matters, safety and security depend on you&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Final Words
&lt;/h2&gt;

&lt;p&gt;Code with the language you like, do not ever listen to others telling you that it's not a good language. If you master it, then it's a good language in your hands.&lt;br&gt;
Be creative, don't just rewrite other tools!&lt;br&gt;
And enjoy coding.&lt;/p&gt;

&lt;p&gt;Create. Love. Improve.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A. Aryani&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>rust</category>
      <category>cpp</category>
      <category>comparison</category>
    </item>
    <item>
      <title>Semicolon-First: A Psychotic Yet Interesting Way of Writing Code!</title>
      <dc:creator>Ali Aryani</dc:creator>
      <pubDate>Tue, 16 Sep 2025 13:52:41 +0000</pubDate>
      <link>https://dev.to/aliaryani-dev/semicolon-first-a-psychotic-yet-interesting-way-of-writing-code-52j8</link>
      <guid>https://dev.to/aliaryani-dev/semicolon-first-a-psychotic-yet-interesting-way-of-writing-code-52j8</guid>
      <description>&lt;h2&gt;
  
  
  How the Idea Came to Me
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;When I was 9, I was dreaming of a programming language in which every line starts with a semicolon. Weird huh? It gets more weird when you realise back then I did not know anything about programming languages!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Three years ago when I was learning a little bit of JavaScript, I read a note about &lt;code&gt;comma-first&lt;/code&gt; writing style. If you don't know what it is, look at the following example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;normal_way&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
   &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;item1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;item2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;item3&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# now let's write it with comma-first
&lt;/span&gt;&lt;span class="n"&gt;comma_first_way&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;item1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;item2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;item3&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you see in the example above, in comma-first, instead of ending a line with a comma, we start the next line with a comma!&lt;br&gt;
There's nothing wrong with this way of coding, it's your personal choice if you want to use comma-first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Anyways, What is &lt;em&gt;&lt;code&gt;semicolon-first&lt;/code&gt;&lt;/em&gt; and what does it have to do with what I've said so far?&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Semicolon-First
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;It's creative, it's lovely, it's a mess!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A month ago I thought to myself: "Let's put this childhood dream into practice, the compiler won't care!".&lt;br&gt;
Writing code in this new way seemed easy at first, but it was a bit tricky to implement.&lt;br&gt;
To start, look at the following C++ example, which is normal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"What's your name? =&amp;gt; "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"Hello "&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"!"&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&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;After trying different ways, I finally invented the &lt;em&gt;semicolon-first&lt;/em&gt; style:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;

&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
    &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"What's your name? =&amp;gt; "&lt;/span&gt;
    &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
    &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"Hello "&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"!"&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt;

    &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&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;except the first line of each block, every other line starts with a semicolon&lt;/li&gt;
&lt;li&gt;the last line starts and ends with a semicolon ( spaces should be there to keep the balance )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;__Question is, should I use it? Is it better than the traditional way? Is it the future? Let's see.&lt;/p&gt;

&lt;h2&gt;
  
  
  Semicolon-First Pros and Cons
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why is it good ?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;By using semicolon first you will never forget to put a semicolon at the end of a statement, because it comes first!&lt;/li&gt;
&lt;li&gt;Commenting in this style is somehow easier. You can break a statement into small chunks and write a comment about each one. look at the following example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;

&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; 
    &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"How old are you? "&lt;/span&gt; &lt;span class="c1"&gt;// just asking&lt;/span&gt;
       &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt; &lt;span class="c1"&gt;// adding new line character&lt;/span&gt;
    &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="c1"&gt;// get the age &lt;/span&gt;
    &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"So you're "&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="c1"&gt;// fore-telling the obvious!&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"Hmm..."&lt;/span&gt; &lt;span class="c1"&gt;// thinking&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"interesting!"&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt;
    &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&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;blockquote&gt;
&lt;p&gt;I shall mention that you can do this in the traditional way, too. So it's not a big deal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Why is it bad?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;World of programming does not like a rule breaker like this!&lt;/li&gt;
&lt;li&gt;There is a chance of getting roasted for using this style!&lt;/li&gt;
&lt;li&gt;Other programmers might see your code as confusing.&lt;/li&gt;
&lt;li&gt;Code formatting tools might change to the traditional way anyways!&lt;/li&gt;
&lt;li&gt;Others will have problems contributing in your projects&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Writing this way is a personal choice, no one can force you to do what you don't like. If you think this style is better, use it.&lt;br&gt;
I personally do not use this style anymore, since I can't risk my code being unclean. But if the world decides to use semicolon first, so will I!&lt;br&gt;
&lt;strong&gt;I will be happy to hear you comments and ideas on this.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create. Love. Improve.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A. Aryani&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>style</category>
    </item>
  </channel>
</rss>
