Author |
Message |
wtd
|
Posted: Tue Nov 01, 2005 1:07 pm Post subject: Programming Tip of the Day |
|
|
Develop a large vocabulary. The programming manuals and other instructional material you'll read here and elsewhere are often written by people with a solid grasp of the english language and its vast vocabulary. If you do not also have a solid vocabulary, you will not be able to completely understand them, and misunderstandings in english often translate to misunderstanding of programming languages. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
jamonathin
|
Posted: Tue Nov 01, 2005 1:16 pm Post subject: (No subject) |
|
|
Very interesting. . . very true.
Since this is a tip of the day, are we going to be seeing a tip every day? |
|
|
|
|
|
wtd
|
Posted: Tue Nov 01, 2005 1:21 pm Post subject: (No subject) |
|
|
Not necessarily. |
|
|
|
|
|
Mr. T
|
Posted: Tue Nov 01, 2005 7:30 pm Post subject: Alex's Opinion |
|
|
So let's call it.. "The tip of the whenever-the-hell-wtd-feels-like-writing-one." |
|
|
|
|
|
wtd
|
Posted: Tue Nov 01, 2005 7:32 pm Post subject: (No subject) |
|
|
That works. |
|
|
|
|
|
Martin
|
Posted: Tue Nov 01, 2005 7:43 pm Post subject: (No subject) |
|
|
So wtd, why should one use accessor methods in their classes instead of public variables? It seems like a lot of extra code just to get the value of a variable. |
|
|
|
|
|
wtd
|
Posted: Tue Nov 01, 2005 7:45 pm Post subject: (No subject) |
|
|
Because accessors can be selective? You can only define a getter, and not a setter, to prevent undesired manipulation of instance variables. |
|
|
|
|
|
Martin
|
Posted: Tue Nov 01, 2005 8:05 pm Post subject: (No subject) |
|
|
It's also so that you could have more control over what happens when variables are accessed, and so that you can put contstraints on your variables.
Like code: | void setSpeed (int speed) {
if (speed < 0) {
this.speed = 0;
} else {
this.speed = speed;
}
drawOdo();
} |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
wtd
|
Posted: Sat Nov 12, 2005 8:25 pm Post subject: (No subject) |
|
|
Update:
Indent. Using spaces, not tab.
Well-formatted code is easier to figure out. The easier code is to figure out, the more likely people will be to help you.
Unless you don't want people to help you, in which case please use no indentation. |
|
|
|
|
|
wtd
|
Posted: Tue Dec 20, 2005 5:17 pm Post subject: (No subject) |
|
|
Just because you can do something in a given programming language, that doesn't mean you should do it.
But just because you shouldn't do something, doesn't mean you shouldn't know how to. |
|
|
|
|
|
[Gandalf]
|
Posted: Tue Dec 20, 2005 8:33 pm Post subject: (No subject) |
|
|
wtd wrote: Just because you can do something in a given programming language, that doesn't mean you should do it.
But just because you shouldn't do something, doesn't mean you shouldn't know how to.
goto |
|
|
|
|
|
Tony
|
Posted: Wed Dec 21, 2005 9:24 am Post subject: (No subject) |
|
|
[Gandalf] wrote: goto
Cornflake wrote:
while(user.status == "dumbass")
slap(user);
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Martin
|
Posted: Wed Dec 21, 2005 10:09 am Post subject: (No subject) |
|
|
Martin's tip of the day. Japanese people - don't make functions with titles in misspelled English. Recievable isn't a word. |
|
|
|
|
|
wtd
|
Posted: Wed Dec 21, 2005 6:43 pm Post subject: (No subject) |
|
|
Surprises in a programming languages aren't always bad. Bad surprises are, but it's not because they're surprises. It's because they're bad. |
|
|
|
|
|
wtd
|
Posted: Wed Dec 21, 2005 7:51 pm Post subject: (No subject) |
|
|
Some programmers can do awesome things with crappy tools. We can admire their accomplishments, but in seeking to emulate their ingenuity, we need not start from the same lowly base. |
|
|
|
|
|
|