<?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: Sam Watkins</title>
    <description>The latest articles on Forem by Sam Watkins (@sswam).</description>
    <link>https://forem.com/sswam</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%2F247261%2Fbd7dda89-98eb-427c-b17b-7e096fee78c4.jpg</url>
      <title>Forem: Sam Watkins</title>
      <link>https://forem.com/sswam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sswam"/>
    <language>en</language>
    <item>
      <title>Why Write a Dev Log?</title>
      <dc:creator>Sam Watkins</dc:creator>
      <pubDate>Thu, 21 Apr 2022 21:18:52 +0000</pubDate>
      <link>https://forem.com/gamedev/why-write-a-dev-log-27nh</link>
      <guid>https://forem.com/gamedev/why-write-a-dev-log-27nh</guid>
      <description>&lt;p&gt;I have rarely ever kept a diary, although I know that it would be good for me. So why don't I do it? I guess I am not keen to write something each day, just for myself, if no one else is going to read it.&lt;/p&gt;

&lt;p&gt;I also know that when I am working on a project, or learning something new, it would be a good idea to write and publish a dev log from the very beginning.&lt;/p&gt;

&lt;p&gt;I realized this while reading about the video game &lt;a href="https://www.pentadact.com/2013-10-15-gunpoint-development-breakdown/"&gt;Gunpoint&lt;/a&gt;. To my mind, Gunpoint was successful largely because the developer &lt;a href="https://www.pentadact.com/category/making-games/gunpoint/?orderby=date&amp;amp;order=ASC"&gt;blogged about it&lt;/a&gt; starting very early on. He grew a community around the blog, and received feedback every step of the way. Many people contributed and helped him to improve his game, and I guess that most of his fans bought a copy when the game was finished!&lt;/p&gt;

&lt;p&gt;It seems to me that blogging from the beginning is the single biggest factor, that can help a project such as an indie game to be successful. Even if the game turns out to be a flop, the blog itself might have value. Even so, I have not been able to write a substantial regular blog by myself. I have tried before, but I didn't keep it up.&lt;/p&gt;

&lt;p&gt;This time is different.&lt;/p&gt;

&lt;p&gt;My kids want to make a computer game, which sounds good to me; and I want them to learn some programming. Based on my own experience, creative programming is fun, it's good for the brains, and it can help children to learn and apply many topics in mathematics, well before they are covered at school. So I am teaching my kids how to program, we are learning to make games, and we are blogging about it as we go along.&lt;/p&gt;

&lt;p&gt;I think that blogging can help us in many ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When we explain something to others, it helps us to learn.&lt;/li&gt;
&lt;li&gt;We do better work when we are going to show it to people.&lt;/li&gt;
&lt;li&gt;As we practise writing, we are learning to think clearly.&lt;/li&gt;
&lt;li&gt;Writing is a very useful skill to develop in itself.&lt;/li&gt;
&lt;li&gt;When we forget something, we can go back and revise it.&lt;/li&gt;
&lt;li&gt;Other people may enjoy reading our posts.&lt;/li&gt;
&lt;li&gt;Other people might learn something from reading our posts.&lt;/li&gt;
&lt;li&gt;Other people can comment and might teach us something.&lt;/li&gt;
&lt;li&gt;Feedback from our readers can guide us in a good direction.&lt;/li&gt;
&lt;li&gt;Some people might join in and help us with the project.&lt;/li&gt;
&lt;li&gt;We can make friends, and maybe build a little community.&lt;/li&gt;
&lt;li&gt;One day we might turn our blog posts into a book.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do you agree that it is useful to write a dev log?&lt;/p&gt;

&lt;p&gt;Please leave a comment and share your thoughts.&lt;/p&gt;

&lt;p&gt;Next post: Coming soon...&lt;br&gt;
Previous post: &lt;a href="https://dev.to/gamedev/making-a-christmas-tree-59l3"&gt;Making a Christmas Tree&lt;/a&gt;, by Sean&lt;br&gt;
Contents: &lt;a href="https://dev.to/gamedev/game-dev-from-scratch-2do1"&gt;Game Dev From Scratch&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>meta</category>
      <category>writing</category>
    </item>
    <item>
      <title>Game Dev From Scratch</title>
      <dc:creator>Sam Watkins</dc:creator>
      <pubDate>Fri, 15 Apr 2022 16:07:15 +0000</pubDate>
      <link>https://forem.com/gamedev/game-dev-from-scratch-2do1</link>
      <guid>https://forem.com/gamedev/game-dev-from-scratch-2do1</guid>
      <description>&lt;p&gt;G'day, welcome to our blog!&lt;/p&gt;

&lt;p&gt;We are Sam, Sean and Thalia, from Melbourne, Australia. We are learning about programming and game development, and writing about it here in this blog.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://dev.to/gamedev/creating-games-4dpj"&gt;Creating Games&lt;/a&gt;, by Sean&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/gamedev/deciding-on-a-programming-language-13ba"&gt;Deciding on a Programming Language for Game Dev&lt;/a&gt;, by Sam&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/gamedev/my-simple-programs-3g97"&gt;My Simple Programs&lt;/a&gt;, by Thalia&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/gamedev/loops-and-math-in-c-582i"&gt;Loops and Math in C&lt;/a&gt;, by Sean&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/gamedev/basic-programming-in-c-243b"&gt;Basic Programming in C&lt;/a&gt;, by Sam&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/gamedev/kisskit-simplifying-game-dev-in-c-3hjd"&gt;kisskit: Simplifying Game Dev in C&lt;/a&gt;, by Sam&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/gamedev/creating-drawings-229e"&gt;Creating Drawings&lt;/a&gt;, by Thalia&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/gamedev/making-a-christmas-tree-59l3"&gt;Making a Christmas Tree&lt;/a&gt;, by Sean&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/gamedev/why-write-a-dev-log-27nh"&gt;Why Write a Dev Log?&lt;/a&gt;, by Sam&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Other links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;our project home page, &lt;a href="https://game.ucm.dev"&gt;game.ucm.dev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;our &lt;a href="https://github.com/gamedevfromscratch"&gt;open source code&lt;/a&gt; on github &lt;/li&gt;
&lt;li&gt;our Facebook group, &lt;a href="https://www.facebook.com/groups/robotgames"&gt;Robots and Games&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;our &lt;a href="https://www.youtube.com/channel/UC2NYuHZIHapsqY_9HnhZ7Qw"&gt;YouTube channel&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>gamedev</category>
      <category>c</category>
      <category>programming</category>
      <category>kids</category>
    </item>
    <item>
      <title>Basic Programming in C</title>
      <dc:creator>Sam Watkins</dc:creator>
      <pubDate>Tue, 12 Apr 2022 19:52:38 +0000</pubDate>
      <link>https://forem.com/gamedev/basic-programming-in-c-243b</link>
      <guid>https://forem.com/gamedev/basic-programming-in-c-243b</guid>
      <description>&lt;p&gt;I am teaching my kids Sean and Thalia how to program in C, so that we can create video games together. They are learning to use some of the same tools that I use myself, namely Debian GNU/Linux, xterm, bash, vim, cc, make, and git.&lt;/p&gt;

&lt;p&gt;Here's a summary of what we did to get started, and some of the things we've learned so far.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;We created &lt;a href="https://github.com/gamedevfromscratch"&gt;a page on github&lt;/a&gt;, so we can share our code.&lt;/li&gt;
&lt;li&gt;We created &lt;a href="https://dev.to/gamedev"&gt;a page on dev.to&lt;/a&gt;, so we can write blog posts in the same place. We think it's a good idea to write about what we are doing, and hopefully some people will follow our progress.&lt;/li&gt;
&lt;li&gt;I installed some libraries we will need on our computers:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install libsdl2-dev libsdl2-gfx-dev libsdl2-ttf-dev \
    libsdl2-image-dev libsdl2-mixer-dev libglew-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For each of my kids, I did the following setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Created a github account.&lt;/li&gt;
&lt;li&gt;Added to our github organization.&lt;/li&gt;
&lt;li&gt;Created an RSA ssh key with &lt;code&gt;ssh-keygen&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Copied the ssh private and public keys to our other PC.&lt;/li&gt;
&lt;li&gt;Added the ssh public key to the github account. This enables us to push changes to github.&lt;/li&gt;
&lt;li&gt;Created a dev.to account using github to log in.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each of my kids, on each of our two main PCs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Created a user account.&lt;/li&gt;
&lt;li&gt;Logged into Chrome sync.&lt;/li&gt;
&lt;li&gt;Logged into github and dev.to.&lt;/li&gt;
&lt;li&gt;Disabled programmable completion in &lt;code&gt;~/.bashrc&lt;/code&gt;. I find it annoying when bash won't complete filenames because it's trying to do something clever.&lt;/li&gt;
&lt;li&gt;Cloned our two git repositories:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone git@github.com:gamedevfromscratch/gamedev.git
git clone git@github.com:gamedevfromscratch/kisskit.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Basic shell commands
&lt;/h2&gt;

&lt;p&gt;We learned a few basic shell commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ls&lt;/code&gt; lists files in the current directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd foo&lt;/code&gt; "changes directory" to &lt;code&gt;foo&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd&lt;/code&gt; by itself goes back to the home directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tree&lt;/code&gt; shows a tree of files and directories.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;vi file.c&lt;/code&gt; opens &lt;code&gt;file.c&lt;/code&gt; in the vim editor (see below).&lt;/li&gt;
&lt;li&gt;We can stop a job, such as vim, with ctrl-Z.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fg&lt;/code&gt; stands for "foreground", it continues the stopped job.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can use the up and down arrows to look at previous commands, change them if needed, and run them again.&lt;/p&gt;

&lt;p&gt;We can also use ctrl-R for a reverse search through the command history, and ctrl-S to search forwards again... but read &lt;a href="https://unix.stackexchange.com/questions/73498/how-to-cycle-through-reverse-i-search-in-bash"&gt;how to fix ctrl-S&lt;/a&gt; first!&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic editing in vim
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Vim has several editing modes. It starts in "normal mode".&lt;/li&gt;
&lt;li&gt;Before typing a program, press &lt;code&gt;i&lt;/code&gt; to enter "insert mode".&lt;/li&gt;
&lt;li&gt;To save changes, go back to "normal mode" by pressing Esc, then type &lt;code&gt;:w&lt;/code&gt; for write, and press enter.&lt;/li&gt;
&lt;li&gt;Enter &lt;code&gt;:q&lt;/code&gt; to quit the editor, or &lt;code&gt;:q!&lt;/code&gt; to exit without saving changes.&lt;/li&gt;
&lt;li&gt;When we press &lt;code&gt;:&lt;/code&gt; to enter a command like &lt;code&gt;:w&lt;/code&gt;, vim goes into "command mode".&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Copy-paste in vim
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;We can select lines using the mouse to select text. Triple-click then drag to select whole lines. Or we can press &lt;code&gt;v&lt;/code&gt; for "visual mode" or capital &lt;code&gt;V&lt;/code&gt; for "visual line mode", and select lines with the arrow keys.&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;y&lt;/code&gt; to "yank" or copy the selected lines.&lt;/li&gt;
&lt;li&gt;You can also press &lt;code&gt;d&lt;/code&gt; to "delete" or cut the selected lines.&lt;/li&gt;
&lt;li&gt;Move to above where you want to paste the lines, using the mouse or arrow keys.&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;p&lt;/code&gt; to paste the copied lines below.&lt;/li&gt;
&lt;li&gt;When we need to move to a different point in the file, it is generally better to use the mouse, not the arrow keys.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Compiling and running a C program
&lt;/h2&gt;

&lt;p&gt;My daughter described some of the first simple programs she wrote in her post, &lt;a href="https://dev.to/gamedev/my-simple-programs-3g97"&gt;My Simple Programs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After we have entered a program, and saved it by pressing Esc then &lt;code&gt;:w&lt;/code&gt;, we need to stop the editor and go back to the shell, with ctrl-Z.&lt;/p&gt;

&lt;p&gt;Then we compile the program. The simplest command to do this is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cc -o hello hello.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates an executable called &lt;code&gt;hello&lt;/code&gt; from the source code file &lt;code&gt;hello.c&lt;/code&gt;. If we omit the &lt;code&gt;-o hello&lt;/code&gt;, and just type &lt;code&gt;cc hello.c&lt;/code&gt;, the compiler will name the executable &lt;code&gt;a.out&lt;/code&gt;, which is not very useful.&lt;/p&gt;

&lt;p&gt;The compiler will tell us if there are any errors.&lt;/p&gt;

&lt;p&gt;If it compiles successfully, we can run our hello program like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need to write &lt;code&gt;./hello&lt;/code&gt; not just &lt;code&gt;hello&lt;/code&gt;, because for safety reasons the shell does not normally look for programs to run in the current directory; who knows what sort of dangerous programs might be lurking around, pretending to be &lt;code&gt;ls&lt;/code&gt; or &lt;code&gt;vi&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;The compiler will give us better warnings about things that might be wrong with our program, if we run it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cc -o hello -Wall hello.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-Wall&lt;/code&gt; stands for "warnings: all".&lt;/p&gt;

&lt;p&gt;After testing our program, we can go back to the stopped editor by entering &lt;code&gt;fg&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Sometimes we need to "link" with other C libraries. For example, if our program wants to use the &lt;code&gt;sqrt&lt;/code&gt; function to calculate a square root, we need to link with the math library. The option for this is &lt;code&gt;-lm&lt;/code&gt;. This is the full command to compile a program call &lt;code&gt;math.c&lt;/code&gt; and link with the math library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cc -o math -Wall math.c -lm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the compiler is a bit difficult, so I wrote a wrapper script called &lt;code&gt;ccw&lt;/code&gt; for "C compiler with warnings". This runs the compiler with all the options and libraries we might need. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ccw hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also use a program called &lt;code&gt;make&lt;/code&gt; to run the compiler, taking options and commands from a &lt;code&gt;Makefile&lt;/code&gt;. We'll look at how to do this in another post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo program
&lt;/h2&gt;

&lt;p&gt;Before getting my kids to write their own programs, I wrote a quick &lt;a href="https://github.com/gamedevfromscratch/gamedev/blob/main/sam/01_demo.c"&gt;demo program&lt;/a&gt; to show them some basic stuff in C:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;basic "Hello, world"&lt;/li&gt;
&lt;li&gt;string variables, say hello with the person's name&lt;/li&gt;
&lt;li&gt;int variable, math multiplying&lt;/li&gt;
&lt;li&gt;for loop, print several times&lt;/li&gt;
&lt;li&gt;if, print different messages odd and even&lt;/li&gt;
&lt;li&gt;modulo operator &lt;code&gt;%&lt;/code&gt; for the remainder after division&lt;/li&gt;
&lt;li&gt;subroutines: rep, nl&lt;/li&gt;
&lt;li&gt;function: pythagores&lt;/li&gt;
&lt;li&gt;What's the difference between subroutine and a function?&lt;/li&gt;
&lt;li&gt;the kids wrote a subroutine: praise&lt;/li&gt;
&lt;li&gt;REPEAT macro, for a simpler loop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the demo program we wrote. It's a bit of a mess, but shows several features of the language:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;time.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;math.h&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;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;c&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;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&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;i&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="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;putchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;nl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;putchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sc"&gt;'\n'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="nf"&gt;pythagores&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;y&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;sqrt&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;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cp"&gt;#define REPEAT(n) for (int i=0; i&amp;lt;10; i++)
&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;praise&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;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&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;for&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;i&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="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s is the best.  "&lt;/span&gt;&lt;span class="p"&gt;,&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="n"&gt;nl&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;nl&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="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;name1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Thalia"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;name2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Sean"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;srandom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;NULL&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;11&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="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;11&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="n"&gt;praise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Nika"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;praise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Sam"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;praise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Sean"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;praise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Thalia"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;nl&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;nl&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;for&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;i&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="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&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="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello %s %d*%d=%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;
            &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello %s %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;nl&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;nl&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;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&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;i&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="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&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;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sc"&gt;' '&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="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sc"&gt;'*'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;nl&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;for&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;i&lt;/span&gt;&lt;span class="o"&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;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&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="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sc"&gt;' '&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="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;rep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sc"&gt;'*'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;nl&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;nl&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;nl&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"pythagores(30, 40) = %f&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pythagores&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next post: &lt;a href="https://dev.to/gamedev/kisskit-simplifying-game-dev-in-c-3hjd"&gt;kisskit: Simplifying Game Dev in C&lt;/a&gt;, by Sam&lt;br&gt;
Previous post: &lt;a href="https://dev.to/gamedev/loops-and-math-in-c-582i"&gt;Loops and Math in C&lt;/a&gt;, by Sean&lt;br&gt;
Contents: &lt;a href="https://dev.to/gamedev/game-dev-from-scratch-2do1"&gt;Game Dev From Scratch&lt;/a&gt;&lt;/p&gt;

</description>
      <category>c</category>
      <category>git</category>
      <category>bash</category>
      <category>vim</category>
    </item>
    <item>
      <title>kisskit: Simplifying Game Dev in C</title>
      <dc:creator>Sam Watkins</dc:creator>
      <pubDate>Fri, 08 Apr 2022 09:06:07 +0000</pubDate>
      <link>https://forem.com/gamedev/kisskit-simplifying-game-dev-in-c-3hjd</link>
      <guid>https://forem.com/gamedev/kisskit-simplifying-game-dev-in-c-3hjd</guid>
      <description>&lt;p&gt;I grew up programming in BASIC in the 1980s, and enjoyed a very simple API for graphics and sound. For example, this draws a line and a circle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MOVE 100, 100
DRAW 300, 200
CIRCLE 300, 200, 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bal7J6Jw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ef7hrid9ulk78365m9r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bal7J6Jw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ef7hrid9ulk78365m9r.png" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To do the same in modern JavaScript with HTML in the browser, without any helper functions, we would have to write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;canvas&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"myCanvas"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"800"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"600"&lt;/span&gt;
 &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"width: 800px; height: 600px; background: black;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/canvas&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;myCanvas&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;strokeStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;white&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;beginPath&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;moveTo&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="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lineTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;beginPath&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And in C with SDL2_gfx, we would need something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;SDL.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;SDL2/SDL2_gfxPrimitives.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdbool.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&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;exit_status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;EXIT_FAILURE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"SDL Demo"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;SDL_Window&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;window&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;SDL_Renderer&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;quit&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="n"&gt;SDL_Event&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="n"&gt;SDL_Init&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SDL_INIT_VIDEO&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;window&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SDL_CreateWindow&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="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SDL_CreateRenderer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;window&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;SDL_RENDERER_ACCELERATED&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
                &lt;span class="n"&gt;SDL_RENDERER_PRESENTVSYNC&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="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;goto&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="n"&gt;SDL_SetRenderDrawColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;SDL_RenderClear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;lineRGBA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;renderer&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="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                 &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;circleRGBA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                   &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;SDL_RenderPresent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;quit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;SDL_WaitEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;e&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;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;SDL_QUIT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="n"&gt;quit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;exit_status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;EXIT_SUCCESS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;error:&lt;/span&gt;
        &lt;span class="n"&gt;SDL_DestroyWindow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;window&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;SDL_Quit&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exit_status&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;I don't want my kids to suffer so very much more than I did, so I'm putting together &lt;a href="https://github.com/gamedevfromscratch/kisskit"&gt;kisskit&lt;/a&gt;, a set of tools to help simplify C programming and game dev as much as possible.&lt;/p&gt;

&lt;p&gt;KISS stands for "Keep it simple, stupid!" and this is &lt;a href="https://www.google.com/search?q=the+practice+of+programming"&gt;very good advice&lt;/a&gt; for programming.&lt;/p&gt;

&lt;p&gt;Kisskit is a work in progress. So far, it includes three main features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;macros for logging and debugging&lt;/li&gt;
&lt;li&gt;macros to wrap library functions and check for errors&lt;/li&gt;
&lt;li&gt;a library called "basic" to enable writing simple games using SDL behind the scenes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a &lt;a href="https://sam.ucm.dev/code/kisskit/eg/compare.html"&gt;comparison&lt;/a&gt; of a simple program written with and without our &lt;code&gt;kiss.h&lt;/code&gt; macros for logging and error handling.&lt;/p&gt;

&lt;p&gt;Returning to our original graphics challenge, here is the same program to draw a line and a circle using our &lt;code&gt;basic&lt;/code&gt; library. All of the SDL boilerplate code is hidden behind the scenes, and our main program is simple enough that a child could write it.&lt;/p&gt;

&lt;p&gt;The library uses a linking trick so that we can override only the functions that we need. In this case, just &lt;code&gt;draw()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;"basic.h"&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;draw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;line&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="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;circle0&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&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;We are able to write simple code similar to BASIC, the &lt;a href="https://processing.org/"&gt;Processing&lt;/a&gt; language, or &lt;a href="https://p5js.org/"&gt;p5.js&lt;/a&gt;, but in plain C.&lt;/p&gt;

&lt;p&gt;In the next few posts, we'll show how we can draw pictures and make a simple game using this library.&lt;/p&gt;

&lt;p&gt;Next post: &lt;a href="https://dev.to/gamedev/creating-drawings-229e"&gt;Creating Drawings&lt;/a&gt;, by Thalia&lt;br&gt;
Previous post: &lt;a href="https://dev.to/gamedev/basic-programming-in-c-243b"&gt;Basic Programming in C&lt;/a&gt;, by Sam&lt;br&gt;
Contents: &lt;a href="https://dev.to/gamedev/game-dev-from-scratch-2do1"&gt;Game Dev From Scratch&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>c</category>
      <category>sdl</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Deciding on a Programming Language for Game Dev</title>
      <dc:creator>Sam Watkins</dc:creator>
      <pubDate>Tue, 05 Apr 2022 12:24:21 +0000</pubDate>
      <link>https://forem.com/gamedev/deciding-on-a-programming-language-13ba</link>
      <guid>https://forem.com/gamedev/deciding-on-a-programming-language-13ba</guid>
      <description>&lt;p&gt;Our first step in learning how to make games was to decide on which programming language to use. I am an experienced software developer, so I guided this decision.&lt;/p&gt;

&lt;p&gt;This is &lt;em&gt;Game Dev From Scratch&lt;/em&gt;, and we want to learn about programming. We don't want to use a game maker tool or a third-party engine, at least not in the beginning. We would like our game to run in the browser, so that people can discover and play it easily. We have lofty goals, so we want to use a high-performance language.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Typically browser games are written in JavaScript. I don't mind JavaScript, and I use it for front-end web development. JavaScript has dynamic typing, but I believe that static typing is advantageous for all but the smallest projects. &lt;a href="https://stackoverflow.com/questions/1517582/what-is-the-difference-between-statically-typed-and-dynamically-typed-languages"&gt;This stackoverflow page&lt;/a&gt; explains the difference. JavaScript is not a slow language, but it's not the quickest either.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript is JavaScript with static typing bolted on. The transpiler is slow. It was developed by Microsoft. Call me a bigot, but I don't like Microsoft, and I don't like TypeScript!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I do much of my professional work in Python. I really like the light-weight syntax, without all those pesky braces and semicolons. Python is great for experiments, and has been adopted by the scientific and artificial intelligence communities. Although Python has some excellent and very fast libraries for mathematics, scientific computing, and AI, the Python language itself is much slower than JavaScript, and for that reason I don't think that it's ideal for game development.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Mainstream stand-alone games are often written in C++. C++ has been described as an octopus made by nailing extra legs onto a dog. When invited to reflect on whether he should have written git in C++, Linus Torvalds retorted that:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do &lt;em&gt;nothing&lt;/em&gt; but keep the C++ programmers out, that in itself would be a huge reason to use C.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If C is a dog, it's a good old dog. The C programming language was &lt;a href="http://www.linfo.org/c.html"&gt;created by Dennis Ritchie&lt;/a&gt; in the early 1970s. In my opinion, just about every programming language that has come after C is largely inferior to C, and none is wholly superior to it. It is not so easy to get started with C compared to Python for example, but I believe that I can make up for that with some helpful libraries and syntactic sugar.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Can we make a browser game written in C? According to &lt;a href="https://developer.mozilla.org/en-US/docs/Games"&gt;Mozilla's Game development page&lt;/a&gt;, yes we can. We can compile C or C++ to WebAssembly using a tool called &lt;a href="https://emscripten.org/"&gt;emscripten&lt;/a&gt;, and WebAssembly runs much faster than JavaScript in the browser.&lt;/p&gt;

&lt;p&gt;As I understand, the popular SDL2 library has been ported to work with emscripten. Using SDL2 and OpenGL, we can build a browser version of our game, and native versions for the major platforms, all from the same code base. I have some prior experience with SDL2 and OpenGL.&lt;/p&gt;

&lt;p&gt;In summary, we considered several different programming languages for learning about game development, and we decided to use C:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;JavaScript – good for web, dynamic typing, not the quickest.&lt;/li&gt;
&lt;li&gt;TypeScript – I don't like it.&lt;/li&gt;
&lt;li&gt;Python – beautiful syntax, but it's too slow.&lt;/li&gt;
&lt;li&gt;C++ – Linus doesn't like it.&lt;/li&gt;
&lt;li&gt;C is the worst programming language – except for all the others that have been tried.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/H4YRPdRXKFs"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next post: &lt;a href="https://dev.to/gamedev/my-simple-programs-3g97"&gt;My Simple Programs&lt;/a&gt;, by Thalia&lt;br&gt;
Previous post: &lt;a href="https://dev.to/gamedev/creating-games-4dpj"&gt;Creating Games&lt;/a&gt;, by Sean&lt;br&gt;
Contents: &lt;a href="https://dev.to/gamedev/game-dev-from-scratch-2do1"&gt;Game Dev From Scratch&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>c</category>
      <category>emscripten</category>
    </item>
    <item>
      <title>Super Startup</title>
      <dc:creator>Sam Watkins</dc:creator>
      <pubDate>Thu, 06 May 2021 21:53:15 +0000</pubDate>
      <link>https://forem.com/sswam/super-startup-28ol</link>
      <guid>https://forem.com/sswam/super-startup-28ol</guid>
      <description>&lt;h2&gt;
  
  
  Super Startup
&lt;/h2&gt;

&lt;p&gt;startup&lt;/p&gt;

&lt;h2&gt;
  
  
  a superannuation / investment startup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Our Mission
&lt;/h3&gt;

&lt;p&gt;We can't find a perfect superannuation investment company, so we're going to make one ourselves. Our company is ethical, effective, and economical, with minimal fees, and good returns compared to other super funds. Members can choose how their money is invested. We achieve efficiency through automation. We are bootstrapping the company ourselves, without taking investment. As an ethical company, our values are more than just words. We hope to build a great community from the very beginning of the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ethical
&lt;/h3&gt;

&lt;p&gt;Different people have different ideas of what investments are "ethical". We suggest a baseline, but each of our members can decide what "ethical" means to them, and we will help them to invest their money accordingly. We are dedicated to our mission, and we won't ever sell out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Effective
&lt;/h3&gt;

&lt;p&gt;Our open-source investment software enables members to include and exclude different types of companies, even down to individual companies, while enjoying the benefits of aggregate trading and economy of scale. Our base application is simple and easy to use. Advanced features and APIs are available for power-users. We listen to feedback, and can implement custom features for individual members.&lt;/p&gt;

&lt;h3&gt;
  
  
  Economical
&lt;/h3&gt;

&lt;p&gt;We intend to operate as a low-profit private company, so that a wide range of people can invest without having to pay hundreds of dollars in fees or any percentage of their account balance. If your investment makes a profit, all of the return goes to you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automation
&lt;/h3&gt;

&lt;p&gt;We are a high-tech company. We intend to absolutely minimize fees by avoiding expenses, staying small as a company, and automating every part of the system as much as possible. Our innovative software is based on the best available technology, for the best user experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bootstrapping
&lt;/h3&gt;

&lt;p&gt;We are starting out as a self-managed super fund, for ourselves and our family members. When we are ready, we will extend the service to others, by providing our software to help them manage their own super fund. Eventually we hope to become a full superannuation investment company.&lt;/p&gt;

&lt;h3&gt;
  
  
  Values
&lt;/h3&gt;

&lt;p&gt;We actually put our members first, we don't just say so. We value quality above profit. We don’t rip people off. We want to provide the best possible service to our members. We actively seek feedback and "negative" criticism, in order to improve.&lt;/p&gt;

&lt;h3&gt;
  
  
  Community
&lt;/h3&gt;

&lt;p&gt;We believe in collaboration, not competition. We are hoping to build a community from the beginning. That is why we are starting a blog now, when the project is still in its infancy. We welcome you to follow along, and even to help with development. We will continue to post and ask for your feedback and help every step of the way.&lt;/p&gt;

&lt;h3&gt;
  
  
  About Us
&lt;/h3&gt;

&lt;p&gt;We are a small family business based in Melbourne, Australia. We intend to stay small. Our CEO, Sean is a secondary school student with a keen interest in investment. Our CTO, Sam is a freelance full stack software developer, working with Toptal and others. Our CFO, Patricia makes sure that the ship stays afloat. Our COO, Thalia keeps everything running smoothly.&lt;/p&gt;

</description>
      <category>startup</category>
    </item>
    <item>
      <title>diodon / clipit logs copious sensitive information to zeitgeist and does not clear it</title>
      <dc:creator>Sam Watkins</dc:creator>
      <pubDate>Fri, 26 Mar 2021 14:18:01 +0000</pubDate>
      <link>https://forem.com/sswam/diodon-logs-copious-sensitive-information-to-zeitgeist-and-does-not-clear-it-3eh4</link>
      <guid>https://forem.com/sswam/diodon-logs-copious-sensitive-information-to-zeitgeist-and-does-not-clear-it-3eh4</guid>
      <description>&lt;p&gt;This is how I feel about &lt;a href="https://en.wikipedia.org/wiki/Zeitgeist_(free_software)"&gt;zeitgeist&lt;/a&gt; and &lt;a href="https://launchpad.net/diodon"&gt;diodon&lt;/a&gt; &lt;a href="https://askubuntu.com/a/1326275/81260"&gt;colluding to record over 500MB of everything I cut and paste&lt;/a&gt;, including server passwords, URLs of smut, and so forth.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# sudo apt purge diodon zeitgeist-core
# cd ~/.local/share/
# shrrec zeitgeist/
shred: zeitgeist/activity.sqlite: pass 1/2 (random)...
shred: zeitgeist/activity.sqlite: pass 2/2 (000000)...
shred: zeitgeist/activity.sqlite: removing
shred: zeitgeist/activity.sqlite: renamed to zeitgeist/000000000000000
shred: zeitgeist/000000000000000: renamed to zeitgeist/00000000000000
shred: zeitgeist/00000000000000: renamed to zeitgeist/0000000000000
shred: zeitgeist/0000000000000: renamed to zeitgeist/000000000000
shred: zeitgeist/000000000000: renamed to zeitgeist/00000000000
shred: zeitgeist/00000000000: renamed to zeitgeist/0000000000
shred: zeitgeist/0000000000: renamed to zeitgeist/000000000
shred: zeitgeist/000000000: renamed to zeitgeist/00000000
shred: zeitgeist/00000000: renamed to zeitgeist/0000000
shred: zeitgeist/0000000: renamed to zeitgeist/000000
shred: zeitgeist/000000: renamed to zeitgeist/00000
shred: zeitgeist/00000: renamed to zeitgeist/0000
shred: zeitgeist/0000: renamed to zeitgeist/000
shred: zeitgeist/000: renamed to zeitgeist/00
shred: zeitgeist/00: renamed to zeitgeist/0
shred: zeitgeist/activity.sqlite: removed
shred: zeitgeist/activity.sqlite-wal: pass 1/2 (random)...
shred: zeitgeist/activity.sqlite-wal: pass 2/2 (000000)...
shred: zeitgeist/activity.sqlite-wal: removing
shred: zeitgeist/activity.sqlite-wal: renamed to zeitgeist/0000000000000000000
shred: zeitgeist/0000000000000000000: renamed to zeitgeist/000000000000000000
shred: zeitgeist/000000000000000000: renamed to zeitgeist/00000000000000000
shred: zeitgeist/00000000000000000: renamed to zeitgeist/0000000000000000
shred: zeitgeist/0000000000000000: renamed to zeitgeist/000000000000000
shred: zeitgeist/000000000000000: renamed to zeitgeist/00000000000000
shred: zeitgeist/00000000000000: renamed to zeitgeist/0000000000000
shred: zeitgeist/0000000000000: renamed to zeitgeist/000000000000
shred: zeitgeist/000000000000: renamed to zeitgeist/00000000000
shred: zeitgeist/00000000000: renamed to zeitgeist/0000000000
shred: zeitgeist/0000000000: renamed to zeitgeist/000000000
shred: zeitgeist/000000000: renamed to zeitgeist/00000000
shred: zeitgeist/00000000: renamed to zeitgeist/0000000
shred: zeitgeist/0000000: renamed to zeitgeist/000000
shred: zeitgeist/000000: renamed to zeitgeist/00000
shred: zeitgeist/00000: renamed to zeitgeist/0000
shred: zeitgeist/0000: renamed to zeitgeist/000
shred: zeitgeist/000: renamed to zeitgeist/00
shred: zeitgeist/00: renamed to zeitgeist/0
shred: zeitgeist/activity.sqlite-wal: removed
shred: zeitgeist/activity.sqlite-shm: pass 1/2 (random)...
shred: zeitgeist/activity.sqlite-shm: pass 2/2 (000000)...
shred: zeitgeist/activity.sqlite-shm: removing
shred: zeitgeist/activity.sqlite-shm: renamed to zeitgeist/0000000000000000000
shred: zeitgeist/0000000000000000000: renamed to zeitgeist/000000000000000000
shred: zeitgeist/000000000000000000: renamed to zeitgeist/00000000000000000
shred: zeitgeist/00000000000000000: renamed to zeitgeist/0000000000000000
shred: zeitgeist/0000000000000000: renamed to zeitgeist/000000000000000
shred: zeitgeist/000000000000000: renamed to zeitgeist/00000000000000
shred: zeitgeist/00000000000000: renamed to zeitgeist/0000000000000
shred: zeitgeist/0000000000000: renamed to zeitgeist/000000000000
shred: zeitgeist/000000000000: renamed to zeitgeist/00000000000
shred: zeitgeist/00000000000: renamed to zeitgeist/0000000000
shred: zeitgeist/0000000000: renamed to zeitgeist/000000000
shred: zeitgeist/000000000: renamed to zeitgeist/00000000
shred: zeitgeist/00000000: renamed to zeitgeist/0000000
shred: zeitgeist/0000000: renamed to zeitgeist/000000
shred: zeitgeist/000000: renamed to zeitgeist/00000
shred: zeitgeist/00000: renamed to zeitgeist/0000
shred: zeitgeist/0000: renamed to zeitgeist/000
shred: zeitgeist/000: renamed to zeitgeist/00
shred: zeitgeist/00: renamed to zeitgeist/0
shred: zeitgeist/activity.sqlite-shm: removed
shred: zeitgeist/fts.index/flintlock: removing
shred: zeitgeist/fts.index/flintlock: renamed to zeitgeist/fts.index/000000000
shred: zeitgeist/fts.index/000000000: renamed to zeitgeist/fts.index/00000000
shred: zeitgeist/fts.index/00000000: renamed to zeitgeist/fts.index/0000000
shred: zeitgeist/fts.index/0000000: renamed to zeitgeist/fts.index/000000
shred: zeitgeist/fts.index/000000: renamed to zeitgeist/fts.index/00000
shred: zeitgeist/fts.index/00000: renamed to zeitgeist/fts.index/0000
shred: zeitgeist/fts.index/0000: renamed to zeitgeist/fts.index/000
shred: zeitgeist/fts.index/000: renamed to zeitgeist/fts.index/00
shred: zeitgeist/fts.index/00: renamed to zeitgeist/fts.index/0
shred: zeitgeist/fts.index/flintlock: removed
shred: zeitgeist/fts.index/iamglass: pass 1/2 (random)...
shred: zeitgeist/fts.index/iamglass: pass 2/2 (000000)...
shred: zeitgeist/fts.index/iamglass: removing
shred: zeitgeist/fts.index/iamglass: renamed to zeitgeist/fts.index/00000000
shred: zeitgeist/fts.index/00000000: renamed to zeitgeist/fts.index/0000000
shred: zeitgeist/fts.index/0000000: renamed to zeitgeist/fts.index/000000
shred: zeitgeist/fts.index/000000: renamed to zeitgeist/fts.index/00000
shred: zeitgeist/fts.index/00000: renamed to zeitgeist/fts.index/0000
shred: zeitgeist/fts.index/0000: renamed to zeitgeist/fts.index/000
shred: zeitgeist/fts.index/000: renamed to zeitgeist/fts.index/00
shred: zeitgeist/fts.index/00: renamed to zeitgeist/fts.index/0
shred: zeitgeist/fts.index/iamglass: removed
shred: zeitgeist/fts.index/termlist.glass: pass 1/2 (random)...
shred: zeitgeist/fts.index/termlist.glass: pass 2/2 (000000)...
shred: zeitgeist/fts.index/termlist.glass: removing
shred: zeitgeist/fts.index/termlist.glass: renamed to zeitgeist/fts.index/00000000000000
shred: zeitgeist/fts.index/00000000000000: renamed to zeitgeist/fts.index/0000000000000
shred: zeitgeist/fts.index/0000000000000: renamed to zeitgeist/fts.index/000000000000
shred: zeitgeist/fts.index/000000000000: renamed to zeitgeist/fts.index/00000000000
shred: zeitgeist/fts.index/00000000000: renamed to zeitgeist/fts.index/0000000000
shred: zeitgeist/fts.index/0000000000: renamed to zeitgeist/fts.index/000000000
shred: zeitgeist/fts.index/000000000: renamed to zeitgeist/fts.index/00000000
shred: zeitgeist/fts.index/00000000: renamed to zeitgeist/fts.index/0000000
shred: zeitgeist/fts.index/0000000: renamed to zeitgeist/fts.index/000000
shred: zeitgeist/fts.index/000000: renamed to zeitgeist/fts.index/00000
shred: zeitgeist/fts.index/00000: renamed to zeitgeist/fts.index/0000
shred: zeitgeist/fts.index/0000: renamed to zeitgeist/fts.index/000
shred: zeitgeist/fts.index/000: renamed to zeitgeist/fts.index/00
shred: zeitgeist/fts.index/00: renamed to zeitgeist/fts.index/0
shred: zeitgeist/fts.index/termlist.glass: removed
shred: zeitgeist/fts.index/postlist.glass: pass 1/2 (random)...
shred: zeitgeistr shrek
Search instead for shr/fts.index/postlist.glass: pass 2/2 (000000)...
shred: zeitgeist/fts.index/postlist.glass: removing
shred: zeitgeist/fts.index/postlist.glass: renamed to zeitgeist/fts.index/00000000000000
shred: zeitgeist/fts.index/00000000000000: renamed to zeitgeist/fts.index/0000000000000
shred: zeitgeist/fts.index/0000000000000: renamed to zeitgeist/fts.index/000000000000
shred: zeitgeist/fts.index/000000000000: renamed to zeitgeist/fts.index/00000000000
shred: zeitgeist/fts.index/00000000000: renamed to zeitgeist/fts.index/0000000000
shred: zeitgeist/fts.index/0000000000: renamed to zeitgeist/fts.index/000000000
shred: zeitgeist/fts.index/000000000: renamed to zeitgeist/fts.index/00000000
shred: zeitgeist/fts.index/00000000: renamed to zeitgeist/fts.index/0000000
shred: zeitgeist/fts.index/0000000: renamed to zeitgeist/fts.index/000000
shred: zeitgeist/fts.index/000000: renamed to zeitgeist/fts.index/00000
shred: zeitgeist/fts.index/00000: renamed to zeitgeist/fts.index/0000
shred: zeitgeist/fts.index/0000: renamed to zeitgeist/fts.index/000
shred: zeitgeist/fts.index/000: renamed to zeitgeist/fts.index/00
shred: zeitgeist/fts.index/00: renamed to zeitgeist/fts.index/0
shred: zeitgeist/fts.index/postlist.glass: removed
shred: zeitgeist/fts.index/position.glass: pass 1/2 (random)...
shred: zeitgeist/fts.index/position.glass: pass 2/2 (000000)...
shred: zeitgeist/fts.index/position.glass: removing
shred: zeitgeist/fts.index/position.glass: renamed to zeitgeist/fts.index/00000000000000
shred: zeitgeist/fts.index/00000000000000: renamed to zeitgeist/fts.index/0000000000000
shred: zeitgeist/fts.index/0000000000000: renamed to zeitgeist/fts.index/000000000000
shred: zeitgeist/fts.index/000000000000: renamed to zeitgeist/fts.index/00000000000
shred: zeitgeist/fts.index/00000000000: renamed to zeitgeist/fts.index/0000000000
shred: zeitgeist/fts.index/0000000000: renamed to zeitgeist/fts.index/000000000
shred: zeitgeist/fts.index/000000000: renamed to zeitgeist/fts.index/00000000
shred: zeitgeist/fts.index/00000000: renamed to zeitgeist/fts.index/0000000
shred: zeitgeist/fts.index/0000000: renamed to zeitgeist/fts.index/000000
shred: zeitgeist/fts.index/000000: renamed to zeitgeist/fts.index/00000
shred: zeitgeist/fts.index/00000: renamed to zeitgeist/fts.index/0000
shred: zeitgeist/fts.index/0000: renamed to zeitgeist/fts.index/000
shred: zeitgeist/fts.index/000: renamed to zeitgeist/fts.index/00
shred: zeitgeist/fts.index/00: renamed to zeitgeist/fts.index/0
shred: zeitgeist/fts.index/position.glass: removed
zeitgeist/fts.index
zeitgeist/000000000
zeitgeist/00000000
zeitgeist/0000000
zeitgeist/000000
zeitgeist/00000
zeitgeist/0000
zeitgeist/000
zeitgeist/00
zeitgeist/0
*
zeitgeist
000000000
00000000
0000000
000000
00000
0000
000
00
0
*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>New job with Tekt; getting good sleep</title>
      <dc:creator>Sam Watkins</dc:creator>
      <pubDate>Thu, 11 Mar 2021 11:23:01 +0000</pubDate>
      <link>https://forem.com/sswam/new-job-with-tekt-getting-good-sleep-1g44</link>
      <guid>https://forem.com/sswam/new-job-with-tekt-getting-good-sleep-1g44</guid>
      <description>&lt;p&gt;I started a new freelance job today, working for &lt;a href="https://www.tektindustries.com/"&gt;Tekt Industries&lt;/a&gt;. I'm learning more about Firebase and Google Cloud, and will be using TypeScript for cloud functions.&lt;/p&gt;

&lt;p&gt;The people are friendly, the work is interesting, and I'm confident I can do a good job.&lt;/p&gt;

&lt;p&gt;I've also been sleeping much better and getting up early thanks to my magical email reminder script, which emails me every hour to remind me how important it is to go to bed early! I'm also using some melatonin, and the Alarmy app. Getting up early is so much better than staying up late, I feel great.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>OAuth2 examples for Deno</title>
      <dc:creator>Sam Watkins</dc:creator>
      <pubDate>Wed, 10 Mar 2021 11:53:27 +0000</pubDate>
      <link>https://forem.com/sswam/oauth2-examples-for-deno-1f7e</link>
      <guid>https://forem.com/sswam/oauth2-examples-for-deno-1f7e</guid>
      <description>&lt;p&gt;I'm working on creating some "portfolio pieces" that are useful web apps. The first project is a kanban board system, similar to Trello with a bit of Airtable mixed in, and my own ideas.&lt;/p&gt;

&lt;p&gt;I decided to use Svelte kit and Tailwind CSS on the front-end, but I'm having a bit of trouble settling on a good system for authentication.&lt;/p&gt;

&lt;p&gt;I started out using Django REST and Djoser, but I'm experiencing some difficulties with this, and I'm thinking it would be better to use something lighter for the public facing auth server.&lt;/p&gt;

&lt;p&gt;Firebase auth would be an easy way to get things up and running. Unlike other auth-as-a-service providers, Google allows unlimited use of Firebase auth free of charge (except for cellular text messages, which are limited). This would be the most practical option, I suppose.&lt;/p&gt;

&lt;p&gt;In the Python world, Flask and FastAPI are more performant, lighter frameworks. The &lt;a href="https://github.com/frankie567/fastapi-users"&gt;FastAPI Users&lt;/a&gt; module looks like a good option for authentication.&lt;/p&gt;

&lt;p&gt;However, today I had a bit of a "JavaScript everywhere" mood, with the idea to share some code on the client and server, including validation. So I did a little work towards setting up an OAuth2 authentication server in &lt;a href="//deno.land"&gt;Deno&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I tried two libraries, &lt;a href="https://github.com/oslabs-beta/dashport"&gt;Dashport&lt;/a&gt; and &lt;a href="https://github.com/cmd-johnson/deno-oauth2-client"&gt;deno-oauth2-client&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Dashport aims to be like Passport.js for Deno. I had a bit of trouble getting their example code to work, so I &lt;a href="https://github.com/ultracodemonkey/dashport"&gt;forked the repo&lt;/a&gt;, fixed a few bugs and added some example code. I also posted &lt;a href="https://gitlab.com/sswam/dashport-test"&gt;a slightly more developed example&lt;/a&gt;. In the process, I gained a bit more experience with TypeScript.&lt;/p&gt;

&lt;p&gt;The other module, deno-oauth2-client, works well. It's smaller and easy to use. Their example shows how to do GitHub auth. I &lt;a href="https://gitlab.com/sswam/deno-auth-test"&gt;extended the example&lt;/a&gt; to support Google and Facebook auth also.&lt;/p&gt;

&lt;p&gt;There's a ways to go before this will be useful as an authentication server. As it is, I can prompt the user to log in with those providers, and fetch the user info.&lt;/p&gt;

&lt;p&gt;I would also like to find or put together a good "local login" system, with email and password auth, also email confirmation, password reset, and all the customary features. I'm not sure if I'll continue with Deno for this, or explore other options.&lt;/p&gt;

&lt;p&gt;Auth is pretty dull, but I guess it will be useful to have a good system that I can reuse in future. Probably should just use Firebase. Anyway, worst case scenario I'm learning stuff that can be useful in future.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
