<?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: Owen Boreham</title>
    <description>The latest articles on DEV Community by Owen Boreham (@bobrossrtx).</description>
    <link>https://dev.to/bobrossrtx</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%2F614009%2F079d16a2-49a7-49c3-ab3b-dee661186a74.png</url>
      <title>DEV Community: Owen Boreham</title>
      <link>https://dev.to/bobrossrtx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bobrossrtx"/>
    <language>en</language>
    <item>
      <title>Demi: Building a Language From the Metal Up</title>
      <dc:creator>Owen Boreham</dc:creator>
      <pubDate>Thu, 14 Aug 2025 00:45:09 +0000</pubDate>
      <link>https://dev.to/bobrossrtx/demi-building-a-language-from-the-metal-up-5ahc</link>
      <guid>https://dev.to/bobrossrtx/demi-building-a-language-from-the-metal-up-5ahc</guid>
      <description>&lt;h1&gt;
  
  
  Demi: Building a Language From the Metal Up 🚀
&lt;/h1&gt;

&lt;p&gt;Demi isn’t just another language.&lt;br&gt;&lt;br&gt;
We’re building &lt;strong&gt;an entire programming ecosystem from scratch&lt;/strong&gt; — compiler, assembler, linker, interpreter, runtime — all &lt;strong&gt;custom&lt;/strong&gt;, with no LLVM, no GCC, no shortcuts.  &lt;/p&gt;

&lt;p&gt;Our vision is &lt;strong&gt;dual-mode execution&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interpretation&lt;/strong&gt; via our custom VM (&lt;em&gt;Virtcomp&lt;/em&gt;) for rapid prototyping, live code reloads, and experimental development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Native compilation&lt;/strong&gt; via our own backend and linker for blazing speed, reliability, and standalone distribution.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Key Features (Vision)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;🔧 Total Customization&lt;/strong&gt; – Demi gives programmers unprecedented control over how the language works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User-defined syntax rules&lt;/strong&gt; – Change keywords, punctuation, and grammar to match your style or project needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extensive behavioral controls&lt;/strong&gt; – Fine-tune type systems, scoping rules, evaluation order, and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom standard libraries&lt;/strong&gt; – Ship your own core API set, replacing or extending built-ins.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execution model tweaks&lt;/strong&gt; – Choose between strict, lazy, or mixed evaluation, control memory management strategies, and even define concurrency models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project-specific dialects&lt;/strong&gt; – Create language variants for different projects without touching the Demi core.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Project-Based Configuration
&lt;/h2&gt;

&lt;p&gt;Every Demi project has its own &lt;strong&gt;&lt;code&gt;.demi/&lt;/code&gt; config folder&lt;/strong&gt; that defines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Syntax and grammar customizations&lt;/li&gt;
&lt;li&gt;Language behavior tweaks&lt;/li&gt;
&lt;li&gt;Standard library overrides&lt;/li&gt;
&lt;li&gt;Build and execution preferences&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Configurations can be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hand-edited&lt;/strong&gt; following the official documentation for total control&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-generated&lt;/strong&gt; using an &lt;strong&gt;online configuration tool&lt;/strong&gt; that guides you through customizing your Demi environment visually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means &lt;strong&gt;every project can feel like its own language&lt;/strong&gt; — without forking or modifying Demi itself.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why this is Different
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Custom ISA&lt;/strong&gt; – Demi ISA (D-ISA) is our own low-level assembly language, portable across targets and designed to be human-readable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full toolchain in one binary&lt;/strong&gt; – &lt;code&gt;demi&lt;/code&gt; acts as compiler, assembler, interpreter, and linker:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;demi -I file.dem          # Interpret Demi source
demi -c file.dem -o file  # Compile to native executable
demi -A file.dasm -O lib  # Assemble Demi ISA to a library/object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Independent binary formats&lt;/strong&gt; – We’ll support ELF, PE, and Mach-O &lt;em&gt;natively&lt;/em&gt; — no system compilers required.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Future JIT&lt;/strong&gt; – Switch between interpreted and compiled code &lt;em&gt;at runtime&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Important Note – We’re at the Very Start
&lt;/h2&gt;

&lt;p&gt;Right now, Demi is in an &lt;strong&gt;extremely early stage&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We are actively developing the &lt;strong&gt;bytecode interpreter&lt;/strong&gt; and the core shell of Virtcomp.&lt;/li&gt;
&lt;li&gt;About &lt;strong&gt;95% of the features described above are not yet implemented&lt;/strong&gt; — they represent the long-term vision for Demi.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;contributor-friendly roadmap&lt;/strong&gt; will be released in due time to guide newcomers through how they can get involved at each development stage.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Contribute Now?
&lt;/h2&gt;

&lt;p&gt;You’ll be helping lay the foundation for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;from-scratch, self-contained language stack&lt;/strong&gt; (parser → compiler → ISA → machine code)&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;platform for language innovation&lt;/strong&gt; where syntax, runtime, and architecture are all under our control&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;long-term open-source project&lt;/strong&gt; with room for deep optimization, new CPU backends, and cross-platform systems programming challenges&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’re looking for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Systems programmers with interest in compilers, assemblers, and linkers&lt;/li&gt;
&lt;li&gt;Low-level hackers who love CPU architectures, binary formats, and calling conventions&lt;/li&gt;
&lt;li&gt;Language designers who want to push the boundaries of language customization&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Get Involved
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/bobrossrtx/demi" rel="noopener noreferrer"&gt;https://github.com/bobrossrtx/demi&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discord:&lt;/strong&gt; &lt;a href="https://discord.gg/vvhkhGkuGF" rel="noopener noreferrer"&gt;https://discord.gg/vvhkhGkuGF&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📢 &lt;strong&gt;Join us&lt;/strong&gt; — we’re not just making a language, we’re making its &lt;strong&gt;world&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>opensource</category>
      <category>compiling</category>
      <category>toolchain</category>
    </item>
    <item>
      <title>Demi &amp; Virtcomp</title>
      <dc:creator>Owen Boreham</dc:creator>
      <pubDate>Sat, 02 Aug 2025 01:44:58 +0000</pubDate>
      <link>https://dev.to/bobrossrtx/demi-virtcomp-2cb</link>
      <guid>https://dev.to/bobrossrtx/demi-virtcomp-2cb</guid>
      <description>&lt;p&gt;Hello, Dev Community! 👋&lt;/p&gt;

&lt;p&gt;I’m excited to introduce two interconnected projects: &lt;strong&gt;Demi&lt;/strong&gt;, a customizable programming language, and &lt;strong&gt;VirtComp&lt;/strong&gt;, a virtual compiler that powers Demi. Let me share the vision, current progress, and roadmap for these projects.&lt;/p&gt;




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

&lt;p&gt;Demi is a programming language designed to be &lt;strong&gt;fully customizable&lt;/strong&gt; by developers. Whether you're working on a niche project or building software with deep API integrations, Demi adapts to your needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Customizable Syntax&lt;/strong&gt;: Tailor the language’s syntax to suit your project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Robust API Integration&lt;/strong&gt;: Seamlessly connect with services and libraries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portable Compilation&lt;/strong&gt;: Create portable executables using VirtComp.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexible Development&lt;/strong&gt;: Demi molds itself to your workflow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Currently, Demi is an &lt;strong&gt;incomplete prototype&lt;/strong&gt; running as an interpreted language using &lt;strong&gt;Deno&lt;/strong&gt;. The final version will be a compiler written in &lt;strong&gt;C++&lt;/strong&gt;, integrated with VirtComp.&lt;/p&gt;




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

&lt;p&gt;VirtComp is a &lt;strong&gt;virtual compiler&lt;/strong&gt; written in C++ that emulates machine instructions for a custom 32-bit CPU architecture, enabling Demi to compile into portable executables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Custom CPU Architecture&lt;/strong&gt;: Optimized for portability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modular I/O System&lt;/strong&gt;: Supports console I/O, file access, and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visual Debugger&lt;/strong&gt;: Offers real-time debugging capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extensibility&lt;/strong&gt;: Developers can expand functionality by adding devices or instructions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;VirtComp ensures programs written in Demi are portable and deployable across systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;The Vision&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The goal is for Demi to evolve into a compiled language, powered by VirtComp. This transformation will result in an executable capable of compiling source code into portable machine code, fostering efficient and customizable software development.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Current Progress&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VirtComp&lt;/strong&gt;: Functional with modular I/O systems, a custom CPU architecture, and a visual debugger. Documentation and tests are available.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Demi&lt;/strong&gt;: Operational as an interpreted prototype. It includes examples, a REPL mode, and a VS Code extension for syntax highlighting. The final version will be rewritten in &lt;strong&gt;C++&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Roadmap&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Phase 1: &lt;strong&gt;Foundation (In Progress)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Develop VirtComp as a functional virtual compiler.&lt;/li&gt;
&lt;li&gt;Prototype Demi as an interpreted language using Deno.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update&lt;/strong&gt;: While initial functionality exists, implementation, features, and refinements are ongoing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Phase 2: &lt;strong&gt;Integration&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Integrate Demi with VirtComp to enable compilation.&lt;/li&gt;
&lt;li&gt;Expand documentation and examples.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Phase 3: &lt;strong&gt;Alpha Release (ETA: Q1 2026)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Release Demi as a compiled language.&lt;/li&gt;
&lt;li&gt;Provide tools for syntax customization, API integration, and system extensions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Phase 4: &lt;strong&gt;Community Development (Q2 2026)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Host hackathons and foster contributions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Phase 5: &lt;strong&gt;Stable Release (Q4 2026)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Launch stable versions of Demi and VirtComp.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;How to Get Involved&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Developers&lt;/strong&gt;: Contribute to the codebase and share ideas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sponsors&lt;/strong&gt;: Support the project to accelerate development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Users&lt;/strong&gt;: Explore the prototype and provide feedback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the repos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VirtComp: &lt;a href="https://github.com/bobrossrtx/virtcomp" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Demi-Lang: &lt;a href="https://github.com/bobrossrtx/demi-lang" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s create a future where programming languages adapt to their users. 🚀&lt;/p&gt;

&lt;p&gt;Join the discussion and connect with the community on Discord! &lt;a href="https://discord.gg/w9vxvfcrXp" rel="noopener noreferrer"&gt;https://discord.gg/w9vxvfcrXp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>virtualmachine</category>
      <category>programming</category>
      <category>startup</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>How to get started with .NET</title>
      <dc:creator>Owen Boreham</dc:creator>
      <pubDate>Mon, 17 Jan 2022 02:26:06 +0000</pubDate>
      <link>https://dev.to/bobrossrtx/how-to-get-started-with-net-50bh</link>
      <guid>https://dev.to/bobrossrtx/how-to-get-started-with-net-50bh</guid>
      <description>&lt;p&gt;I am very new to blogging, so I thought I would write a little bit about myself. I am a software developer, programming since October 2020.&lt;br&gt;
I have worked on a number of projects, ranging from small to large scale, and I have been working on a number of different languages.&lt;br&gt;
The reason I am writing this blog is to share my experiences with the .NET platform, and how you can get started with it too!&lt;/p&gt;

&lt;p&gt;I'm not a professional programmer, I just like to write code and learn new things. The approach I took to learning to code was average,&lt;br&gt;
I had been playing with HTML and CSS, then I moved to JavaScript, then I started playing with React. I have learned a lot of things since then,&lt;br&gt;
ranging from Low level programming in C to modern JavaScript, to the latest frameworks like React. I had always struggled to get started with .NET and&lt;br&gt;
C#. It had always felt like a daunting task, mainly because I had never worked with C# before, and the people I have seen using it were amazing.&lt;/p&gt;

&lt;p&gt;After I finally decided to learn C#, I was able to get started with it. I was able to write a simple program in Visual Studio, and I was able to&lt;br&gt;
get it to run. I felt a great sense of accomplishment, but also disappointment, I was thinking about how I could have done better, started earlier.&lt;br&gt;
It was no different to learning another language, like Python, JavaScript, or even C. Now I am going to take you through the process of getting started with&lt;br&gt;
.NET.&lt;/p&gt;
&lt;h1&gt;
  
  
  How to get started with .NET
&lt;/h1&gt;

&lt;p&gt;First of, we are going to start with something extremely simple. We are going to create a simple Console Application. There is just one small, but important&lt;br&gt;
step we must take before we can start writing code. Now unfortunately, if you use a Linux based system, you will need to install the .NET Core SDK, which can&lt;br&gt;
be tedious. You can download the SDK from the following link: &lt;a href="https://www.microsoft.com/net/core"&gt;https://www.microsoft.com/net/core&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On Windows or MacOS, you can install Visual Studio, which comes with the .NET Core SDK already installed. You can download Visual Studio from the following&lt;br&gt;
link: &lt;a href="https://visualstudio.microsoft.com/downloads"&gt;https://visualstudio.microsoft.com/downloads&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This article is directed at windows users, but you can also use Visual Studio on MacOS. If you are using Linux, you will need to use another IDE/Text Editor&lt;br&gt;
and the dotnet CLI. You can download the dotnet CLI from the following link: &lt;a href="https://dotnet.microsoft.com/download"&gt;https://dotnet.microsoft.com/download&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Creating a project
&lt;/h1&gt;

&lt;p&gt;In Visual Studio, you can create a new project by clicking new-&amp;gt;project. You can also create a new project by right clicking on the solution explorer, and&lt;br&gt;
then clicking new-&amp;gt;project. You will be prompted to select the type of project you want to create, pick the Console Application, and then you will be prompted&lt;br&gt;
to name the project, and choose the location where you want to save it. Once you have created the project, you will be able to start writing code.&lt;/p&gt;

&lt;p&gt;You should be greeted with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;BoilerPlateConsoleApp&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code you see above is called boilerplate code. This is code that is automatically generated by Visual Studio when you create a new project. You can&lt;br&gt;
run the project, and it will run the code you see above. The will then see "Hello World!" printed to the console. Good job! You have just created your&lt;br&gt;
first .NET project!&lt;/p&gt;
&lt;h1&gt;
  
  
  Writing Code
&lt;/h1&gt;

&lt;p&gt;I know what you are probably thinking, why haven't we written any code yet? Well, the answer is that we haven't needed to. First we need to decide what&lt;br&gt;
we want out code to do. I will show you how to write a small program that will print a list of films. This will include the title, the year, and the director.&lt;/p&gt;

&lt;p&gt;We will create a new class called Film, and then we will create a new method called &lt;code&gt;PrintFilmInfo&lt;/code&gt; which will print the title, year, and director of the film.&lt;br&gt;
We will also create a List of films, and then we will add a few films to the list.&lt;/p&gt;

&lt;p&gt;Lets get started with writing code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Collections.Generic&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;BoilerPlateConsoleApp&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Film&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Year&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Director&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;PrintFilmInfo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Title: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Year: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Year&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Director: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Director&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Film&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;films&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Film&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
            &lt;span class="n"&gt;films&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Film&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"The Shawshank Redemption"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Year&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1994&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Director&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Frank Darabont"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
            &lt;span class="n"&gt;films&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Film&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"The GodFather Part II"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Year&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1974&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Director&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Francis Ford Coppola"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
            &lt;span class="n"&gt;films&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Film&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"The Dark Night"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Year&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2008&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Director&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Christopher Nolan"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

            &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;film&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;films&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;film&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;PrintFilmInfo&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the complete code for the film list. You can run the code to see the output. Might I also mention that I have used the &lt;code&gt;foreach&lt;/code&gt; loop to print out&lt;br&gt;
the films. This is a very common loop in C#, and it is very easy to use. You can use it to loop through a list of items, and then print out the items.&lt;br&gt;
The &lt;code&gt;List&amp;lt;Film&amp;gt;&lt;/code&gt; is a data structure that is used to store a list of items. The &lt;code&gt;Film&lt;/code&gt; class is a class that we created to store information about a film.&lt;br&gt;
Inside of the &lt;code&gt;Film&lt;/code&gt; class, we have three properties, &lt;code&gt;Title&lt;/code&gt;, &lt;code&gt;Year&lt;/code&gt;, and &lt;code&gt;Director&lt;/code&gt;. Properties are like variables, and they are used to store information.&lt;/p&gt;

&lt;p&gt;I'm not going to go into nitty gritty details about what is going on here, as I expect you to be familiar with some of the concepts already. I really recommend&lt;br&gt;
reading up on the C# language, and reading the documentation, at &lt;a href="https://docs.microsoft.com/dotnet/csharp"&gt;https://docs.microsoft.com/dotnet/csharp&lt;/a&gt; to get a better understanding of what is going on here.&lt;/p&gt;

&lt;p&gt;I fully understand that dotnet can be a bit confusing at first, but I hope that this article will help you get started with .NET. I hope you enjoyed the article!&lt;/p&gt;

&lt;h1&gt;
  
  
  Contact
&lt;/h1&gt;

&lt;p&gt;If you have any questions, comments, or concerns, feel free to contact me at &lt;a href="https://www.owenboreham.tech/contact"&gt;https://www.owenboreham.tech/contact&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>JS - What are Closures</title>
      <dc:creator>Owen Boreham</dc:creator>
      <pubDate>Sat, 19 Jun 2021 14:24:23 +0000</pubDate>
      <link>https://dev.to/bobrossrtx/js-what-are-closures-3coe</link>
      <guid>https://dev.to/bobrossrtx/js-what-are-closures-3coe</guid>
      <description>&lt;h3&gt;
  
  
  About me:
&lt;/h3&gt;

&lt;p&gt;Hi there, my name is Owen Boreham, and most people call me by my username... "Bobrossrtx". At the time of posting this, I am a 15 year old teenager hoping to be a get into college for Computer Science. Anyway that is enough about me, lets talk about closures...&lt;/p&gt;

&lt;p&gt;
  summary
  &lt;p&gt;I will talk about what closures are and when they are used in this article. All credit of this knowledge comes from &lt;a href="https://www.youtube.com/channel/UCsBjURrPoezykLs9EqgamOA"&gt;Fireship&lt;/a&gt; and you can check out his website &lt;a href="https://fireship.io"&gt;here&lt;/a&gt;.&lt;/p&gt;



&lt;/p&gt;

&lt;h2&gt;
  
  
  Closures
&lt;/h2&gt;

&lt;p&gt;Closures are JavaScript functions access variables from the global scope, for example...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Lexical environment&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;myVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Function&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myVar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Captures the myVar variable&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to call a function in your code, the JS interpreter needs to know about the function itself and any other data from the surrounding environment that it depends on.&lt;/p&gt;

&lt;p&gt;Take for example a pure function that only depends on it's own arguments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// No external data&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;pureFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&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="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&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;What we have here is a fully self contained closed expression. When it is called, it gets pushed onto the call stack where it will be executed and its internal data (arguments) will be kept in memory until it is popped back off the call stack.&lt;/p&gt;

&lt;p&gt;But what if that function references data from outside of it's own scope like from the global environment or an outer function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Parent scope&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// free variable&lt;/span&gt;

&lt;span class="c1"&gt;// This is a Closure&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;impureFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Function scope&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Captures `b` variable&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This leaves us with an open expression that references other free variables from the environment. In order for the interpreter to call this function and also know the value of these free variables it creates a closure to store in the Heap, this is a place in memory that can be later accessed. Unlike the call stack where the it is short lived, the Heap can keep data indefinitely then decide to remove that data when it is no longer needed by using a garbage collector.&lt;/p&gt;

&lt;p&gt;So a closure is not just a function, it is a function combined with the outer state or lexical environment. Closures do require more memory and processing power than a pure function but you will come over many practical reasons why to use them.&lt;/p&gt;

&lt;p&gt;
  Socials
  &lt;p&gt;Twitter: &lt;a href="https://twitter.com/bobrossrtx"&gt;@bobrossrtx&lt;/a&gt;&lt;br&gt;
YouTube: &lt;a href="https://www.youtube.com/channel/UCrnwYvGzBiig4O5pj_8b7-Q"&gt;Owen Boreham&lt;/a&gt;&lt;br&gt;
Medium: &lt;a href="https://medium.com/@bobrossrtx"&gt;@bobrossrtx&lt;/a&gt;&lt;br&gt;
dev: &lt;a href="https://dev.to/bobrossrtx"&gt;bobrossrtx&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/bobrossrtx"&gt;@bobrossrtx&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;br&gt;
&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
