Skip to main content

Posts

The Myth of Non Repeating Code

One of the first lessons you learn in computer science is that if you find yourself repeating yourself in your code then you've done something wrong. I am here to tell you that that's a lie.

I'll give you some very simple examples.

In many languages there is a feature like C++ include. We've all seen this where at the top of your file you write out the libraries that you are going to include in order to make your code run. By necessity these have always got to be typed every time.

Furthermore in C++ and some other languages there must be a main function and you must always add some extra syntax in order to declare your functions which doesn't necessarily need to be there but is just caked into the language.

Here lies the crux of the problem in that there are some language features that just get in the way which you can do nothing about.

Take for example an if statement in javascript.

if(bool){

code

code

}
else{

code

code

code
{

Realitically this could be reduced to…
Recent posts

The system that never needed to be replaced - El Dorado

I am extremely interested in systems programming and language design.

As you may know there are many computer systems in existence today and those systems are usually made out of systems.

Take the proprietary Microsoft Windows, for example. MS Windows is a computer system known as an Operating System. We can think of it as three parts. First is the kernel, which runs at the base of Windows. The second are the file system and programmer utilities which the programmers use to provide applications for the user. Among these applications is the proprietary MS Windows desktop environment where the rest of the graphical programs live.

Linux is built a similar way. We have a kernel underneath, with gnu running on top. Among the things ported to GNU are the x window environment where graphical applications live.

Here is an illustration

Kernel -> shell -> graphics -> applications

What I am concerned in with my research is this shell level.

In linux the most common shell we are met with…

Research into the Unix Way of Programming: an exploration of concatenative language

I have been spending the last four years studying the Unix way of programming as described in this video: https://www.youtube.com/watch?v=tc4ROCJYbm0

Watching this video and understanding it is key to understanding the thinking behind my research.

In the UNIX days you would have to rewrite your entire system from scratch each time a new computer came onto the market and your team decided to upgrade. This was very expensive, and so the UNIX people were very concerned with trying to make sure that their code would not be rewritten but have everlasting life. And their mission has succeeded, as I can still use programs like awk, dc, vi, and many more today in my terminal.

Part of the way they describe in the video above of how they were to solve the problem of having to rewrite code was the use of the UNIX pipeline. Specifically they discussed how one could write a text file which makes shell calls on c programs, and turn that text file it's self into a file that behaves as if it were…

Memories as an 11 Year Old Struggling with HTML

When I was younger I was taught the basics of html by my dad and how to find the w3schools website. w3schools was pretty much one of the only two good website I could find for learning about making websites. The other one had something to do with a monkey but I could not remember the title.

I played around alot with HTML and at first I tried really hard to figure out how to make my website beautiful and interactive like some of the ones I had seen in the past few years. But eventually I got tired of that and I thought to myself, what if I could make a website that was entirely ascii art that was actually really great and pretty interactive.

So the first thing I started doing since I was playing around was to add random features. The only way I knew how to write features at the time was to create another html document and save it into my documents, then link it in the other html document. Of course, I was doing this in notepad, so this became tedious to do with alot of webpages.

I want…

My current setup: ssh + tmux + emacs

I want to explain how I currently program so that people can get an idea of what my environment looks like. I'll first go into a little extra detail because I know most people are not emacs or tmux users, or even Linux users.

So I've got a chromebook which means that all I can do is run javascript apps or go to webapps like stack overflow, github, facebook, wikipedia, etc. Luckily chromebooks come with this dedicated application called Secure Shell which allows me to connect remotely into a Linux machine with just a url, a username, and a password. And so I rent a virtual machine which is just a linux server from Microsoft in their Azure datacenter and I use Secure shell to connect to this remotely. So what it sort of looks like is I open up my application and I am greeted by a prompt asking me to type in my hostname, my username, and my password. After that is done I am greeted by a black terminal window much like powershell or the old terminals in the 70's and 80's.

Being a college age programmer in 2016

I realize alot of the community out there is made of of guys in their late 30's and older who have been around since maybe the commedore 64 or earlier and so I thought as a next post in my blog I would just sort of explain what it is like to be like as a programmer born in the mid 90's and living today.
First of all I grew up on a GUI. By the time I first tried using a computer they were already trying to hide the code from me, and so although I used computers heavily I had no idea about how they worked internally. One of the hardest parts of getting into programming was sort of breaking free of the gui. When you can only think of how a computer works in terms of a GUI it really limits the way you can understand the computer. And so I spent years digging into the shell as far as I could go to try to go out the other side understanding what a computer was beneath the GUI.
There are some advantages to growing up on a GUI though. If you are someone in your 30's or older and y…

A four year study into the Unix Way of programming

There is a programming friend of mine who keeps encouraging me to write a blog about what I am working on. This is that blog.

Six years ago I first installed Linux. I was sixteen at the time. It was Ubuntu back when it still used gnome, and this was back before gnome 3 I think. Keep in mind folks my first computer was a Dell windows XP not a commodore 64.
About two years after that was when I started college and the first programming language they taught me was C++. This was really a nightmare especially since my Professor, also a Microsoft employee, insisted that windows was a required resource to take the class and my colleagues should not have to allow open source libraries so that the code can even run on my machine. Even though I liked the class and I really think the instructor was a great person, this was very frustrating for me. At the same time I was failing chemistry. So I decided to leave my current major of Computer Engineering and go do psychology because that was easier.