>> What, the "conspiracy" that there is *NO* manual of style that mentions names are to be written in uppercase?? > Try the Blue Book @ http://www.legalbluebook.com/
Which Section (or Page Number) is this mentioned??
I see nothing that states the Blue Book is law, but just common practise.
> It also seems a bit odd to me that you treat your english teacher as more authoritative than a federal judge, If federal judges are perverting the language by completely disregarding Proper Nouns, then why aren't the English teachers taught the "new" way then??
> A shortened form of a word or phrase used chiefly in writing to represent the complete form, such as Mass. for Massachusetts or USMC for United States Marine Corps.
Using www.dictionary.com I see. Funny that they don't list MA as the abbreviation for Massachusetts, but Mass.
> that think that your name in all caps is the name of a legal fiction.
That would be the "Nom de guerre" belief. It comes from French which means "war name," but it really means an assumed name.
I don't know about you, but I learnt to spell names with the first letter in capitals, and the rest in lowercase. Lawyers used to give the excuse that typewritters only had uppercase, so they spelt names in uppercase. Why they continue this fraud and abuse of English is above me.
> I tried to understand the thinking behind that, but it involves conspiracy theories and a general detachment from reality.
What, the "conspiracy" that there is *NO* manual of style that mentions names are to be written in uppercase?? If there is, please show me !! Ask any English teacher how names are spelt. Now why do lawyers continute to disregard the rules of the language?
You probably don't think companies are legal person as well (which the law has unfortunately ruled they are.)
> They also belive that the two letter postal code abbreviations for states represent different states than the ones that you write out longhand.
Look up the definition for abbreviation proper. Abbreviations are either: 1) First letter of each word, (which is really an acronym) 2) The first syllable.
Again, lawyers use English inconsistentenly with what is taught.
<sarcasm> They couldn't have a reason, now could they! Guess it's a conspiracy! </sarcasm>
GameSpy (Which used to be QuakeSpy before it got popular), Eudora Lite, FreeAgent Lite, etc, I think demonstrate where shareware is heading.
These shareware programs have basic working functionality, but with ads. When you register, the ads are gone. What I liked about GameSpy was that lifetime membership is $20 -- "free upgrades!" It's not nickling and diming me to death, say like Microsoft does with Windows.
Policing shareware is futile --- there will always be people who use keygens, etc, no matter what. The *only* effective way to reduce piracy is to teach people the results of their actions: i.e. By not paying for shareware, developers have a harder time paying bills, less incentive to produce it the future, etc.
> There are people who do visualisation who care about this stuff. As for the color, does anyone know if you can actually see any difference there ? I mean - 24 bit color is 16M colors ?
Yes, 24 Bit color is 16M colors, but that is *inadequate* when you start talking about color gradients. 24-bit color has 3 color channels, each with 8-bit depth. That allows for 256 shades of *primary colors*, but the eye can detect millions of shades. A higher color bit depth has less banding issues.
Not for the embedded market, and consoles! I'm a console (games) programmer. All those little checks *ADD* up. Checks should be at the *programmer's descretion*, not at the whim of a compiler or language.
> to the problem and modern languages build these checks into the run-time environment, where they belong.
And you're completely ignoring the cost (performance) of doing so! For a debug build, yes, I love having extra checks, but for a full optimization build, NO. The performance cost is too high. There is a reason you have them in a debug build -- to write your code properly (robustfully) the 1st time, so you don't need the extra checking later.
> To eliminate buffer overflows, getting rid of the C legacy is the only solution.
Now you're trolling. You can write safe code in any language. Likewise you can write bad code in any language. Languages are *not* the silver bullet to the problem, but you for whatever reason think they are.
Not quite. There are some OpenGL features that will *never* be supported on the PS2 (because the hardware doesn't support them *at all*,) and others that are dog-slow. (Check out "ps2gl" if you need more info)
i.e. lack of blending modes, reading back the frame buffer, faking a stencil buffer via alpha tricks, etc
I wish the PS2 had better OpenGL support, but the hardware unfortunately wasn't designed for it.
I know the article mentions WinXP (NT 5.1), but since Win2K is NT5.0 this is related:
I have a ECS K7S5A motherboard that I had to disable ACPI in the BIOS, otherwise Win2K would blue screen on setup -- this blue screen even tells you to press F7 at the setup screen "when it prompts press F6 for RAID devices" to *silently* disable ACPI support!
Can anyone enlighten me WTF does every device need to be on the same IRQ ?? What's wrong with having every device on it's own IRQ ??
The bloody problem was that segments overlapped. i.e. Only 16 bytes *didn't* overlap in 2 consecutive segments -- meaning there was 65535 different ways to address the *same* memory location. (Ok, 64K wrap-around in a segment sucked too.)
Why the heck couldn't Intel just have "zero" memory for when the CPU accessed segmented memory that didn't exist.
i.e. segment:memory 0000:0000.. FFFF full 64k 0009:0000.. FFFF full 64k (total 640K) 000A:000
: all zero when read B7FF:0000 B800:0000 frame buffer (mono or cga, I forgot) A000:0000 VGA frame buffer
// For when you don't have a working assert // Assuming you have hardware that can catch writing to memory address 0 int* pPoorMansBreakpoint = 0; *pPoorMansBreakpoint = 0xDEADC0DE;
> However, the issue of free speech is not so cut and dry.... Laws against slander, libel, death threats, and the proverbial "yelling fire in a crowded theater" fall into the same category.
*sigh*
Yelling "Fire!" in a crowded theater is NOT an issue of free speech.
> And, although it's rather controversial these days, I don't believe it protects those who want to make copies of DVDs and CDs and distribute them over the net or to their friends. That is an issue of "Fair Use", not free speech.
> If I and five friends have a LAN party and we want to play this game without connecting to the internet we cannot do so without bnetd (or can we? Yes, you can play on a LAN without bnetd.
Obviously, you don't have D2, or you'd know that D2 supports TCP/IP play (Select Multiplayer from the main menu.)
One machine hosts, the other join. Real simple.
> I assume that the game is not playable over raw ethernet without a server of some sort).
> In a Libertarian world, me putting a gun to your head and not pulling the trigger for half your worldly goods is a mutual agreement between two consenting private parties.
Libertarian has *nothing* to do with the signing of the contract.
> I live in the real world, where that's called extortion.
No, the above example is callled "signing a contract under duress" which makes the contract null and void.
I wrote an image recognition system for the lumber industry a few years back.
People (graders) using neon chalk would write on boards (The marks would designate the board quality, and where to cut the bad pieces off.) The boards and chalk would go under a housing with UV light, which had a photosensitive trigger. The trigger would signal the computer, to capture the image. The computer would analyze the image, and send out appropiate bits to a PLC which controlled the saws and sorting.
As you have found out, RGB does *not* uniquely identify colors. We worked around that problem in 2 ways:
1) carefully choosing our chalk color.
2) I then converted the colors over to HSB and used a relative error of Hue to determine if 2 colors were "close enough."
It wasn't perfect, but it was close enough and extremely fast.
I doubt HSB will be sufficient for your domain, but see if you can "change the problem" to make it more computer friendly:-)
> yet Phillips (the company who invented the CD spec) has said that it intends to try and make its next CD burner able to circumvent the copy mechanisms.
I'm glad Phillips is doing this. It's great to finally see a company supporting people's fair use* and right to listen to music they have bought, regardless of the medium.
However, I've always wondered if Phillip's didn't have an exterior motivation? If [audio] copy protection worked, would Phillips have less sales of CD's? What do they have to gain by taking a stance against copy protection?
*I believe distributing music against the author's wishes is wrong. However, if I've paid for a CD, I believe I have paid for the privilege (or right) to listen to it wherever I am, and in whatever medium I choose, aka unlimited private use, or "fair use"
> So why (other than to piss off the consumer) are the record companies doing this???
Now this I can answer. The Recording Companies are desperately trying to maintain control of having people buy music. It's a loosing battle -- all you need is one person to make a perfect digital copy and they *believe* sales will go down. Personally I believe more people *buy* music when they are exposed to more of it. (Go Figure:)
> For the purposes of this history, our focus will be on the games that are
> generally understood to be in the "harvest, build, destroy" mode
> that we've come to know and love.
Or more commonly known as in the RTS world:
eXplore, eXpand, eXploit, eXterminate
Master Of Orion 3 (MOO3) is supposedly adding eXperience, but how well they will pull it off, remains to be seen. (I loved MOO2 and am very interested to see what is "new".)
Cheers
~~
"The issue today is the same as it has been throughout all history, whether man shall be allowed to govern himself or be ruled by a small elite." -- Thomas Jefferson
Disclaimer: This is an opinion on the strengths and weaknesses of publically available source code. If you find this offensive, then maybe you need to learn how to take *constructive criticism* as you're missing the point of these tips.
I use Linux (for my Firewall) and Win2K (for Desktop gaming) I am very happy with the *functionality* of free code.
What I love about programs that provide source:
- Tons of free programs! (Everything from OSes, Compilers, Editors, Office Apps, and even Games)
- The source is available. As a programer, if I find a trivial bug I can fix it, or submit a patch. It empowers the USERS (something closed source programs will never be able to provide by definition.)
Where public source falls down, and what I hate about it:
- Most of it is so poorly written, with bad naming conventions, lack of internal documentation (no comments!?) that it is a complete and utter TURN-OFF to even bother hacking it.
I know, don't knock a gift horse. I admire the *functionality* (Linux and *BSD make great servers!) of open source programs. They work beautifully! (once you put the time investment reading ALL the docs:) But I absolutely do *not* have time to slog through poorly written code. If a programmer can't even take the time to write readable code, it's not worth reading IMHO.
It's taken me a LONG time to learn how to write clean code. I'll give some examples and rules of thumb that I have found extremely handy.
(I use C++ but these rules-of-thumbs can be used in any language.)
The first few tips will seem Hungarian notation -ish, but it's not as anal rentative as true Hungarian notation.
1. Prefix pointers with 'p' (This is pretty standard, everyone is familiar with it)
2. Prefix all globals with 'g'
3. Prefix all member variables with '_' (underscope)
4. Prefix all references with 'r'.
5. Constants are in uppercase. (I also avoid #defines so that the compiler can make use of type checking)
i.e.
#define BUFFER_WIDTH 80
const int BUFFER_WIDTH = 80;
5. Make abundant use of whitespace!! Align things up vertically in the code.
So MANY programmers don't have a clue about how even adding a TINY amount of whitespace makes a world of difference for readability. Would you read a book or a math formula without any whitespace!!?? If not, then why should you expect code to be any different??
i.e.
if(a+b) {// UNREADABLE
Foo( arg1, arg2 );// space around arguments
if (a + b)// space after if and around operators
char     *pBuffer;
const int BUFFER_WIDTH = 80;
const int BUFFER_HEIGHT = 25;
See how types are aligned in 1st column, variable names in 2nd column, and the value in the 3rd column.
(ARGH,/. compresses contigious white space, between "char" and "*pbuffer", but fortunately I was able to use non-breaking spaces for alignment.)
6. Putting functions in alphabetical order (so anyone using a 'dumb editor' can quickly find them.
7. For function definitions, putting *one* space between the function name and parenthesis. This lets you do a search to locate the function definition.
i.e.
>
void Foo (... args... )
{
}
Whenever the function is called, there is NO space between the function name and parenthesis.
i.e.
Foo( arg1, arg2 );// invoke Foo
8. Use descriptive variable names! Using the classic 'i' as an iterator name is DUMB. It doesn't tell the reader WHAT you're iterating over. X & Y are "OK" if you're iterating over a 2D matrix since they have become a defacto standard.
If you can't think of a good descriptive variable name, chances are you don't completely understand the subject / formula. Coming up with good names is HARD, but don't use that as an excuse to get away with sloppy naming.
9. Use a line delimiter to seperate functions, ALONG with a comment describing what the function does.
i.e.
// Returns the size of a 8-bpp bitmap in bytes.
// param theWidth Width in pixels
// param theHeight Height in pixels
//
int CalcSize( const int theWidth, const int theHeight )
{
}
(Note: There shouldn't be any spaces in the = seperator but/. adds them in.)
Ok, I've done enough "ranting":)
Feel free to email me if you want to discuss coding styles that you find helpfull. I'm especially interested in learning why someone finds a rule-of-thumb usefull.
Cheers
--
Lameness filter SUCKS for posting code snippets!
Sorry. But computers have a *LONG* way to go, before we have to worry about being "threatened" by them. Namely, doing MORE then just what they are programmed to do.
> Luckily, Enlightenment hasn't been updated since the days when 200mhz was the norm :)
:)
Hehe. That's like using Win 3.1 on a modern CPU
Does anyone know what Rasterman is up to now-a- days? How long ago did he leave Red Hat?
>> What, the "conspiracy" that there is *NO* manual of style that mentions names are to be written in uppercase??
> Try the Blue Book @ http://www.legalbluebook.com/
Which Section (or Page Number) is this mentioned??
I see nothing that states the Blue Book is law, but just common practise.
> It also seems a bit odd to me that you treat your english teacher as more authoritative than a federal judge,
If federal judges are perverting the language by completely disregarding Proper Nouns, then why aren't the English teachers taught the "new" way then??
> A shortened form of a word or phrase used chiefly in writing to represent the complete form, such as Mass. for Massachusetts or USMC for United States Marine Corps.
Using www.dictionary.com I see. Funny that they don't list MA as the abbreviation for Massachusetts, but Mass.
> that think that your name in all caps is the name of a legal fiction.
That would be the "Nom de guerre" belief. It comes from French which means "war name," but it really means an assumed name.
I don't know about you, but I learnt to spell names with the first letter in capitals, and the rest in lowercase. Lawyers used to give the excuse that typewritters only had uppercase, so they spelt names in uppercase. Why they continue this fraud and abuse of English is above me.
> I tried to understand the thinking behind that, but it involves conspiracy theories and a general detachment from reality.
What, the "conspiracy" that there is *NO* manual of style that mentions names are to be written in uppercase?? If there is, please show me !! Ask any English teacher how names are spelt. Now why do lawyers continute to disregard the rules of the language?
You probably don't think companies are legal person as well (which the law has unfortunately ruled they are.)
> They also belive that the two letter postal code abbreviations for states represent different states than the ones that you write out longhand.
Look up the definition for abbreviation proper. Abbreviations are either:
1) First letter of each word, (which is really an acronym)
2) The first syllable.
Again, lawyers use English inconsistentenly with what is taught.
<sarcasm> They couldn't have a reason, now could they! Guess it's a conspiracy! </sarcasm>
GameSpy (Which used to be QuakeSpy before it got popular), Eudora Lite, FreeAgent Lite, etc, I think demonstrate where shareware is heading.
These shareware programs have basic working functionality, but with ads. When you register, the ads are gone. What I liked about GameSpy was that lifetime membership is $20 -- "free upgrades!" It's not nickling and diming me to death, say like Microsoft does with Windows.
Policing shareware is futile --- there will always be people who use keygens, etc, no matter what. The *only* effective way to reduce piracy is to teach people the results of their actions: i.e. By not paying for shareware, developers have a harder time paying bills, less incentive to produce it the future, etc.
> There are people who do visualisation who care about this stuff. As for the color, does anyone know if you can actually see any difference there ? I mean - 24 bit color is 16M colors ?
Yes, 24 Bit color is 16M colors, but that is *inadequate* when you start talking about color gradients. 24-bit color has 3 color channels, each with 8-bit depth. That allows for 256 shades of *primary colors*, but the eye can detect millions of shades. A higher color bit depth has less banding issues.
> Automatic checks are indeed the solution
Not for the embedded market, and consoles! I'm a console (games) programmer. All those little checks *ADD* up. Checks should be at the *programmer's descretion*, not at the whim of a compiler or language.
> to the problem and modern languages build these checks into the run-time environment, where they belong.
And you're completely ignoring the cost (performance) of doing so! For a debug build, yes, I love having extra checks, but for a full optimization build, NO. The performance cost is too high. There is a reason you have them in a debug build -- to write your code properly (robustfully) the 1st time, so you don't need the extra checking later.
> To eliminate buffer overflows, getting rid of the C legacy is the only solution.
Now you're trolling. You can write safe code in any language. Likewise you can write bad code in any language. Languages are *not* the silver bullet to the problem, but you for whatever reason think they are.
> DX/OGL + PS2 = X-box...with native DVD support!
Not quite. There are some OpenGL features that will *never* be supported on the PS2 (because the hardware doesn't support them *at all*,) and others that are dog-slow. (Check out "ps2gl" if you need more info)
i.e. lack of blending modes, reading back the frame buffer, faking a stencil buffer via alpha tricks, etc
I wish the PS2 had better OpenGL support, but the hardware unfortunately wasn't designed for it.
> , changing ACPI from on to off or vice versa on a current install of Windows 2000 or XP will... "fuck shit up."
You can safely "downgrade", that is turn ACPI support off in Win2K by chaning your HAL without any problems.
I know the article mentions WinXP (NT 5.1), but since Win2K is NT5.0 this is related:
I have a ECS K7S5A motherboard that I had to disable ACPI in the BIOS, otherwise Win2K would blue screen on setup -- this blue screen even tells you to press F7 at the setup screen "when it prompts press F6 for RAID devices" to *silently* disable ACPI support!
Can anyone enlighten me WTF does every device need to be on the same IRQ ?? What's wrong with having every device on it's own IRQ ??
The bloody problem was that segments overlapped.
.. FFFF full 64k .. FFFF full 64k (total 640K)
:)
i.e. Only 16 bytes *didn't* overlap in 2 consecutive segments -- meaning there was 65535 different ways to address the *same* memory location. (Ok, 64K wrap-around in a segment sucked too.)
Why the heck couldn't Intel just have "zero" memory for when the CPU accessed segmented memory that didn't exist.
i.e.
segment:memory
0000:0000
0009:0000
000A:000
: all zero when read
B7FF:0000
B800:0000 frame buffer (mono or cga, I forgot)
A000:0000 VGA frame buffer
At least "real mode" is dead (finally
// For when you don't have a working assert
// Assuming you have hardware that can catch writing to memory address 0
int* pPoorMansBreakpoint = 0;
*pPoorMansBreakpoint = 0xDEADC0DE;
> However, the issue of free speech is not so cut and dry. ... Laws against slander, libel, death threats, and the proverbial "yelling fire in a crowded theater" fall into the same category.
n dness.com/FREEDOM990628.htm
*sigh*
Yelling "Fire!" in a crowded theater is NOT an issue of free speech.
Please read this link and learn why.
http://www.google.com/search?q=cache:www.fatalbli
> And, although it's rather controversial these days, I don't believe it protects those who want to make copies of DVDs and CDs and distribute them over the net or to their friends. That is an issue of "Fair Use", not free speech.
Correct.
> Canada is a separate and sovereign nation independent of the crown but acknowledges its past history with it.
Canada constitution was patriated in 1982. SOURCES OF CANADIAN LAW
Just one question:
Can *anyone* show me a definition for "patriated" -- because I can't find it *any* dictionary!
I converted the end game music for Karateka into music notation and made a midi file.
Email me if you want it.
> If I and five friends have a LAN party and we want to play this game without connecting to the internet we cannot do so without bnetd (or can we?
Yes, you can play on a LAN without bnetd.
Obviously, you don't have D2, or you'd know that D2 supports TCP/IP play (Select Multiplayer from the main menu.)
One machine hosts, the other join. Real simple.
> I assume that the game is not playable over raw ethernet without a server of some sort).
Correct, D2 is a client-server game.
> They claim the problem is that bnetd doesn't have the CD-KEY anti-piracy that their servers have.
.dll) to authenticate CD-KEYs ?
This raises some obvious questions:
a) If bnetd did have the cd-key anti-piracy implimented, would Blizzard allow bnetd to exist?
b) Would Blizzard offerer any source, or binaries (.lib,
> In a Libertarian world, me putting a gun to your head and not pulling the trigger for half your worldly goods is a mutual agreement between two consenting private parties.
Libertarian has *nothing* to do with the signing of the contract.
> I live in the real world, where that's called extortion.
No, the above example is callled "signing a contract under duress" which makes the contract null and void.
I wrote an image recognition system for the lumber industry a few years back.
:-)
People (graders) using neon chalk would write on boards (The marks would designate the board quality, and where to cut the bad pieces off.) The boards and chalk would go under a housing with UV light, which had a photosensitive trigger. The trigger would signal the computer, to capture the image. The computer would analyze the image, and send out appropiate bits to a PLC which controlled the saws and sorting.
As you have found out, RGB does *not* uniquely identify colors. We worked around that problem in 2 ways:
1) carefully choosing our chalk color.
2) I then converted the colors over to HSB and used a relative error of Hue to determine if 2 colors were "close enough."
It wasn't perfect, but it was close enough and extremely fast.
I doubt HSB will be sufficient for your domain, but see if you can "change the problem" to make it more computer friendly
> yet Phillips (the company who invented the CD spec) has said that it intends to try and make its next CD burner able to circumvent the copy mechanisms.
:)
I'm glad Phillips is doing this. It's great to finally see a company supporting people's fair use* and right to listen to music they have bought, regardless of the medium.
However, I've always wondered if Phillip's didn't have an exterior motivation? If [audio] copy protection worked, would Phillips have less sales of CD's? What do they have to gain by taking a stance against copy protection?
*I believe distributing music against the author's wishes is wrong. However, if I've paid for a CD, I believe I have paid for the privilege (or right) to listen to it wherever I am, and in whatever medium I choose, aka unlimited private use, or "fair use"
> So why (other than to piss off the consumer) are the record companies doing this???
Now this I can answer. The Recording Companies are desperately trying to maintain control of having people buy music. It's a loosing battle -- all you need is one person to make a perfect digital copy and they *believe* sales will go down. Personally I believe more people *buy* music when they are exposed to more of it. (Go Figure
> For the purposes of this history, our focus will be on the games that are
> generally understood to be in the "harvest, build, destroy" mode
> that we've come to know and love.
Or more commonly known as in the RTS world:
eXplore, eXpand, eXploit, eXterminate
Master Of Orion 3 (MOO3) is supposedly adding eXperience, but how well they will pull it off, remains to be seen. (I loved MOO2 and am very interested to see what is "new".)
You can read more by following these links:
http://www.google.com/search?hl=en&q=moo3+4x
Cheers
~~
"The issue today is the same as it has been throughout all history, whether man shall be allowed to govern himself or be ruled by a small elite." -- Thomas Jefferson
Disclaimer: This is an opinion on the strengths and weaknesses of publically available source code. If you find this offensive, then maybe you need to learn how to take *constructive criticism* as you're missing the point of these tips.
:) But I absolutely do *not* have time to slog through poorly written code. If a programmer can't even take the time to write readable code, it's not worth reading IMHO.
// UNREADABLE
// space around arguments
// space after if and around operators
/. compresses contigious white space, between "char" and "*pbuffer", but fortunately I was able to use non-breaking spaces for alignment.)
... args ... )
// invoke Foo
/. adds them in.)
:)
I use Linux (for my Firewall) and Win2K (for Desktop gaming) I am very happy with the *functionality* of free code.
What I love about programs that provide source:
- Tons of free programs! (Everything from OSes, Compilers, Editors, Office Apps, and even Games)
- The source is available. As a programer, if I find a trivial bug I can fix it, or submit a patch. It empowers the USERS (something closed source programs will never be able to provide by definition.)
Where public source falls down, and what I hate about it:
- Most of it is so poorly written, with bad naming conventions, lack of internal documentation (no comments!?) that it is a complete and utter TURN-OFF to even bother hacking it.
I know, don't knock a gift horse. I admire the *functionality* (Linux and *BSD make great servers!) of open source programs. They work beautifully! (once you put the time investment reading ALL the docs
It's taken me a LONG time to learn how to write clean code. I'll give some examples and rules of thumb that I have found extremely handy.
(I use C++ but these rules-of-thumbs can be used in any language.)
The first few tips will seem Hungarian notation -ish, but it's not as anal rentative as true Hungarian notation.
1. Prefix pointers with 'p' (This is pretty standard, everyone is familiar with it)
2. Prefix all globals with 'g'
3. Prefix all member variables with '_' (underscope)
4. Prefix all references with 'r'.
5. Constants are in uppercase. (I also avoid #defines so that the compiler can make use of type checking)
i.e.
#define BUFFER_WIDTH 80
const int BUFFER_WIDTH = 80;
5. Make abundant use of whitespace!! Align things up vertically in the code.
So MANY programmers don't have a clue about how even adding a TINY amount of whitespace makes a world of difference for readability. Would you read a book or a math formula without any whitespace!!?? If not, then why should you expect code to be any different??
i.e.
if(a+b) {
Foo( arg1, arg2 );
if (a + b)
char     *pBuffer;
const int BUFFER_WIDTH = 80;
const int BUFFER_HEIGHT = 25;
See how types are aligned in 1st column, variable names in 2nd column, and the value in the 3rd column.
(ARGH,
6. Putting functions in alphabetical order (so anyone using a 'dumb editor' can quickly find them.
7. For function definitions, putting *one* space between the function name and parenthesis. This lets you do a search to locate the function definition.
i.e.
>
void Foo (
{
}
Whenever the function is called, there is NO space between the function name and parenthesis.
i.e.
Foo( arg1, arg2 );
8. Use descriptive variable names! Using the classic 'i' as an iterator name is DUMB. It doesn't tell the reader WHAT you're iterating over. X & Y are "OK" if you're iterating over a 2D matrix since they have become a defacto standard.
If you can't think of a good descriptive variable name, chances are you don't completely understand the subject / formula. Coming up with good names is HARD, but don't use that as an excuse to get away with sloppy naming.
9. Use a line delimiter to seperate functions, ALONG with a comment describing what the function does.
i.e.
// Returns the size of a 8-bpp bitmap in bytes.
// param theWidth Width in pixels
// param theHeight Height in pixels
//
int CalcSize( const int theWidth, const int theHeight )
{
}
(Note: There shouldn't be any spaces in the = seperator but
Ok, I've done enough "ranting"
Feel free to email me if you want to discuss coding styles that you find helpfull. I'm especially interested in learning why someone finds a rule-of-thumb usefull.
Cheers
--
Lameness filter SUCKS for posting code snippets!
Sorry. But computers have a *LONG* way to go, before we have to worry about being "threatened" by them. Namely, doing MORE then just what they are programmed to do.
I was going to ask if anyone has Linux running on the new dual G4's, but then I found this cool link
http://linuxppc.org/hardware/dualg4/
Anyone have benchmarks (under Linux) for the dual G4's and corresponding PCs for:
- compiling the kernal
- GIMP
- Quake1/2 benchmarks
I'd love to get the "other endian machine" and compile some game code on it. Anyone have any recommendations? How did id do the Quake3 port to Macs ?
"PC Expert - Mac newbie"
> For instance, the fact that there are truly *billions and billions* of stars *just in our galaxy*.
If you think that's interesting, check out this fact:
It is estimated that there are over 1,000,000,000,000,000 connections in brain, more connections than there are stars in universe
And the brain has more cells in it then stars in the galaxy.
stars number of brain connections