Web Development, Better Done On GNU/Linux

Author: Jacob Barkdull on Friday, February 18 2011 Comments

I often tell people that setup, configuration, writing, scripting, and other general development of any website is better done on the same web server, or at least the same operating system that is installed on the web server that the site is going to be hosted and ran on, rather than developed elsewhere and simply dropped in place later. It doesn't matter whether you're using Apache or Windows Server, GNU/Linux or Windows.

For example, even little things like URLs matter a lot, because they need to be consistent with the operating system location paths, for example "/var/www/articles/bash.css" is written with forward slashes and is case-sensitive. If you write your code on Windows and deploy the website on GNU/Linux, you might end up in a situation where an entire website's HTML, CSS, JavaScript, and PHP files all have incorrect paths like "C:\\TildeHash\articles\bash.css". A recipe for non-functionality.

Furthermore, I often see people who write a large amount of code and/or spend hours writing the HTML, CSS, and JavaScript for the website's design in Windows, only to find that the source code doesn't look right in their text editor on their GNU/Linux server. This happens because Unix and Unix-like operating systems, like GNU/Linux and Mac OS, only place a "Line Feed" at the end of each line, where as in Windows a "Line Feed" and a "Carriage Return" are placed at the end of each line. So on Windows, files missing the expected "Carriage Return" read as one long line, on GNU/Linux, files with an unexpected "Carriage Return" read with double spacing, which doesn't make compilers, interpreters, nor text editors very happy.

That problem is actually one I hear a lot, and one I had myself before switching entirely to GNU/Linux, but the problem is bigger than just extra line breaks. Because the file originated from a Windows computer and the extra "Carriage Return" displays as "^M" at the end of each line or as a second line break, I often hear that PHP code won't execute or executes very slowly, or that their software for web development on the server won't open the files or opens them as corrupt gibberish.

Sometimes they don't even have web development software on the server at all.

The problem exists both ways, too. I often hear that after encountering and resolving many problems, they then find that they're having whole new problems when they attempt to work with the files again on Windows after making changes to them on their GNU/Linux server.

They see some opposite behavior and yet similar problems, like files display as only a single -- very long -- line, and web development applications either refuse to open them, open them corrupted, and/or certainly save them in the same manner that caused them so much trouble the first time around. All this can be avoided by simply using the same web server when developing the website infrastructure, using the same operating system that is installed on the web server, or using a capable text editor, though the problem can still persist if some programs handle the foreign newlines properly while others do not.

Compilers and interpreters may fail with obscure syntax errors even though the source file looks correct when displayed on the console or in a text editor.

Many people like GNU/Linux for developing websites and software, and how could I blame them. GNU/Linux has some of the best compilers, interpreters, debuggers, and professional software development suites around. Almost every text editor supports syntax highlighting and autocomplete for multiple languages, regular expression, and search and replace. While the more professional applications also have function calltips, IME support, integration with major source code control systems, built-in DOM viewer and editor, built-in HTTP inspector, built-in multi-language debugger, built-in web browser, and so much more!

And let's not forget the easy one-line "apt-get" command for installing and updating of an entire free web server application suite and it's many impressive extending components such as PHP5-FFmpeg, GD 2, etc.

In conclusion, if you're planning on developing a website on GNU/Linux, make sure to use a Unix or Unix-like operating system on your server. And if you're planning on developing a website on Windows for use on a GNU/Linux web server, stop right now and switch over to GNU/Linux, or prepare for a confusing mess.
Share This Page On...
Subscribe to Newsletter:
Advertisements: portfolio
On the blog...
HashOver Gets a Logo!
Regarding Identi.ca and Its Share Button
Did Brendan Eich Contribute to Firefox's Decline?
The NSA backdoor in "Linux"
The popularity of Firefox is definitely waning!
Critique of Gedit Syntax Highlighting + PHP Color Schemes