There’s no reason to be scared, anybody can code now. So just do it!!

I was thinking over this days on how the development tools have evolved. I think that anybody can just start doing code now, with only some little training or just following some of the courses that exist over the Internet. I’ve been working on software for several years, and as I can tell that I hadn’t a really hard time as the first Assembly or C coders did, things weren’t as easy as they are now.

Obviously, this doesn’t mean that anybody can be a Programmer, even less a Software Engineer. For getting into that, I think, there are more topics that need to be covered beyond how to code or use an IDE. Concepts of data structures, memory management, networking and OS internals are really important to do the things correctly, not just doing them.

But for that, there’s a lot of info too. Even more, there are some schools or private institutions that offer “converting” your non-software degree onto something pretty similar to a Bachelor on Computer Sciences.

Thanks to the new Visual Studio 2012, Nuget, Entity Framework, MVC3/4, WebApi, etc. starting on the .net world is much more easier than it was 6 years ago. Frameworks like jQuery and YUI are helping people to get into the Javascript world with much less difficulty, and the same has happened with Cake for PHP and Spring/SpringRoo on Java.

So there is no reason to be scared, anybody can code now. So if you have an idea, or you’ve wondered if can do coding as a hobby, just do it! Maybe you have a million-dollar idea 😉

 

Tic-Tac-R source code

After some tweaks, I’m releasing the source code of the Tic-Tac-R game. As you may find on the previous post, this game is an experiment on how to make a simple Tic-Tac-Toe game in a real-time web application using SignalR and host it on a cloud environment using Windows Azure.

I hope you find it useful for learning just as I did

Download the source code on Github

Updates to Tic-Tac-R. Now it works on Windows Azure =)

This is an update of my previous post

Update: Post with the source code of the game

After spending a lot of time testing and searching on the web, I wasn’t able to get the Tic-Tac-R game on my Windows Azure website. I tried a lot of things and can shameless say that I was totally lost, since my application was working fine on a shared hosting environment (GoDaddy) but not on my Windows Azure.

Thanks to an anonymous user that replied my question on StackOverflow I was able to know that this is a weird issue only happening there with some sort of caching by Windows Azure (neither really a bug on my app nor SignalR). The suggestion was changing enforce the transport to be Long Polling and with that the app started to work no the cloud. It is kinda little slow though, and I feel that some times the call that I make from the browser is lost, but is’s maybe just my imagination… Time and more testing will give us the answer… In the meanwhile, you play the game can be part of the beta testers of this simple game… It’s free!! =P

By the way, I updated SignalR to the just released 0.5.3 version and everything seems to keep working fine..

I hope you can share your opinion regarding Tic-Tac-R. It will be really appreciated it =)

Tic-Tac-R is alive!

After several weeks of work (and intensive learning) I’m releasing Tic-Tac-R for beta testing.

Tic-Tac-R is a little experiment of creating a traditional Tic-Tac-Toe game using SignalR, and it can be played here.

On the next days I will be posting the code on GitHub, once we’ve done all the changes and fixes that might come from the beta testing period.

So then, enjoy the game!

HealthyHarry: A healthy version of the traditional snake game over HTML5

As an experiment for learning HTML5 Canvas, I created this small game based on the popular “Snake” that many of us played on our old mobile phones (A Nokia 3320 in my case)

I deployed the game one of my Windows Azure websites and you can access it here. Initially I was thinking of buying a hosting account on a different place, but I think the cloud is a good place for host this kind of pet projects and Windows Azure is a great option, (IMHO) for 2 things: 1) Is extremely easy to use (saying creating websites, databases, deploying, etc) 2) It is free for 90 days, which is great if you are starting on the cloud “wave”. Let’s see what happen when the cloud bills begin to come.

So then, enjoy the game online for at least the next 60 days (when my free account expires :P)

The source code is hosted on Github. Feel free to do whatever you want with it

Send content to the layout using a Helper on CakePHP

This post is based on Robert Conner’s code forCakePHP 1.x., and I made some changes to get it to work onCakePHP 2.x . The original post can be found here.

Maybe some people have faced problems trying to send some content to the layout on CakePHP. By content I mean not only a simple string but a whole a piece of HTML code. To solve this, we can create a Helper on CakePHP 2.x, according to the following steps:

1. Create the Helper

On theViews/Helpers folder, you need to create the .php file for the helper. In this case we will call it LayoutHelper.php

class LayoutHelper extends AppHelper {
 var $__blockName = null;
 function blockStart($name) {
  if (empty($name))
   trigger_error('LayoutHelper::blockStart - name is a required parameter');
  if (!is_null($this->__blockName))
   trigger_error('LayoutHelper::blockStart - Blocks cannot overlap');
  
  $this->__blockName = $name;
  ob_start();
  return null;
 }
 
 function blockEnd(&$view){
  $buffer = @ob_get_contents();
  @ob_end_clean();
  $out = $buffer
  $view->viewVars[$this->__blockName . '_for_layout'] = $out;
  $this->__blockName = null
 }

 function output($var) {
  if (isset($var) && $var != null)
  echo $var;
 }
}

2. Setting up the content

For setting up the content that we want to send to the layout, we use the Helper

$layout = $this->Helpers->load('Layout');
$layout->blockStart('custom_content');

Right after this, we specify the content that will be sent to the layout

<div>Custom content</div>

and we close the block

$layout->blockEnd($this);

3. Show the content

For showing the content on the layout, we add the following

$layout = $this->Helpers->load('Layout');
$layout->output($custom_content_for_layout);

As we can see, this is really simple and also very useful when trying to customize the content on the layout according to the view we are loading

I wrote this article also on The Bakery