martes, 17 de diciembre de 2013

Learning online

Almost two weeks since the last post, too much time! But it has not been only my fault (playing for example Rome Total War II), it has been because in my free time I've been learning online.

There are three main sources of knowledge that are taking my free time, two for developing and one for languages. The ones for developing are where I'm spending most of my time because represents what I need to do now and what I want to do in the future. The language source is part of hobby and part of long-term plans for my life, but I think better explain that in order:

First I want to introduce you iTunes U, a really really big repository of knowledge that you can access from your iTunes for free. There you can find lots of different courses about different topics: history, science and, of course, development. My favorite one is the University of Stanford course about developing in iOS 7 (that you can find here). I've tried to learn iOS developing with a couple of books, but only with this course I've been able to understand the basics. In every class there are a slides presentation and at the second half a practical example, everything explained in a comprehensive way easy to understand by a non-english speaker. In addition here you can find the whole collection of podcasts made by Mike Duncan about the history of Rome that as a lover of ancient history I found a perfect mix of entertainmentand culture, give it a try!

The second knowledge source is CodeSchool that is not only a series of videos and slides like iTunesU, but there are 'code labs' to practice every part of the lesson you've done. There are various topics (all related to developing) like Ruby, Rails, CSS, javascript, JQuery... It has gamification so you earn badges and points when you are advancing in the different courses. You REALLY learn here but the sand part is that's not free, but it's only 27$ per month so it's not expensive.

And finally the last one. Since the first time I was in Germany I loved the country and Berlin over all, My wife and I have plans to go to live abroad in the future and as Germany is a good place to go I started to learn german on my own. Needless to say that without a teacher is a hard language to learn but I make it for fun so it's ok for me. One website that I use often to improve my german is Deutsche Welle where you can find lots of exercises and theory to improve your language knowledge.

So, that's all for today, I hope that you find those website as useful as I do.

martes, 3 de diciembre de 2013

Working with versions: Git




What's Git? Wikipedia says: In software development, Git /ɡɪt/ is a distributed revision control and source code management (SCM) system with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux kernel development in 2005. Based on a recent survey of Eclipse IDE users, Git is reported to have 30% adoption as of 2013.

What does that mean? Well, the most basic example of the use of git is a web/app/somethingelse which is developed during days/weeks/months. During that time your code is evolving and changing, adding new features and solving bugs. But sometimes you make a mistake and modify parts of the code that you shouldn't modify and the worst part is that you think that everything is OK. Weeks later you realize that something in your code doesn't work and the origin is a code your erased/rewrote weeks ago. If you are using Git you don't have to worry, only search for the old code and add it to the new one, easy!

The other situation which Git is very useful is when you're working with a team of developers. Everyone is working with his own copy of the code, but when someone has finished some feature of new classes, everyone will be able to download it to his own copy almost seamless, only worrying about the files both has modified.

In the first case we only need a local repository, once initialized Git will track all of the modifications of your code. When you feel that want to make a 'snapshot' of your code, you can commit the changes and add a message. Then using for example SourceTree you will be able to see all your commits and dive through them.

In the second case you'll need a shared repository, the most famous is GithHub. GitHub allows you to have any number of public repositories (everyone can see your code) and if you pay you can have private repositories, which is useful for companies. You can work with your own code as long as your wants before adding the others code to your own, but it's a bad practice because the more you waits the more code you'll have to add which can lead to divergences and bugs.

Last but not least is the ability of Git to work with different branch of code. Typically there are three branches: production, preproduction and development. The first is the application in his most stable form, the one that is in the store or you use to show the development to the client. The second is a stable version in testing mode, in theory there isn't bugs here. And the third is where the new code is tested. In addition every developer has his own branch where he is saving his own code and when he is sure that it's ok he will merge it with development, where at the same time when is tested will be merged to preproduction that will be merged with production.

As you can see, Git is an extremely useful tool that maybe is a little hard to use, but it's worth it!

Some useful links:
- Git homepage.
- SourceTree, a very useful Git client.
- A big tutorial about Git.

martes, 19 de noviembre de 2013

Learnings from my first apps

Well, I think it's a good begining talking about my first apps and what conclusions I have taken from it. Until now I have developed three apps but for now only one is in the market, it is a tiny app for a tabletop-RPG called Hackmaster with permission from the editor, its main use is to roll critical hits and fumble, very basic. One of the other two apps is being developed by a startup and has to be online in a few days, the other was developed in group at the Android postdegree and sadly was not finished.

So, here are the conclusions. My idea is to expand those ideas each one in a different post because I think that are very very important and add other subjects as I learn it.


First think, second draw and third develop.

Maybe it's logical and the thing that everyone plans to do, but for what I've seen the developers what to love is, well, develop. Planning the classes diagram, the flux of data is really boring, but is a huge mistake not to do that. After three hours of coding you're going to see that X class is not necessary or Y method has to be rewritten, but in this case you're lucky. The worst case is to see that everything that you've done the last week is useless, that's really frustrating.

The solution is first try to think all the functional specifications of the app, draw it to do it more visual and when all is compiled in a single document let's apply all the technology to do what the functional document says. One of the most common mistakes that we de developers do is to think directly in technology and his limitations. I think that's better first decide what we want to do and then how we're doing that.

At this point is not only OK to see the limitations, we've to search for it! We've to search for all the things that can make the project go wrong and be able to prevent that.


Layouts for different designs

Doing layouts is one of the most frustrating things in the Android app development, there are so many devices with their own differences that's almost impossible that the app can be seen perfectly in all of them, but we have to test the app in every device we can especially the older (and ugly) the better. We've to know the flaws of our app and be sure that everyone can use it!



Version repository

 Until I began to develop with Android I didn't used it, I have heard of the existence of Git but I never realized how useful is. Even if you're developing alone is a good way to have your code safe and be able to see how your code has evolved through the weeks. If you are working with a team using Git is absolutely mandatory, how many hours in the university I would have saved with Git...

With Git a team can be working with the same app at the same time and if the code has a good structure (the first point) to add the other developer's code in your own is easy and seamless. Also, you can easily have different versions of your code (production, preproduction, development...) and switch into them easely.



Here I presented three points that I think are of capital importance, but are not the only, for sure I'll find more and as soon as I can post it here. The next posts I'm writing speak about those three main ideas, I hope they'll be useful.

domingo, 10 de noviembre de 2013

First entry

So here's another new blog, but not my first blog (nor the second). Until now what I've written in the Internet have been a bunch of unrelated (or uninteresting) things, that's what I want to change. Besides, this blog will be written in english not in spanish/catalan as the other blogs I've written.

The main goal of 'The Ghost in the Circuit' will be to post little articles about stuff that I think that may be interesting: developing (Android & iOS), music, tabletop RPG and other things that i find or discover.

So, let's start...