Saturday, November 15, 2014

Contributing on Github

This is one of those things I end up doing now for the third time, and since it is not something I do pretty often, I always forget the steps since I don’t work with git on my day to day job. Also, as Scott Hanselman suggested some time ago, you should write a post for future reference, chances are it will also eventually help others.
So here it is, this is my step by step guide on how to contribute on a Github repository (actually any git repository) you don’t own. When you own it, it’s obviously simpler, we’ll see that part too, but when you don’t own it and don’t have enough privileges to push your changes to your repository, you need to create a pull request.
Little disclaimer: I’m not a git wiz or anything, I’m just annotating the steps that I found that worked for me for what I wanted to do. If there is a “better” option or you see anything that should be done differently, don’t hesitate to leave a comment.

Fork it

So, if you want to pull a request, you have to have a repository to pull from. To do that go to the upper right corner of the repository page and hit the fork button (I assume you already have a github account).
fork

Clone it

Ok, you have your “own copy” of the repository, but where? yeap, up in the sky. You now want to bring the sources to your hard drive. To do that you need to clone the repository. In order to clone it you need first to know the clone address, you’ll find that address again in your repository fork page under HTTPS clone url (clever, uh?)
So, open a command line, yes a command line, the command line is your friend, go to the directory where you want the source code to go and type:

git clone
 
After that you’ll see some magic. If it’s the first time you’ll be asked for credentials.

Do some work and commit the changes

After the transfer is done, you have your own local copy, of your own repository in your hard drive, now we can start changing what we want.
Always remember git status, git status is also your friend and it is the one that will tell you what’s going on. If you run git status right after the clone, you’ll get a message saying everything is up to date. But if you do run it after you modified a file, you’d get a message saying there are some changes but it’s not being tracked, which means it will not be committed, so you’ll need to add the files to what’s called as stage.
To do that type:
git add –a
 
If you run git status now you’ll see everything is ready for commit, so, let’s commit that.
git commit –m “your commit comment goes here”
 

Push it

Now you need to push the commit to the server, in this case, the forked repository. If you come from non-distributed version control systems and don’t know why is there a commit and a push I suggest you go read a little bit about git and distributed version control systems. Also, there’s a pretty good hand-on lab tutorial that helped me start with git (Try Git).

git push
 

Pull request

Now go to the original repository and create a pull request. You’ll see that you’ll be able to see you own repository commit where you’ll create the pull request.
And that’s it, you just created a pull request and hopefully it’ll be accepted and merged into the original repository.

Remote add

That’s it? well, not exactly. Chances are, you’ll want to keep your copy of the repository up to date so you can continue contributing. In order to do that you need to add another remote repository to your local copy. This remote will be linked to the original repository you forked from.
So type:

git remote add
 

Keep your copy up-to-date

You need to update your local copy from the original repository, the one that changed, since I’m the only one working on my own fork.

git pull master
 

Again, push

Keep in mind you just pulled the changes from the original repository, this changes are not in your own forked repository, so you need to push those to your fork.

git push origin master
 
 
And that’s pretty much all you have to do. Keep in mind you’ll be iterating thru pulling from the original repository, adding your changes, committing and pushes your changes and creating pull requests to the original repository.
The following diagram pretends to show you a “big” picture about the procedure.

git

As mentioned before, I’m not a git wiz or anything like it so if anything goes wrong, you’re pretty much on your own. Because as a common statement of this blog, this is 100% “works on my machine” certified.

workonmymachone

Read Full Post

Friday, May 30, 2014

Cross-platform is a feature

The way of making software has changed a lot since the early days, it has changed more than what the software itself has. Think of an old green-screen program where you had a lot of data entry to do. Now think of a brand new (smooth, spa) web application also for data entry, they might even look the same, but I’m sure the process of building each is totally different.

Nicol├ís Jodal mentioned in a recent keynote that the way of creating software is much more complicated than what it used to be. I couldn’t agree more, and I’ll try to explain here why.

Back in the old days when you were asked for a piece of software, you had (almost every time) the chance to choose the programming language and tools of your choice. Were you good at php, or asp? you could work in whatever you wanted and then tell your customer what hardware he needed to run the software you would provide. Sometimes of course, the client would tell you he had an old Linux server he wanted to use for that piece of software. Then, you would go to your office (bed room?) and hack for days in order to get to the promised schedule with something good enough to show your client. Once you had the program “done” you would deliver it to the client. There were some features he wanted but never told you about. He wanted the software to run smooth, with no delays (I remember 3secs per page load being the affordable top) and of course, secure. He didn’t want it to be hacked.

Now everything is a little more complex than that.

When you are asked for a program, it’ll will most likely be for a phone and/or tablet. That’s where the trends are. You could be asked for an app or a whole solution with back-end integration with existing software. Plus, you’ll most likely be asked to provide services to talk to other programs, and also consume from other programs. One thing is clear: you will have to provide many platforms.

Being good (expert) in Java and provide one single “flavor” of the app for Android is not good enough. You will have to learn Objective-C for iOS and C# (or Javascript) for Windows Phone. And that’s just as of today, we have no idea what will come next.

So a lot of people realized that, it is not something new, and are trying to provide some layer of abstraction so you don’t have to actually learn everything that comes out.

Xamarin provides you with a single language approach, where just by knowing C#, you can create native apps for every major smart device platform. That is OK, but still, you need to learn how the different programming models work.

Let’s say you want to show a small message in you app, you would have to write something like these depending on the platform:


Toast.MakeText (this.Activity, "Please verify your Xamarin account credentials and try again", ToastLength.Long).Show();


var alert = new UIAlertView ("Could Not Log In", "Please verify your Xamarin account credentials and try again", null, "OK");
alert.Show ();
alert.Clicked += delegate {
LoginView.PasswordField.SelectAll (this);
LoginView.PasswordField.BecomeFirstResponder ();
};


The first line is for Android, while the second snippet is for iOS. Trust me when I say they’re both C#, but as you can see, when developing for Android you need to learn what Toasts and Activities are. While for iOS the code looks totally different and you need to learn about the UIAlertView, program it’s delegate for the callback and so on.

As you can see, the language is not the problem here, the problem is that you still need to learn a lot from every platform you are targeting, and this is a simple example of course.

Xamarin recently released Xamarin.Forms. This trends to solve this problem by adding another layer with controls and pages that match a specific control in Andoid and iOS.

The other problem I see with traditional approaches, and this brand new from Xamarin, is that you need to write your business rules in a Word document (?) and then write the code, and sometimes also comment that code to explain what is supposed to do. That means that you have the same information in 3 different means.

Wouldn’t it be great if you could have all that information someplace centralized and versioned, let’s say a model? And run some process for which its output is the program that implements those rules? Wouldn’t it be great if once you have your Android app you could just (after tweaking some properties) run the process again and have your iOS app ready?

Wouldn’t that be awesome?

You cannot afford to learn everything if you really need to, I’m not saying it would be fun, but if you really need to do real world stuff that just does not scale up. What if a new platform shows up? Would your customer wait for you to learn the new thing (say Swift)?

It just does not scale up.

I mentioned before about Find my Plane, the flight tracker app I built which is now for Android, iOS and Windows 8. I could have never done that app for every platform in the time it actually took me. And now I’m able to prototype and deploy new versions easily, why? because I work on a model where I declare what I want to happen next and then I run this process to generate the many versions of my app.

image 

That’s why I believe Genexus is on the right track. I’m not saying it is done or solves every developer problem, but it sure helped me and thousands of developers around the world to take their apps out there. On time.

NOTE: The code shown above was taken from the actual app from Xamarin Store. You can download the app here: http://xamarin.com/sharp-shirt

Read Full Post

Sunday, March 16, 2014

9 reasons to use Genexus for cross-platform development

I recently came across an article talking about the best 5 reasons to use some particular product for cross-platform development, but when I read the article all I saw was smart devices development. I know we’re using the word platform for many things nowadays, but if you ask me, smart device technology is just one platform. Desktop apps and web apps are two more platforms that need to be added to the mix.

So, I thought I would write a post, from my own point of view and list the reasons why anyone considering writing cross-platform apps, should take a look at Genexus.

Disclaimer: I currently work for Genexus, but prior to joining them, I used their toolset in my previous job. And even though it will be difficult for me to be objective, I’ll try to stick to facts and leave my subjective opinions aside. These are my own thoughts.

If you’re not familiar with Genexus, let me give you a little background. Genexus is a 4GL development tool which represents your entities (or classes) in a a structure called Transaction. You define your structures (Transactions) and do not have to worry about the physical representation of the data, because Genexus is smart enough to create a 3NF normalization of your data in the database engine of your choice.

With that knowledge, Genexus will create the necessary programs to access the data, but you always have complete control of the program. You can define rules and access control. It’s everything you’re used to, but easier.

With that introduction, here’s my list of reasons why Genexus is THE TOOL to start paying attention to.

1. One Language to rule them all

If you’re a Genexus developer you can skip this one. If not, I know what you’re probably thinking: “do I have to learn another programming language?”. I’ll be honest with you.. yes, you do! But there are two primary benefits of learning the Genexus programming language.

  1. If you know English, you’re 50% closer. The Genexus language is really simple. Of course you have control flow statements, variable assignations, and basic native functions to perform every task you do, as with every other programming language.
  2. The Genexus programming language has been around for more than 25 years. It has evolved and improved over time. Can you imagine yourself using one single programming language for more than 25 years? Can you imagine your level of expertise in that language? You don’t have to move on, Genexus does it for you.

2. Real cross-platform

As I mentioned earlier, Genexus has been around for over 25 years. We didn’t generate native iOS apps back in 1989, we had COBOL and XBase. Then RPG came along. Then there was FoxPro for Windows, Visual Basic and Visual FoxPro, then Java, C# and Ruby for the web, plus HTML and Javascript, and recently Objective-C, Java (for Android and BlackBerry) and Javascript for WinJS and the new Microsoft stack.

So, we know what cross-platform is all about.

3. Native apps

We always thought of Genexus as a platform agnostic tool, so no matter what your target is, your same Genexus programs will execute in every platform. But that does not mean “platform ignorant”. We know where you what to run your programs. And we know what the best practices, or ways to execute programs, depends on the specific target platform. For that reason, we generate native target platform code. Take our Android-generated apps, for instance: you could open the generated sources with Eclipse, or use XCode for our Objective-C iOS generated code.

Let me be clear. You don’t have to -- there’s actually no need to do that -- I’m just saying you could if you wanted to.

4. Faster development

Well, of course is faster. But I’m not going to give you some marketing/sales pitch – but I can share my personal experience with you. I created Find My Plane for Android, iOS (iPhone) and Windows 8 (Modern UI) in a month using Genexus Smart Device toolset.

Do you think you can do better than that? Let me remind you that every app has specific layouts for its platform. I did reuse some of them, but most of them are exclusive for its target platform.

5. Practically no bugs

Of course we have bugs. But when you generate your code, most of the time you will generate the bug over and over again, so it’s easier to find. You could write an event and, if there’s a bug, it will depend on our event-firing mechanism or on our generated version of your code. What I’m saying is, our event-firing mechanism is the same for every event no matter what the developer wrote, so it’s really well tested (and used).

6. Model based

Since I started talking about architecture, let me tell you that Genexus is model based, which is a great feature.I won’t take up space to here to explain why that’s a great thing. Gaston created a list 8 reasons supporting the superiority of model driven development and you can find it here: 8 reasons why Model Driven Development is great.

7. Real world scenarios

We have all seen a cool demo about a new development tool, language, or technology where, with just a few key strokes you get a “Hello World!” kind of example up & running. Genexus is more robust than that. Of course, I could show you the “Hello World!” text on an iPhone in less than 5 minutes, but that’s not what Genexus is all about. Genexus is about real world stuff… from a little flight tracker app, to a huge world class ERP, and believe me, there are tons of great examples in between.  

8. Future Proof

There’s no much to say here. We told our RPG/Cobol users we were future proof; we also told that to our VB/Visual FoxPro users -- so now we are telling you we are future proof. But what does that mean? It means that no matter what the big players are going and no matter they are doing, we will take you there. And what if new players show up? We will be there too. In fact, right now we are working on our Windows Phone generator, and adding iBeacon support to our apps.

9. Free DB reorganizations

This item should get a whole post by itself. If you know Entity Framework, think of Genexus as Entity Framework on steroids. What happens when you need to move an attribute from a table to another or remove a whole table because you managed to merge its data into other tables? Genexus takes care of that. I know it sounds like black magic, but don’t just take my word for it -- give it a try yourself.

I didn’t want to write a marketing post, but I know I failed. The thing is I do believe Genexus is a great tool for agile software development. I know what some people is thinking because I’ve been there too: “I like to program my own code”, “I don’t want a generator” (and yet you use a compiler). I thought the same way. It’s a whole new world, and a whole new way of approaching a software development problem. It requires you to get out of your comfort zone, learn something new. But I guaranteed, you will never look back once you create your first app in half the time you would have using traditional tools.

Read Full Post

Sunday, May 05, 2013

Privacy Statement for Windows Store Applications

 

We are committed to maintaining your confidence and trust, and recognize your right to keep your personal information private. We maintain the following privacy policy to protect personal information you provide:

Basic Privacy Policy
The application does not store any personal information at any time. If you share personal information, such as your username, Live ID, IP or email address, we will keep this information private and confidential. We will use this information only to save the application settings and progress across multiple platforms or installations.
Information collected during the use of the application
All remotely stored information will only be used for the purpose of determining the most popular features, and to determine what to develop later.
We do Not share information with third parties
Personal information and usage statistics of the application will not be given to third parties, except as necessary to fulfill the purpose for which you provide your information, or legally required, as in the case of an investigation of an offense criminal serving a search warrant.

Read Full Post

Thursday, February 07, 2013

My very own Microsoft Surface RT experience

I’ve been trying to write this post for a long time now, but I’m glad I didn’t do it right after a month or so of use. I’m glad I waited all this time because there a few things that now look a lot different. Although there are some things that I have not change my mind of, some of them good, some of them bad.

I started using the Surface a little skeptical, I was looking for apps that would make me use the device. It was not easy at the beginning. Just a few apps in the Windows Store and some of them you could tell just from the icon that were pieces of crap. And that was Microsoft’s fault, they let people upload apps with the default icon Visual Studio would add to your test app (a black cross). They did change that and the store started to look better.

When talking about the Surface I guess you need to separate 3 different aspects of it. Its hardware, its Metro side (yeah I said Metro, deal with it), and the Desktop side.

Hardware: Great! I love the hardware, I love the resolution and the fact that the screen is 16:9. It’s great when reading plain text to use it portrait. It is super responsive, the first time you grab a Surface you want to swing around the start screen (I guess that’s all you can do) and it is very responsive or as Microsoft says it, fast and fluid.

The gestures are not that intuitive, you have to learn them, but once you do they feel pretty natural.

The Metro side. It’s ok. I like the fact that every app looks the same, so you know where to go look for stuff. Whenever I come across an app that does not follows Microsoft UI guidelines (*) it takes me a while (30 secs?) to understand how to use it. I also like the Semantic Zoom and the ability to have a big picture view of my apps.

The Desktop side. What a piece of crap!. Why is it even there? I don’t want it!, but unfortunately I need it :(

The first time I got and email with an attachment in my Surface it was a log file (plain text), so how do I open those? with good old notepad, which runs of course as a desktop app. Calculator? desktop app. I have found Metro style replacement apps for these.

Why is the desktop side there? because of Office. Is it easy to use? hell no! Why do you think Microsoft’s previous tablets (with XP) never took off? Precisely because they had the same XP you would found on a desktop PC. Why didn’t Windows CE for phones wasn’t that big of a deal… because you had to be a friking genius with that little stylus in order to move around the OS. And now they add the same OS they had before in a 10.6 inches screen? Do you know how hard it is to hit the X on the top right to close Power Point? try selecting a word and make its font bold, it’ll drive you nuts!

Having that said, I had used Power Point with SkyDrive to prepare a presentation. I love the way SkyDrive integrates everywhere but I know you’d get that with DropBox also, although I have 25GB of free space on SkyDrive :)

As a developer there are a couple of reasons I use the desktop side. First of all, it comes with PowerShell which is needed to locally deploy apps. And second, there’s a cool feature of remote debugging your apps thru the Visual Studio remote debugger which is a desktop app. This app allows you to run your app in a Surface while debugging it with Visual Studio in your PC, and that’s a killer feature (for developer only of course)

So, to wrap thing up. I love the Surface RT, I love the way it feels and I love the fact that there are cool apps coming everyday (have you heard of Find My Plane? :) .Will I get a Surface Pro? Hell no! I have a notebook for that! Yes, it’s a huge 17inches heavy ass Vaio, I like the big screen, the Surface Pro is a netbook, and netbooks are just not for me. Everywhere I read about the Surface Pro they talk about how to hook it to an external monitor so I don’t think even Microsoft knows where is the Surface Pro targeting. (I really hope I’m wrong)

*: If you create your app with Genexus you don’t have to worry about this.

Read Full Post