# If you can’t spell, step away from the database

**URL:** <https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024>\
**Category:** The BBQ Pit\
**Created:** [June 24, 2004, 3:23pm UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024 "2004-06-24T15:23:26Z")\
**Posts on this page:** 19\
**Page:** 2

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [June 25, 2004, 12:06am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/21 "2004-06-25T00:06:23Z")

</div>

Sometimes moronic looking code is actually really smart. I’m working with something that reads like this:

```auto

do
{
    // Can't really reveal too much :(
} while (0)

```

“Now why the hell would anyone do it that way?” I’m sure you’re asking. Thing is, it makes perfect sense, and nothing else works.

---

<div class="post-metadata">

**Author:** ![Manduck](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/manduck/32/256_2.png) [@Manduck](https://boards.straightdope.com/u/Manduck)\
**Post date:** [June 25, 2004, 2:05am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/22 "2004-06-25T02:05:03Z")

</div>

I have one -

There is no point in putting “TABLE” in the names of your tables. We already know it’s a table, you don’t have to call it “EMPLOYEE\_TABLE”. It’s no fun banging out queries when you have to put \_TABLE on the end of everything.

---

<div class="post-metadata">

**Author:** ![Green\_Bean](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/green_bean/32/1760_2.png) [@Green\_Bean](https://boards.straightdope.com/u/Green_Bean)\
**Post date:** [June 25, 2004, 2:26am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/23 "2004-06-25T02:26:40Z")

</div>

> [@This Year's Model](#):
>
> I had a job once where whoever created the database spelled employee “employe” throughout. After I left that job, it took me a year till I could spell it correctly again. Aggravating as hell, I agree.

In the old version of Word that I had, the spellchecker thought that the word “address” was spelled “adress.” So I re-learned it with the wrong spelling. And then I had to re-re-learn it.

Welcome **Halleluau**. Like the name.

---

<div class="post-metadata">

**Author:** ![Bruce\_Daddy](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@Bruce\_Daddy](https://boards.straightdope.com/u/Bruce_Daddy)\
**Post date:** [June 25, 2004, 3:18am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/24 "2004-06-25T03:18:38Z")

</div>

> [@Manduck](#):
>
> I have one -
> 
> There is no point in putting “TABLE” in the names of your tables. We already know it’s a table, you don’t have to call it “EMPLOYEE\_TABLE”. It’s no fun banging out queries when you have to put \_TABLE on the end of everything.

I find this to be tolerable. Redundant, yes, but tolerable. There is a school of thought where everthing includes its type in its name, for instance:

Dim strMyTextString as string  
Dim intMyInteger as integer

Using your example, an Oracle query might read:

Select FIRST\_NAME from EMPLOYEE\_TABLE WHERE IS\_ACTIVE = ‘1’

Yes, a little redundant but not unreadable.

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [June 25, 2004, 7:43am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/25 "2004-06-25T07:43:28Z")

</div>

Yes - it’s supposed to be helpful if you’re working with a lot of variables in a language that strongly enforces types - rather than compiling the thing and at some point realising that it isn’t quite working, you would notice that you’re writing an expression with incompatible types at design time.

---

<div class="post-metadata">

**Author:** ![Sir\_Doris](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@Sir\_Doris](https://boards.straightdope.com/u/Sir_Doris)\
**Post date:** [June 25, 2004, 8:01am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/26 "2004-06-25T08:01:50Z")

</div>

I used to teach databases - this is making me cry!

Both of the guys in control of our web server are dyslexic. The main one seems to have it quite badly and won’t use any sort of coping strategy (according to the other). Plus he seems to never rename anything. He’s also contantly reorganising the server. So we’re constantly battling with misnamed files, his inability to accept the concept of case sensitivity, things getting deleted and so on.

The last time he deleted my directory it took him four attempts to spell my name correctly when he created a new one. Why on earth he can’t cut and paste from my emails, I don’t know. and more often than not if we point out he’s missspelt or buggered up the case of a directory he simply creates a new one and puts in a link between the two, which makes maintaining our pages much harder. We know what we think the directory should be called, but we have to guess how he may have spelt it and where on the server he may have put it (no one has yet been able to work out the logic behind his directory structure).

---

<div class="post-metadata">

**Author:** ![Manduck](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/manduck/32/256_2.png) [@Manduck](https://boards.straightdope.com/u/Manduck)\
**Post date:** [June 26, 2004, 3:07am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/27 "2004-06-26T03:07:48Z")

</div>

> [@Mangetout](#):
>
> Yes - it’s supposed to be helpful if you’re working with a lot of variables in a language that strongly enforces types - rather than compiling the thing and at some point realising that it isn’t quite working, you would notice that you’re writing an expression with incompatible types at design time.

but we are talking about a database - there are only, what, three kinds of thing: tables, columns, and views. It just ain’t worth tacking \_table onto the end of everything. And it’s not as if the columns all have \_column on the end, although go knows there are probably some people who do that. It’s just syntactic clutter.

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [June 26, 2004, 3:43am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/28 "2004-06-26T03:43:03Z")

</div>

My precedessor at my current place of work had a first name that started with a “D”. I know of this because dozens of fields in each table that my precedessor had added bore field names that started with a “d” — dDue\_Date, dBleed, dCompanyCode, etc.

---

<div class="post-metadata">

**Author:** ![Excalibre](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@Excalibre](https://boards.straightdope.com/u/Excalibre)\
**Post date:** [July 2, 2004, 1:08pm UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/29 "2004-07-02T13:08:08Z")

</div>

> [@Sir Doris](#):
>
> I used to teach databases - this is making me cry!
> 
> Both of the guys in control of our web server are dyslexic. The main one seems to have it quite badly and won’t use any sort of coping strategy (according to the other). Plus he seems to never rename anything. He’s also contantly reorganising the server. So we’re constantly battling with misnamed files, his inability to accept the concept of case sensitivity, things getting deleted and so on.
> 
> The last time he deleted my directory it took him four attempts to spell my name correctly when he created a new one. Why on earth he can’t cut and paste from my emails, I don’t know. and more often than not if we point out he’s missspelt or buggered up the case of a directory he simply creates a new one and puts in a link between the two, which makes maintaining our pages much harder. We know what we think the directory should be called, but we have to guess how he may have spelt it and where on the server he may have put it (no one has yet been able to work out the logic behind his directory structure).

Why in the _world_ is he still allowed to work there?

---

<div class="post-metadata">

**Author:** ![MaxTheVool](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@MaxTheVool](https://boards.straightdope.com/u/MaxTheVool)\
**Post date:** [July 2, 2004, 6:39pm UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/30 "2004-07-02T18:39:04Z")

</div>

> [@ultrafilter](#):
>
> Sometimes moronic looking code is actually really smart. I’m working with something that reads like this:
> 
> ```auto
> 
> do
> {
> // Can't really reveal too much :(
> } while (0)
> 
> ```
> 
> “Now why the hell would anyone do it that way?” I’m sure you’re asking. Thing is, it makes perfect sense, and nothing else works.

Let me guess… a lot of “break” statements were involved?

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [July 2, 2004, 6:43pm UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/31 "2004-07-02T18:43:35Z")

</div>

> [@MaxTheVool](#):
>
> Let me guess… a lot of “break” statements were involved?

None at all. This is a macro that needs to have extremely local scope for its variables, and just using braces would cause it to not compile in something like this:

```auto

if (...)
    MACRO(....);
else
    MACRO(....);

```

---

<div class="post-metadata">

**Author:** ![SolGrundy](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@SolGrundy](https://boards.straightdope.com/u/SolGrundy)\
**Post date:** [July 2, 2004, 11:14pm UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/32 "2004-07-02T23:14:09Z")

</div>

What really bugs me are flippant comments in code. I see them all the time, like

// this is really icky code but it works

or

// HACK: remove this – dfw 092501

(no one knows who dfw is, and he hasn’t worked for the company in 3 years)

or

/\* shoot this code. now. \*/

Why bother to put something like that in there at all? Either don’t bother to make a comment, or actually _do_ something about it! If you’re trying to be clever, that’s what e-mail is for!

What really bugs me is the most egregious offender in my company is my supervisor, who is enough a pedant to frequently criticize me for putting my brackets on the same line as an if statement.

```auto

if (youAreAPedanticJerk)
{
   your_hands.clap();
}

```

is acceptable practice, while

```auto

if (!it.broke()) {
   it.dontFix();
}

```

will bring about the downfall of humanity as we know it.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [July 2, 2004, 11:46pm UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/33 "2004-07-02T23:46:15Z")

</div>

> [@SolGrundy](#):
>
> What really bugs me is the most egregious offender in my company is my supervisor, who is enough a pedant to frequently criticize me for putting my brackets on the same line as an if statement.

Your boss is a twat. It’s a complete waste of vertical space to devote an entire line to holding an open brace. I fucking hate that.

But I suppose that’s what they invented [indent](http://man.linuxquestions.org/index.php?query=indent&section=0&type=2&print=1).

---

<div class="post-metadata">

**Author:** ![wolfman](https://avatars.discourse-cdn.com/v4/letter/w/a8b319/32.png) [@wolfman](https://boards.straightdope.com/u/wolfman)\
**Post date:** [July 2, 2004, 11:57pm UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/34 "2004-07-02T23:57:31Z")

</div>

> [@](#):
>
> What really bugs me is the most egregious offender in my company is my supervisor, who is enough a pedant to frequently criticize me for putting my brackets on the same line as an if statement.

I agree with your boss on that one. Once you get to 10 nested levels or so, trying to read through code someone else wrote takes 3-4 times the time if, when the bracket levels don’t match up spatially. Particularly when dealing with long quotes that have to wrap around and screw up the indent pattern, so you have to scan for brackets to maintain flow.

---

<div class="post-metadata">

**Author:** ![Squink](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Squink](https://boards.straightdope.com/u/Squink)\
**Post date:** [July 3, 2004, 12:32am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/35 "2004-07-03T00:32:39Z")

</div>

> [@](#):
>
> 3-4 times the time if, when

SHUDDER!!!

---

<div class="post-metadata">

**Author:** ![Manduck](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/manduck/32/256_2.png) [@Manduck](https://boards.straightdope.com/u/Manduck)\
**Post date:** [July 3, 2004, 2:09am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/36 "2004-07-03T02:09:01Z")

</div>

> [@wolfman](#):
>
> I agree with your boss on that one. Once you get to 10 nested levels or so, trying to read through code someone else wrote takes 3-4 times the time if, when the bracket levels don’t match up spatially. Particularly when dealing with long quotes that have to wrap around and screw up the indent pattern, so you have to scan for brackets to maintain flow.

If you have 10 levels of nesting, you should decompose that routine. I don’t think any bracketing style could make 10-level indentation readable.

---

<div class="post-metadata">

**Author:** ![EllisDee](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ellisdee/32/4531_2.png) [@EllisDee](https://boards.straightdope.com/u/EllisDee)\
**Post date:** [July 3, 2004, 5:34am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/37 "2004-07-03T05:34:14Z")

</div>

> [@SolGrundy](#):
>
> What really bugs me is the most egregious offender in my company is my supervisor, who is enough a pedant to frequently criticize me for putting my brackets on the same line as an if statement.

Your boss is correct. You are living in the 80s.

I hope you realize you both have your preferences for the exact same reason: readability. His position is that when blocks begin and end on the same level, the code is more readable. Your position is that you can only fit 24 lines (79 characters wide) of code on the screen at a time, so wasted lines make it less readable.

I would advise you kick up your resolution, reduce your font size, hide some IDE features, or implement some combination of all 3 in an effort to overcome this irrational need to conserve the over-abundant screen real estate modern development environments provide.

---

<div class="post-metadata">

**Author:** ![SolGrundy](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@SolGrundy](https://boards.straightdope.com/u/SolGrundy)\
**Post date:** [July 3, 2004, 8:20am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/38 "2004-07-03T08:20:35Z")

</div>

> [@Ellis Dee](#):
>
> Your boss is correct. You are living in the 80s.
> 
> I hope you realize you both have your preferences for the exact same reason: readability. His position is that when blocks begin and end on the same level, the code is more readable. Your position is that you can only fit 24 lines (79 characters wide) of code on the screen at a time, so wasted lines make it less readable.
> 
> I would advise you kick up your resolution, reduce your font size, hide some IDE features, or implement some combination of all 3 in an effort to overcome this irrational need to conserve the over-abundant screen real estate modern development environments provide.

```auto

me.bite();

```

---

<div class="post-metadata">

**Author:** ![SolGrundy](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@SolGrundy](https://boards.straightdope.com/u/SolGrundy)\
**Post date:** [July 3, 2004, 8:27am UTC](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024/39 "2004-07-03T08:27:47Z")

</div>

Forgot this was the Pit, so I need to make it clear: I was kidding.

I don’t care one way or the other, and I think it’s a completely pedantic distinction that matters only to people who don’t have more important things to think about. It’s particularly annoying when the code in questioin was a simple 4-line if-else deal where the bracketing style had absolutely no bearing on the readability of the code as a whole.

It’s stuff like this that makes me realize more and more that I don’t want to be a programmer. I’m not anal-retentive enough to care, but I’m just anal-retentive enough that it bothers me when people point it out.

[Previous page](https://boards.straightdope.com/t/if-you-can-t-spell-step-away-from-the-database/252024.md?page=1)
