Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C is like the marketing slogan to Othello (reversi):

    A minute to learn, a lifetime to master.
The language is fairly simple in terms of features and aspects you have to learn to use it, but concepts like pointers and direct memory management are difficult to master. Programming in C is like building a building out of bricks; bricks are relatively simple objects, building a building out of them is not a simple task.


Agree with both parents. "Simple" to me means that the code does exactly what I ask: no more, no less. For better or for worse. No behind-the-scenes magic (garbage collection, etc). I know exactly how much memory I am using, where it's allocated, and how it's passed around. Again, for better or for worse. With great power comes great responsibility!


Do you also know all the undefined and unspecified use cases of the standard?

http://de.slideshare.net/olvemaudal/deep-c


>No behind-the-scenes magic

I assume you never compile with optimisations turned on then?


Has very little to do with the language, apart from what undefined and platform dependent behavior allow the compiler to trick around. Of course, if the compiler goes nuts or is buggy, anything can happen "behind the scenes", but as far as I'm aware, this has nothing to do with the language as specified in the standard.


The problem is when what you ask for is incompatible with how it's done. Hence me today observing a price field in a record containing $9.500000000000000000002, knowing that making the obvious problem there "easy" will result in painful data manipulations elsewhere, and remembering that under certain conditions a Boolean can be neither true nor false. Asking a binary computer to handle non binary data just plain gets weird sometimes.


I think that pointers are hard is self fulfilling prophecy. We studied them in the 9th grade. Because nobody bothered to tell us they were hard almost my whole class - around 80% after the first two lessons groked pointers and linked lists.

Same was with pointer arithmetic and function pointers.

Right now I am struggling mightily with monads mostly because the voice in my head tells me the thing all of the internet is singing - they are hard don't bother.


Pointers are easy when everything is working right.

It's when there are bugs in code which uses pointers that the weird can kick in and really give you a headache.


Monads are easy. Do bother.

=D. Just need to be the discord to the Internet's harmony.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: