benad is currently certified at Apprentice level.

Name: Benoit Nadeau
Member since: 2002-04-03 17:23:09
Last Login: 2014-04-22 17:48:00

FOAF RDF Share This

Homepage: http://benad.me/

Notes:

I am Benoit Nadeau, jr. eng. in Software Engineering,
living and working in Montreal, Canada.

Projects

Recent blog entries by benad

Syndication: RSS 2.0

A Code's First Draft

Incremental software development, or evolutions of it, is now pretty much the standard approach, as we now expect requirements to be changed all the time. But this too easily leads to "over engineering", as since we expect change at all times, we spend too much effort on maximizing the flexibility of the code over any other quality.

I admit that in the past I too fell into the trap of over engineering my code, for the sake of "beautiful design" over functionality, making the code far too unnecessarily difficult to understand. From that experience, I now make incremental design changes more reactively.

Practically, it means that I always make a "first draft" of my code with minimal design, and then, based on that experience, make a second draft with a first draft of the design, all that before the first wave of requirements changes. This is quite different than software prototyping, where the first iteration is expected to be deleted or completely rewritten over time. In my case, most of the code of the first draft remains, but moved and refactored to fit the first design change.

The first code draft is done primarily as a proof of concept that demonstrates feasibility, to reduce future risk as much as possible. That way, regardless of future design or functional changes, at least we have a simple functional version of the code. That first draft could even be used as some "sample pseudo-code" to document the functional mechanism of the code, outside of the design and architectural complexities that are added later on as the software grows. That implies that the first code draft should be so clear and simple that it is (almost fully) self-documented.

Secondarily, it helps in making worthwhile design decisions early. Once you have working code, it's easier to see what design patterns would be useful, and precisely where. You can see in context the costs and benefits of each design pattern, and only those that are worth it are applied as a first design iteration. Once additional features are added or existing one changed some new design decisions may be needed, but if by the time of the second draft you have sound code and design, it will be easier to adapt than if you greedily made inappropriate or unnecessary design choice.

At some point, though, the extra effort in doing design changes on top of purely functional coding changes may be too costly if requirements changes are chaotic or indisciplined. This may be why so many programmers invest in design upfront while they have the chance, dooming the code to over engineering. The software engineers may be the only ones in the software development process that can present (and defend) the impact of endless changes on quality (bad code, inappropriate design, etc.), so over-design may be indicative of greater organizational issues.

Syndicated 2015-06-01 02:18:25 from Benad's Blog

The Mystery of Logitech Wireless Interferences

As I mentioned before, I got a new gaming PC a few months ago. Since it sits below my TV, I also bought with it a new wireless keyboard and mouse, the Logitech K360 and M510, respectively. I'm used to Bluetooth mice and keyboards, but it seems that in the PC world Bluetooth is not as commonplace as in Macs, so the standard is to use some dongle. Luckily, Logitech use a "Unifying Receiver" so that both the keyboard and mouse can share a single USB receiver, freeing an additional port. In addition, the Alienware Alpha has a hidden USB 2.0 port underneath it, which seems to be the ideal place for the dongle and freeing all the external ports.

My luck stopped there though. Playing some first-person shooters, I noticed that the mouse was quite imprecise, and from time to time the keyboard would lag for a second or so. Is that why "PC gaming purists" swear by wired mice and keyboards? I moved the dongle to the back or front USB ports, and the issue remained. As a test, I plugged in my wired Logitech G500 mouse with the help of a ridiculously long 3-meter USB cable, and it seems to have solved that problem. But I remained with this half-working wireless keyboard, and with that USB cable an annoying setup.

I couldn't figure out what was wrong, and willing to absorb the costs, until I found this post on the Logitech forums. Essentially, it doesn't play well with USB 3.0. I'm not talking about issues when you plus it the receiver in a USB 3.0 port, since that would have been a non-issue with the USB 2.0 port I was using underneath the Alpha. Nope. Just the mere presence of a USB 3.0 in the proximity of the receiver creates "significant amount of RF noise in the 2.4GHz band" used by Logitech. To be fair (and they insist on mentioning it), this seems to be a systemic issue with all 2.4GHz devices, and not just Logitech.

So I did a test. I took this really long USB cable and connected the receiver to it, making the receiver sit right next to the mouse and keyboard at the opposite side of the room where the TV and Alpha are located. And that solved the issue. Of course, to avoid that new "USB cable across the room" issue, I used a combination of a short half-meter USB cable and a USB hub with another half-meter cable to place the receiver at the opposite side of the TV cabinet. Again, the interference was removed.

OK, I guess all is fine and my mouse and keyboard are fully functional, but what about those new laptops with USB 3.0 on each port? Oh well, next time I'll stick to Bluetooth.

Syndicated 2015-05-03 21:48:04 from Benad's Blog

Electricity Savings: All Those Blinking Lights

As part of my "spring cleaning", and partly inspired by this "Earth Hour" thing, I did an inventory of all the connected electrical devices around my apartment.

I basically categorized them this way:

  1. Devices that are used all the time and must be connected: Lights, electrical heating, fridge, water heater and so on.
  2. Devices that are seldom used, but cannot be turned off completely or disconnected easily: Oven, washer, dryer, and so on.
  3. Devices that are on all the time, for some reason.
  4. Devices that are used enough to warrant leaving them in "low-power standby mode".
  5. Devices I should turn off completely or disconnect when not used.

While I can't do anything for the devices in categories 1 and 2, other than replacing them, my goal was to move as many devices to either standby or turned off as possible. For example, my "home server PC", a Mac mini, doesn't use much power, but do I really need to have to running all the time? So I programmed it to be in standby, and wake up only during the afternoons on weekdays.

For devices already in standby mode, are they used enough? For example, my Panasonic Blu-Ray player kept being warm, since it remained in standby mode, for what? About 10 seconds of boot time? Since my TV takes that much time to "boot up" anyway, I just need to power on both at the same time, and I'll save all the electricity of keeping it in standby all the time.

I am generally less worried about laptops, tables and other battery-operated mobile devices when they stand in standby. They are already quite energy-efficient, running on batteries or not, especially when not actively used. Still, unplugging them from chargers reduces risks if there's an electrical surcharge in the apartment's wiring.

Syndicated 2015-03-30 20:26:00 from Benad's Blog

Alpha: My First PC

The PC port of Final Fantasy VII that I recently completed was the first of many PC-only games I wanted to play, but queued up because playing PC games is inconvenient. I have a 2011 Mac mini that I can dual-boot in Windows, which is what I mostly used for FF VII, but rebooting was slow, the mini was noisy, and its graphics card simply unable to properly play games made after 2010. I have a late-2013 MacBook Pro, but I keep using it for work, it's inconvenient for playing on a TV, and its graphics card could have been better.

I insisted on using Macs, even for PC games, because "gaming PCs" are just too much trouble. Almost all small-form-factor PCs sacrifice graphics performance for size and quieter fans, including the mini. On the other end, even your average "gaming PC" is expensive, a bulky tower with neon lights and require manual assembly. Here's the thing: I can do all of that without problem, from building a PC server to maintaining Windows Server. But that's what I do at work. It's as if there is not such thing as a "casual gaming PC for your TV". Well, at least until the Alienware Alpha, essentially a small-form-factor gaming PC.

The Alienware Alpha is presented as a kind of video game console. While it runs Windows 8.1, its default user account is running a modified version of XBMC that replaces the Windows desktop, and lets you run Steam in "Big Picture" mode. The entire setup can be done (a bit clumsily) using the provided XBox 360 controller (oddly, with its USB dongle for wireless use). For me, though, I already had my wireless mouse and keyboard (and a USB mouse with a long USB extension of FPS games), because I want to play older PC games made for a mouse and keyboard, so I ultimately disabled that "full screen" account and set up a standard desktop Windows account.

And you have to accept that the Alienware Alpha is a PC that isn't that user-friendly and requires tweaking to play games. For example, the frame rate of "Metro: Last Light" was terrible because it was using outdated nvidia libraries; updating the library files made the game much faster. Or Geometry Wars 3 had terrible lag issues, until you run it in windowed mode or manually edit its settings file. Actually, the simple fact that the Alpha's nvidia card is "too new" to be recognized by older games is enough to force you to tweak all the settings. I'm still curious about dual-booting into SteamOS, a Linux distribution of Steam that has a proper "console feel", though most games I want to play are PC-only or not in Steam in the first place (from GOG, actually).

With all that said, the Alpha is a pretty good PC. I was able to plan all the games at maximum settings at at least 30 frames per second, and much more on games made before 2012. It's well optimized for 1080p, which is less than 4K support from current-gen 3D gaming cards, but is perfect for TV use. The hard drive is slower than my MacBook Pro's SSD, but the 3D card is so much better on the Alpha that I don't mind the extra load time. You can still easily replace the hard drive in the Alpha with a SSD, and you can upgrade pretty much everything else but the motherboard and 3D chip, with detailed service manuals. It has an HDMI passthrough, digital optical audio output, many USB 2 and 3 ports (and even a hidden USB port underneath, perfect for my wireless keyboard dongle). Finally, its price is competitive, meaning absurdly cheap compared to similar specifications from Apple.

What I'm saying is that the Alienware Alpha is a good "entry-level" casual gaming PC for use on a TV, without the hassle of a typical PC tower. That, and I now have a PC. I still feel a bit weird about that.

Syndicated 2015-01-14 00:33:59 from Benad's Blog

The Last Retro Final Fantasy

Going back to my previous post, I'm a bit relieved that Final Fantasy VII didn't live up to its hype. And what hype. When released in 1997, it was backed by the unprecedented weight of Sony making it the flagship game of their first foray in video game consoles. The game was marketed everywhere as a kind of "movie as a game", placing emphasis on the FMVs (part of a $100 million publicity campaign, including television and cinema, for 3 months). For many, Final Fantasy VII was their first video game experience.

Let's step back a bit and look at its predecessor, Final Fantasy VI (named "Final Fantasy III" on Nintendo platforms). Its setting was exactly halfway between "Dungeons and Dragons" style of fantasy and Shinto-style fantasy in the present day. It does so by making its setting a world where magic vanished for a thousand years and the world evolved into a "steampunk" style. It successfully explains, through its story, the source of magic in this world, including deep ethical considerations of its use.

The game presents the story through a large group of characters, without a clear, single "hero", and this is done deliberately so as an important theme later in the game. The dramatic elements are at times mature and dark, yet presented subtly (as if to evade Nintendo's sensibilities), dealing with themes of death and suicide unseen on a kid-friendly game platform before. For years I found the game to dark for my liking, the same way I disliked Zelda: Majora's Mask. The themes in Final Fantasy VI are perfectly integrated with the gameplay, visual art and music. Speaking of which, the game's graphic design and music are masterpieces of their authors, Amano and Uematsu.

But Final Fantasy VI was too weird. Being overly focused on its artistic statements, it doesn't please enough neither Western nor Japanese sensibilities. A cross between steampunk and Dungeons and Dragons, with multiple narratives and realism like Game of Thrones? That's not what kids want? And so with VII they started pandering to their audience, with anime-like effeminate "Japanese Boy Band" characters, over-the-top drama presented with in-your-face imagery that make Evangelion subtle, lots of FMVs and cool characters, and since they won't really like RPGs anyway, let's throw as many mini-games in there as possible.

Over time, they became niche of their own captive market anyway. But mass-market appeal pretty much died out with Final Fantasy: Spirits Within, meaning that people that never played any Final Fantasy are unlikely to even try the latest instalments. Still, the damage was done. A new generation of video game players didn't really cared about gameplay, but more the over-pretentious low quality movie experience that surrounds it. It's style over substance, and even if you focused on the art, it was superficial crap made for teenagers that didn't knew any better. The latest Final Fantasy XV trailer looks like an expensive car ad. Magical realism can only go so far before it becomes ridiculous (Zoolander, the game?).

Essentially, Final Fantasy VII and Sony started a movement that, by the mid-2000s, nearly destroyed the video game industry, temporarily saved by the Wii and morally questionable free-to-play games. Only with the recent raise of retro and indie gaming we are starting to see the market increase again.

All to say that I now hate Final Fantasy VII with a passion. Its predecessor is a timeless masterpiece, and I'm not saying this out of nostalgia or because I was influenced by marketing as a teenager. Final Fantasy VI is the best RPG I can recommend, and is now out on iOS and Android, also 50% off at $8 (Canadian Dollars) until January 5, 2015.

Syndicated 2014-12-31 01:49:20 from Benad's Blog

113 older entries...

 

benad certified others as follows:

  • benad certified benad as Journeyer
  • benad certified llasram as Journeyer
  • benad certified shlomif as Journeyer

Others have certified benad as follows:

  • benad certified benad as Journeyer
  • llasram certified benad as Journeyer
  • pasky certified benad as Apprentice

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page