<?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: ib-dev-cpp</title>
    <description>The latest articles on Forem by ib-dev-cpp (@ibdevcpp).</description>
    <link>https://forem.com/ibdevcpp</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%2F765118%2F5798e0a5-b7f3-4bd2-bbc2-e6eeb862d22f.png</url>
      <title>Forem: ib-dev-cpp</title>
      <link>https://forem.com/ibdevcpp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ibdevcpp"/>
    <language>en</language>
    <item>
      <title>From #cpp to #flutter: My Go-To #developertip for Sanity</title>
      <dc:creator>ib-dev-cpp</dc:creator>
      <pubDate>Sun, 06 Jul 2025 16:14:34 +0000</pubDate>
      <link>https://forem.com/ibdevcpp/from-cpp-to-flutter-my-go-to-developertip-for-sanity-482m</link>
      <guid>https://forem.com/ibdevcpp/from-cpp-to-flutter-my-go-to-developertip-for-sanity-482m</guid>
      <description>&lt;p&gt;Let's be real, a huge part of #coding is managing complexity. We juggle logic, state, and deadlines. But what if the language itself is adding to the weight?&lt;/p&gt;

&lt;h2&gt;
  
  
  The #cpp World: Raw Power, High Stakes
&lt;/h2&gt;

&lt;p&gt;I was recently deep in some #cpp code. It’s a beast—unbelievably powerful for performance-critical tasks. But it asks a lot from you.&lt;/p&gt;

&lt;p&gt;Remember this pattern?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// You are in complete control... for better or worse.
std::vector&amp;lt;int&amp;gt;* createNumbers() {
    auto* numbers = new std::vector&amp;lt;int&amp;gt;(); // Manual allocation
    numbers-&amp;gt;push_back(10);
    numbers-&amp;gt;push_back(20);
    return numbers;
}

// And you must remember to clean up your own mess.
// delete myNumbers;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code gives you fine-grained control, but it's a contract. You are responsible for every &lt;code&gt;new&lt;/code&gt; and &lt;code&gt;delete&lt;/code&gt;. One slip-up can lead to memory leaks and hours of debugging.&lt;/p&gt;

&lt;h2&gt;
  
  
  The #dart &amp;amp; #flutter World: Power with Guardrails
&lt;/h2&gt;

&lt;p&gt;Then, I switched contexts to a #flutter project. Flutter runs on #dart, and the difference in mental overhead was night and day.&lt;/p&gt;

&lt;p&gt;Here’s the same logic in Dart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Simple, clean, and safe.
List&amp;lt;int&amp;gt; createNumbers() {
  final numbers = [10, 20];
  return numbers;
}

// The garbage collector is your friendly neighborhood cleaner.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No pointers. No manual memory management. It’s built with safety features like a world-class garbage collector and sound null safety. This is the foundation that makes building beautiful, complex UIs in #flutter feel so productive.&lt;/p&gt;

&lt;h2&gt;
  
  
  My MAIN #developertip: Match Your Tool to Your Task
&lt;/h2&gt;

&lt;p&gt;This brings me to my number one tip for any developer working across different tech stacks:&lt;/p&gt;

&lt;p&gt;Actively choose your level of abstraction.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When you're writing #cpp, you're often choosing low-level control for maximum performance. You accept the cognitive load as part of the deal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you're writing #dart for a #flutter app, your goal is a fantastic user experience. Dart's design intentionally abstracts away low-level worries so you can focus on widgets, state management, and animations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't just see Dart's simplicity as "easier." See it as a strategic choice that frees up your brainpower for what truly matters in that context: the user.&lt;/p&gt;

&lt;p&gt;Great #programming isn't about always using the "most powerful" language. It's about picking the tool that makes you the most powerful for the task at hand.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>beginners</category>
      <category>programming</category>
      <category>flutter</category>
    </item>
    <item>
      <title>A NEW REGEX ENGINE IS HERE!</title>
      <dc:creator>ib-dev-cpp</dc:creator>
      <pubDate>Fri, 11 Nov 2022 21:49:51 +0000</pubDate>
      <link>https://forem.com/ibdevcpp/a-new-regex-engine-is-here-50ja</link>
      <guid>https://forem.com/ibdevcpp/a-new-regex-engine-is-here-50ja</guid>
      <description>&lt;p&gt;In the last week, I've been working on a new regex engine called &lt;a href="https://github.com/MBU-ModernBinaryUtility/MRegex-Engine" rel="noopener noreferrer"&gt;Mregex&lt;/a&gt;, a free and open regular expression engine and still under development.&lt;/p&gt;

&lt;p&gt;Enough talking let's explore its features.&lt;/p&gt;

&lt;p&gt;As any regex engine it supports the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sub-expressions:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;Mregex.h&amp;gt;

int main ( void ) {
    char regex [] = "(he), \0llo", str [] = "he, hello";
    short c = Regex ( regex, str, NULL, 0 );
    // Will return SUCCES
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the above code has defined two strings the regex string which &lt;br&gt;
   has one expression that will match "he" and then will match &lt;br&gt;
   ", " and then will match the first sub-expression again and &lt;br&gt;
   then will match the "llo".&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Anchors:
^: will match the beginning of the string or the beginning of the line in multi-Line mode ( more on that later).
$: will match the ending of the string or the ending of the line in multi-Line mode
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;Mregex.h&amp;gt;

int main ( void ) {
    char regex [] = "^ $", str [] = " ";
    short c = Regex ( regex, str, NULL, 0 );
    // Will return SUCCES
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Character class:&lt;br&gt;
[char-group]: Match any single character in the char-group. &lt;br&gt;
[start-end]: Char range: Match any character between the start and end in the ASCII Table.&lt;br&gt;
. : Match any single character in the ASCII table instead '\n' and NULL Byte&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Quantifier:&lt;br&gt;
*:  Match the previous element zero or more times&lt;br&gt;
+: Match the previous element one or more times&lt;br&gt;
?: Match the previous element zero or one time&lt;br&gt;
{min, max}: Match the previous element min times or more but no more than max&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Modes:&lt;br&gt;
NoCase: use it whit case insensitive&lt;br&gt;
NoWhit: ignore all the white spaces&lt;br&gt;
MultiLine: Use multiline mode, where ^ and $ match the beginning and end of each line (instead of the beginning and end of the input string)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Regex function
&lt;/h3&gt;

&lt;p&gt;The Regex function has 4 parameters &lt;br&gt;
 the first parameter is the regex string&lt;br&gt;
 the second parameter is the text string (the string to be matched)&lt;br&gt;
 the third parameter is not yet implemented&lt;br&gt;
 the fourth parameter is the modes where it can be ( 0 or NoCase | NoWhite)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Regex ( regex, str, NULL, MultiLine | NoWhite )&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IMPORTANT:
Whenever you use '.+' or '.*' make sure that the next character is a valid character or escaped character like '(' or 'v' but MAKE SURE IT'S NOT '('&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, what are you waiting for, go ahead and try it out.&lt;br&gt;
Found a bug Let us know at &lt;a href="mailto:modernbinaryutility@gmail.com"&gt;modernbinaryutility@gmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>regex</category>
      <category>cpp</category>
      <category>opensource</category>
      <category>github</category>
    </item>
    <item>
      <title>Platform detection in C&amp;C++</title>
      <dc:creator>ib-dev-cpp</dc:creator>
      <pubDate>Sat, 07 May 2022 15:29:03 +0000</pubDate>
      <link>https://forem.com/ibdevcpp/platform-detection-in-cc-2h6e</link>
      <guid>https://forem.com/ibdevcpp/platform-detection-in-cc-2h6e</guid>
      <description>&lt;p&gt;sometime when writing c or c++ code you need to write a code specific to the compiler/OS. and to this job the compiler have some predefined macros to detect the compiler or the OS.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Checking for OS:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;to check which platform the code is compiled use these predefined macros:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for Windows              :  _WIN32
for Windows 64 bit       :  _WIN64 ( _WIN32 included )
for Mac OS &amp;amp; IOS         :  __APPLE__
for Linux &amp;amp; Linux-derived:  __linux__
for Android              :  __ANDROID__ ( __linux__ included )
for Akaros               :  __ros__
for NaCL                 :  __native_client__
for AsmJS                :  __asmjs__
for Fuschia              :  __Fuchsia__
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Checking for Compiler:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;to check wich compiler used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Visual Studio       _MSC_VER
gcc                 __GNUC__
clang               __clang__
emscripten          __EMSCRIPTEN__ (for asm.js and webassembly)
MinGW 32            __MINGW32__
MinGW-w64 32bit     __MINGW32__
MinGW-w64 64bit     __MINGW64__
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>cpp</category>
      <category>c</category>
      <category>gcc</category>
      <category>clang</category>
    </item>
  </channel>
</rss>
