News:

Wieners, Brats, Franks, we've got 'em all.

Main Menu

Learning

Started by mfqr, September 22, 2005, 05:01:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Windowlicker

Quote from: Newby on September 26, 2005, 06:00:17 PM
Quote from: Mangix on September 26, 2005, 05:54:45 PM
If you want my advice on learning C, make sure to code perfectly. sometimes really sloppy and ugly code can result in memory leaks(mainly with pointers)

Sorry. Hate to break it to you, but if everything was coded "perfectly", we would have no use for patching software.

And by the way, "sloppy and ugly code" that results in "memory leaks" has nearly nothing to do with pointers. (Unless you push the wrong address space in the pointer integer, and point to something wrong, but that isn't a leak. That's more of an overflow than it is a leak.)

Do you know what a memory leak is? Apparently, seeing as how you associated it with pointers, I'd say no.

EDIT -- Did you know THAT good looking code can have memory leaks still?


Indeed. Most of my code never leaks memory, well according to Valgrind at least, but I'd be amazed if it ever passed a checkstyle. What might seem like ugly code to one programmer, could be perfectly acceptable to another. The international obfuscated C code contest comes to mind; I'd argue that the "ugly" source codes in those entries are pieces of art.

rabbit

Quote from: iago on September 25, 2005, 01:36:00 PM
Quote from: rabbit on September 25, 2005, 09:52:03 AM
Quote from: Joe[e2] on September 22, 2005, 11:37:33 PMThere can't possibly be anything broken with it.
There's plenty wrong with it, but good enough programmers can get around the problems.
What, in C, would you consider "broken"? Or are you just arguing to be an asshole?
namespaces, mostly.