Author Topic: Learning  (Read 11818 times)

0 Members and 1 Guest are viewing this topic.

Offline Windowlicker

  • Newbie
  • *
  • Posts: 11
  • I'm new here!
    • View Profile
Re: Learning
« Reply #30 on: September 27, 2005, 05:19:30 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.

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Learning
« Reply #31 on: September 29, 2005, 06:57:57 pm »
There 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.