New project up on the main site

March 28th, 2009

I just added another project to my projects page. It’s the Control Panel I’ve been developing for SherWeb in the past few months.

It’s been deployed for all our clients since tuesday, and it been a roller coaster of a ride since then. There were a bunch of features that hadn’t been properly tested, some because we simply didn’t have the time, others because only a huge number of users could find in such a short time.

I basically spent the entire week identifying, fixing and publishing bug fixes. It was a pretty entertaining experience. Lots of pressure, but in general, the new Control Panel was very stable. I expected more errors with the large number of users we’re supporting. It’s faster and easier to navigate than the original Control Panel.

I want to give props to my colleague Marc — I wish I could link him, but he has no site — for being as awesome as he is and for helping me out with tasks and bug fixes on this project. He’s a life saver and one of the greatest guys I know.

A good word for Jonathan. I copied loads of code from the original Control Panel’s code, and he developed most of it. Good job!

All in all, I’m very proud of this product. It’s stable, reliable, fast(er) and safe. I really enjoy working for SherWeb. There’s always a new challenge ahead while it remains the domain of Web development, which is what I love.


Idiomatic programming

June 2nd, 2008

So I spent a part of my day researching Perl as I’m setting up Request Tracker at work and it’s made in Perl. While reading loads of blog posts on why Perl is good and why Perl is bad (I get sidetracked sometimes), I starting wondering if I was using the languages I know properly. That is to say, idiomatically.

Many of those blogs posts had comments on why people agreed that Perl sucked or that it rocked. They often compared it to other languages, saying so and so was better most of the time. I actually chuckled at a couple of arguments that went back and forth since most of them were about style issues.

Nobody seems to like languages for what they truly are, and that is a programming language. Just like english and french, they are a matter of personal tastes and what you’ve been raised with, in a manner of speaking. I was raised by a francophone1 family and I learned english later on in my life. I am far from being a perfect speaker / writer in this language, but I still love it and I think I have a really good grasp of it.

To get back on track, there are lots of people who seem to only swear by one language (Perl, Java, Ruby, Python, C++, etc.) and hate all others. They want to do everything with their language of choice. I don’t understand this. I always feel like people writing those “opinions” are 15 year-old trolls.

Why do they think their view on a particular language is right? There is no such thing as a universal programming language. Sure, you can do everything with most, but it doesn’t mean that it’s the best, most efficient way. And isn’t that what programming is all about? Creating good, efficient applications that solve problem in the simplest way possible?

That is where idiomatic programming comes in. Programming languages were invented with an idea in mind. Python for example was created to be simple to read, learn and code. It is massively extendable from C to .NET. Java was made to be entirely object-oriented. I’m not going to go into more details, you can probably find what idea was used as foundation for each and every language that exists.

Using a language to make every application you need is stupid and an insult to the language you are using wrong and the one you aren’t using right instead. It isn’t only a concept based on ideas for programming it’s also how you use the language. Doing things in a pythony way instead of a C# way when doing C# is bad.
Writing Python? Learn the most you can about basic type such as lists and dictionaries, they’ll save your life and loads of bloated code.

Doing

1
2
3
4
5
6
7
    a_list = [1, 2, 3, 4, 5, 6, 7, 4, 3, 2]
    temp_list = []
    for element in a_list:
        if element == 2:
            temp_list.append(element)
    for element in temp_list:
        do_something(element)

instead of

1
2
3
    a_list = [1, 2, 3, 4, 5, 6, 7, 4, 3, 2]
    for element in [x for x in a_list if x == 2]:
        do_something(element)

is not a Pythony way and should be avoided.

I’m not here to tell anybody how to use their favourite languages, I’m far from a master of any language at all. But one thing I know is that I’ll never claim to be one, and I will surely never be able to say that a language is better than another just because I don’t know it enough or dislike its syntax.

The goal is to make sure that someone that knows a bit about the language you are writing will be able to skim through it and understand what it’s meant to do.

Example of things that shouldn’t be because they kill idioms on sight (will be kept updated when I remember things or discover them):

  • Microsoft’s .NET WebForms. Because it goes against everything the HTTP protocol declares.
  • PHP general messed-up-ness. Nothing is constant, you have to know most of it by heart because the STL it has is nothing short of messed up.
  • Using tables for layout in HTML or using deprecated HTML 4.0 style tags and attributes instead of CSS.

Notes

Francophone means a person or group that speaks french, for you people who assume us Quebecers are “french”.


Cool font for Windows XP

May 24th, 2008

If any of you are using Windows for developing, you might know that the XP fonts are kind of annoying to the eye. Vista introduced Consolas and are now offering it for download.

It’s a highly legible font and it pleases my eyes.

It also looks much better with ClearType activated. ClearType can be turned on by going to the Control Panel, double-clicking the display icon, going into the appearance tab and selecting effect. The second listbox there should let you choose ClearType.

It’s pretty much eye orgasms.


CSS fluid layout with sidebar

May 19th, 2008

So it seems that a lot of people are trying to achieve this. More and more people are becoming aware of CSS and its awesomeness and I think it’s about time. We’re not in 1996 anymore.

Then, getting a nice horizontally fluid layout isn’t very easy for most. If you try pixel widths, you can’t make it fluid, if you use percentages, borders start to mess things up and it’s not sharp enough.

I’ve found this solution on the internet, though I can’t remember where.

Here is the html:

<body>
    <div id="sidebar">
        Your sidebar here, menu, whatever
    </div>
    <div id="content">
        Your content, headers, all kinds of fun.
    </div>
    <div id="footer">
        footer text.
    </div>
</body>

And here is the CSS:

#sidebar
    {
     width: 250px; /* whatever width you want in pixels or % */
     float: left;
    }
#content
    {
     margin-left: 250px; /* same as the #sidebar width or more if you want space */
    }

And there you have it. You can mess around with width and all that. You just have to make sure that your next div (#footer) is cleared on both sides (clear: both;) or your content might be over the next divs.

So that’s it. Now you only have to have designer talents and you can build awesome sites with sidebars. You can easily add a sidebar on the right with the same method, but floating your div on the right. My sidebar is currently working that way, you can look at the code.

Have fun with it.


Tag testing

May 19th, 2008

I’m just trying out some tags here to set up the CSS.

And here is some ruby code in a pre tag:

1
2
3
4
@accounts = Account.find(:all)
if @accounts.nil? or @accounts.empty?
    @accounts = []
end

Here we go

May 15th, 2008

So I don’t really want to derail this blog with random stuff. But let’s just say that I picked up a really, really nice friend tonight. She is beautiful.
Oh yeah


New blog!

May 14th, 2008

Just a placeholder until I take the time to set everything to my tastes.
So here it is. A real Wordpress blog because even though I thought about coding my own, I have other - more important - things to do.

So on this blog, I’ll post about stuff that I care about, mostly programming thoughts and solutions. Occasionally, I might post nonsensical rants, just because. I hope I get some readers!