- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
this reminds me of my very first developer job in a business research environment, where coders are part of their experimental subjects. projects were divided into loose phases and each phase lasts usually 6 to 9 months. since they tend to hire university students who just learned the rules of consistent naming, every one of them decided to play god and over use their own conventions against existing ones. by the time i took over the project, i've seen all the possible permutations such as 'tblCatagories', 'tblCatagory', 'tbl_catagory', 'catagoryTables',...,...
captcha: business
Admin
This might actually be a good thing. Leaving the code open for SQL injection attacks might invite some poor hacker to try and derive the structure of the database. This will ultimatly cause his brain to implode leaving him unable to even look at a computer without curling up into the fetal position.
I say put the app into the wild and annouce that it is unhackable. :)
Admin
it's a good thing universities don't teach useful things, because they can't teach them right anyway. i'm glad that they don't teach things like integrated webdevelopment. yet still, they've ruined my favourite language - C. in general university is a machine that produces incompetent java programmers.
captcha: freedom
didn't work ... this forum software is shit
captcha: fraction
Admin
some teachers simply don't know their stuff, or they'd make note that recursion vastly simplifies the development and validation of an algorithm trivially - linked lists are a prime example. but the factorial example is a perfect way to teach a math major the concept of recursion in programming: it's exactly what he does with such algorithms as a matter of course.
but the people that end up teaching either don't know this or don't realize it and just don't pass the knowledge on to students.... leaving them to fend for themselves in their vain attempts at understanding an algorithm.
i hated school.
(ooh, yay! my first post!)
Admin
that's why i read the WTF site, just to learn those words. developmestuction, developmestRuction, brillant,... just to name a few.
captcha: enterprise
captcha (2nd attempt... again!): hamburger
Admin
Oh, you guys aren't creative, I can think of lots of ways to make this worse. I mean, look at how clear those table column names are! He could have used user_field_1 and user_id_2 for actual and test values, for instance. Or he could have written his code in VBScript. Or.. . damn, this is hard...
Admin
Surely everyone knows that you should use an MD5* of a description of the field as the field name, for security reasons**? I mean, what is the world coming to...
* Possibly truncated
** Job security
Admin
on a second note, I don't want to know what would drive a perfectly good developer to quit after just three days.
I'm crying. A grown man is CRYING!!!
Admin
Well, at least they teach capital letters.
Admin
Subversion uber alles!
svnadmin create /svn/myrepos
svn co /svn/myrepos .
svn add *
svn commit -m 'initial commit'
Admin
Does it? I routinely process linked lists like so (pseudocode):
process(node) {
local_node = node;
while (local_node != EOL) {
do_something(local_node);
local_node = next(local_node);
}
}
OTOH, traversing all nodes of a sorted binary tree in order is a Big Win (tm) for recursion (more pseudocode):
process(node) {
if (node == null) return;
process(left(node));
do_something(node);
process(right(node));
}
Admin
Yes. Any project bigger than hello world benefits from SCM. Especially students, who should be encouraged to experiment, which is one of the great things about SCM. Likewise, I can remember doing my own half-assed SCM at least once:
cp main.cpp main2.cpp
vi main.cpp
cp main.cpp main3.cpp
cp main2.cpp main.cpp
vi main.cpp
Oh, I'm done, let's get rid of all these extra copies..
rm main*.cpp
DOH.
And I can remember most of my classmates committing similiar mistakes, as I imagine most CS students have. Why shouldn't the instructor spend a day going over cvs/svn instead?
Admin
Furthermore, you should never not use source control. Even if you are just slapping together a project by yourself, regardless of the size. There will always be cases where you will want to revert changes and doing that by hand (plus the frustrations of failing to do so correctly) will always cost more time than the occassional commit.
And to be pedantic, it gives you good practice too.
Admin
That makes good sense, thanks.
Admin
I would have to agree with sammybaby on some form of "source control". I recall many years ago developing on a 16-bit machine; most of the development was writing utility libraries or small applications. There was no source control for this platform or even a "diff" utility. (This was a TI-99/4a by the way.) Even worse, there were not date or time stamps on files.
I ended up with several stacks of floppy disks from a game that I had developed, complete with dates and numbers written with a silver sharpie, each time I made radical changes or re-wrote portions. It was difficult to know what changed when and where.
I will admit that source control is a tool, however, it is difficult to find many situations in which not using that tool (i.e. "Hello World" programs or miniscule code snippets) isn't beneficial.
I don't know if comparing a programming methodology with a tool used to increase productivity is necessarily a good comparison.
Admin
When I was starting out, I was big on making an archive of a project at roughly each "commit" stage. Of course, that meant each project had a directory with a bunch of numbered zip files. :P
Then I got into using MS Source Safe...and the first time I had to roll back more than one file (after a few days of work that turned out to be a dead end), I began seriously researching SCM. I've been using Subversion since (which has been a godsend), though I'm looking at darcs, now...
Admin
I've worked with people like this. There can never be more than one on any given project, of course.
The most effective term I've ever seen for such a person is "programming prima donna" or "techie prima donna."
They never take constructive criticism. They've been doing things the same way since the seventies and they're never going to improve or budge an inch, because, after all, "it works." They create endless extra work and painstaking tedium for the other developers. They cost the project untold hundreds of hours.
And they're usually in charge, and they're usually the boss's favorite (a.k.a. "star developer" or "hero"), because if they weren't, they would have been dismissed long ago.
At every interview, I ask bluntly whether I'll have to deal with such a person. If the place is infected with a prima donna, there is no escaping a job of near-constant misery.
By the way, peer reviews and design reviews are an excellent countermeasure to prima donnas, who are quickly defeated by exposure. For that reason, they rabidly oppose instituting peer reviews.
Admin
Bitch bitch bitch.
Where the code with the WTF?
Admin
I've come to love the Local History (http://www.jetbrains.com/idea/features/lvc.html) of my IDE, because with it I can revert some lines of code that I edited a couple of minutes or hours ago (I think a history entry is created at every autosave; the history length defaults to 3 active work days). It gives much freedom when you can trust that there is always the possibility to go back to any previous state. A separate server for CVS/SVN/similar is good for backups and working in teams, or if you need to revert to a state more than a couple of days ago.
Admin
I've seen this. I've lived through it. I assumed a project a few years back that clearly qualifies for WTFery. Just as this one. Lots of tables with incremental names. EG: "students2003", "students04" and "students11". (no telling on the last one)
It's a real WTF. 19 copies of the same file, all different by about 35 lines of code. Variables that don't seem to be defined anywhere. Variables that are consistently used everywhere but about 10% of the time. Random files (word .doc files, pdf files, etc) strewn about haphazardly. Is it linked to? Who knows?
And no, I'm not exaggerating when I say there was 800 MEGABYTES of this...
I nursed it along for a few months, grabbed out of it what I could, and then rebuilt the thing from scratch. Now we have a clean test environment, build scripts, publishing methods that are consistent and reliable, and 2 years of HARD WORK later, it's starting to come together very nicely...
(PS: Another WTF is that Captcha doesn't always work here...)
Admin
I know I'm late to this party, but, in my opinion, the WORST thing you can do as a programmer is be inconsistent. To me, you can do pretty much whatever you want and it will still be manageable as long as you always do the same thing.
This kind of crap not only masks the underlying WTF but makes it impossible to locate/contain.
For once, I must agree that the goggles do nothing.
Admin
It just occured to me that you could make it worse by having a meta field for each table, into which you could insert an xml string detailing if the data is test or production data. That could be a great way of ensuring your job for ever more.
Admin
How about the properly spelled 'tblCategories'? I'm not really trying to pick on you, just trying to lead into my own short story.... The guy who designed the databse I work on most of the time absolutely couldn't spell. Now I have to memorize 30 misspellings of common words to work with the data. I haven't grown the balls yet to rename them because they are tied way too tightly with the application and all hell would break loose if I did. It drives me nuts, he is a lifelong english speaker, college educated, highly paid, and he gets about 10% of the words he spells wrong.
Admin
mine did.
learning to use the SVN system is part of one of the obligatory first year courses here. the University of Utrecht also runs an extra SVN server just for students to use for their own projects.
university CS students mostly learn to think about complexity and algoritms, not lines of code. this is the reason some of them can't write a single line of C when they start out on their first job. and they don't have to. they've got minions for that ;)
Admin
and you're proud that they can't code a single line? Thats a major WTF in itself http://www.c2.com/cgi/wiki?ArchitectsDontCode
captcha: speaker
Admin
As long as "can't write a single line of C" means that they learned other programming languages, it's ok for me - C isn't known for beauty and elegance.
As long as ".. on their first job. and they don't have to. they've got minions for that" doesn't mean they start as some kind of manager or consultant, it's ok for me - people without experience are dangerous in such positions, especially if they try to replace experience with arrogance.
Admin
Dyslexic?
Admin
Nope, just good ole' bad spelling. Here are some examples I am able to find with minimal effort (these are from production tables, stored procedures, and documentation, all stuff the client can see):
Registerd
Buisness
Lable
Balnk
retrives
migrate-able
"on queue" (he meant "on cue")
Devlopment
Disconceted
Signetures
Some of the stuff could be contrued as dyslexic if they were on their own, but most are just plain wrong. The most common examples are spelling words how they sound (signetures) or using the wrong word amongst several that sound the same (he almost never used "they're" and "their" correctly). The strange part was that he had been promoted to a job where he spent 90% of his time in contact with clients and writing specs and almost no time programming.
Admin
Well, maybe I'm just thick, but is there a situation where using a SCM is not benefical at all? Before you say "toy project" or "quick hack", count all of your toy projects that snowballed into a Kind Of Tolerable Tools that really do benefit from SCM use. In my opinion SCM is never overkill even for small projects.
I've had tons of small hacks and regretted they weren't versioned at all initially. (And tons of small hacks that were versioned with RCS and I learned the pains of converting that to CVS and on to Subversion, but that was worth it =)
And as for immediate benefits, well, small exercises like "see how Subversion kills the revision feature of your word processor dead, small file sizes
Admin
SCM are not beneficial if you use them incorrectly. 15 Years ago, I learned that the hard way when we used a GUI-builder tool called UIMX to design motif forms and let UIMX generate the necessary C source. Unfortunately, we put the resulting C files into SCCS, but not the UIMX files.
Then, one day, one of us damaged a UIMX file containing dozens of forms. Lesson to learn: always put _all_ files into the SCM.
Admin
I actually began reading this site when one day I got to work and had to exclaim WTF about a colleague’s code. I was so depressed that I plugged WTF into Google and I was relieved to discover that I’m not alone. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
The problem with the guy I work with is that he just thinks chaotically...when I try to sit and help him he simply can't think in a clear manner, maybe I intimidate him. When I started here 6 months ago they didn't have coding standards and version control was time stamped directories on a server (I’ve since introduced coding standards, which are not followed and forced them to purchase SourceGear Vault, which has meaningful check in comments for less than 50% of the checkin’s, and that’s only because I’m the one who did them). When I watch this guy code he can write 5 lines of code using 5 different coding standards. He cuts and pastes like a mad man... He's scared shitless of losing stuff so there are multiple copies of files and multiple copies of databases everywhere on the network. His harddrive Data directory has about 250 folders off the root folder, how the hell he finds anything I’ll never know. Each database or file will have minor changes done for one specific customer or one specific bug fix. He's also got no grasp of OOP concepts. When I got here the network also had around 250-300 folders in the “IT Development” directory…step one was for me to create a folder “unorganised” and move the whole pile of steaming cow dung into there and issue a request for stuff to be organised as we “moved forward” (I know that PHB bullshit bingo talk but I figured it might help…it didn’t). Naturally I’m the only one who has ever moved anything and I’m the only one who has ever created a directory structure with more than 1 level.
The trouble is he's quick in that he gets things working but everything he does pretty much needs rewriting. However being quick means that management love him because he’s a producer…
I've just resigned from this hell hole so fortunately I only have three weeks to survive this nightmare.<o:p></o:p>
Admin
Heh, look at what he DID capitalize...
Admin
Except the standard factorial example is ludicrously inefficient and quite likely to put off any student who understands it fully.
Admin
They don’t, but I agree with your point.
(http://en.wikipedia.org/wiki/Eskimo_words_for_snow)
H.
Admin
Jake, I don't know why you assume everyone would disagree with you. There are battles worth fighting, and battles not worth fighting. No one can choose your battles for you, or second-guess the reasons for your choices.
It sounds as if the lowest level of management at that company was trading off long-term cost for short-term benefit. If you decided to fight the battle, you could use the same logical skills you normally apply to software engineering to the task of quantifying the cost of doing business that way. You could estimate a project to remediate the system and present it to management. You could show the approximate date where the two cost projections cross; the date of payoff for remediating the system.
If the first level of management was uninterested, you could take your story to the next level of management, and you could keep doing that until you get results or you are shut down. Unpleasant and not easy, but at least it would address the root problem.
And if you were already so fed up that you had decided to quit the job anyway, what's the risk to you in doing that? Best case, you would be recognized as a clear thinker who needs to be put into a better job position. The star programmer and his star manager would be exposed. Maybe you would decide to stay with the company a while longer. Worst case, you could take these skills with you to your next job, and talk about how you acted as a proactive problem-solver in your last job. Either way, you can't lose.
Admin
This is a really interesting WTF. A lot of people are responding to it at a detailed level - how should one set up version control, etc. I think there's a much bigger WTF here, though. The whole management culture at that company is screwed up. How is it that the project manager is so short-sighted that he praises the star programmer for building crap on top of crap? How is it that the next manager up the chain isn't paying attention to what's going on in his/her area? How is it that management is unwilling to listen to other members of the technical staff who are concerned about the situation? The whole situation with the developestuction environment is a symptom of much bigger problems, IMO. I get the sense there are quite a few good reasons for Jake's new colleague to regret joining that organization.
Admin
Thanks for that. It's the first time I've actually laughed out loud while reading this forum.
Admin
Sod. When I said "Thanks for that. It's the first time I've laughed out loud while reading this forum," it was meant to quote what I was referring to as well.
Admin
I've been in that situation before, and I took it upon myself to rewrite the code to externalize file paths and data sources, improve its legibility and maintainability, and and fix some dumb things. I did this from the very first day I was hired. Well, actually the third day, as I spent the first day staring at the horrendous mess of code, and the second day trying to recover my sanity from it. This is when I resolved myself to rewriting it (probably testament to my loss of sanity.) I worked on it on any breaks I could take, using a lot of my personal time (even staying late), while at the same time trying not to neglect my current obligations.
Eventually (after about 2 months) I was done and showed my code to management, along with proof and justification for the improvements, such as quantified performance boosts and security features. They accepted it, and a plan for deployment was prepared, including an entire plan for a separation of test, development and production environments, with versioning control. The thing that sold them the most was that the work was already done for free (i.e. on my own personal time), so no resources need to be considered for that. But it was also important that I didn't just say "your code is crap, I need to rewrite it", but that I had a compelling, well thought-out case that my new code was significantly better to maintain and execute.
I will admit that in my case it helped that I was displacing the "star programmer", as he had recently left the company, so there was a lot less active resistance.
Its not for everyone, I know, but I *had* to do it. I just had to. If I hadn't, or couldn't for some reason, I probably would have quit after those first 3 days, just like your co-worker.
-dZ.
Admin
It should be easier than that. You should be able to ask simpler questions, such as "Which versioning control software do you use", or "could you describe your development environment to me, and how it reflects your production environment?" If their answers are something like "Versioning what? uh... Development environment? We are a small shop, so we do not feel the need for a large development infrastructure... we let Bob here, our developer, take care of those things..."
If their answers resemble those, run! Run, and don't look back.
-dZ.
Admin
Well, I am self-taught. I only have ME to blame.[:S]
Admin
You know what's the WTF with most SCMs? They don't like 'shared sandbox' situations. At the place I work we develop websites, we have some DLL's that are used as well as a bunch of XSL's that produce HTML (yes we use XML, but it actually makes sense here). We use Visual Studio and Visual SourceSafe as our SCM, unfortunately to get it to work with a shared sandbox we need to use FrontPage Extensions, otherwise when you check a file out it's open to anybody to edit and Visual Studio doesn't bother finding out if you have it checked out or not. We have had many problems with that, as well as situations where someone opened the file to look at it while someone else had it checked out, the first person checked it back in and the second person checked it out while he still had it open in Visual Studio, did some edit, saved and checked it in, but because VS didn't refresh the open file when it was checked in he overwrote the first persons edits. Also with FP Ext loading a project takes almost a minute, and project-wide searches can take up to 5 min to return anything.
We are looking for better tools but we stay in the MS environment for the customers (they are kinda stuck on MS products) but we would love to find a way to run something better… if there is a better setup around (IDE + SCM that will work with a shared sandbox and had syntax highlighting + intellisense for XSL/HTML/CSS/JavaScript and ASP) Most likely we are stuck with what we have… ohh well…<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Admin
Did you work for DTI too?
Admin
Why would anyone want to bother with source control for a toy project?
If you screw it up, who cares?
Admin
Why do you say that?
It may not be the most efficient way but it does make the concept very easy to understand and apply to other situations.
Admin
I've seen enough toys become actual production apps that source control is probably a good idea (though I'll admit I've often not used sc for toys, myself).
Admin
SCM for Windows is spelled TortoiseSVN, if you ask me. The lack of Visual Studio integration is IMO not a big problem since Subversion uses a copy-modify-merge model as an alternative to locking. I've also been trying to introduce Trac, which integrates with Subversion, at job but project leaders have been surprisingly reluctant this far.
Admin
The concept is useless if it is not used. If the students can not see how it is better, why would they use it?
A technique that makes things more complicated to do? Things like that get submitted to Alex.
Sincerely,
Gene Wirchenko
Admin
And what do you do about the student who says, "That looks like a rather complicated way to do a backup."?
In a way, you are right, but this is also true of the student. Can you get across why (and when) your way would be better?Sincerely,
Gene WirchenkoAdmin
That is not what I am stating. Look again at the bold words.
Do I also get to count the number of toy projects that I threw out? The time used in dealing with SCM for them would be largely wasted.
Do I really need SCM for a program that turns keyboard click on/off (It fit on a screen.) and that will almost certainly never be revised.
SCM takes time. Sometimes, that time would be better spent elsewhere.
When the project stops being a toy, that is when SCM comes into its own.
I have written lots of little programs that I threw away quite soon after I wrote them. Had I had to use SCM, it often would have been less trouble not to bother writing.
SCM has its place, but that is not everywhere.
Sincerely,
Gene Wirchenko