So far the little bit of code I've encountered pretty much shows me what I need to know about the structured approach is that good structured code approaches some quasi-OOP state. For example, suppose there is a ball struct, and the program keeps up with several of them. The UpdatePosition function that in OOP I would place within a class is now placed in global space, and takes arguments to indicate the ball it will work with. No big deal there, I thought maybe there was more to it.
What little research I've done reveals this tome to be some sort of sacred text for coders, impressively receiving more reference than The Llama. I think I'll look into it. Whether C++ or C is better or not doesn't really matter; I feel like if I am going to put C/C++ on my resume I may as well learn to use C. Plus I think owning that book would be a good idea because it probably provides a CHA bonus and can cause random status ailments to programmers with a class level that is 5 levels lower than mine.
Since it was asked, I'll mention my programming experience. In one of my coworker's Perl books, Larry Wall claims that the three traits needed for effective programmers are laziness, impatience, and hubris. I will not pass up this chance to display hubris since I'm certain at least four of you can smash my ego back down 😛.
I started something like 8 years ago in Turbo Pascal 7.0 and managed to write a Tic-Tac-Toe game that I was fairly proud of (I spent days playing games against myself developing and testing the AI 😊). From there I moved to self-taught C++ but never really got anything done. About 3 years ago I hit college and learned some more C++, but still didn't really produce anything of note. At one point I tried to use C# but because I was stupid then and too lazy to read documentation I wrote it off as "too hard" and "not worth the trouble". Last year I entered a co-op position at a manufacturing plant and I was told I needed to learn VB .NET. In 2 weeks' time I was productive, and in 3 months' time my skill in .NET eclipsed my C++ abilities. The product of the first term was a MS SQL Server database application that featured both simple and complex databinding (biggest misnomer ever; simple databinding requires 10-15 lines of code for every line that complex databinding requires) and featured update conflict resolution that allowed the user to view the original entry, their change, and the database's current value and choose between the three. In addition, I experienced scope creep firsthand and grew a healty fear. The last 3 months were spent on odd utility projects. One is a program that pulls information from the Event Logs of several remote computers and displays the data through a ListView with a flexible filtering engine. The other is a program that scans folders on several remote computers for files that match certain extensions and generates reports on the files it found. Both use multithreading, though the second is much more refined because the first project was where I cut my teeth.
I've dabbled in Perl and PHP but never really gotten anywhere with them. When I moved the Member Pages to my domain I used a Perl script to fix all the links. I really don't know how a language can be so ugly but do such beautiful work. I know some rudimentary Win32 API programming with C, but not enough to really get anywhere.
I have way too many personal projects going, but here's what's going on and the status of each project, who knows, maybe one of you can help me with the things I'm stuck on.
1. Program for fiancee: Eventually will run as a screensaver and display various statistics and messages about our long relationship. Currently halted because I've never been good with date calculations and the .NET TimeSpan class only lists up to total days. Anyone know some good "Years Months Days Hours Minutes Seconds between two dates" algorithms? I'm also struggling with the piss-poor text measurement facilities in GDI+.
2. ThoughtList: theplustwo thinks I forgot about this one. It's a task manager program that will move in three phases from a TreeView-oriented design to a custom control that merges TreeView and ListView to a virtual whiteboard that you place "Post-It" type notes on and draw lines to indicate relationships. Currently halted due to lack of free time and I'm really at a loss on how to combine the TreeView and ListView... I've seen some C++ examples but I want it done in .NET and I want to write the code myself, not to mention they were MFC and deciphering Perl is much easier than MFC.
3. Express Yourself: Regular Expression testing tool that is a blatant ripoff of Chris Sells's Regular Expression tool. I started the project because his tool was once open-source freeware but like several other prominent .NET open-source projects he decided to remove the source and make the program shareware. Currently reeling due to my hubris. The original displays the source strings with matches and replacements highlighted and hovering over the region displays a ToolTip with information about the groups within the match. He accomplishes this by generating HTML files and displaying them in the MS HTML control. I felt this was silly and decided to accomplish the same with the RichTextBox control. Everything is perfect except for one bug that I will detail in the vain hopes that someone has a solution. RichTextBox.GetCharIndexFromPosition will return the character closest to the cursor, which means in areas with no text a ToolTip can still be displayed. This should be as simple as determining the boundaries of each visible line and testing if the mouse is outside these boundaries. Horizontally this is no big deal, but vertically there is a distinct challenge. Font.GetHeight is supposed to return the distance between the baselines of two lines of text, which sounds like a reasonable estimate of the line height to me. Given the height of the font, it's a simple matter to calculate the position of each line, right? Wrong. Due to some undocumented distance that I don't understand, GetHeight is only accurate for specific font sizes. So far my only workaround comes in the form of RichTextBox.GetPositionFromCharIndex(). For line n, the position of n represents the top left of the rectangle and the position of n + 1 represents the bottom left. This still poses a problem for when n is the last line of text, but I think in this case GetHeight may be sufficient. This has been upsetting me for months now.
4. AGN Member Pages: Sometime in the last few versions of FireFox the Member Pages stopped displaying properly. They need an update anyway, so I figure I'll give them an overhaul.
5. Pong Screensaver: This is a screensaver that displays a Pong game between two computer players. I have the ball logic down, now it's a matter of overcoming laziness to implement the paddles and paddle AI.
All projects but the Member Pages are in VB .NET, though I'm thinking of doing the screensaver in C# for a change of pace. The book I'm reading now covers Allegro, but it's going to be a while before I submit myself to the task of writing a game. I think a Minesweeper clone is the first thing I want to write.