Posted on September 2nd, 2010 No comments
My latest web project, People & Business Development, has recently been selected by HTML5 Gallery, a website that showcases exemplary HTML5 websites with the objective that their implementations serve as a reference for web developers. It also features a dedicated page with the description, rating and suggestions of improvements so that webmasters of the showcased websites can perfect their creations.
HTML5 Gallery being a popular website, the impact on People & Business Development’s visits has been dramatic, as well as its ranking in Google (ended up at the 2nd place for some keywords).
Think I’ll put some interest in CSS galleries too
Posted on August 9th, 2010 No comments
At the company I’m currently working for, there’s a big poster on the wall with the following headline : “if you see something like this, please raise your hand to improve code quality”. Below is the content of that poster – a list of things to avoid when coding – from Martin Fowler’s refactoring book.
- Duplicated code : the same code structure in two or more places is a good sign that the code needs to be refactored: if you need to make a change in one place, you’ll probably need to change the other one as well, but you might miss it
- Long methods : longs methods should be decomposed for clarity and ease of maintenance
- Large class : classes that are trying to do too much often have large numbers of instance variables. Sometimes groups of variables can be clumped together. Sometimes they are only used occasionally. Over-large classes can also suffer from code duplication
- Long parameter list : long parameter lists are hard to understand. You don’t need to pass in everything a method needs, just enough so it can find all it needs
- Divergent change : software should be structured for ease of change. If one class is changed in different ways for different reasons, it may be worth splitting the class in two so each one relates to a particular kind of change
- Shotgun surgery : if a type of program change requires lots of little code changes in various different classes, it may be hard to find all the right places that do need changing. Maybe the places that are affected should be all brought together into one class
- Feature envy : this is where a method on one class seems more interested in the attributes (usually data) of another class that in its own class. Maybe the method would be happier in the other class
- Data clumps : sometimes you see the same bunch of data items together in various places: fields in a couple of classes, parameters to methods, local data. Maybe they should be grouped together into a little class
- Primitive obsession : sometimes it’s worth turning a primitive data into a lightweight class to make it clear what it is for and what sort of operations are allowed on it (eg creating a date class rather than using a couple of integers)
- Switch statements : switch statements tend to cause duplication. You often find similar switch statements scattered through the program in several places. If a new data value is added to the range, you have to check all the various switch statements. Maybe classes and polymorphism would be more appropriate
- Parallel inheritance hierarchies : in this case, whenever you make a subclass of one class, you have to make a subclass of another one to match
- Lazy class : classes that are not doing much useful work should be eliminated
- Speculative generality : often methods or classes are designed to do things that in fact are not required. The dead-wood should probably be removed
- Temporary field : it can be confusing when some of the member variables in a class are only used occasionally
- Message chains : a client asks one object for another object, which is then asked for another object, which is then asked for another one, etc. This ties the code to a particular class structure
- Middle man : delegation is often useful, but sometimes it can go too far. If a class is acting as a delegate, but is performing no useful extra work, it may be possible to remove it from the hierarchy
- Inappropriate intimacy : this is where classes seem to spend too much time delving into each other’s private parts. Time to throw a bucket of cold water over them !
- Alternative classes with different interfaces : classes that do similar things, but have different names, should be modified to share a common protocol
- Incomplete library class : it’s bad form to modify the code in a library, but sometimes they don’t do all they should do
- Data class : classes that just have data fields, and access methods, but no real behavior. If the data is public, make it private !
- Refused bequest : if a subclass doesn’t want or need all of the behavior of its base class, maybe the class hierarchy is wrong
- Comments : if the comments are present in the code because the code is bad, improve the code
Posted on May 18th, 2010 3 comments
Mon nouveau projet, réalisé en tant que freelance et en collaboration avec le graphiste Quentin Flamant, est le site web pour la société People & Business Development. L’objectif principal est d’assurer une présence en ligne de cette dernière, y compris dans les réseaux sociaux (tels que Twitter, Facebook et LinkedIn), afin de présenter son activité et ses services. Le surf sur mobile étant une tendance en vogue, une version optimisée pour l’iPhone et l’iPod touch a également été développée.
Présentation de la société
Actif depuis une dizaine d’années, People & Business Development est un bureau spécialisé en coaching, en formation et en conseil pour optimiser le potentiel humain des organisations et, en conséquence, le chiffre d’affaires. Leur liste de clients comporte des noms tels que Alstom, la Commission Européenne, Delta Lloyd Life, Securitas ou encore Gefco.
Le site web
La version iPhone et iPod touch
Ci-dessous, des captures d’écran de la version dédiée à l’iPhone et l’iPod touch. On notera notamment la détection de l’orientation permettant une lecture plus aisée de longs paragraphes de texte ainsi que l’intégration au menu de l’iPhone et l’iPod touch, permettant un accès direct au site web.
Cliquez pour agrandir
Cliquez pour agrandir
L’objectif de ce post, outre l’aspect publicitaire, est de présenter une application concrète de bon nombre de mes précédents posts, incluant :
- Why you should use a CDN for your website ?
- W3C : Validate green in XHTML strict with ASP.NET
- A standards-compliant alternative to target=”_blank”
- The IE nested lists whitespace bug
- Custom paging in ASP.NET with ListView & DataPager
- Implementing the Bing API in a ASP.NET website (part 1)
- Implementing the Bing API in a ASP.NET website (part 2)
- Writing a clean CSS
- Website referencing & management
Bonne visite !
Posted on April 26th, 2010 1 comment
My blog being a little more than 1 year old now, I wondered what’s my audience in the world. So here are the results based on Google Analytics :
Audience in the world
First observation : audience is worldwide, which is pretty cool.
Second observation : top 5 countries are
- United States
- United Kingdom
These results aren’t surprising to me :
- My blog being written in english, US is the biggest audience
- Myself living in Belgium and blogging about belgian events (such as Visug, Techdays), here’s why this little country ends up second
- India, offshoring a lot of software development, holds the third place
- UK : same conclusion as for the US
- France : having started recently to blog some posts in french, it has led France to enter the top 5
1st : United States
Best audience is coastal states. Makes sense in a way : isn’t the pinnacle of the geek attitude to be on the beach, laptop on the knees ?
Top 5 states are :
- California : has always be my highest audience in the US since the beginning
- New York
2nd : Belgium
Best audience is Brussels area and the north of the country. Hey walloon guys, what are you doing ?
3rd : India
Top 5 cities in India are :
And that’s it for this post ! Thanks everyone for your interest in this blog !
Bonjour à tous,
Il s’agit d’une première sur ce blog : un billet en français. Le but de ce dernier est d’annoncer que seront postés désormais des billets dans la langue de Molière.
On oublie Shakespeare alors ?
Non, pas du tout. Certains billets seront en anglais, d’autres en français. Les deux coexisteront désormais sur ce blog. Pour faire la distinction, les sujets des billets en français seront marqués par le tag [FR], comme c’est déjà le cas pour ce billet.
Pourquoi cette séparation en 2 langues ?
Simplement car je trouvais illogique de blogger à propos de choses typiquement francophones en anglais. Un excellent exemple à ce sujet est la revue du livre Réussir son site web en 60 fiches, réalisée en anglais pour des raisons de cohérence. De la même manière, des événements tels que des formations, séminaires, etc méritent d’être signalés dans la langue appropriée.
A new logo for Visual Studio (illustrated above) and the MSDN were recently introduced. I personally find ‘em pretty damn sweet : sober yet powerful. Also note that the MSDN has not just a new logo, but the whole website was refreshed at the same time, featuring new services. Details about this can be found on Scott Hanselman’s blog.
“A comprehensive coding standard is essential for successful product delivery. The standard helps in enforcing best practices and avoiding pitfalls, and makes knowledge dissemination across the team easier.”
- Juval Lowy
As this statement says and from your working experience, you surely know how a coding standard is an essential thing. Juval Lowy, founder and architect at IDesign, an industry and world-class leader bureau of software architecture, puts at our disposal his standards about C# and WCF. Since he published these ones, they’ve become the de-facto industry standards. Needless to say they’re worth casting a glance at.
Also don’t forget that there are no best standards and what defines a good one is how well and how uniformly you apply the one you’ve defined. Hope you’ll find these resources interesting !
Maintenance cost is a huge part of a software life-cycle (about 70%, according to many sources)
Thus, keeping that in mind when developing is an important thing : it’s your today’s work that greatly influences the future maintenance costs. A lot of good practices have been defined about writing better, cleaner code, with comments, separation of concerns, a right choice of architecture and patterns, etc. The point of this post is not to cover all these points, which are already extensively discussed by many articles on the web but to talk about one less-known but surely not less important aspect : the functional aspect.
The functional aspect, a point our architect Pierre-Emmanuel Dautreppe justifiedly insisted on, consists of writing code that, when read, is just like reading the functional rules that are behind it. Let’s take a simple example :
if (state.Code == 4)
This is the kind of thing we see too often, where developers code to make things work but where other ones (and even themselves some months later) will wonder “what does that mean ?”. One thing you could do is to comment that :
// If we are at the final state, call method "DoSomething()"
if (state.Code == 4)
Obviously, this is not the preferred solution. Even with a less verbose comment, the problem would remain the same. Comments can be handy to explain a bunch of tricky lines of code, but when possible, write good code that is self-descriptive. Indeed, your code would quickly become messy if you need to comment every single line or condition (like the example shown above). Secondly, code is always up to date (because it’s always reflecting the application in its current state) but that’s not the case of comments, which developers sometimes (often ?) forget to keep up to date. And these comment updates have a cost too, needed everytime the code is modified. Let’s look now at our final example :
That’s it ! Isn’t it much better like this ? Of course, we need to add a boolean property to the State class, which can be considered as redundant because the same information can already be accessed via the Code property, even if it’s less clear. We, developers, are used to think about “memory optimization” and such concerns, like thinking twice before adding another variable or property to a given class. But the bigger costs in software development is not the hardware (exceptions kept apart), it’s the human cost behind it. And here was shown a very little example, but just imagine if the project you are working on was written like this…
Completely unuseful but so cool ! More seriously, it’s sometimes helpful to keep in touch with friends/colleagues and I’m soon gonna work on a way to use Twitter in a slight different manner for a website project (I’ll talk about it later). So I obviously needed to start with the creation of an account…
As every good web developer, you have to test your website under different browsers such as Firefox, Safari, Opera, Chrome, etc. And of course, all of these programs must be installed on your machine and kept up to date. This is where Xenocode comes in : you connect to their website and thanks to a virtualization process, you launch the application you want from a catalogue, without the need to download or install it. Very handy !