Here's just an accumulation of random thoughts I've had over the last couple weeks.
1.
First and most importantly, I'm running into the problem where I'm trying to build a monitoring system that hooks into the System.Diagnostics.PerformanceCounter class and logs data (to be used for reporting later on) ever X seconds. The problem I'm running into with ASP.NET is that I don't know, nor can I seem to figure out, the instance name for the specific application. When I'm hooking into the ASP.NET Apps vXXXX, this isn't a problem because it uses the IIS name (_LM_W3SVC_.....Root). However, when I need counters from the Process or .NET XXX objects, the instances show up as the actual process (all I get is w3wp, w3wp#1, w3wp#2). At any given time, I have no clue which process is responsible for which application. IISAPP.vbs doesn't help because that just gives me the PID, which I still can't use.
2.
SQL INSERT should support a WHERE clause which actually does an UPDATE for rows matching the WHERE expression. So instead of checking if something exists and doing an IF .. update ... ELSE insert ..
You can just do:
INSERT INTO Users (....) VALUES (...)
WHERE UserId = 3
3.
MySQL Stored Procedure language is based on the SQL:2003 ISO/ANSI standard. Compared to TSQL, it's still very young (as is the entire stored procedure support). My biggest complaint, which might just be a case of complete ignorance on my part, is that variables aren't prefixed. In a normal language, variable prefixing isn't important...but in SQL it's critical because you easily get into conflicts with column names. Take:
CREATE PROCEDURE GetUserById
(
Id INT
)
BEGIN
SELECT Username, Email
FROM Users
WHERE Id = Id
END
How will MySQL handle that? I don't know. We've simply settled on prefixing all our parameters/variables with an underscore.
4.
While we're talking about MySQL..If you are using MySQL, set the sql-mode variable to STRICT_ALL_TABLES. It's a joke that it isn't on by default - and something that's almost impossible to go back and fix. You can learn more here, but implicit behaviour sucks
5.
SQL Server doesn't escape my wrath today either. I don't think Microsoft should buy-out RedGate (because that might put an end to a good thing), but RedGates products certainly put a lot of the MS SQL Server client products to shame. The SQL Bundle is stupidly useful...matched only by Resharper.
6.
The single biggest problem with the Amazon Web Services is...that someone at Amazon decided to call them Web Services. If you've never heard of AWS,
what would you think? Another Web 2.0 web service to tie into some Amazon property, like their store, or their search or something. WRONG! AWS S3 is a cheap storage/bandwidth service...and EC2 (which we just love here at Fuel) is an "Elastic Cloud" network which lets us quickly scale computing power at the push of a button. Per hour billing of CPU cycles is very interesting to us, and as it gets easier and easier to do, it'll be a lot more interesting to everyone else too. It'd be great if EC2 ran Windows and they had worked out some great licensing arrangement with Microsoft, but it's such a great service
we're just not using MS products on there (we might try a mono-solution in the near future though). Microsoft and Google and the thousands of hosting companies are gonna have to adjust.
7.
Speaking of Content Delivery, if you are paying too much for bandwidth (like more than $1.00/gb) consider using one of the many newer CDN's out there. We prefer PantherExpress, but there's also CacheFly and Amazon S3. In my experience, you pay A LOT less, get MUCH better customer service and almost as good (in some cases much better) speeds as you do with the 2 big boys of the CDN industry.
8.
Can't finish this off without laughing at PHP. I've said it before, and I'll say it again, PHP developers and the PHP team itself just don't get object
oriented programming. The MySQLi extension is the OO way of connecting to a MySQL database (versus the normal MySQL extension). Not only does MySQLi support a completely procedural way of being used, but check out their documentation on how to use it:
Example 1417. Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
printf("Host information: %s\n", $mysqli->host_info);
/* close connection */
$mysqli->close();
?>
Notice those crapy mysqli_connect_errno() and mysqli_connect_error() calls? I'm sure the lack of exceptions will make Joel happy, but come on...this just plain out sucks!
