Zend Studio for Eclipse
Right, lets get this out of the way. Zend Studio for Eclipse is a great tool and no other PHP IDEs come near to its level of Intellisense smarts, features, and integration. I’ve been using it steadily since version 5, before it was Eclipse, and I don’t see myself stopping in the future.
That said…
Most code editors have figured out this whole code folding thing where you click on the minus button next to the function block and it collapses into a neat declaration.
Zend Studio has this too, only with a slight twist. Most of the times it works right. Other times, it forgets to fold bits. Yet other times, especially when folding PHPDoc blocks, the fold swallows whole unrelated fields/functions that happen to be next to the one I want to fold, declaration and everything. Nice.
I could understand this slipping past testing given how intermittent it is, but ZS’s been around for at least a couple of years, and it’s got like a dozen version updates, one of which explicitly touted having better folding. Yeah, it’s better, because before it screwed up half the time rather than a 10th of the time. It still sucks.
And while on the subject of sucking, in what universe is it sensible that if I edit a file that exists in a ZS project outside of the environment, and then try to open it in ZS, it flips out in glorious fashion:
And then I right click on the offending file, click on Refresh, and it’s happy again. If it knows it’s out of sync, why the hell can’t it refresh it automatically? The file’s right there!
Makes me want to hit it. Surely I can’t be the only one running into this stuff?
Changelogs are nice
I’m talking to you, Windows Live 8046.206. If you’re going to make me go through a 5 minute installation, you could at least tell me what’s changed so I can look forward to it, especially when your latest update has no visible changes.
You see, I’m thrilled at the knowledge that some piece of the software I use every day received an update and got a little bit better. Maybe a potential security problem was solved, maybe some performance was added, or maybe some kink was ironed out. Whatever it was, I love the feeling that something that was making my life an insignificant bit harder is going to go away in the new release. Even if it didn’t affect me before, the knowledge that it’s not ever going to gives me a little bit of peace of mind.
But, you know, I have to know about it. If I don’t, I can’t feel good about it.
And it’s especially mean of you to have a large “What’s new” button that just takes me to your homepage. Then you’re just being a cocktease.
Initializing DataRows
How many ways are there to initialize a new DataRow with new values?
-
Set the DefaultValue property on the respective DataColumns.
This works fine for static values. However, you’re likely using the DataSet designer in Visual Studio, and it will hose itself if you try to set a GUID because it can’t tell them apart from a string. Plus, initializing with dynamic values like
DateTime.Nowwon’t work because you’ll end up with the date of the creation of the column rather than the date of the row. -
Initialize after creating it, but before adding it to the DataTable.
If you’re creating the row manually, you can just set any initial values before adding it to the table. None of the values, indices, etc. are validated until that happens. Strong typed datasets are even nice enough to generate methods that take and return rows of your type.
MyDataSet ds = new MyDataSet(); MyTableRow row = ds.MyTable.NewMyTableRow(); row.ID = new Guid(); row.CreatedOn = DateTime.Now; ds.MyTable.AddMyTableRow(row);
-
Override the OnTableNewRow of the DataTable in a derived class. This doesn’t actually work.
Like the derived classes created by the strong typed table generator. You can get to this method if you use the DataSet’s helpful partial class definition:
// Note: does not actually work public partial class MyDataSet { public partial class MyTable { protected override void OnTableNewRow(DataTableNewRowEventArgs e) { MyDataSet.MyTableRow row = (MyDataSet.MyTableRow)e.Row; row.ID = new Guid(); row.CreatedOn = DateTime.Now; base.OnTableNewRow(e); } } }
It doesn’t work because this method is never called unless you also attach a handler to the TableNewRow event, defeating the whole point of creating a virtual method. GG, Microsoft. This set me back a whole afternoon trying to figure out why some of my tables ran the method and others didn’t.
You can overcome this if you…
Windows and me
As it turns out, I share a birthday with the Windows OS. Windows is exactly one year older than me. I’ll drink to that.
Nifty.
Goodbye, b2evo
b2evolution didn’t go quite as well as I had hoped. A couple of days ago it started giving me HTTP 406 errors for some posts for no apparent reason, and filling my error log with fascinating things like…
[15-Oct-2008 04:52:15] b2evolution error: MySQL error! / Duplicate entry ‘c-events-are-accessors’ for key 2(Errno=1062) / Your query: DataObject::dbinsert()INSERT INTO evo_items__item (post_datestart, post_creator_user_ID, post_notifications_status, post_renderers, post_status, post_locale, post_priority, post_main_cat_ID, post_ptyp_ID, post_url, post_excerpt, post_urltitle, post_comment_status, post_title, post_content, post_wordcount, post_datecreated, post_datemodified, post_lastedit_user_ID) / VALUES (’2008-10-15 12:52:14′, ‘1′, ‘noreq’, ‘b2evSmil.b2evALnk.evo_videoplug.b2WPAutP.evo_code’, ‘draft’, ‘en-US’, ‘3′, 16, 1, ”, ”, ‘c-events-are-accessors’, ‘open’, ‘C# events are accessors’, ‘An interesting feature of C# I discovered recently is that events are actually accessors, [...] is’, 60, ‘2008-10-15 12:52:14′, ‘2008-10-15 12:52:14′, 1) in /home/sonic12/public_html/sunstormlabs/inc/_core/model/db/_db.class.php at line 568 / REQUEST_URI: /admin.php / HTTP_REFERER: http://www.sunstormlabs.net/admin.php?ctrl=items&action=new&blog=1
[30-Oct-2008 04:51:01] XML error: Invalid document end at line 2, column 1
Being patient with software faggotry like the programmer I am, I promptly fixed the error by installing WordPress.
I was fed up with b2evolution anyway. It was doing a lot of stuff that I didn’t care for, and wasn’t doing a lot of stuff that I did want. It had support for multiple blogs for people with MPD, and statistics rendered useless by Analytics, but it also had some 3 good (ie: not fixed width) skins available, couldn’t do comments and their formatting right, had at least 3 URLs for everything, wasn’t very friendly about posting images, no decent syntax highlighting plugin, and I was feeling left out of all the WordPress feature wanking I keep seeing on other blogs.
The irony is that I picked b2evo in the first place because it wasn’t WordPress and I wanted to be different. No matter how much I try to convince myself that “alternative” doesn’t mean “worse” in every possible context, 10 out of 10.1 times I get a cockslap to the face. Why do I bother?