<?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: TwisterRL</title>
    <description>The latest articles on Forem by TwisterRL (@twisterrl).</description>
    <link>https://forem.com/twisterrl</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%2F3773249%2F4390e497-2b46-4e56-9110-e672c88ee65a.png</url>
      <title>Forem: TwisterRL</title>
      <link>https://forem.com/twisterrl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/twisterrl"/>
    <language>en</language>
    <item>
      <title>New Map Split Code in Nebula: Say Goodbye to Endless and Opaque C++ Builds</title>
      <dc:creator>TwisterRL</dc:creator>
      <pubDate>Wed, 01 Apr 2026 08:35:22 +0000</pubDate>
      <link>https://forem.com/twisterrl/new-map-split-code-in-nebula-say-goodbye-to-endless-and-opaque-c-builds-17hk</link>
      <guid>https://forem.com/twisterrl/new-map-split-code-in-nebula-say-goodbye-to-endless-and-opaque-c-builds-17hk</guid>
      <description>&lt;p&gt;&lt;strong&gt;Nebula dévoile son nouveau Code Map split : la visualisation intelligente des builds C++ enfin simplifiée&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Les développeurs C++ le savent trop bien : compiler un gros projet peut vite devenir un cauchemar. Entre les temps de compilation interminables, les headers qui polluent tout le codebase et les logs de build illisibles, optimiser un build relève souvent de l’archéologie logicielle.&lt;/p&gt;

&lt;p&gt;Bonne nouvelle : &lt;strong&gt;Nebula&lt;/strong&gt; vient de sortir une fonctionnalité qui change la donne.&lt;/p&gt;

&lt;h3&gt;
  
  
  Un Code Map en mode split, enfin adapté au C++
&lt;/h3&gt;

&lt;p&gt;La nouvelle feature, baptisée &lt;strong&gt;Code Map split&lt;/strong&gt;, divise l’interface en deux panneaux clairs :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Panneau de gauche&lt;/strong&gt; : tous vos fichiers d’en-tête (&lt;code&gt;.h&lt;/code&gt; et &lt;code&gt;.hpp&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Panneau de droite&lt;/strong&gt; : vos fichiers sources (&lt;code&gt;.cpp&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chaque fichier est automatiquement tagué pendant le build avec des informations précieuses :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Les &lt;strong&gt;warnings&lt;/strong&gt; et &lt;strong&gt;erreurs&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Le &lt;strong&gt;temps de compilation&lt;/strong&gt; réel par fichier&lt;/li&gt;
&lt;li&gt;Une représentation visuelle (couleurs) des performances&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Résultat ? Vous repérez &lt;strong&gt;en un seul coup d’œil&lt;/strong&gt; les goulots d’étranglement, les headers trop lourds qui ralentissent des dizaines de fichiers, et les sources qui méritent une optimisation urgente.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exemple concret avec libvterm
&lt;/h3&gt;

&lt;p&gt;Dans la capture partagée par l’équipe, on voit le projet &lt;strong&gt;libvterm&lt;/strong&gt; analysé. Le graphique de dépendances utilise un code couleur intuitif :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vert → compilation rapide&lt;/li&gt;
&lt;li&gt;Jaune → acceptable&lt;/li&gt;
&lt;li&gt;Rouge → très lent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Le fichier &lt;code&gt;harness.c&lt;/code&gt; apparaît clairement en rouge, immédiatement identifiable comme le principal coupable du ralentissement. Plus besoin de lancer des outils externes comme &lt;code&gt;ninja -t graph&lt;/code&gt;, &lt;code&gt;clang -ftime-trace&lt;/code&gt; ou de parser des centaines de lignes de logs : tout est visuel et intégré.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pourquoi cette fonctionnalité est-elle particulièrement puissante en C++ ?
&lt;/h3&gt;

&lt;p&gt;Le C++ souffre historiquement de deux grands problèmes de build :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;La dépendance massive aux en-têtes (header hell)&lt;/li&gt;
&lt;li&gt;La difficulté à mesurer précisément où passe le temps pendant la compilation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Le Code Map split de Nebula attaque ces deux points de front :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Il rend visibles les chaînes de dépendances entre headers et sources&lt;/li&gt;
&lt;li&gt;Il quantifie le coût réel de chaque fichier&lt;/li&gt;
&lt;li&gt;Il permet d’identifier instantanément les fichiers qui méritent un refactor (PImpl, forward declarations, modules C++20, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pour les équipes travaillant sur des engines de jeu, des simulateurs, des logiciels embarqués ou tout projet de taille importante, cette visualisation peut faire gagner des heures, voire des jours de travail par mois.&lt;/p&gt;

&lt;h3&gt;
  
  
  Un pas de plus vers des outils C++ modernes et agréables
&lt;/h3&gt;

&lt;p&gt;Cette feature s’inscrit dans la tendance actuelle : rendre le C++ moins douloureux sans en sacrifier la performance. Alors que des outils comme CMake, Meson ou Bazel améliorent déjà la gestion de build, Nebula va plus loin en apportant une couche de &lt;strong&gt;visualisation et d’analyse en temps réel&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Points forts observés :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Intégration native dans le workflow de build&lt;/li&gt;
&lt;li&gt;Diagnostic ultra-rapide des problèmes&lt;/li&gt;
&lt;li&gt;Interface claire et pensée pour les gros projets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bien sûr, l’efficacité réelle dépendra de la précision de l’analyse sur des configurations très complexes (unity builds, préprocesseurs custom, etc.), mais l’idée de base est excellente.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verdict
&lt;/h3&gt;

&lt;p&gt;C’est une des meilleures améliorations récentes que j’ai vues dans l’écosystème des outils C++. Simple, visuelle et directement utile au quotidien. Si vous passez beaucoup de temps à optimiser vos builds, Nebula mérite clairement un essai.&lt;/p&gt;

&lt;p&gt;N’hésitez pas à partager vos retours en commentaire !&lt;/p&gt;

</description>
      <category>code</category>
      <category>editor</category>
      <category>nebula</category>
    </item>
    <item>
      <title>5 C++ Tips Every Developer Should Know</title>
      <dc:creator>TwisterRL</dc:creator>
      <pubDate>Fri, 20 Feb 2026 08:25:03 +0000</pubDate>
      <link>https://forem.com/twisterrl/5-c-tips-every-developer-should-know-40m4</link>
      <guid>https://forem.com/twisterrl/5-c-tips-every-developer-should-know-40m4</guid>
      <description>&lt;p&gt;C++ remains one of the most powerful and widely used programming languages in systems programming, game development, finance, embedded systems, and high-performance applications. Its flexibility and performance come at a cost: complexity. Mastering C++ requires understanding not only syntax, but also memory management, object lifetimes, and modern language features.&lt;/p&gt;

&lt;p&gt;In this article, we will explore five essential C++ tips that can significantly improve your code quality, performance, and maintainability. Whether you are a beginner or an intermediate developer, these principles will help you write safer and more modern C++.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Prefer RAII Over Manual Resource Management
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What Is RAII?
&lt;/h3&gt;

&lt;p&gt;RAII stands for &lt;em&gt;Resource Acquisition Is Initialization&lt;/em&gt;. It is a core C++ idiom where resource management is tied to object lifetime.&lt;/p&gt;

&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Resources are acquired in a constructor.&lt;/li&gt;
&lt;li&gt;Resources are released in a destructor.&lt;/li&gt;
&lt;li&gt;When the object goes out of scope, cleanup happens automatically.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why It Matters
&lt;/h3&gt;

&lt;p&gt;Manual memory management using &lt;code&gt;new&lt;/code&gt; and &lt;code&gt;delete&lt;/code&gt; is error-prone. Forgetting to free memory leads to leaks. Freeing memory too early leads to undefined behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bad Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;process&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="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="c1"&gt;// ... some logic ...&lt;/span&gt;

    &lt;span class="k"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// What if we forget this?&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If an exception occurs before &lt;code&gt;delete[]&lt;/code&gt; is called, memory leaks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Better Approach: Use Smart Pointers
&lt;/h3&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;memory&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;unique_ptr&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_unique&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// ... logic ...&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="c1"&gt;// Memory automatically released here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or for shared ownership:&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="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;shared_ptr&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_shared&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Takeaway
&lt;/h3&gt;

&lt;p&gt;Avoid raw &lt;code&gt;new&lt;/code&gt; and &lt;code&gt;delete&lt;/code&gt;. Use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;std::unique_ptr&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;std::shared_ptr&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;std::vector&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;std::string&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These follow RAII and automatically manage memory.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Use &lt;code&gt;const&lt;/code&gt; Correctly and Aggressively
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why &lt;code&gt;const&lt;/code&gt; Is Powerful
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;const&lt;/code&gt; is not just about preventing modification. It communicates intent and allows the compiler to enforce correctness.&lt;/p&gt;

&lt;p&gt;Adding &lt;code&gt;const&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prevents accidental modification&lt;/li&gt;
&lt;li&gt;Improves readability&lt;/li&gt;
&lt;li&gt;Enables better compiler optimizations&lt;/li&gt;
&lt;li&gt;Helps avoid subtle bugs&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example: Const Member Functions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;public:&lt;/span&gt;
    &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&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="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;const&lt;/code&gt; at the end guarantees that &lt;code&gt;getName()&lt;/code&gt; does not modify the object.&lt;/p&gt;

&lt;h3&gt;
  
  
  Const References
&lt;/h3&gt;

&lt;p&gt;Instead of copying large objects:&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="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&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="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;endl&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;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No copy&lt;/li&gt;
&lt;li&gt;No modification&lt;/li&gt;
&lt;li&gt;Clear intent&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Const Pointers
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&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="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;      &lt;span class="c1"&gt;// pointer to const int&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;ptr2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;     &lt;span class="c1"&gt;// const pointer to int&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// const pointer to const int&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Understanding these distinctions helps avoid confusion in complex codebases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Takeaway
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;const&lt;/code&gt; wherever possible. Start with everything const, then remove it only when necessary.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Prefer &lt;code&gt;std::vector&lt;/code&gt; Over Raw Arrays
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why Avoid Raw Arrays?
&lt;/h3&gt;

&lt;p&gt;Raw arrays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do not track their size&lt;/li&gt;
&lt;li&gt;Decay into pointers&lt;/li&gt;
&lt;li&gt;Are unsafe in many contexts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&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="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once passed to a function:&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="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;print&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;arr&lt;/span&gt;&lt;span class="p"&gt;[])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// size information lost&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Better: &lt;code&gt;std::vector&lt;/code&gt;
&lt;/h3&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;vector&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Knows its size (&lt;code&gt;values.size()&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Automatically resizes&lt;/li&gt;
&lt;li&gt;Exception safe&lt;/li&gt;
&lt;li&gt;Integrates with STL algorithms&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example with Algorithms
&lt;/h3&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;algorithm&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;begin&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get powerful functionality with minimal effort.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance Consideration
&lt;/h3&gt;

&lt;p&gt;Some developers worry about performance. In practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;std::vector&lt;/code&gt; is extremely efficient.&lt;/li&gt;
&lt;li&gt;It uses contiguous memory.&lt;/li&gt;
&lt;li&gt;It is often identical to raw arrays in performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Key Takeaway
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;std::vector&lt;/code&gt; by default. Only use raw arrays in rare, low-level scenarios.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Understand Move Semantics
&lt;/h2&gt;

&lt;p&gt;Move semantics, introduced in C++11, are essential for writing efficient modern C++.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem: Expensive Copies
&lt;/h3&gt;

&lt;p&gt;Consider this class:&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="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Buffer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;public:&lt;/span&gt;
    &lt;span class="n"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

    &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="kt"&gt;size_t&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;data&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;Copying this object duplicates the memory allocation, which is expensive.&lt;/p&gt;

&lt;h3&gt;
  
  
  Move Constructor
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Buffer&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;noexcept&lt;/span&gt;
    &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&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;Instead of copying, we transfer ownership.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using &lt;code&gt;std::move&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Buffer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;buffers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Buffer&lt;/span&gt; &lt;span class="nf"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;buffers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;move&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;std::move&lt;/code&gt; converts &lt;code&gt;buf&lt;/code&gt; into an rvalue reference, enabling move semantics.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why It Matters
&lt;/h3&gt;

&lt;p&gt;Move semantics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid unnecessary copies&lt;/li&gt;
&lt;li&gt;Improve performance&lt;/li&gt;
&lt;li&gt;Are essential in container-heavy code&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Rule of Five
&lt;/h3&gt;

&lt;p&gt;If your class manages resources, you likely need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Destructor&lt;/li&gt;
&lt;li&gt;Copy constructor&lt;/li&gt;
&lt;li&gt;Copy assignment operator&lt;/li&gt;
&lt;li&gt;Move constructor&lt;/li&gt;
&lt;li&gt;Move assignment operator&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or better: follow RAII and use smart pointers to avoid implementing them manually.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Takeaway
&lt;/h3&gt;

&lt;p&gt;Understand move semantics deeply. They are critical for modern, efficient C++.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Leverage the Standard Library
&lt;/h2&gt;

&lt;p&gt;One of the biggest mistakes in C++ development is reinventing what the Standard Library already provides.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid Writing Custom Implementations
&lt;/h3&gt;

&lt;p&gt;Do not manually:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implement sorting algorithms&lt;/li&gt;
&lt;li&gt;Write custom linked lists&lt;/li&gt;
&lt;li&gt;Manage memory pools unnecessarily&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use:&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;algorithm&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;map&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;unordered_map&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;set&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;thread&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;chrono&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example: Algorithm Instead of Loop
&lt;/h3&gt;

&lt;p&gt;Instead of:&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="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;auto&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mi"&gt;2&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;You can use:&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="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;begin&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;begin&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;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&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;This expresses intent clearly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use &lt;code&gt;std::optional&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Instead of returning sentinel values:&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;optional&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;optional&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;findValue&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;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;nullopt&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;This makes failure states explicit and safer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use &lt;code&gt;std::filesystem&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Instead of platform-specific file handling:&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;filesystem&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;filesystem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"data.txt"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;filesystem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Takeaway
&lt;/h3&gt;

&lt;p&gt;The Standard Library is powerful and battle-tested. Learn it thoroughly. It will make your code cleaner, safer, and more expressive.&lt;/p&gt;




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

&lt;p&gt;C++ is not just about syntax; it is about understanding ownership, lifetime, and abstraction. By applying the following principles:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use RAII instead of manual memory management&lt;/li&gt;
&lt;li&gt;Apply &lt;code&gt;const&lt;/code&gt; consistently&lt;/li&gt;
&lt;li&gt;Prefer &lt;code&gt;std::vector&lt;/code&gt; over raw arrays&lt;/li&gt;
&lt;li&gt;Master move semantics&lt;/li&gt;
&lt;li&gt;Leverage the Standard Library&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You move from writing functional C++ to writing professional C++.&lt;/p&gt;

&lt;p&gt;Modern C++ (C++11 and beyond) provides powerful tools to reduce bugs and increase clarity. The key is not to use every feature, but to use the right features thoughtfully.&lt;/p&gt;

&lt;p&gt;Invest time in understanding these concepts deeply. They form the foundation of clean, efficient, and maintainable C++ code.&lt;/p&gt;

</description>
      <category>code</category>
      <category>cpp</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Subagents and web search in Claude Code</title>
      <dc:creator>TwisterRL</dc:creator>
      <pubDate>Tue, 17 Feb 2026 09:39:12 +0000</pubDate>
      <link>https://forem.com/twisterrl/subagents-and-web-search-in-claude-code-4ibk</link>
      <guid>https://forem.com/twisterrl/subagents-and-web-search-in-claude-code-4ibk</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/twisterrl" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3773249%2F4390e497-2b46-4e56-9110-e672c88ee65a.png" alt="twisterrl"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/twisterrl/subagents-and-web-search-in-claude-code-15il" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Subagents and web search in Claude Code&lt;/h2&gt;
      &lt;h3&gt;TwisterRL ・ Feb 17&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#pgaichallenge&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#code&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ai&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>pgaichallenge</category>
      <category>code</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>Subagents and web search in Claude Code</title>
      <dc:creator>TwisterRL</dc:creator>
      <pubDate>Tue, 17 Feb 2026 09:12:31 +0000</pubDate>
      <link>https://forem.com/twisterrl/subagents-and-web-search-in-claude-code-15il</link>
      <guid>https://forem.com/twisterrl/subagents-and-web-search-in-claude-code-15il</guid>
      <description>&lt;p&gt;Ollama now supports subagents and web search in Claude Code. No MCP servers or API keys required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;ollama launch claude --model minimax-m2.5:cloud&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Subagents
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5tp6rbofaaeofx7ed845.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5tp6rbofaaeofx7ed845.png" alt="Ollama Claude Code" width="800" height="592"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Subagents can run tasks in parallel, such as file search, code exploration, and research, each in their own context.&lt;/p&gt;

&lt;p&gt;Some models will naturally trigger subagents when needed (minimax-m2.5, glm-5, kimi-k2.5), but you can force triggering subagents by telling the model to “use/spawn/create subagents”&lt;/p&gt;

&lt;p&gt;Example prompts:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;gt; spawn subagents to explore the auth flow, payment integration, and notification system&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;gt; create subagents to map the database queries, trace the API routes, and catalog error handling patterns&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Web search
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3k7sy7xhk0kmbxaveof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3k7sy7xhk0kmbxaveof.png" alt="Ollama web search" width="800" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When a model needs current information, Ollama handles the search and returns results directly without any additional configuration. Subagents can leverage web search to research topics in parallel and come back with actionable results.&lt;/p&gt;

&lt;p&gt;Example prompts: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;gt; research the postgres 18 release notes, audit our queries for deprecated patterns, and create migration tasks&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;gt; create 3 research agents to research how our top 3 competitors price their API tiers, compare against our current pricing, and draft recommendations&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommended models
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;minimax-m2.5:cloud &lt;/li&gt;
&lt;li&gt;glm-5:cloud &lt;/li&gt;
&lt;li&gt;kimi-k2.5:cloud &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

</description>
      <category>pgaichallenge</category>
      <category>code</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>Most developers know == is dangerous.
But do you know why [] == false is actually true? 🤯
Let’s break it down.</title>
      <dc:creator>TwisterRL</dc:creator>
      <pubDate>Mon, 16 Feb 2026 10:21:16 +0000</pubDate>
      <link>https://forem.com/twisterrl/most-developers-know-is-dangerous-but-do-you-know-why-false-is-actually-true-lets-20dm</link>
      <guid>https://forem.com/twisterrl/most-developers-know-is-dangerous-but-do-you-know-why-false-is-actually-true-lets-20dm</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/twisterrl" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3773249%2F4390e497-2b46-4e56-9110-e672c88ee65a.png" alt="twisterrl"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/twisterrl/javascripts-weirdest-comparison-i29" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;JavaScript’s Weirdest Comparison&lt;/h2&gt;
      &lt;h3&gt;TwisterRL ・ Feb 16&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>JavaScript’s Weirdest Comparison</title>
      <dc:creator>TwisterRL</dc:creator>
      <pubDate>Mon, 16 Feb 2026 10:18:50 +0000</pubDate>
      <link>https://forem.com/twisterrl/javascripts-weirdest-comparison-i29</link>
      <guid>https://forem.com/twisterrl/javascripts-weirdest-comparison-i29</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;        &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;          &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait… what? 🤯&lt;/p&gt;

&lt;p&gt;How can an empty array be equal to &lt;code&gt;false&lt;/code&gt;?&lt;/p&gt;




&lt;h2&gt;
  
  
  Let’s break it down
&lt;/h2&gt;

&lt;p&gt;JavaScript’s &lt;code&gt;==&lt;/code&gt; operator performs &lt;strong&gt;type coercion&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That means it tries to convert values to the same type before comparing them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;false&lt;/code&gt; becomes &lt;code&gt;0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[]&lt;/code&gt; becomes &lt;code&gt;""&lt;/code&gt; (empty string)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;""&lt;/code&gt; becomes &lt;code&gt;0&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we end up with:&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="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;  &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 2
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First evaluate &lt;code&gt;![]&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;[]&lt;/code&gt; is truthy&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;![]&lt;/code&gt; becomes &lt;code&gt;false&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So now we have:&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="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which we already know is:&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="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;==&lt;/code&gt; operator can lead to unexpected results because of implicit type conversion.&lt;/p&gt;

&lt;p&gt;That’s why most developers prefer:&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="o"&gt;===&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It compares values &lt;strong&gt;without coercion&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;JavaScript doesn’t behave randomly.&lt;br&gt;
It follows rules — even strange ones.&lt;/p&gt;

&lt;p&gt;Understand coercion, and the weirdness disappears.&lt;/p&gt;

&lt;p&gt;Happy coding ✨&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Pourquoi j’ai arrêté d’utiliser VS Code pour mes projets C++</title>
      <dc:creator>TwisterRL</dc:creator>
      <pubDate>Mon, 16 Feb 2026 09:25:49 +0000</pubDate>
      <link>https://forem.com/twisterrl/pourquoi-jai-arrete-dutiliser-vs-code-pour-mes-projets-c-3467</link>
      <guid>https://forem.com/twisterrl/pourquoi-jai-arrete-dutiliser-vs-code-pour-mes-projets-c-3467</guid>
      <description>&lt;p&gt;En 2026, on ne manque clairement pas d’éditeurs de code.&lt;/p&gt;

&lt;p&gt;Entre &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;, &lt;a href="https://visualstudio.microsoft.com/fr/" rel="noopener noreferrer"&gt;Visual Studio&lt;/a&gt;, &lt;a href="https://www.jetbrains.com/clion/promo/?source=google&amp;amp;medium=cpc&amp;amp;campaign=EMEA_en_FR_Clion_Branded&amp;amp;term=clion&amp;amp;content=772650040709&amp;amp;gad_source=1&amp;amp;gad_campaignid=11960748368&amp;amp;gclid=CjwKCAiAncvMBhBEEiwA9GU_ft_iuz7YcBQ-56wyfSNNcQ1K8Abjks-QZiud_NMIIEfuRhS9DZ6J-xoCyhsQAvD_BwE" rel="noopener noreferrer"&gt;CLion &lt;/a&gt;et tous les autres, le problème n’est pas le choix.&lt;/p&gt;

&lt;p&gt;Alors pourquoi construire le mien ?&lt;/p&gt;

&lt;p&gt;La réponse est simple :&lt;br&gt;
je voulais comprendre ce qui se passe vraiment sous le capot.&lt;/p&gt;




&lt;h1&gt;
  
  
  Le moment où ça a basculé
&lt;/h1&gt;

&lt;p&gt;Pendant des années, j’ai utilisé des éditeurs puissants, modernes, remplis de fonctionnalités.&lt;/p&gt;

&lt;p&gt;Mais à force, j’ai commencé à remarquer des choses :&lt;/p&gt;

&lt;p&gt;Démarrage lent&lt;/p&gt;

&lt;p&gt;Consommation mémoire élevée&lt;/p&gt;

&lt;p&gt;Petits lags pendant le scroll&lt;/p&gt;

&lt;p&gt;Sensation d’utiliser un navigateur plus qu’un outil natif&lt;/p&gt;

&lt;p&gt;Ce n’est pas que ces outils sont mauvais.&lt;br&gt;
Ils sont impressionnants.&lt;/p&gt;

&lt;p&gt;Mais moi, je voulais autre chose.&lt;/p&gt;

&lt;p&gt;Je voulais un éditeur qui :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;démarre instantanément&lt;/li&gt;
&lt;li&gt;reste léger&lt;/li&gt;
&lt;li&gt;ne charge pas 200 modules au lancement&lt;/li&gt;
&lt;li&gt;soit pensé d’abord pour la performance&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Construire Nebula
&lt;/h1&gt;

&lt;p&gt;C’est comme ça qu’est né &lt;strong&gt;&lt;a href="//astracode.dev"&gt;Nebula&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzddzsj2a8ihxhij8ujoj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzddzsj2a8ihxhij8ujoj.png" alt="Nebula Interface" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Au début, c’était un simple prototype.&lt;br&gt;
Juste une fenêtre. Du texte. Un curseur.&lt;/p&gt;

&lt;p&gt;Puis les problèmes ont commencé.&lt;/p&gt;

&lt;p&gt;Un éditeur de texte paraît simple… jusqu’à ce que tu essaies d’en écrire un.&lt;/p&gt;

&lt;p&gt;Tu découvres que :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;rendre des milliers de glyphes rapidement, c’est compliqué&lt;/li&gt;
&lt;li&gt;mesurer du texte coûte cher&lt;/li&gt;
&lt;li&gt;le scroll peut casser ton framerate&lt;/li&gt;
&lt;li&gt;la coloration syntaxique peut tuer les performances&lt;/li&gt;
&lt;li&gt;Et là tu comprends quelque chose d’important :&lt;/li&gt;
&lt;li&gt;La performance n’est pas une optimisation.&lt;/li&gt;
&lt;li&gt;C’est une décision d’architecture.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Pourquoi rester minimaliste
&lt;/h1&gt;

&lt;p&gt;Je pourrais ajouter :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LSP complet&lt;/li&gt;
&lt;li&gt;debugger intégré&lt;/li&gt;
&lt;li&gt;terminal embarqué&lt;/li&gt;
&lt;li&gt;système d’extensions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mais plus tu ajoutes, plus tu complexifies.&lt;/p&gt;

&lt;p&gt;Et plus tu risques de perdre ce qui rend l’outil agréable.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Nebula est volontairement focalisé.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ouvrir un fichier.&lt;br&gt;
Éditer.&lt;br&gt;
Scroller sans lag.&lt;br&gt;
Rester fluide même avec de gros fichiers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C’est tout.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Le vrai objectif
&lt;/h1&gt;

&lt;p&gt;Au fond, Nebula n’est pas juste un éditeur.&lt;/p&gt;

&lt;p&gt;C’est un exercice de compréhension.&lt;/p&gt;

&lt;p&gt;Comprendre :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;le rendering&lt;/li&gt;
&lt;li&gt;les buffers de texte&lt;/li&gt;
&lt;li&gt;l’architecture UI&lt;/li&gt;
&lt;li&gt;la gestion mémoire&lt;/li&gt;
&lt;li&gt;la perception utilisateur&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Construire un éditeur, c’est comme construire un mini système d’exploitation spécialisé.&lt;/p&gt;

&lt;p&gt;Et c’est probablement l’un des meilleurs projets pour apprendre la performance réelle.&lt;/p&gt;

&lt;h1&gt;
  
  
  Et maintenant ?
&lt;/h1&gt;

&lt;p&gt;Nebula continue d’évoluer.&lt;/p&gt;

&lt;p&gt;Thèmes dynamiques.&lt;br&gt;
Drag &amp;amp; drop.&lt;br&gt;
Améliorations sur les gros fichiers.&lt;/p&gt;

&lt;p&gt;Mais l’objectif reste le même :&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Faire un éditeur léger qui donne l’impression d’être instantané.&lt;/strong&gt;&lt;br&gt;
Pas parce qu’il a moins de features.&lt;/p&gt;

&lt;p&gt;Mais parce qu’il est pensé différemment.&lt;/p&gt;

</description>
      <category>code</category>
      <category>cpp</category>
    </item>
    <item>
      <title>I have leave VS code for this code editor.</title>
      <dc:creator>TwisterRL</dc:creator>
      <pubDate>Sat, 14 Feb 2026 22:36:34 +0000</pubDate>
      <link>https://forem.com/twisterrl/i-have-leave-vs-code-for-this-code-editor-525p</link>
      <guid>https://forem.com/twisterrl/i-have-leave-vs-code-for-this-code-editor-525p</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/twisterrl" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3773249%2F4390e497-2b46-4e56-9110-e672c88ee65a.png" alt="twisterrl"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/twisterrl/nebula-building-a-fast-lightweight-c-code-editor-4kae" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Nebula: Building a Fast, Lightweight C++ Code Editor&lt;/h2&gt;
      &lt;h3&gt;TwisterRL ・ Feb 14&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#news&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#code&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cpp&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>programming</category>
      <category>news</category>
      <category>code</category>
      <category>cpp</category>
    </item>
    <item>
      <title>Nebula: Building a Fast, Lightweight C++ Code Editor</title>
      <dc:creator>TwisterRL</dc:creator>
      <pubDate>Sat, 14 Feb 2026 22:29:28 +0000</pubDate>
      <link>https://forem.com/twisterrl/nebula-building-a-fast-lightweight-c-code-editor-4kae</link>
      <guid>https://forem.com/twisterrl/nebula-building-a-fast-lightweight-c-code-editor-4kae</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus3ngetjgzkz2pdi5bny.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus3ngetjgzkz2pdi5bny.png" alt="Screenshot of the Nebula code editor showing first page" width="800" height="430"&gt;&lt;/a&gt;&lt;br&gt;
Most code editors today are impressive… but also huge.&lt;/p&gt;

&lt;p&gt;They ship with dozens of features, plugins, telemetry layers, web engines, background services, and sometimes feel closer to a browser than a native tool. That’s not necessarily bad — but I wanted something different.&lt;/p&gt;

&lt;p&gt;I wanted a code editor that feels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;instant&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;small&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;native&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;focused&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;and especially &lt;strong&gt;fast for C++ workflows&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why I started &lt;strong&gt;Nebula&lt;/strong&gt;, a lightweight C++ code editor with a strong focus on rendering performance, clean architecture, and a minimal but modern feature set.&lt;/p&gt;

&lt;p&gt;In this article, I’ll share what I built, what I learned, and what changed recently — including &lt;strong&gt;dynamic theme support&lt;/strong&gt; and &lt;strong&gt;drag &amp;amp; drop&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why build a new editor in 2026?
&lt;/h2&gt;

&lt;p&gt;This is the obvious question.&lt;/p&gt;

&lt;p&gt;The honest answer:&lt;br&gt;
I didn’t build Nebula because there aren’t enough editors. I built it because:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52zxfno4whk0mex9vx4n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52zxfno4whk0mex9vx4n.png" alt="Nebula Page d'acceuil" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1) I wanted full control over performance
&lt;/h3&gt;

&lt;p&gt;I wanted to measure and optimize everything: startup time, memory, UI redraw cost, text rendering speed.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) I wanted a native architecture
&lt;/h3&gt;

&lt;p&gt;No webview. No Electron. No huge runtime.&lt;/p&gt;

&lt;h3&gt;
  
  
  3) I wanted something &lt;em&gt;simple&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;A fast editor that does the core job well:&lt;br&gt;
open files, edit, search, syntax highlight, manage projects.&lt;/p&gt;




&lt;h2&gt;
  
  
  Goals and constraints
&lt;/h2&gt;

&lt;p&gt;Before writing any code, I defined a few hard constraints:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Small binary&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Low memory usage&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fast startup&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Smooth scrolling even with large files&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clean UI&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No plugin system (for now)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No dependency explosion&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a different mindset than “add features until it becomes a full IDE”.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture overview
&lt;/h2&gt;

&lt;p&gt;Nebula is built around a few main layers:&lt;/p&gt;

&lt;h3&gt;
  
  
  Core layers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;UI layer&lt;/strong&gt; (windows, panels, tabs, layout)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Editor layer&lt;/strong&gt; (text buffer, selection, cursor, undo/redo)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rendering layer&lt;/strong&gt; (glyph drawing, caching, clipping)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File &amp;amp; project layer&lt;/strong&gt; (open/save, tree, recent files)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Settings layer&lt;/strong&gt; (including the new dynamic theme system)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key idea:&lt;br&gt;
Nebula is not “a single editor widget”.&lt;/p&gt;

&lt;p&gt;It’s a set of small modules that communicate with simple data structures and events.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rendering: where everything matters
&lt;/h2&gt;

&lt;p&gt;Text editors look simple until you try to render them fast.&lt;/p&gt;

&lt;p&gt;Rendering is the heart of Nebula, and most performance lessons came from this part.&lt;/p&gt;

&lt;h3&gt;
  
  
  The main issues
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Rendering thousands of glyphs every frame is expensive&lt;/li&gt;
&lt;li&gt;Measuring text layout is expensive&lt;/li&gt;
&lt;li&gt;Scrolling causes constant redraw&lt;/li&gt;
&lt;li&gt;Syntax highlighting adds CPU cost&lt;/li&gt;
&lt;li&gt;UI animations and resizing can destroy frame stability&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The approach
&lt;/h3&gt;

&lt;p&gt;Nebula uses a rendering pipeline that tries to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;avoid re-measuring text constantly&lt;/li&gt;
&lt;li&gt;reuse cached glyph data when possible&lt;/li&gt;
&lt;li&gt;redraw only what’s needed&lt;/li&gt;
&lt;li&gt;keep the UI responsive under load&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is not “maximum features”.&lt;br&gt;
It’s &lt;strong&gt;maximum responsiveness&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The editor core: text buffer design
&lt;/h2&gt;

&lt;p&gt;The text buffer is another big piece.&lt;/p&gt;

&lt;p&gt;A naive implementation (like a big std::string with insert/delete) becomes slow quickly when editing large files.&lt;/p&gt;

&lt;p&gt;Nebula uses a buffer design that keeps operations like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;insert&lt;/li&gt;
&lt;li&gt;delete&lt;/li&gt;
&lt;li&gt;selection edits&lt;/li&gt;
&lt;li&gt;multi-line operations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;fast enough for real work.&lt;/p&gt;

&lt;p&gt;Even if you don’t notice it directly, the editor “feel” comes from that.&lt;/p&gt;




&lt;h2&gt;
  
  
  Syntax highlighting: keep it fast
&lt;/h2&gt;

&lt;p&gt;Syntax highlighting is one of the easiest ways to kill performance.&lt;/p&gt;

&lt;p&gt;The biggest mistake is re-highlighting the entire file on every keypress.&lt;/p&gt;

&lt;p&gt;Nebula does incremental updates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;highlight only impacted lines&lt;/li&gt;
&lt;li&gt;avoid expensive parsing on every edit&lt;/li&gt;
&lt;li&gt;cache results where possible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is:&lt;br&gt;
&lt;strong&gt;you should never feel the highlighter.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Recent update: Dynamic theme system
&lt;/h2&gt;

&lt;p&gt;This is one of the biggest recent improvements.&lt;/p&gt;

&lt;p&gt;Previously, the editor had a more static style configuration.&lt;/p&gt;

&lt;p&gt;Now Nebula supports &lt;strong&gt;dynamic themes&lt;/strong&gt;, meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;theme changes apply instantly&lt;/li&gt;
&lt;li&gt;UI + editor colors update live&lt;/li&gt;
&lt;li&gt;no restart required&lt;/li&gt;
&lt;li&gt;themes can be extended more easily&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why it matters
&lt;/h3&gt;

&lt;p&gt;A theme is not just “colors”.&lt;/p&gt;

&lt;p&gt;It impacts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;readability&lt;/li&gt;
&lt;li&gt;focus&lt;/li&gt;
&lt;li&gt;perceived quality&lt;/li&gt;
&lt;li&gt;and user comfort during long sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also:&lt;br&gt;
Users expect themes. Even minimal tools need this in 2026.&lt;/p&gt;




&lt;h2&gt;
  
  
  Recent update: Drag &amp;amp; Drop support 🖱️
&lt;/h2&gt;

&lt;p&gt;Nebula now supports &lt;strong&gt;drag &amp;amp; drop&lt;/strong&gt;, which seems simple, but required several design decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  What it enables
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;drag a file into the editor to open it&lt;/li&gt;
&lt;li&gt;drag multiple files&lt;/li&gt;
&lt;li&gt;drag folders (optional, depending on OS behavior)&lt;/li&gt;
&lt;li&gt;smoother workflow, especially for quick edits&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why it was harder than expected
&lt;/h3&gt;

&lt;p&gt;Drag &amp;amp; drop touches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OS events&lt;/li&gt;
&lt;li&gt;window focus&lt;/li&gt;
&lt;li&gt;file path validation&lt;/li&gt;
&lt;li&gt;tab management&lt;/li&gt;
&lt;li&gt;project behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This feature is a good example of something that looks small but affects many layers.&lt;/p&gt;




&lt;h2&gt;
  
  
  Lessons learned from building Nebula
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1) Performance is architecture
&lt;/h3&gt;

&lt;p&gt;If you “optimize later”, you often end up rewriting.&lt;/p&gt;

&lt;p&gt;A fast editor is fast because it was designed to be fast.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Every feature has a hidden cost
&lt;/h3&gt;

&lt;p&gt;Drag &amp;amp; drop is not just “open file”.&lt;br&gt;
Themes are not just “change colors”.&lt;/p&gt;

&lt;p&gt;Even small features create complexity in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;settings&lt;/li&gt;
&lt;li&gt;rendering&lt;/li&gt;
&lt;li&gt;event handling&lt;/li&gt;
&lt;li&gt;edge cases&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3) Smoothness is more important than raw speed
&lt;/h3&gt;

&lt;p&gt;Users don’t measure your milliseconds.&lt;/p&gt;

&lt;p&gt;They feel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stutter&lt;/li&gt;
&lt;li&gt;lag&lt;/li&gt;
&lt;li&gt;UI delays&lt;/li&gt;
&lt;li&gt;slow scrolling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main goal is consistency.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Nebula stays minimal (for now)
&lt;/h2&gt;

&lt;p&gt;I could add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;full LSP integration&lt;/li&gt;
&lt;li&gt;debugger&lt;/li&gt;
&lt;li&gt;extensions&lt;/li&gt;
&lt;li&gt;Git UI&lt;/li&gt;
&lt;li&gt;terminal&lt;/li&gt;
&lt;li&gt;build system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the more you add, the more you risk turning it into the thing you tried to avoid.&lt;/p&gt;

&lt;p&gt;Nebula is intentionally a focused tool:&lt;br&gt;
&lt;strong&gt;fast editing, clean UI, low overhead.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What’s next?
&lt;/h2&gt;

&lt;p&gt;Some ideas on my roadmap:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;improving large-file performance even more&lt;/li&gt;
&lt;li&gt;better project indexing&lt;/li&gt;
&lt;li&gt;smarter search&lt;/li&gt;
&lt;li&gt;more themes / theme import&lt;/li&gt;
&lt;li&gt;refining the UI layout system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the most important goal stays the same:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make a lightweight editor that feels instant.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Try Nebula
&lt;/h2&gt;

&lt;p&gt;Nebula is available here:&lt;br&gt;
&lt;strong&gt;&lt;a href="https://astracode.dev/" rel="noopener noreferrer"&gt;https://astracode.dev/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you try it and have feedback (bugs, UX, performance), I’m open to it — especially from people who care about native software and fast tools.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final thought
&lt;/h2&gt;

&lt;p&gt;Building a code editor is one of the best ways to learn about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;performance&lt;/li&gt;
&lt;li&gt;rendering&lt;/li&gt;
&lt;li&gt;UI architecture&lt;/li&gt;
&lt;li&gt;text systems&lt;/li&gt;
&lt;li&gt;and how small decisions scale into big problems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nebula started as a personal project.&lt;/p&gt;

&lt;p&gt;Now it’s becoming a real tool — and every update teaches me something new.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>news</category>
      <category>code</category>
      <category>cpp</category>
    </item>
  </channel>
</rss>
