Posted on: 19-Apr-2015

Earlier today I read a blog-post titled Of Debt And Decisions. It got me thinking...

I know that I tend to be a perfectionist. I want my code to be perfect both in functionality and style. Bug-free, fast and well-coded. And that's how it should be. Right?

 

Read the full article and/or post a comment...

Posted on: 24-Mar-2015

Every now and then someone will say that we need more programmers. That every child should learn to program in school. That programming is the new writing.

I disagree.

In every field you will have a few people who are at the very top of their profession, more who are just good, even more who are average, and yes, you will also have some people who plainly suck.

Let's face it, not everyone is suited for every job. Just as most programmers will suck at being a salesperson or an actor or a physician or a lawyer, so will most lawyers or actors or salespeople suck at being programmers. There is a finite supply of people who are suited for any given job.

 

Read the full article and/or post a comment...

Posted on: 27-Feb-2015

Maybe it's because I'm relatively new to JavaScript. Maybe I'm just getting old. But yesterday evening JavaScript really pissed me off.

I was refactoring some code. After the change it didn't work as intended. There was no error-message, the code just didn't do what it was supposed to do. At first I thought it was because of some floating-point problem, but it wasn't.

 

Read the full article and/or post a comment...

Posted on: 26-Feb-2015

Today I read on a mailing-list that someone is planning to release the code to a small app as open-source, but he needs to clean it up a little bit before he does that.

Which made me laugh as I'm currently in the exact same spot. I'm currently in the process of rewriting something in JavaScript, which I originally wrote years ago in Pascal.

 

Read the full article and/or post a comment...

Posted on: 21-Jan-2015

This is going to be a dry and boring post. Seriously. If you don't want to waste your time, just go away. I mean it. Hmm... you're still here... well, don't say I didn't warn you... :)

In my previous post I compared the performance of Node.js 0.10.35 and io.js 1.0.2. Since both relased new versions - Node.js 0.11.15 and io.js 1.0.3 - just yesterday, I thought I should retest. (Hmm... both released new versions on the day after my blog-post... I'll just pretend I'm innocent... I probably am... Yes, I'm certain... And I'm gonna stick to that story, no matter how long "they" will interrogate me...)

 

Read the full article and/or post a comment...

Posted on: 19-Jan-2015

tl;dr - Depending on whether you use Node.js or io.js, you may experience performance differ by a factor of more than 5 for identical code.

[Update 21-Jan-2015: There is now a new blogpost that compares Node.js 0.11.15 and io.js 1.0.3. It also gives additional data and an explanation why io.js 1.0.2 performs so poorly in one of the tests here.]

First of all, let me make something clear. This is not, and cannot be, a comprehensive test. Every application is different. Depending on what your Node application does, my findings may or may not apply to your use-case.

 

Read the full article and/or post a comment...

Posted on: 15-Jan-2015

During most of my time as a software-developer I have been using Pascal as my primary language. Mostly using Delphi on Windows. About a year ago I switched to FreePascal on Linux.

But I have also done some programming in C and have recently started using JavaScript, mostly on the server-side with Node.js.

 

Read the full article and/or post a comment...

Posted on: 09-Jan-2015

We all know that we should frequently refactor our code, so that it stays in good shape despite all the things we changed or added.

So let's show up hands who of us actually does this? Oh... only a few out of all the people here? Just what I thought... :)

Hmm... how can we actually get this done, then?

 

Read the full article and/or post a comment...

Posted on: 08-Jan-2015

While writing yesterday's blogpost, I noticed that I have several places where I load templates for blogposts, index-pages, RSS-feeds, whatever.

And I also noticed that each time the code is several lines long and that a lot of it gets repeated every time.

Let's take a look at one example:

 

Read the full article and/or post a comment...

Posted on: 07-Jan-2015

Today let's take another look at blogforum.js.

At the end of course is the initialization-code. Above that is the RequestListener() callback which checks what the user wants to see, and then sends the request further down the line. And we have handleBlog() and handleBlogIndex().

First thing we notice is that handleBlogIndex() does a lot of stuff which is not just routing further processing, but which is actual processing. Well, that doesn't belong in this file. It's on a different level of abstraction. So let's move it to its own file handle-blog-index.js.

 

Read the full article and/or post a comment...

Posted on: 06-Jan-2015

In my endeavour to make the code for my blog-engine better, I will start with the main file, blogforum.js. Everything starts here. So I may as well start here too. :)

Let's begin with some code-cleanup. And by that I mean eliminating some console.log() statements which were used for debugging and have since then been commented-out. No need to keep those.

 

Read the full article and/or post a comment...

Posted on: 05-Jan-2015

Hi, my name is Michael Schöbel. I am new to Node.js and also pretty new to Javascript. I am NOT new to programming though. I'm 46 years old now and I have been programming professionally ever since I was 18. But almost all of my work has been done in Pascal.

If you want to see what I can do in Pascal, take a look at this: deusu.org

BTW: The sourcecode I wrote for the search-engine technology behind DeuSu is on GitHub. It is named OpenAcoon as DeuSu's predecessor was named Acoon.

 

Read the full article and/or post a comment...

A Programmer's Diary