Learning Rust: More Modules! More Tests! More Types!

Rust seems kind of cool

Stewart Charles

Since the last post, there have been several incremental changes made to the game module. First, the module has been expanded to include sub-modules for the network component, and an additional module for testing. These sub-modules have yet to be implemented, but are declared for structural reasons. The tree view of game module is shown below.

Screen Shot 2015-08-03 at 6.35.56 PM

Revenge of the Modules!

As you can see, the complexity of our project is increasing! While it’s tempting to try and cram the entire program into a single main.rs file (actually, it’s not tempting…), we would be better served breaking our project into sub-modules. This is a convenient way of dissembling our project into it’s elementary but related components, which allows us to sensibly navigate our rather complicated hierarchy of related data types, functions and items.

Sub-Modules are ‘linked’ to the parent game module by declaring them from the entry point of the crate…

View original post 979 more words

How I Debug things

I like insights and this covers a good one

Mike's Tech Blog

One day, while I was writing some C#, a coworker commented on a line I wrote:

var foo = getFoo();

“Don’t use var!” he exclaimed. “Use a concrete type. Otherwise, how would I know what foo is?”

I was willing to accommodate him, so I updated the selection:

Object foo = getFoo();

He was not amused, however, if the only way I’m using foo is:

Object foo = getFoo();
foo.toString();

Then what is the problem? My code will compile, after all.

Two different modes of thought

His basic issue came down to trying to debug my use of foo. Let’s say foo.toString() wasn’t doing what it supposed to, here is how he would look at the code before testing it:

  1. Determine the specific instance of foo by inspecting getFoo
  2. From this, project what state foo would be in at runtime (variables, fields, and whatnot)
  3. Trace out how the…

View original post 397 more words

Real time 3D programming

This is an amazing real time programming language that I came across some time ago. It’s been a while since a post but assured that soon I will have made up content after I’ve everything I want sorted on the site itself. For now, revel at the awesome that is Tao3D

Also just a reminder to follow on wordpress, twitter, facebook or old fashioned RSS. All the links can be found on the side menu and the facebook page has just been started so will be empty so please, show some love, thanks

There is a great temptation among people starting to learn programming to use the computer far too early….

There is a great temptation among people starting to learn programming to use the computer far too early…. Occasionally this works, but the resultant program is usually very badly constructed and hard to understand. — How to Think Like a Programmer: Problem Solving for the Bewildered [Paul Vickers], opening of chapter 2, A strategy for problem solving

This quote is the grounds of it all. This is formed from the idea that made me want to take the route into computer science that I’m taking, problem solving. I’ve seen many potentially good programmers quit or waste too much time learning things the wrong way. I know it takes a lot of time but doing it right can cut that time down.

 

One of the biggest problems I see is not understanding the problem and how to solve it. This is how my blog will work. Looking at problem solving techniques, how to break a problem down, how to program to prevent problems from being coded into a program and how to understand problems and how to solve them, not just in programming, but in maths, logic and anywhere else lines can be drawn between these subjects

My favourite places to learn programming

I love how many new people are looking into programming and I get asked all the time about good resources. We all know you can google “how to java” and it will negate the bad grammar and bring you to a junkyard full of resources. All teaching roughly the same thing, the logic of programming. But being such a vast result….. what do you do with it?

See the thing here is you can sit down and learn all the ways to make a string and print it or create an object, but that’s not doing much for you if you’re just following examples and not thinking for yourself. A good programmer has a logical mind and is able to think of all possible avenues of a problem, not follow a tutorial better than anyone else. It’s hard to find that kind of teaching in these results.

The first place I wanted to pass on is a site called project euler and will really make you think about how to use some basic concepts to make some complex structures but also will make you look into things on your own and think of more efficient ways to solve things. At the heart of it all though, it’s main purpose is just to get the right answer to a crazy maths problem that no one would ever ask in the first place, which frankly are the best kinds of math problems, while also taking you from if statements to pointers and will push everything you know with every new problem.

There’s also things everyone should just know on their own. That is to say that we can’t hold your hand across every interest that’s out there and how to get involved. It’s impossible, people and minds change all the time, so you need to know where you can find something that tickles your fancy and you can work on yourself. That’s where coursera comes in. It will give you online courses in what ever you might think you’re interested in. It will start you off small, give you assignments and give you a feel what what caught your curiosity. Maybe you’ll love it, maybe it’ll just never mean anything to you again, but either way you’ll have an answer. There’s so many amazing courses on that site it’s impossible not to mention.

It’s a long journey, learning to code, but it’s got some of the best views along the way. It’s not easy and you have to keep at it, but there’s lots of ways to get there and well worth it. It’s exciting pursuing something that doesn’t have an end and can amaze you every time you think you’ve seen it all

Back to the blog

Seems I just could not keep away.

Hello again world of readers. I’ve decided that I’m going to take up blogging again. Strange time as I’m in the middle of study for exams this week but if any of you have ever had to study and found weird things to distract you, this kind of procrastination should make sense to you.

It’s just that I’ve been doing a lot lately and things have changed so much in the tech and programming world that I just wanted to get back and talk about it.

tumblr_m7jhivE7DP1qhy6c9o6_250

When I started with my first blog, infoturtle.ie, it was all java, android, bash, linux and news as filler. Now I’ve come to love python, perl, C++, software architecture, and really just want to share some of the new things I’ve learned with people who are interested in programming too.

The blog will be different this time as I won’t be hosting on my home server myself and it will be much looser about computer science but will always have some tie.

So if you’re intrested in computer science, cryptography, software architecture, software patterns, or all forms of programming, I hope you can stick around!