Something I keep forgetting – the locale code for the UK (en-gb) is 2057. I shouldn’t have to remember that as much as I do, but SharePoint Designer’s Dataview Web Part seems to assume you’re American…
So, I’ve been forced to spend a couple of weeks modifying some code I wrote a couple of years back, in VB6. One word – crap. That’s the word for both the language, and my code.
Visual Basic 6 is just painful to code with. ‘Dim’? I’d say. The inability to return arrays from a function keeps catching me out. And I detest the way that no matter what I do, I can’t stop Visual Studio beeping errors at me and show message boxes when I try to leave an incomplete line so that I can copy and paste a variable name.
The worst part is, though, that it doesn’t really promote good program structure – well, not to me anyway. I’m often not entirely convinced that Object Oriented Programming actually reuses much code – but it does force it to be structured and organised. My code in this project, well, it isn’t. It’s suffered that sort of ‘evolutionary’ growth rather than proper, designed expansion. And some of it has to excapsulate an API that is archaic, irritating, and dangerous. (I’ve been debugging for memory leaks, dammit. Yes, this API forces me to allocate/deallocate memory).
What a sucky language. It really makes you appreciate Java/C#.
Some notes from work, where I had to summarise what Unicode really is (no, not ‘just two bytes per character’…). Mostly just copied from Wikipedia, though with some of the gory details removed. Continue reading “Because I always forget how Unicode really works…”
Ook – And it should work…
This is an interesting way of speeding up DoEvents, which is useful in a loop. It’s expensive, but necessary in your programme if you want it to respond to user actions. GetInputState() is cheaper, and it’s easy enough to use Windows API calls in Visual Basic code.
If GetInputState <> 0 Then DoEvents
Sorry, but it’s been busy lately. You know how it is. I’ve recently had to do some work looking into how Unicode works and how to use it in PHP. Interesting stuff, certainly I think that all the guys I work with could do with reading this one. Internationalisation is important for big (successful) products – and isn’t that what everyone wants to write?
Apparently, SHA-1 might have been broken. Well, I say ‘broken’, but it’s not like it’s a code to ‘break’. Rather, some guys have been able to figure out a way to make a collision with a hash much easier. No more MD5, no more SHA-1 – what’s next?