
-----------------------------------
wtd
Tue Nov 01, 2005 1:07 pm

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.

-----------------------------------
jamonathin
Tue Nov 01, 2005 1:16 pm


-----------------------------------
Very interesting. . . very true.  

Since this is a tip of the day, are we going to be seeing a tip every day? :)

-----------------------------------
wtd
Tue Nov 01, 2005 1:21 pm


-----------------------------------
Not necessarily.  ;)

-----------------------------------
Mr. T
Tue Nov 01, 2005 7:30 pm

Alex's Opinion
-----------------------------------
So let's call it.. "The tip of the whenever-the-hell-wtd-feels-like-writing-one."  :hb:

-----------------------------------
wtd
Tue Nov 01, 2005 7:32 pm


-----------------------------------
That works.

-----------------------------------
Martin
Tue Nov 01, 2005 7:43 pm


-----------------------------------
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
Tue Nov 01, 2005 7:45 pm


-----------------------------------
Because accessors can be selective?  You can only define a getter, and not a setter, to prevent undesired manipulation of instance variables.

-----------------------------------
Martin
Tue Nov 01, 2005 8:05 pm


-----------------------------------
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 void setSpeed (int speed) {
    if (speed < 0) {
        this.speed = 0;
    } else {
        this.speed = speed;
    }
    drawOdo();
}

-----------------------------------
wtd
Sat Nov 12, 2005 8:25 pm


-----------------------------------
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
Tue Dec 20, 2005 5:17 pm


-----------------------------------
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]
Tue Dec 20, 2005 8:33 pm


-----------------------------------
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 :P

-----------------------------------
Tony
Wed Dec 21, 2005 9:24 am


-----------------------------------
"]goto :P

while(user.status == "dumbass")
     slap(user);


-----------------------------------
Martin
Wed Dec 21, 2005 10:09 am


-----------------------------------
Martin's tip of the day. Japanese people - don't make functions with titles in misspelled English. Recievable isn't a word.

-----------------------------------
wtd
Wed Dec 21, 2005 6:43 pm


-----------------------------------
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
Wed Dec 21, 2005 7:51 pm


-----------------------------------
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.

-----------------------------------
Naveg
Wed Dec 21, 2005 7:57 pm


-----------------------------------
He's so modest this one ^^  :)

-----------------------------------
wtd
Wed Dec 21, 2005 7:58 pm


-----------------------------------
He's so modest this one ^^  :)

Thanks.

-----------------------------------
wtd
Wed Dec 21, 2005 8:56 pm


-----------------------------------
All large, complex problems are composed of smaller, simpler problems.  It is reasonable to assume that any language or tool which makes the simple problems easier in a general manner will do the same for more complex problems.

-----------------------------------
bugzpodder
Wed Dec 21, 2005 10:34 pm


-----------------------------------
Indent.  Using spaces, not tab.

why?

-----------------------------------
wtd
Wed Dec 21, 2005 10:36 pm


-----------------------------------
Indent.  Using spaces, not tab.

why?

Tabs aren't interpreted consistently across different machines.   A tab might look good to you, if you have it set to display as 4 spaces, but then if it's 8 spaces in another text editor it'll look like crap.

Some text editors will convert tabs to spaces when you save the file, which is a decent compromise.

-----------------------------------
Martin
Wed Dec 21, 2005 11:07 pm


-----------------------------------
Indent.  Using spaces, not tab.

why?

Alignment.

Tabs will be a variable amount of whitespace, spaces are always one space.

for example, if you have a bunch of variables documented like this:

...
int userName = 5;             //the user's name
int transactionIdNo = 7;      //the ID number for the last transaction
int thisisadummyvariable = 3; //this variable didn't do very well in school


With tabs, if the tabspacing is set up differently, the comments won't necissarily be aligned. With spaces, it'll always look the same.

-----------------------------------
wtd
Mon Dec 26, 2005 3:31 pm


-----------------------------------
Revisit your code.

Remember that little RPG you wrote with the sprites ripped off from Zelda?  You thought it was pretty cool.  Now, go back and look at it critically.  Try to figure out ways to improve the code.

Place your code on a pedestal and you will never learn to accept constructive criticism.  Not accepting constructive critism means that in five years time you'll be writing little RPGs in Turing with sprites ripped off from Zelda.

-----------------------------------
wtd
Thu Dec 29, 2005 2:12 am


-----------------------------------
No matter how slow our program is, if it does the right thing, it will be faster than even the most heavily optimized program that does the wrong thing.

-----------------------------------
wtd
Thu Dec 29, 2005 2:31 am


-----------------------------------
If your teacher won't teach you the things you should know, then learn them on your own.  

For instance, I've yet to meet a CS teacher covering Java who talked about creating and using packages early in a course, and yet code re-use (and thus packages) are at the very heart of the Java programming language.

-----------------------------------
wtd
Thu Dec 29, 2005 2:01 pm


-----------------------------------
"Do it right, or don't do it at all."

This is not a call for novices to give up.  It's a challenge.  Don't give up... work harder.

-----------------------------------
Martin
Thu Dec 29, 2005 4:48 pm


-----------------------------------
"Do it right, or don't do it at all."

This is not a call for novices to give up.  It's a challenge.  Don't give up... work harder.
Nah. Do it. Then do it right.

-----------------------------------
wtd
Thu Dec 29, 2005 5:16 pm


-----------------------------------
Well, doing it right refers to more than just the actual code you write.  It also refers to how you go about learning something.

-----------------------------------
Naveg
Thu Dec 29, 2005 5:25 pm


-----------------------------------
"Do it right, or don't do it at all."

This is not a call for novices to give up.  It's a challenge.  Don't give up... work harder.

Depends what you mean by "do it right". For example, certain teachers follow your other tip about revisiting code by having students go about an assignment a certain way, then tackling the same problem in a new, better way later on. Even though the new way is the "right way", the first step is important in the learning process.

-----------------------------------
wtd
Thu Dec 29, 2005 5:29 pm


-----------------------------------
There can be degrees of "right".  :)

Something can be right, and still leave room for improvement.  Then there are the ways that are completely wrong.  

For instance, you might start out with a simple Swing app in Java that's perfectly ok design-wise, and then you're shown how to create a great degree of separation of important bits of code.

On the other hand, you might have someone write the same app with lots of static variables and almost no use of methods to factor out redundant code.

-----------------------------------
Naveg
Thu Dec 29, 2005 5:54 pm


-----------------------------------
I agree. The only problem is where you define the different degrees of "right". Many people would argue that the only right way to make an address book program, for example, would be to use "people" objects and create an array of "people". However, many teachers use such a problem to teach arrays in the first place, using multiple arrays with corresponding indeces. While anyone with any experience with objects would clearly regard this as the wrong approach, it isn't seen that way from the point of view of the student who has just learned what an array is.

The most important step, in this case, is the realization on the part of the student, when he or she finally does learn about objects, that objects are now the "right" way.

-----------------------------------
wtd
Thu Dec 29, 2005 6:00 pm


-----------------------------------
Well, this is an area that's really troublesome.  You have to match the assignment to the concept without getting too far ahead.  Teachers shouldn't be giving students problems which call for aggregate data structures (records, objects) when students have not yet been given any idea how to deal with that.

The thing to keep in mind, I think is that once you teach something, it's very difficult to unteach it.  Once someone learsn to handle aggregate data management with parallel arrays, they'll fall back to that even when shown how to use aggregate data structures in a single array.

-----------------------------------
wtd
Wed Jan 04, 2006 8:01 pm


-----------------------------------
Converting a fanatic is not the same as opening a mind.

You got your friend to switch from Windows to Linux, or frm using Java to using Ruby.  Congratulations, but if he or she brings slavish, unquestioning, fanatical devotion to that new technology, then you have not done anyone a favor.

-----------------------------------
Martin
Wed Jan 04, 2006 8:19 pm


-----------------------------------
Converting a fanatic is not the same as opening a mind.

You got your friend to switch from Windows to Linux, or frm using Java to using Ruby.  Congratulations, but if he or she brings slavish, unquestioning, fanatical devotion to that new technology, then you have not done anyone a favor.

cough95percentofapplesuserbasecough

-----------------------------------
wtd
Wed Jan 04, 2006 8:23 pm


-----------------------------------
I was actually thinking of those solidly entrenched in the AMD vs. Intel flamewars.

-----------------------------------
Martin
Wed Jan 04, 2006 8:43 pm


-----------------------------------
Those people too. But Mac people now also fall into that category. As much as I like my iMac, I hate that it means I now belong to a closer demographic to these crazy Mac people.

-----------------------------------
wtd
Wed Jan 04, 2006 8:48 pm


-----------------------------------
I think the problem is that the ones you see are the zealots.  You don't see the legions of folks using Macs professionally.  Go to a Java conference hosted by Sun or OSCON and look at the sea of iBooks and Powerbooks that have replaced the sea of Thinkpads.  Are these people raving fanatics with undying loyalty to Apple?

-----------------------------------
Martin
Wed Jan 04, 2006 8:51 pm


-----------------------------------
True that.

-----------------------------------
Geminias
Thu Jan 05, 2006 7:15 am


-----------------------------------
i dont use a mac, but i'd say its safe to say where these mac people are coming from.  Mac computers have always been better, performance wise, than any pc.  Which is why people who understand this grit their teeth at how ignored Mac is in the software department...

i read an article that the mac x2 or x3 (i forget) has a bus speed of 1.1ghz.  

I suppose pc could do that too... but at the consumers cost.   I believe current bus speeds (pretty much the most important thing to look at now that processers have topped 1.5ghz) for a pc are 400mhz for top of the line motherboards.  sigh.

-----------------------------------
md
Thu Jan 05, 2006 9:26 am


-----------------------------------
i dont use a mac, but i'd say its safe to say where these mac people are coming from.  Mac computers have always been better, performance wise, than any pc.  Which is why people who understand this grit their teeth at how ignored Mac is in the software department...

i read an article that the mac x2 or x3 (i forget) has a bus speed of 1.1ghz.  

I suppose pc could do that too... but at the consumers cost.   I believe current bus speeds (pretty much the most important thing to look at now that processers have topped 1.5ghz) for a pc are 400mhz for top of the line motherboards.  sigh.
Performance on Macs is not always better. Macs do have very good performance but it is definitely possible to build a better performing PC, though it might cost a bit more then the mac.

As for bus speeds, the current top bus speen for PCs is 1066 MHz, and the most common bus speed after that is 600 MHz. But that only applies to intel chips as AMD uses an entirely different way of doing things that is very similar to the way PowerPC chips do things.

Be sure of what your saying next time, otherwise you just look dumb.

-----------------------------------
Geminias
Thu Jan 05, 2006 10:30 am


-----------------------------------
umm bus speeds as in the ram module sending data to the cpu.  its at 400mhz, commonly.  and you say mac is not always better than pc... well ever since macs and pc's existed at the same time mac has been ahead in every aspect 90% of the time...  there were a few instances where pc manufacturers developed some higher technology faster, but then that didnt matter too much because the macs would still out perform the pc's due to the pc's being unable to properly implement it due to: bad design.  which is what pc is still struggling to get itself out of today.    

but of course thats just my oppinion based on the few articles i read and also my uncle who used to be a computer engineer designing mobo's for pc.

-----------------------------------
wtd
Thu Jan 05, 2006 1:18 pm


-----------------------------------
Yes, Apple does have the opportunity to more optimally design computers since they make the whole thing.  You don't have to worry about some shady company selling computers with fast processors, but really slow hard drives or such.

But Apple is not perfect.  Cosnider the G4.  It was great in its day, but bus issues formed a bottleneck in the system that Apple has had a very hard time dealing with.

It's the software that makes Apple special, and the emphasis on design.

The most common bottleneck for a modern personal computer is the human sitting in front of it.  If the software makes it possible to do what you want to faster and easier, then even a slower computer can seem faster.

-----------------------------------
Geminias
Thu Jan 05, 2006 1:30 pm


-----------------------------------
yeah definitely, definitely, but when discussing such things as hardware performance you have to assume that both are tested with equally optimum or equally crappy software.  Otherwise, its no longer about hardware but software.

-----------------------------------
md
Thu Jan 05, 2006 6:46 pm


-----------------------------------
umm bus speeds as in the ram module sending data to the cpu.  its at 400mhz, commonly.  and you say mac is not always better than pc... well ever since macs and pc's existed at the same time mac has been ahead in every aspect 90% of the time...  there were a few instances where pc manufacturers developed some higher technology faster, but then that didnt matter too much because the macs would still out perform the pc's due to the pc's being unable to properly implement it due to: bad design.  which is what pc is still struggling to get itself out of today.    

but of course thats just my oppinion based on the few articles i read and also my uncle who used to be a computer engineer designing mobo's for pc.

I'm not trying to start a flame war... just pointing that out... but,

Bus speed is not the speed of the memory, and the memory speed on both PCs and Macs is generally the same; though PCs usually adopt new, faster standards quicker. Point, PC.

PCs also generally don't suffer from bad design. There are definitely bad designs out there, but if you're buying your own hardware you can easilly avoid the crappy stuff. That's one of the advantages of PCs, you can pick and choose your componets as opposed to relying on what one specific company says you can use.

-----------------------------------
Martin
Thu Jan 05, 2006 8:04 pm


-----------------------------------
AMD64's have 2GHz FSB's guys...

Power isn't really what Apple's all about though. Apple computers are quick enough, but you can get a faster PC at any Apple price point no problem. There's no argument - you can get faster, better hardware for cheaper for a PC. 

What Apple's about is design in both hardware and software. You get a fairly decent software package with the mac, and OSX is for the most part nicer to use than Windows. I can't say that it's nicer than Linux though. I ditched OSX for it pretty quickly, mostly because the Finder is by far the most useless program ever invented. I'd rather use Microsoft's Hearts for file management. Want to see the path to your current directory? Hah, tough. Want to merge the contents of two folders? Good thing you know how to use Perl!

Apple's big problem I think right now is the lack of flexibility that their hardware offers. Want to upgrade your iMac? Great! It's really easy - just throw it out and buy a new one.

-----------------------------------
wtd
Thu Jan 05, 2006 8:14 pm


-----------------------------------
Did you try using something like Pathfinder, instead of Finder?  Did you research alternatives to the Finder since you find it unpleasant?

The key to Apple's success, in a nutshell, has generally been to not ship hardware without software that can take advantage of it.

I mean, doesn't take much to get a Wintel box with a DVD burner anymore, but I still see people using Windows going nuts trying to find software that can make that piece of hardware useful.

-----------------------------------
wtd
Thu Jan 05, 2006 8:29 pm


-----------------------------------
Breaking from the Apple dscussion...

Ponder this statement for a bit: "Sure FP offers a way to solve the problem, but requires more education than more complex systems."

FP = Functional Programming

Does this kind of justification for "mainstream" OO languages even begin to make sense?

-----------------------------------
Martin
Thu Jan 05, 2006 8:34 pm


-----------------------------------
Did you try using something like Pathfinder, instead of Finder?  Did you research alternatives to the Finder since you find it unpleasant?

I installed Linux ;) Now if only I could get my remote to work with it...

I do boot OSX sometimes, mostly to play UT2004. Kind of like my Windows usage of times long past...

I'll check out pathfinder when I get home.

-----------------------------------
rizzix
Thu Jan 05, 2006 9:37 pm


-----------------------------------
Linux is my hobby OS. No way can it replace OSX. Quality of apps avaible of OSX out beat those for Linux anyday. Gee.

-----------------------------------
rizzix
Thu Jan 05, 2006 9:41 pm


-----------------------------------
Breaking from the Apple dscussion...

Ponder this statement for a bit: "Sure FP offers a way to solve the problem, but requires more education than more complex systems."

FP = Functional Programming

Does this kind of justification for "mainstream" OO languages even begin to make sense?

No but I can give you another reason to avoid FP: It's much more difficult to debug code. If not your own code, then somebody else's. On the other hand most of these mainstream OO languages make debugging code super easy.

Yet its a hard choice. Consider..

FP: Most common bugs found in mainstream OO languages do not apply here. Some complex algorithms are better written in FP than in imperative languages. But debugging code could be difficult. Efficiency is also an issue at times. 

Mainstream: Bugs are very easily introduced. But debugging is extremely simple (with an exception to some ugly languages, e.g. C++).

-----------------------------------
wtd
Thu Jan 05, 2006 10:19 pm


-----------------------------------
I just find it very odd to say that more complex systems require less education.  Methinks this thinking gave us the BSOD.

-----------------------------------
rizzix
Thu Jan 05, 2006 10:23 pm


-----------------------------------
I think C and C++ should be banned! Safer alternatives should be used instead, as in [url=http://en.wikipedia.org/wiki/Cyclone_programming_language]Cyclone and [url=http://www.digitalmars.com/d/]D

-----------------------------------
Martin
Thu Jan 05, 2006 10:37 pm


-----------------------------------
I don't see the quality of apps thing for OSX. iTunes is decent, but doesn't have ANY codec support. QuickTime player is slow and doesn't support full screen mode out of the box. Pages is junk to use (cheap though, I guess). OSX is great, sure, but as for software - nothing has blown me away so far.

-----------------------------------
rizzix
Thu Jan 05, 2006 10:51 pm


-----------------------------------
Quicktime is the only player so far to succesfully play h264 coded video without any problems. None of the opensource alternatives can match it yet (both in terms of speed and stability). Techinically yea, you need quicktime pro to utilize some feature, but it's not entirly true. Apple's quicktime framework has support for all these features out-of-the-box and you don't have to pay a dime. Just search for a quicktime "clone" and you might get one that unlocks these feature for free.

iTunes does not have a large choice in audio formats, but what it has are the best: AAC, (the commonly used MP3). Either way you can have an app bloated with features, but it's poorly designed, and hence low in "quality". Most linux/opensouce apps fall under this category. They focus too much on functionality, they leave out design and stability.

I don't know about Pages. I should give it a try and evaluate it my self. But I do use M$ Office 2004, and it's pretty darn good. Maybe not the best designed app, but good enough to be considered a mac app.

-----------------------------------
Martin
Thu Jan 05, 2006 11:04 pm


-----------------------------------
Quicktime is the only player so far to succesfully play h264 coded video without any problems. None of the opensource alternatives can match it yet (both in terms of speed and stability). Techinically yea, you need quicktime pro to utilize some feature, but it's not entirly true. Apple's quicktime framework has support for all these features out-of-the-box and you don't have to pay a dime. Just search for a quicktime "clone" and you might get one that unlocks these feature for free.
Like VLC or MPlayer, which aren't Mac specific apps.

iTunes does not have a large choice in audio formats, but what it has are the best: AAC, (the commonly used MP3). Either way you can have an app bloated with features, but it's poorly designed, and hence low in "quality". Most linux/opensouce apps fall under this category. They focus too much on functionality, they leave out design and stability.
xmms is bloated? mpg123 is bloated? I've never used a media player that uses more memory than iTunes. Or on Windows, Foobar2000 I think takes the crown.

I don't know about Pages. I should give it a try and evaluate it my self. But I do use M$ Office 2004, and it's pretty darn good. Maybe not the best designed app, but good enough to be considered a mac app.
If the definition of Mac app is 'good software,' well then yeah...


Here's what I don't get. OSX is great, but everyone preaches that it has all of this great software for it - where? iLife is nice, but there are free alternatives that are better. Sure it comes with a lot nicer a selection of software than a Windows box, but that's beside the point.

-----------------------------------
wtd
Thu Jan 05, 2006 11:11 pm


-----------------------------------
Have you looked at VersionTracker?

-----------------------------------
rizzix
Thu Jan 05, 2006 11:24 pm


-----------------------------------
VLC and MPlayer both have failed to play h264 encoded video properly. Well i've tried and it failed.

Besides, VLC is SLOW as hell. MPlayer isin't too bad, but it's gui interface is pathetic.



OK I wasn't just talking about music player when i mentions the apps were bloated. I was talling about most opensource apps in general. 


Bah about Office2004 comment, most apps following the Apple human interface design specs usually are designed pretty well. M$ has tried their best.

-----------------------------------
wtd
Fri Jan 20, 2006 1:25 pm


-----------------------------------
Your teachers, who have years more experience than you as a student, are ironically not there to answer your questions.

They are there to ask the questions, and it is your job to answer them.  The purpose of their knowledge and experience is to make sure you ask the correct questions, and to be able to tell you if you're right or wrong.

Additionally, when you answer their questions, do not answer uncertainly.  Answer with confidence.  Be prepared to be wrong, of course, but have the confidence to back your answer up if challenged.  

If you do not have this confidence, it likely means you have not done enough research, or you have not thoroughly experimented to determine whether your answer will stand up to testing.

-----------------------------------
wtd
Sat Jan 21, 2006 3:40 pm


-----------------------------------
Solve the easy problems first.  Use the experience you gain and the lessons learned to make the hard problems easier.

-----------------------------------
wtd
Sun Jan 29, 2006 5:06 pm


-----------------------------------
The measure of code expressiveness is not purely brevity.

All other things being equal, it's a good thing, but the true measure of expressiveness is how directly the code represents your intent.

-----------------------------------
Martin
Mon Jan 30, 2006 6:11 am


-----------------------------------
Learn how to use bit shifting, and use it! You will save a ton of memory and increase performance too!

-----------------------------------
wtd
Mon Jan 30, 2006 3:06 pm


-----------------------------------
Avoid premature optimization!

-----------------------------------
Martin
Mon Jan 30, 2006 7:15 pm


-----------------------------------
TouchÃ©.


Learn how to use typesafe enumeration before you learn how to use bit shifting.

-----------------------------------
wtd
Mon Jan 30, 2006 10:56 pm


-----------------------------------
Learn how to write expressive code before you learn how to write fast code.

There, fixed that for ya.  ;)

-----------------------------------
wtd
Tue Jan 31, 2006 3:06 pm


-----------------------------------
Different programming languages have different strengths.    Sometimes these strengths are so great that it's easier to learn an entirely new language than to tackle a problem in a language you already know.

-----------------------------------
wtd
Tue Feb 07, 2006 12:27 pm


-----------------------------------
There is no spoon

Once we have learned a few things, gained a few skills, there is a tendency to view new ideas with suspicion.  They are not like what we already know, so something must surely be wrong with them.

Instead of thinking this way, remember that when you started out with  it was hard.  There were likely moments when you muttered and said it was impossible.

There is no spoon.  Everything is unnatural and awkward in the programming world.  Nothing makes any real kind of sense, and ncertainly nothing is intuitive.

And you know... we manage.  Remind yourself that you've already overcome obstacles you didn't think you could, and new ones will not seem so insurmountable.

-----------------------------------
bugzpodder
Wed Feb 08, 2006 2:35 pm


-----------------------------------
Avoid premature optimization!

Knuth

-----------------------------------
wtd
Thu Feb 09, 2006 1:34 pm


-----------------------------------
The biggest part of programming is semantics.  Take for instance an issue from object-oriented programming.

Methods.  Why you should separate code into a separate method is vastly more important than understanding how to do it.

If you're learning, pick the language and tool combination that lets you experiment the fastest.

It's the why that makes our heads hurt.  It has us crying out in frustration.  Get past that and the how is child's play.

-----------------------------------
wtd
Fri Feb 10, 2006 1:37 pm


-----------------------------------
Don't be afraid of learning things "wrong" if you try to learn without the structure of a class and a teacher.

Is there the chance  you might get things wrong?  Yes.  But that chance exists when you have a teacher too.  So, why shouldn't you fear this?

Because you can put your knowledge to the test.  Especially in the world of programming.  If you fear you've screwed something up, try it and see if it works.

-----------------------------------
MihaiG
Mon Feb 13, 2006 9:49 pm


-----------------------------------
Hes like confucious.....but for prgramming :? 
 :notworthy:  :notworthy:

-----------------------------------
Martin
Mon Feb 13, 2006 10:29 pm


-----------------------------------
Nice, El Comandante :)

There is no fork
Well, there is, but you probably shouldn't be using it. Save the big guns for when you really need them. You can probably kill a fly with a machine gun, but a fly swatter is cheaper and you won't have to pay to replace your walls and furniture when you're done.

-----------------------------------
Martin
Wed Feb 15, 2006 7:53 pm


-----------------------------------
Google.

'Nuff said.

-----------------------------------
Cervantes
Fri Mar 17, 2006 9:07 pm


-----------------------------------

Converting a fanatic is not the same as opening a mind.


How true. And it hits upon what I feel is the main theme of this thread.

Have an open mind. Be open to new languages, new programming paradigms, new solutions to a problem. Closed minds can never advance; this prevents them from ever succeeding. Further, two closed minds with different views can never reach an agreement; this prevents anything from being achieved in a group project.

The world of programming is so large and changes so fast that there's always something to learn, even for the gurus. Learn, learn, learn. Learn new languages; learn new programming paradigms; learn new solutions to a problem. More options never hurt anybody, and often the "alternative" is better than the "preferred".

Be yourself, but at the same time heed the wisdom of others. Create your own opinion, but think critically about the advice you're given. Realize that the group following wtd learning languages like Ruby and O'Caml has thought critically about their decision, but do not blindly accept their thought as correct, for there is an opposing group elsewhere that learns only Java and C++.

-----------------------------------
chrispminis
Sun Mar 19, 2006 7:18 pm


-----------------------------------
You know, I REALLY think we could take this thread and some, and write up a genuinely useful book...

-----------------------------------
wtd
Sun Jun 25, 2006 11:10 am


-----------------------------------
Be yourself, but at the same time heed the wisdom of others. Create your own opinion, but think critically about the advice you're given. Realize that the group following wtd learning languages like Ruby and O'Caml has thought critically about their decision, but do not blindly accept their thought as correct, for there is an opposing group elsewhere that learns only Java and C++.

Pay special attention to the people who've learned Ruby and O'Caml and Java and C++.

-----------------------------------
wtd
Sun Jun 25, 2006 11:13 am


-----------------------------------
So you want to learn Java?

So why on earth would you consider understanding C important in this?  It's not garbage-collected, has no object orientation support, and lacks an oh-so-important sane string type.

Well, understanding C is a bonus because Java's creator's really liked C.  Someone who knows Java and understands C pointers will program in Java much more smoothly than someone who has only studied Java.

-----------------------------------
Slaivis
Wed Jun 28, 2006 10:32 pm


-----------------------------------
So you want to learn Java?

So why on earth would you consider understanding C important in this?  It's not garbage-collected, has no object orientation support, and lacks an oh-so-important sane string type.

Well, understanding C is a bonus because Java's creator's really liked C.  Someone who knows Java and understands C pointers will program in Java much more smoothly than someone who has only studied Java.

But will understanding Java help you program in C?

-----------------------------------
wtd
Wed Jun 28, 2006 11:21 pm


-----------------------------------
So you want to learn Java?

So why on earth would you consider understanding C important in this?  It's not garbage-collected, has no object orientation support, and lacks an oh-so-important sane string type.

Well, understanding C is a bonus because Java's creator's really liked C.  Someone who knows Java and understands C pointers will program in Java much more smoothly than someone who has only studied Java.

But will understanding Java help you program in C?

Somewhat with the syntax, perhaps, and it might motivate one to investigate things like using static linking to hide the actual composition of a struct.

-----------------------------------
wtd
Sun Jul 23, 2006 3:56 pm


-----------------------------------
If you don't understand the general concept of interfaces, then you don't understand OOP.

-----------------------------------
wtd
Sun Jul 23, 2006 4:01 pm


-----------------------------------
If you know Ruby, but have no idea what the "erb" program is for, then now is the time to learn.

-----------------------------------
Martin
Sun Jul 23, 2006 9:37 pm


-----------------------------------
Documentation is for suckers.

-----------------------------------
wtd
Sun Jul 23, 2006 10:14 pm


-----------------------------------
Perl is only unreadable gibberish if you don't know Perl.  But that holds true for any language.

-----------------------------------
rizzix
Wed Jul 26, 2006 9:53 am


-----------------------------------
Not haskell.. Yes most languages look like gibberish, but haskell didn't. Of course I didn't understand a thing back them.. but it read like english.. to some extent.

Same is true for AppeScript. Actually AppleScript is bit easier to infer even for a complete newbie.

-----------------------------------
Slaivis
Wed Jul 26, 2006 5:18 pm


-----------------------------------
Not haskell.. Yes most languages look like gibberish, but haskell didn't. Of course I didn't understand a thing back them.. but it read like english.. to some extent.

Same is true for AppeScript. Actually AppleScript is bit easier to infer even for a complete newbie.

Possibly for Turing aswell.

-----------------------------------
Clayton
Wed Jul 26, 2006 7:23 pm


-----------------------------------
true but readability is a very minor thing when learning a new language (at least to me), turing may be readable, but that readability doesnt make up for its major drawbacks (a decent OOP environment for example)

-----------------------------------
wtd
Wed Aug 09, 2006 7:48 pm


-----------------------------------
If you wish to do GUI programming, give Glade a long, thorough look.

-----------------------------------
wtd
Sat Aug 12, 2006 12:41 pm


-----------------------------------
Traditionally, we've thought about solving programming problems as a process of bringing our problem closer to the logic of a programming language.

But the smart money is on a different approach.  Instead of just solely doing this, build the language up to meet your problem.  Ever thought, "this would be so much easier if there were some easy way in the language to do X."  Well, then extend the language so it can do X.

-----------------------------------
wtd
Wed Sep 06, 2006 12:01 pm


-----------------------------------
Data structures like linkied lists are about boolean logic, not pointers.  As it happens, pointers are the only way of expressing such boolean logic with regards to types in some languages.

Pointers can express boolean logic by being either a valid pointer to something, or null.

More expressive type systems may be able to (and often do) express data structures without explicit pointers.

Do not be confused about this just because many college and university programs combine data structure classes and pointer education into a single curriculum.

-----------------------------------
wtd
Fri Nov 10, 2006 2:09 pm


-----------------------------------
If you really want a corporate programming job (they pay pretty well) then think about the little things you normally take for granted.  Think about them a lot.

Think about walking into a giant store like Wal-Mart.  You buy a box of pop-tarts.  

How do they know how many pop-tarts have sold?  Do they go through and count them by hand all the time?  

Of course they don't!  Sure, they might hand-count once in awhile if there's a big discrepancy, but that costs money, and they have a lot of stuff to count, and paying people to count stuff costs a lot of money.

No.  They have a database somewhere that keeps track of how many pop tarts are in every store.  When you check out, it does a:

pop_tarts--;

And when it gets low enough, they order more.  How do they know how many to order?

They've got somebody who keeps track and really understands how things sell, right?

Heck no!

People who understand stuff make a lot of money.  Money Wal-Mart would have to pay them.  Computers cost money too, but a lot less, minus an initial cost.

So the computer keeps track of how much stuff has sold, and how much is left, and it calculates how much more is needed.  But, it doesn't stop there.  It takes into account weather, and traffic issues, and events in the news.

For instance, rain happens to historically correspond to strong sales of strawberry pop-tarts.  So the computer checks the weather forecast.  It sees a high probability of rain.  It orders lots more strawberry pop-tarts than necessary.  A week later it checks to see if the last week has validated that decision.

The result: costs are lower, and the local Wal-Mart doesn't get swamped by excess pop-tarts, or customer complaints that they're out of strawberry pop-tarts.

But computers don't learn to do this by themselves... yet.

Computer programmers make this possible.  Whether you agree with Wal-Mart's ethics or not, it's pretty amazing what those programmers made possible.

-----------------------------------
wtd
Thu Dec 14, 2006 10:09 pm


-----------------------------------
Textbook knowledge is no substitute for practical experience.

Practical experience is no substitute for textbook knowledge.

-----------------------------------
Craige
Thu Dec 21, 2006 4:31 pm


-----------------------------------
These are all very insightful. Please, do go on.

-----------------------------------
wtd
Fri Dec 22, 2006 10:24 am


-----------------------------------
Ask questions frequently and early, and heed the advice given.  Do not fail to ask about something because you feel it's too trivial.

The real mistake is writing a lot of code, and then asking questions.  If you're going in the wrong direction, and you have a lot of code, you're going to have inertia working against you.  You won't want to go back and change that code.  You'll want to keep doing things the way you have been.

Buddhists will tell you this:

From attachment arises sorrow,
From attachment arises fear.
For one who is freed from attachment,
There is no sorrow -- whence fear?

-----------------------------------
wtd
Sun Dec 24, 2006 12:29 am


-----------------------------------
Solving problems with programming typically involves breaking down a problem until it can be expressed in terms of the programming language you've chosen.  But, this can suck, especially when the language in question is not very expressive.

Consider also building the language up to meet your problem halfway.  If you find yourself saying, "this would be so much easier if X did Y" quite frequently, and Y is reasonably simple or fundamental, then extend the language so that it does Y.

-----------------------------------
wtd
Thu Jan 11, 2007 3:47 am

Re: Programming Tip of the Day
-----------------------------------
Learning to be a programmer is a great experience.  It teaches you about abstract thinking, and problem-solving.  The multitude of programming languages and approaches to problem-solving can really open your mind.

That said, just because you're learning to be a programmer, doesn't mean you have to actually be one when you get a piece of fancy paper.

Be a well-rounded individual both intellectually and socially.  Programming can hone your mind, but once that has happened, you don't have to apply it back to programming.  You don't owe some inaminate lump of silicon and steel a damn thing.

-----------------------------------
wtd
Mon Jan 22, 2007 11:12 am

Re: Programming Tip of the Day
-----------------------------------
When learning to program, you don't need a program that will debug code.  You already have one.  It's your brain.

Follow the flow of control and the change of state in your mind.  It'll hurt.  It'll probably hurt a lot.

It'll also make you a better programmer.

-----------------------------------
wtd
Mon Jan 22, 2007 11:55 am

RE:Programming Tip of the Day
-----------------------------------
It's not that "Design Patterns" are necessarily bad...

It's just that if you use a language with powerful enough abstractions, the patterns just come so naturally that you end up taking them for granted.

-----------------------------------
jamonathin
Mon Jan 22, 2007 12:49 pm

Re: Programming Tip of the Day
-----------------------------------
"Be a well-rounded individual both intellectually and socially. Programming can hone your mind, but once that has happened, you don't have to apply it back to programming. You don't owe some inaminate lump of silicon and steel a damn thing."
 = my favorite quote.

-----------------------------------
ZeroPaladn
Wed Jan 24, 2007 10:55 am

Re: Programming Tip of the Day
-----------------------------------

"Be a well-rounded individual both intellectually and socially. Programming can hone your mind, but once that has happened, you don't have to apply it back to programming. You don't owe some inaminate lump of silicon and steel a damn thing."
 = my favorite quote.
Amen.

Oh, by the way, they're mostly made of aluminium now :D

-----------------------------------
wtd
Sun Mar 11, 2007 8:44 pm

Re: Programming Tip of the Day
-----------------------------------
Do not spend much time asking "is language X worth learning?"

Just restrict the set from which X is drawn to those languages which are relatively quick and easy to learn.

-----------------------------------
wtd
Sun Mar 25, 2007 8:43 am

Re: Programming Tip of the Day
-----------------------------------
If C and C++ are such a great way to introduce students to programming, then why are there so many lousy C and C++ programmers out there?

The point:  Do not believe hyperbole.  Believe your eyes.

-----------------------------------
abcdefghijklmnopqrstuvwxy
Sun Mar 25, 2007 5:30 pm

Re: Programming Tip of the Day
-----------------------------------

If C and C++ are such a great way to introduce students to programming, then why are there so many lousy C and C++ programmers out there? 


That's like someone without any sense saying to you "If basic training is the best way to start out in the military, why are there so many lousy solidiers out there?"  

Analysis: 
Basic training and the amount of soldiers who are lousy have no coorelation.  All soldiers learned basic training, the two are not relative but absolute.  
A real coorelation?  The quality of the individuals recruited and the amount of lousy soldiers in the army.  

Same goes for programming.  While say a scripting language is far easier to learn there are many learned individuals who would contend it is these languages that tend to create the "bad habits" as they descend to lower level programming.  The argument goes both ways, but it's only logical to assume understanding the fundamentals will help (actually help is an understatement) in understanding the simplifications used in higher level languages.

EDIT: someone's been deleting all my threads including my little genius-as-me quiz.  I'd just like to point out how rude that is and how much I don't even feel like posting at this forum anymore.

-----------------------------------
klopyrev
Sun Mar 25, 2007 5:50 pm

Re: Programming Tip of the Day
-----------------------------------
There are so many lousy C/C++ programmers just because there are so many C/C++ programmers.

-----------------------------------
Clayton
Sun Mar 25, 2007 6:37 pm

RE:Programming Tip of the Day
-----------------------------------
EDIT: someone's been deleting all my threads including my little genius-as-me quiz. I'd just like to point out how rude that is and how much I don't even feel like posting at this forum anymore.

No one has deleted your threads, they've just been locked. If you ever bothered to look at the Recent Discussions list, you'd see both of those threads there.

-----------------------------------
abcdefghijklmnopqrstuvwxy
Sun Mar 25, 2007 7:12 pm

RE:Programming Tip of the Day
-----------------------------------
Oh okay, thanks Freakman, that makes me feel slightly better although I'm surprised it would get locked for that.

-----------------------------------
Brightguy
Sun Mar 25, 2007 9:02 pm

Re: Programming Tip of the Day
-----------------------------------
'Lousy' is a pretty subjective term... and the best way of teaching such programmers even more subjective.  I would guess that the methodology is more important than the actual language used.  But ultimately it comes down to the individual's understanding and their willingness to learn.

On a side note, I think topics are locked too easily, there didn't seem to be a need for it...

-----------------------------------
md
Sun Mar 25, 2007 9:32 pm

RE:Programming Tip of the Day
-----------------------------------
Tip of the day: Stop discussing things in the Tip Of The Day thread.

-----------------------------------
Cervantes
Mon Mar 26, 2007 4:32 pm

RE:Programming Tip of the Day
-----------------------------------
md, discussion is the point of a forum. (So long as it's constructive.)

I think wtd's point is that there are a disproportionate amount of lousy C/C++ programmers out there. Whether that statistic is true or not will not be validated by me. However, think about it for yourselves.

-----------------------------------
Bobrobyn
Mon Mar 26, 2007 7:37 pm

Re: RE:Programming Tip of the Day
-----------------------------------
md, discussion is the point of a forum. (So long as it's constructive.)

I think wtd's point is that there are a disproportionate amount of lousy C/C++ programmers out there. Whether that statistic is true or not will not be validated by me. However, think about it for yourselves.

I think that part of what wtd might also mean is that people are learning C and C++ poorly instead of learning an easier to learn language well.  At the very least, I agree with this statement that I just made up :P

-----------------------------------
wtd
Mon Mar 26, 2007 10:05 pm

Re: RE:Programming Tip of the Day
-----------------------------------
md, discussion is the point of a forum. (So long as it's constructive.)

I think wtd's point is that there are a disproportionate amount of lousy C/C++ programmers out there. Whether that statistic is true or not will not be validated by me. However, think about it for yourselves.

I think that part of what wtd might also mean is that people are learning C and C++ poorly instead of learning an easier to learn language well.  At the very least, I agree with this statement that I just made up :P

This is more or less accurate.  The more general point relates to people believing that these are good languages to start with just because schools often do it this way, rather than looking at the results and coming to the conclusion that it doesn't work.

-----------------------------------
abcdefghijklmnopqrstuvwxy
Tue Mar 27, 2007 12:11 am

RE:Programming Tip of the Day
-----------------------------------
Are you right wtd?  You seem to always think you're right even in matters where there is no right...  You can produce good programmers by starting with C++ or any other language.  The language you start learning with is NOT the key factor in the success of the programmer.  Not by far.  To prove this take into account how many people began with C++ and any other language and became successful in computer science.  Who are you to suggest what's best for everyone, wtd?  Honestly I think it's time you admit your wrong the for the first time in your life. It's not so bad being wrong wtd...  But it's just plain faulty logic to compare the amount of people who start off with C++ and the amount of bad programmers there are.  The only conclusion you can draw is that most people start with C++, nothing more...

-----------------------------------
rdrake
Tue Mar 27, 2007 12:36 am

RE:Programming Tip of the Day
-----------------------------------
Even the vast pool of knowledge can be tainted.  Take everything you hear with a grain of salt.

-----------------------------------
wtd
Tue Mar 27, 2007 2:13 am

Re: RE:Programming Tip of the Day
-----------------------------------
Even the vast pool of knowledge can be tainted.  Take everything you hear with a grain of salt.

Essentially, the point I was trying to make, much more succinctly expressed.

-----------------------------------
Cervantes
Tue Mar 27, 2007 12:19 pm

Re: RE:Programming Tip of the Day
-----------------------------------
Are you right wtd?  You seem to always think you're right even in matters where there is no right...  You can produce good programmers by starting with C++ or any other language.  The language you start learning with is NOT the key factor in the success of the programmer.  Not by far.  To prove this take into account how many people began with C++ and any other language and became successful in computer science.  Who are you to suggest what's best for everyone, wtd?  Honestly I think it's time you admit your wrong the for the first time in your life. It's not so bad being wrong wtd...  But it's just plain faulty logic to compare the amount of people who start off with C++ and the amount of bad programmers there are.  The only conclusion you can draw is that most people start with C++, nothing more...

The fact of the matter is that neither of you have provided any facts on the issue. You both have your conceptions, but no facts to support it. Only your own personal experiences. This discussion is moot unless facts are presented.

And alphabet, you're acting awfully condescending. What's worse is that it's directed at wtd. If I had to pick one person on this forum who doesn't deserve that kind of attitude, it would be wtd.

-----------------------------------
wtd
Fri Apr 06, 2007 12:04 pm

Re: Programming Tip of the Day
-----------------------------------
Life is full of surprises, and we rarely end up where we think we will.  If you find your future ending up exactly as you envisioned, it means that one of two things has happened.  Either you've been incredibly dedicated to your goals, or you've missed an important opportunity.

Or both.

-----------------------------------
wtd
Wed May 30, 2007 1:54 pm

Re: Programming Tip of the Day
-----------------------------------
An API is a bunch of useful stuff more or less coherently organized such that it can be reused to add functionality to your program.

A framework is an API, but one crafted such that either deviating from its own style is disadvantageous, or adhering to its style is advantageous.  Both need not necessarily be simultaneously true.

-----------------------------------
rdrake
Sat Jun 02, 2007 12:47 pm

RE:Programming Tip of the Day
-----------------------------------
A variable with a meaningless name is far better than one with a meaningful, yet misleading name.

-----------------------------------
wtd
Sat Jun 02, 2007 12:50 pm

RE:Programming Tip of the Day
-----------------------------------
And yet, both are vastly inferior to just doing it right.  ;)

-----------------------------------
wtd
Thu Jun 21, 2007 7:11 pm

Re: Programming Tip of the Day
-----------------------------------
Do or do not.  There is no try.

If you firmly believe you have the best idea about how to do something, but others disagree, do not dilute your concept to try to "sell" it.  Either continue to push your concept unadulterated, or give up on it and go with the crowd.

-----------------------------------
Aziz
Mon Jul 16, 2007 1:08 pm


-----------------------------------
So you want to learn Java?

So why on earth would you consider understanding C important in this?  It's not garbage-collected, has no object orientation support, and lacks an oh-so-important sane string type.

Well, understanding C is a bonus because Java's creator's really liked C.  Someone who knows Java and understands C pointers will program in Java much more smoothly than someone who has only studied Java.

What about me, wtd? I've just recently studied C++, and as a matter of fact, I understand pointers because I understand Java and it's references.

-----------------------------------
wtd
Mon Jul 16, 2007 1:22 pm

RE:Programming Tip of the Day
-----------------------------------
Java doesn't have references, so though I respect you, I have to question your level of understanding.  :)

-----------------------------------
Aziz
Mon Jul 16, 2007 2:39 pm

RE:Programming Tip of the Day
-----------------------------------
Then what do you call it? Handles?

Object "references" (as I call them from this point on, for the purpose of this post), this is how I understand them to be (and I am most confident in this believe, from reading, experience and understanding, though I've been known to be wrong a few (