Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Programming Tip of the Day
Index -> General Programming
Goto page 1, 2, 3 ... 11, 12, 13  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: 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
Sponsor
sponsor
jamonathin




PostPosted: 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? Smile
wtd




PostPosted: Tue Nov 01, 2005 1:21 pm   Post subject: (No subject)

Not necessarily. Wink
Mr. T




PostPosted: 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." Head Bang
wtd




PostPosted: Tue Nov 01, 2005 7:32 pm   Post subject: (No subject)

That works.
Martin




PostPosted: 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. Wink Wink
wtd




PostPosted: 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




PostPosted: 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
Sponsor
sponsor
wtd




PostPosted: 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




PostPosted: 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]




PostPosted: 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 Razz
Tony




PostPosted: Wed Dec 21, 2005 9:24 am   Post subject: (No subject)

[Gandalf] wrote:
goto Razz

Cornflake wrote:

while(user.status == "dumbass")
slap(user);
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Martin




PostPosted: 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




PostPosted: 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




PostPosted: 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.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 13  [ 184 Posts ]
Goto page 1, 2, 3 ... 11, 12, 13  Next
Jump to:   


Style:  
Search: