Posted by Sébastien Lachance with Comments (0)
2010 will be a great year and I’m sure that my life will change dramatically. I have a whole bunch of ideas and things I want to do. Here is a list of my “professional goals”.
Ever since I first heard of ASP.NET MVC, I knew I should become proficient in it. But I can’t control the type of project I’m working on, so I neglected to do my homework and stay up to date.
A big gap to fill. I’ve made some progress but still not able to do it efficiently. I will probably pick up some books and try to design web site from scratch just for gun.
I have some ideas of plugins that haven’t made it to general release. This year, I will definitely launch one to have a real experience with launching an open source project and responding to feedback.
Something else than the jQuery plugin mentioned earlier. I have made some “improvement” to BlogEngine.Net and maybe I will submit them some changes I’ve made.
95 posts to go and around 50 more readers. Completely feasible. I also picked some tips while I had a complete lack of posts for some month and I am now ready to apply them.
I need to finish Getting Things Done and try it for some months. A goal that I really need to complete this year.
I took some weight since the wedding in October 2009 and I can now see how it affect my health. So I am ready to take care of this again. It may not looks like a professional goal but I’m sure It will have a big impact in the end.
Yes, it's another meta-blogging post (see Jeff Atwood post on meta-blogging). But I think it's a relevant one. I finally made the big move and decided to use an hosting provider to host my blog. And more importantly, I switched from WordPress to BlogEngine.Net.
How I made the choice to go with BlogEngine.NET?
Back in July, I decided to create my own blog engine. So I began the development with exactly what I had in mind for the most fantastical blog ever. After a week and really slow progress (I was sure to finish development by the beginning of August, 1 month later), I decided to look at other blog engines to gather idea on architecture and what is needed to be implemented. I looked at Oxite and BlogEngine.NET (since they are in .NET). I had a big surprise. I haven't realized coding your own blog was so much work. In fact, BlogEngine.NET was already doing everything that I wanted (except for extension-less url).
And the ability to write your own theme is so easy! The BlogEngine.NET really did done a good job.
How was the migration?
Horrific. WordPress use a proprietary format and can't be imported directly into BlogEngine.NET. But it was no big deal since I wanted to reread all post and correct spelling and bad grammar, I decided to recreate them all. I used the WordPress statistics to know which post were the most read and done them first.
Uploading to GoDaddy.
I’m not an expert in hosting server. I guess the experience was relatively easy, if it wasn’t for the fact that I abandoned after 2 hours and when getting back, everything was working as expected. The important thing is that it worked and it’s fast.
My apologies to Wordpress.
I have nothing against you, really. You are a great service and a wonderful blogging platform. For 2 years you made blogging a unique experience. But my world is in .NET and you are not written in it. But again, thank you!
I’m way too late to post the conclusion of the trial, but for all of you who wanted to know here are the results.
Will I continue to use vi/Vim in my everyday life? Probably. But not for a little while. The experience was fun but I did not find that my productivity increased a lot. I can’t really say for sure. The problem I had was that I did not have a proper typing technique. So I found myself distracted because I was hitting the wrong key and caused side effects. So, I came to the conclusion that I needed to learn how to type properly.
I have already started to follow the lessons provided by typeonline.co.uk. And while typing with the proper skill in Visual Studio, I found myself missing viEmu real bad. I did not wanted to remove my hand from the keyboard to move around. Having seen what vi/vim was capable of, it’s a huge way back.
That was disastrous. No really. I had a lot of modifications to be made fast and it just seemed that viEmu was always in the way. I’m not blaming viEmu here, it’s just because I was not completely comfortable with it and I should had it deactivated for the rush. On another side, I learned how to do search without using Ctrl-F. Disturbing at first, a must now. 24 days left.
I’m starting to really like this. I’m much more confident and often I don’t need to think twice before using a command. Today I have used many times the “yank & put” keys along with v,V (selection) and o,O (new line before of after the current line). I am not required to think. So far, so good.
Today I had real opportunity to use gVim so I decided to install ViEmu for Visual Studio and give it a try. A had a lot of code to write on a recent application I'm working on so why not.
I'm starting to get a hand on basic navigation and on inserting/appending removing/deleting characters. It's too soon to know I it had improved my productivity yet, but I'm still learning so let's see in a couple of days how it goes.
Not been typing much today, but I wanted at least to clear something. How do I cut/paste inside gVim.
First you need to enter the selection mode by hitting "v". Then move the cursor to select text using h, j, k, l, w, e, etc. When the text is selected, hit "d". This will cut the text. Now hit "p" to put the line back.
On another note, I talked about vi/vim to some of my colleagues and friends and everyone is just laughing at me. Everyone seems to agree that there is no points in learning this and should stick with "what everyone do". I do hope to show them what it's really about.
Day 2 of the trial, I have gone through half the tutorial (up to Lesson 3.3) and I begin to see where the power of this vi/vim residing. The most annoying thing so far is the color scheme/font that is not remembered, but I'm pretty sure it will have to do with learning vi (maybe a hidden command or something :P, or maybe not and will have to modify a config file somewhere).
Here is a recap of what I learned today
First, I have been using the "w" and "e" key to navigate through text in "Normal mode" (Normal Mode is where you are when you are not typing, hitting ESC get you there).
Next, the "x" key. Again, in normal mode, you hit the x key to delete the remaining of the words. If you are at the start of the word, it removes it completely and if you are at the second characters, it remove all remaining characters after the cursor.
This is it. I learned a lot through the tutorial but haven't used it much so it does not count. Tomorrow I will try a few new commands to keep learning it until I'm a master of vi/vim!!
I've decided to give a serious try to the like of vi/vim. I have heard a lot of gossip around thoses editors and since it's supposed to increase productivity (and I want to increase my productivity), I decided that I should at least try it for 30 days. I've started this morning and found out that it's a hell of a learning curve.
I've downloaded gVim this morning and used it for all the things that involved typing (except Visual Studio, waiting to be more familiar with it). The first interaction was a little bit strange. I admit I had to use the mouse to start editing since I had no idea at all why I need to type "i" to start typing.
Later that day, I stumbled across the "why page" of viEmu, the author does a good job of clearing things. Mainly the use of the "normal" and "edit" mode. To start writing text, you need hit "i" and as soon as you are finish you hit "Esc" to get you back in navigation mode. The "normal" mode is where you need to stay at all time when you are not typing.
Where I have a lot of difficulty on this first day, is the use of the h,j,k,l keys to navigate through the text file. I'm still trying to apply the mnemonics of the first lesson of the tutorial (h is the leftmost key so you move left, j looks like the down arrow, l is the right most key so it goes right, and then k is up). I have not understood yet how it works since it's seem to go everywhere, but where I want it to go.
And the last things I learned is the :sav command, which is basically the save as function.
I have not picked all the terms correctly since it's only the first day and had not the time to read through all the tutorials. But I'll keep you up to date with my new way of typing.
I almost never give my opinion about code I see, but I felt this one was interesting and educative. It all started while working on a legacy project (an ASP.NET web application), I found out that most connections were not closed. So I fixed them all and making sure every connection was closed once the I finished with it, should an error occurred or not.
try { using (IDataReader reader = SqlHelper.ExecuteReader(Sql.MainConnection, "sp_name", paramter1, parameter2)) { while (dr.Read()) { //do something } } } finally { Sql.MainConnection.Close(); }
Pretty basic stuff. Today I deployed the application to a server for some testing. After two or three users getting in, Boumm! SQL Server is dead. I check the activity monitor and found out that a hundred connections were still open. The reason is : I have wrongly assumed that a static class in the project was providing me with a connection that was shared between all data access class.
I was sure I was closing all the connection, but I ended up closing nothing. Let’s take a look at the MainConnection property of the Sql class :
public static SqlConnection GetMainConnection { get { return new SqlConnection("connectionstring"); } }
Each time I was accessing the database, and it was accessed a lot (20 times per request), I ended up with a lot of open connections. Enough to make SQL Server unavailable for some time. You could argue that it was my mistake and I shouldn’t be assuming things like this. But in my opinion, it’s a case of bad naming. The choice of name for the property that return me a connection was inconstant. If I access a property, I assumed that if I call it five times in a row, I would have five times the same result. The best choice would have been to create a method that return a new connection and name it accordingly.
public void SqlConnection GetNewSqlConnection() { return new SqlConnection("connectionString"); }
It would have reduced the ambiguity and would have been a lot more easy to read. Good naming is very important and can greatly enhance productivity on a project. Good code should be easy to read and you should not ask yourself if a calling a method would cause side-effects or not doing what it said it should.
Technorati: Learning, .NET, SQL Server, DataAccess