I truly believe that since I joined tacitknowledge the best tool added to my portfolio has been git (Yeah even more important than IntelliJ).
For those that do not know what is git, it is a Source Control Manager, what it does is to keep a truly history of what has happened to the files in the directory it is managing, all of this without of the need of having another server managing this versioning (of course you can have a Continuous Integration server where you can centralize shared code, but here I am talking about having git in your local environment without the need of having to be connected to internet to commit your changes).
For people that do not know about git, go to the following page http://git-scm.com download git for the operating system you're on, open your git shell or a terminal in case you're in Unix environment, choose a folder you want to keep track of and type "git init" and press enter, this will prepare all things git requires to start versioning, now is time to add the files you want to version by executing the command "git commit -a -m 'First Commit, starting to version all files'" and there you go, you have your first commit.
In later posts I will start to share all things you can do with git, compare file versions, create branches, rollback to a previous version, revert your changes, merge branches, reset your changes and more.
The Craft of Software Engineering
Thursday, November 24, 2011
Tuesday, May 31, 2011
Continuing with Finally things
More weird things happening in Finally clauses:
Believe it or not, most probably believed, the returned value is the one in the finally clause ("Hello World"), well after all that's expected since the last executed line in the method would be the ones in the finally clause.
But...
Returns "Hello" only!, it seems that it only takes into account what you do with the reference before the finally clause.
Now... The same thing does not happen if you change state in an object, for instance:
Returns "Hello World" so the assumption applies only for references, not state.
String guessWho(){
String toReturn = "Hello";
try {
return toReturn;
} finally {
return toReturn + " World";
}
}
Believe it or not, most probably believed, the returned value is the one in the finally clause ("Hello World"), well after all that's expected since the last executed line in the method would be the ones in the finally clause.
But...
String guessWho(){
String toReturn = "Hello";
try {
return toReturn;
} finally {
toReturn = toReturn + " World";
}
}
Returns "Hello" only!, it seems that it only takes into account what you do with the reference before the finally clause.
Now... The same thing does not happen if you change state in an object, for instance:
StringBuilder getFinallyResult() {
StringBuilder builder = new StringBuilder();
builder.append("Hello");
try {
return builder;
} finally {
builder.append(" World");
}
}
Returns "Hello World" so the assumption applies only for references, not state.
Monday, April 18, 2011
Guess what is thrown
Today it happened we asked ourselves the following:
Which one is going to be really thrown? Make your best guess and put in the comments section what you expected to happen and what really happened and why?
try {
throw new NullPointerException();
} finally {
throw new IllegalArgumentException();
}
Which one is going to be really thrown? Make your best guess and put in the comments section what you expected to happen and what really happened and why?
Ask me if I learned
First day,
First task, how to install a drive in a mac book pro 17'', after that installing the OS and all the needed tools, it is the first time I have ever used a macbook for anything.
I liked very much that I saw one colleague trying to find the best name for a method, then refactored the code inside that method and finally avoided all kind of duplication there might be.
This is what I was talking about.
First task, how to install a drive in a mac book pro 17'', after that installing the OS and all the needed tools, it is the first time I have ever used a macbook for anything.
I liked very much that I saw one colleague trying to find the best name for a method, then refactored the code inside that method and finally avoided all kind of duplication there might be.
This is what I was talking about.
Thursday, March 31, 2011
Welcome to the Major Leagues
18 days more lefting to join a new company. The first thing one of my new co-workers said to me after telling him that I was willing to join there was this: "Welcome to the Major Leagues".
Three years have passed since the day I applied for the first time to this company, from that time to date, I have read about 20 books related to software engineering and tried to practice what I learnt from there (the things I liked) in the daily job.
When I applied for the first time they rejected me, and they had their reasons, and I understood what the reasons where after I read The Pragmatic Programmer, my first software engineering book.
Now the time has come and I am going to join this company where only selected, really selected people works, I'll be what Chad Fowler says in his book "The Passionate Programmer" the worst in the team, I know I'll make a lot of mistakes at the beginning and that the road won't be as straight as I would like it to be, but that is what will make the things interesting and fun.
Now with an increased portfolio and new programming techniques learned I am still joining this company to learn, to learn and practice a lot, and to learn from people that are the best, not only in Mexico but in the complete planet earth.
8 months had to pass to post a new entry in the blog, I know now that they'll come frequently, why? Because when I created this blog thing I said that I was going to post the things I'll be learning to share it with others, and I truly believe that starting from the first day working there I'll come to know a lot of new stuff.
See you in April 18th.
Three years have passed since the day I applied for the first time to this company, from that time to date, I have read about 20 books related to software engineering and tried to practice what I learnt from there (the things I liked) in the daily job.
When I applied for the first time they rejected me, and they had their reasons, and I understood what the reasons where after I read The Pragmatic Programmer, my first software engineering book.
Now the time has come and I am going to join this company where only selected, really selected people works, I'll be what Chad Fowler says in his book "The Passionate Programmer" the worst in the team, I know I'll make a lot of mistakes at the beginning and that the road won't be as straight as I would like it to be, but that is what will make the things interesting and fun.
Now with an increased portfolio and new programming techniques learned I am still joining this company to learn, to learn and practice a lot, and to learn from people that are the best, not only in Mexico but in the complete planet earth.
8 months had to pass to post a new entry in the blog, I know now that they'll come frequently, why? Because when I created this blog thing I said that I was going to post the things I'll be learning to share it with others, and I truly believe that starting from the first day working there I'll come to know a lot of new stuff.
See you in April 18th.
Friday, June 25, 2010
Legacy Code
At the time of this writing, I have received different definitions about what is legacy code. Some people say that is mainframe code, other people that its structured oriented code such as in the C programming language.
I think I will stick with Michael Feathers definition. "Legacy code is code that does not have tests. No matter how beautiful it is or how object oriented is, code withouth tests are not telling us if we have broken something when we change the behavior of the code".
In his book "Working Effectively with Legacy Code" Michael show us many different ways to handle this type of legacy code, starting with the affirmation in chapter 6 "I don't have much time and I have to change it" it show us that making changes to the code creating some tests and proving that our code is safe save us a lot of time to do other more important things such as going on vacation to a warm beach or playing soccer with your friends.
Give a shot to Michael Feathers book, read it and improve your efficiency at work.
I think I will stick with Michael Feathers definition. "Legacy code is code that does not have tests. No matter how beautiful it is or how object oriented is, code withouth tests are not telling us if we have broken something when we change the behavior of the code".
In his book "Working Effectively with Legacy Code" Michael show us many different ways to handle this type of legacy code, starting with the affirmation in chapter 6 "I don't have much time and I have to change it" it show us that making changes to the code creating some tests and proving that our code is safe save us a lot of time to do other more important things such as going on vacation to a warm beach or playing soccer with your friends.
Give a shot to Michael Feathers book, read it and improve your efficiency at work.
Wednesday, December 16, 2009
SITEC 2009 Thoughts
Well finally I am having time to write about the congresses I went to last month.
The first one I will talk about is the SITEC 2009. It was the first symposium organized by the Instituto Tecnológico de Celaya and it was good.
The conferences given by other people were interesting and I like them. What I did was to give a conference about refactoring and a workshop about Design Patterns. Everyone were staring at me to know what I was going to say next.
Good times at a well organized symposium.
The first one I will talk about is the SITEC 2009. It was the first symposium organized by the Instituto Tecnológico de Celaya and it was good.
The conferences given by other people were interesting and I like them. What I did was to give a conference about refactoring and a workshop about Design Patterns. Everyone were staring at me to know what I was going to say next.
Good times at a well organized symposium.
Subscribe to:
Posts (Atom)