Random thoughts

In the course of my web-surfing about, I found this interesting post by Joel Spolsky.

“The Perils of JavaSchools”

I’ve never been formally educated on a computing thing in my life :. Having seen code by someone that was, whom I’d like to strangle… Some times I wonder if I should keep it that way >_>. I would still very much like to one day pursue a masters, an excuse to (hopefully) learn more then I can solo. But honestly, the odds of ever being free to do so are quite slim.

I still remember starting out in C++ for the first time, and having a problem handling the syntax for simple statements:

if (foo < bar)
do_bar();

if (bar < foo) {
do_foo();
do_bar();
}

At the time, it was actually the most complex thing I’d ever had to learn. After figuring out that the curly brace was only required if there was more then one line, the rest was easy as pie. Once the simple logic was sorted out, I never had a problem like that learning another language.

But, that’s why I’ve come to look on learning a language differently then learning to write programs. A language has a syntax, how do you express something in written form? Through the languages syntax. One of the things that I love about C, is that for better or worse. You can cram the entire language syntax into your head. It’s really that small and light, that leaves a lot more room for working on a problem and not feeling: “Oh, I didn’t know I could write it like that” later on.

Actually creating a workable program is a bit different, it’s not a question of how you may write it (e.g. if (expr) { do; } or if expr: do), but how do you write it? One of the big joys of programming for me, is to sit back and try to figure out how to solve the problem. That’s the fun thing (y).

Japanese beaver or Blackwidow spider?

Well I’ve taken care of most of the stuff in need of doing, realising that I couldn’t take care of the paper work until I hear from Valroe, saved time lol.

Since I’ve been unable to find anything suitable, I’ll probably end up creating a new library of code for the website…. One that obey’s a policy of not shooting the next coder in the foot, like the bastard taking pot shots at me through years old code >_>. The sad thing? I thought about the ideal implementation for hours at work (my job leaves me with my brain free 90% of the time). Yet, between various business…. It is approx 15 hours later……. I’ve still not had the freedom to work on it!!!

Yet implementing it,a nd making code on the website would improve a heck of a lot. Especially debug times, and probably save me more time in the long run. Which reminds me, looking at the code I’m charged with maintaining/fixing:

Judging code by WTF/Min

But what do you do, if the WTF’s are rapid enough to be measured in seconds?

Muttering about my task list

I managed to fix the issue quite easy, I still can’t believe it was that simple… I wonder though, if this is what will hit me in the next fix-it task to come up:. I’d also love to punch people that don’t check errorous return codes in the face!

I remember the 6th commandment of C Programmers,

If a function be advertised to return an error code in the event of difficulties, thou shalt check for that code, yea, even though the checks triple the size of thy code and produce aches in thy typing fingers, for if thou thinkest “it cannot happen to me”, the gods shall surely punish thee for thy arrogance.

Especially since I’m the one being punished for anothers dickheadedness!

I really wish PHP had exception handling, WAIT !!! (a quick google of the reference manual later), PHP 5 added them, YKYMF! I smell a few additions to my utility library… unless what I need has already been universally implemented by someone hehe.

And in likewise reflection upon The 10 Commandments of C Programmers:

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest “foo” someone someday shall type “supercalifragilisticexpialidocious”.

Some people just don’t know how true that is!

Thumbing through the annotated edition, I can’t help but chuckle at this… And hope such a thing befalls the bastard that did this to me lol.

verily there be many, many ancient systems in the world, and it is the decree of the dreaded god Murphy that thy next employment just might be on one. While thou sleepest, he plotteth against thee. Awake and take care.

Ok, so maybe I am a jerk sometimes ^_^

Anyway, I got a little bit of time before bed. I’ll use that to take care of a few odds and ends, and I’ll finish the other work I need to do tomorrow night.

GIGO, How to debug and fix code the hard way

THAT SON OF A BISCUIT BAKING PIECE OF HOG CRAP OF A MODULE !!!!!

I’ve finally found the problem that, i spent 3 hours trying to prove was broken. Only to find out, the ‘contract’ behavior it expected from it’s environment at fault. And the rest of the module, is such a hopeless pile of shit, that I didn’t realize it, until I found the simple fact.

Garbage In, Garbage Out, but no Error message.

I never checked the data stream output, because the interface test failed. But it actually did do exactly what it was supposed to do, just with garbage values, which through off the rest of the code… That ignores errors rather then handling them.

If I h ave got to kick the bitch in the teeth twice a day to do it, this website will furfil the [SAS]’s needs.Or it will get ripped apart bit by bit and rebuilt as something that will serve them well!

Of languages, libraries, and tools

I have been contemplating my standard language/library issue with care, although I’ve yet to finish most of the tests…. Courtesy of work, laziness, and to much work on the website lol.

So far, it seems to me that language wise my best thoughts:

Python, I don’t really ‘like’ python but I can do a tremendous amount of work in it compared to other languages, time wise. And it’s fairly easy to implement and test stuff — worst thing I can say about it is it’s interpreted and the regular expression support is done via a standard library module. Although jython (compile to byte code, but compares to a smaller version of an old CPython release) and ironpython (python for .net clr) should help the former, and the api for regex ain’t that bad, but sucks compared to Perl lol (like most languages seem to, that don’t steal Perls syntax or likewise make it a core element of the language syntax). Python also can handle interfacing with other languages well enough between the CPython, Jython, and IronPyhon implementations.

Java, great syntax and fairly logical. The byte code is portable enough between Sun JVMs and it even has the portable Swing GUI toolkit, although I’d probably end up using SWT or the WxWidgets bindings. The bad things about Java, although you can compile to native machine code, ya need to get the GNU Compiler for Java (GCJ) working first. Regular expressions are done via it’s libraries rather then syntax, and. Well the only _nice_ way of saying it, most of the tools with the JDK eventually piss me off, but I like the language aside from that. The only major con is it is as OOP-centric as I’ve ever seen, and it’s that way by design.

C++, lower level then any of the others and offering the best level of interface to C code of any of them around ;-). I personally prefer Java’s syntax over that of C++ but it still gets the job done. It’s just a question of how often you want to press Shift while typing… One of the best things, the STL is quite nice and well enough supported now to be worth using. Although, in my experience when working around C interfaces, the STLs value can go out the window, but maybe that’s just how long I went before using the STL. One plus, unlike Java or Python, you get a more traditional pointer, not to mention a few interesting things in the std::namespace and boost libraries. Not sure what shape exceptions support is like under various system compilers, but I don’t think that I’ve ever seen C++ code using exceptions outside of examples or perhaps the FAQ :.

Useful points of interest:

WxWidgets for the GUI — portable to target platforms of most interest and in all three of the above languages (and a few more too).

libxml2 for XML — portable to target platforms, but seems to only have C++ and Pyhon bindings easily available, libxmlj (for java) I think would need compiling and I haven’t tried that under FreeBSD or Windows yet.

Semi-Native Regular Expressions — Boost libraries for C++, Pythons own regular expression module, and ditto for Java (not that I like them).

std::string, str, and String classes — basic string handling in C++, Python, and Java. Boost and WxWidges also provides wxString.

MySQL bindings — database operations; quickly available for C++, Python, and Java (JDBC based). Using SQLite in C++/Python is also easy enough but I’m a bit leerly of Java-related connections for SQLite3.

As to the other stuff that was on my list:

C++ and Python provide suitable IPC systems, never have looked at Java in that light. Most of the stuff I need, is basically provided by the C libraries under POSIX systems and Windos, Python has a suitable interface to it, so I’m happy hehe.

Python has good enough built in support for common compression and archive formats. Whatever can’t be done via java.util.zip hopefully could be done via JZlib, I’m not familiar with anyhing ZLib under C++, but there is always the traditional interface ^_^.

I haven’t considered the network side that much. Although I sometimes find it a bit lengthly, I don’t really mind working with the C-style sockets library I’ve used here, using the windows sockets library shouldn’t be to far off from the ones used on *BSD and GNU for my needs (aside from headers/linking). Python has support for a number of protocols (and pwns Ruby on documenting the classes for most protocols IMHO), Java well enough out of the box, and both Python and Java provide usable interface to TCP/UDP. WxWidgets also has a few things as well but more limited, that might be worth looking at, since I’d rather like to use a similar interface in each language, while still leaving code that can be read.

As to the ease of use and deployment, that is always a tough question. Under FreeBSD and Debian at least, they are all ‘easy enough’. Windows of course, always has to be the pain in the ass. But for total portability this is an AoR where Python excels. When it comes to deploying stuff, it gets tricker. Windows lacks a package manager and you eventually have to draw a line between what you’re stuck bundling and what your stuck making a dependency. One of these days I need to look at py2exe and see how it would work out for what I’ve a mind to setup.

Big pluses:

Qt4 for C++ and (generally) Python is great and works on all my systems, QtJambi I’ve never tried on FreeBSD yet, but would be interesting if it works. The only thing I hate about Qt, the commercial license costs an arm and a leg :-(, but most of my needs fit within the (free) Open Source Editions license terms with a smile.

WxWidgets seems to be less painful then GTK+ under Windows while still supporting many languages, although GTK+ would probably be more fun to learn in my case. It also has nifty things, including string/regex classes.

MySQL and SQLite are generally portable and have bindings to other languages quick & easy enough. I’ve never used SQLite on a project, since I run MySQL on one of my own systems to service all my SQL-related needs 😉

When it is all said and done, I really think Pyhon is the best choice… I dunno why or how, but it seems that way! Hmm, to re-dive into using Python for most tasks, or to get C++ crazy… Or live with using both side by side? For my own sake, I think I should sake fuck Java! But it is a great language in it’s own right.

Oh well, maybe in a few months I’ll have figured out which path to take. I can always make use of other languages and tools, but I very much need to find a “primary” set to work with!

think:
switch(choice) {
case PYTHON_ONLY:
// Python becomes my primary language
break;
case CPP_ONLY:
// C++ becomes my primary language
break;
case PYTHON_AND_CPP:
// use both side by side
break;
default:
goto think;
}

The days woes

I think if I have to look upon another line of code on the website tonight, I’ll go mental! Maybe it’s lucky for me, that tomorrow is such of a hell of a long job, that I’ve got to go to bed early to survive it lol.

Even a spider needs sleep eventually

The best way to describe old code on the site, is a scripting language with many globals, almost no regard for scope, rarely any indentation, extremely long lines, and compounded with (often shitty)HTML embedded in multiple layers, and designed in such a way. That if you so much as add a comment somewhere you’ll probably break something lol*. It’s an exaggeration of course, but it is essentially _that_ bad to work with. Much worse when you consider that system upgrades can often make subtle changes that only an asshole would’ve assumed never would change. I’m tired of having to think up band aids around shit that shouldn’t have been written in the first place. I’m no brilliant programmer, but for the love of HAL, at least try to do a decent job!

[SAS] has had one very negative impact on my life, I can’t stand assholes that do things half-assed, whether it’s running around like a headless chicken, or making toxic waste look pretty.

In a lot of ways, I wish I could just rip the website part… Build it anew, as Operation Excalibur was meant to experiment with locally. But people would likely not like that idea, because all they get to see is the ‘outside’ of the site, not the innards. *SIGH*, I don’t like rewriting stuff from scratch, but I don’t like being forced into bubble-gum solutions with bubble gum on the bubble gum either. I know Wiz isn’t a code monkey, tbh he would have a good excuse to write putrid code, but the sad thing? The jackasses who wrote the code we’re working on, were supposed to be an educated man. I really hope, if that person ever gets a job that involves computers and programming or webwork, they stick a cattle prod up their ass at the sight of the work being done. At least Wiz makes an effort, that’s more then I can say of the person that hashed out most of the websites less-nice modules.

I still need to fix one module used in the selection course, and after having spent more then 3 hours reading, thinking, and testing. I still can’t find the reason why it stopped working lol. The S.O.B. in question doesn’t even have anything to do with our recent changes, but no… It’s gotta be a prick and break, without reason, without word. To be honest, I never knew how much I would miss exception handling before I had to live without it, even if I never really used exceptions in most of my code lol.

Tis the nature of my sort, I think, to be pissed off and frustrated with such crocks. Including the kind that I wouldn’t even wish on a machine let along a programmer. One thing I do know, it’ll have to wait until at least Wednesday to get fixed, because I’m going to be working like a dog tomorrow and Tuesday. Oh man, what I would do if I had a week or two of nothing else to do but wage code-warfare upon building a more robust website.

* For those that don’t know, a comment is a section of code that is totally ignored when running it, e.g. int foo = /* comment */ 1; is treated as if /* comment */ was never there.

I managed to fix it fairly quick, wlel have way. I fixed it for [SAS] but broke it for non [SAS] lol. I’ve still got to wrap my head around that bowl of soup before I can be sure it’ll work right along side the new code.

I would’ve had it done much faster, if it wasn’t for the stupidest of typo’s… I really wish the difference between

$foobar = some value;
if ($foo_bar) {
... do something;
}

Was an error (or at least a warning) about an undefined variable on our setup, rather then creating a new one called $foo_bar. Maybe, I’ve just been using statically typed languages to much lately :.

More work to do today, but I did managed to install SWAT 4 and TSS without problem. It’s very good to return to the Proving Grounds, but I still miss some of the old gang… Alas, that’s the way things are and there still is work that remains to be done in the department.

My poor baby…

Installed Netbeans on my laptop to give it a test drive, and between top and the massive change in performance in flock, I can’t help but think that my system is in pain as it fights with flock for system resources :

last pid:  2235;  load averages:  2.04,  1.50,  1.00    up 0+01:08:22  03:52:09
86 processes: 4 running, 81 sleeping, 1 stopped
CPU: 83.8% user, 0.0% nice, 16.2% system, 0.0% interrupt, 0.0% idle
Mem: 298M Active, 18M Inact, 96M Wired, 12M Cache, 53M Buf, 1888K Free
Swap: 860M Total, 100M Used, 760M Free, 11% Inuse

PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND
2195 Terry 30 44 0 387M 137M ucond 0:00 77.25% java
1498 Terry 1 99 0 715M 139M RUN 25:43 13.87% flock-bin
1358 root 1 44 0 119M 63776K select 1:56 0.00% Xorg
1403 Terry 1 45 0 18616K 4796K select 0:51 0.00% gkrellm
1504 Terry 1 0 0 715M 139M linuxf 0:19 0.00% flock-bin
1500 Terry 1 0 0 715M 139M linuxf 0:04 0.00% flock-bin
1499 Terry 1 44 0 715M 139M select 0:03 0.00% flock-bin
1477 Terry 1 44 0 30940K 6832K select 0:03 0.00% Terminal
1887 Terry 1 44 0 34752K 8020K select 0:02 0.00% xchat
1174 root 1 44 0 3264K 564K select 0:02 0.00% moused
1404 Terry 1 44 0 45900K 2944K select 0:01 0.00% pidgin
1402 Terry 1 44 0 14280K 2256K select 0:00 0.00% fbpanel
1509 Terry 1 0 0 715M 139M linuxf 0:00 0.00% flock-bin
1405 Terry 1 44 0 9080K 1340K select 0:00 0.00% blackbox
1515 Terry 1 0 0 715M 139M linuxf 0:00 0.00% flock-bin
1481 Terry 1 20 0 4640K 0K pause 0:00 0.00%
1399 Terry 1 44 0 8172K 724K select 0:00 0.00% bbkeys

The fact that I’ve got flash7 running in one tab and only a small set of 5 tabs open in flock, ain’t that bad I guess. It seems that my system has almost adapted to this load, because the stats in top have gotten even worse but FreeBSD has gotten almost as responsive as normal when running these programs.

I love my darlin’ Dixie 😉

Busy of late and more to come!

oy, what a time the past week has been!

I’ve managed to fix several issues on the website, create a few more,a nd fix them lol. One was a typo, the other was a logic error that slipped by me. In the latter case, it wouldn’t have happened if I wasn’t more worried about *breaking* old code that predates my membership then beign wide awake >_>. I also had to fix a really, really, really old line of code today. That seems to have been broken by one of the site upgrades yesterday.

I’ve been screwing with Services For UNIX, The Korn Shell (various implementations, ranging from SFU to the official ksh93). Shoe horning Windows into a usable system, and trying to keep a steady presence on the RvS servers… but I’m still longing for SWAT !!! It’s been so long since I’ve had a solid game with my teammates (other then in RvS). I’ve also had to update my vimrc file while I was at it, I’ve vastly improve it but still thinkit it could be better. I also tested a few plugins and colo’s as well, the only headache is making sure it works on all of my systems lol. SFU, however seems to be the cause of most problems!

Tomorrow will probably be another monster of a work day, I’m not looking forward to it… There will however be a *lot* of stuff to deal with when I get home, I’m sure of it. At least though, we seem to be moving into a very positive direction for the future (long term). I can’t say that I am happy with some of the things I suspect may have to be done, but I pray it goes well… For the sake of all. I can’t say the same for everyone else in the world, but for me, I only know one thing about myself:


LOYAL TO THE END

You know, the more I try to give IDEs a fair chance, the more I find. That in the end, THEY ALL SUCK !!! Either that, or it has proven impossible to find something with even so much as a decent editor that’s worth more then notepad or /bin/ed, is it really to much to ask; a decent editor?

Even on Windows XP, where cmd.exe has proven to be the worst damn CLI I’ve used, *my way* still seems to beat any IDE I’ve tried, and that is pretty damn sad lol. And so far I have found nothing that bests my personal combo of term+zsh+vim+tools, and tending to the more ‘IDE like’ features myself >_>. The only bad thing about cmd.exe, is it doesn’t have emacs based line editing out of box lol, that and the tab completion works like a kinder garden program compared to bash/tcsh/zsh/pdksh.