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

Username:   Password: 
 RegisterRegister   
 C is scary....
Index -> Programming, C -> C Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mirhagk




PostPosted: Wed Oct 03, 2012 5:01 pm   Post subject: RE:C is scary....

Yes reflection is a dangerous tool, and anon functions could cause some wierd things in the hands of a stupid person. But at least you don't have the potential to overwrite memory used by something else, or worse your code.

If you have a problem with reflection, it's a library that you can easily do a CTRL+SHIFT+F to find all the occurrences where you use it, and make sure you're using it right. I also don't think reflection should be used except when it really is genuinely useful, or if you're making a compiler. I can only think of 1 scenario in my 4 years of C# code where reflection was remotely a good idea, and that was because of integration with SQL, if the other code was in C# as well it'd be easily avoided. Anon functions will usually mess things up locally, and leave a relatively fine stack trace.

Incorrect memory references can be created numerous ways, and the problems they create can pop-up in totally separate locations, with a totally different stack trace. You could be looking in the wrong place, or worse, not know where to look at all because it's impossible to reproduce the bug exactly.

And again 2goto1 just because there are others issues doesn't matter you can't try to solve one issue. It's mathematically impossible for compilers to completely check your code for everything (even with infinite time and space) but that doesn't mean you shouldn't check your code for anything with the compiler.
Sponsor
Sponsor
Sponsor
sponsor
btiffin




PostPosted: Sat Oct 06, 2012 9:20 am   Post subject: Re: RE:C is scary....

2goto1 @ Wed Oct 03, 2012 3:52 pm wrote:
... idiots can do stupid things with just about anything.


I use COBOL to fill that need, http://opencobol.add1tocobol.com/

Wink

Cheers
mirhagk




PostPosted: Sat Oct 06, 2012 7:54 pm   Post subject: RE:C is scary....

What do you mean by you use COBOL to fill that need?
bl0ckeduser




PostPosted: Sun Oct 07, 2012 9:48 am   Post subject: Re: C is scary....

This quote seems to give some insight on why C can be scary:

Quote:

The philosophy of BCPL can be summarised by quoting from the book BCPL, the language and its compiler:
Quote:

The philosophy of BCPL is not one of the tyrant who thinks he knows best and lays down the law on what is and what is not allowed; rather, BCPL acts more as a servant offering his services to the best of his ability without complaint, even when confronted with apparent nonsense. The programmer is always assumed to know what he is doing and is not hemmed in by petty restrictions.

The design, and philosophy, of BCPL strongly influenced B, which in turn influenced C.

(Source: http://en.wikipedia.org/wiki/BCPL)
mirhagk




PostPosted: Sun Oct 07, 2012 12:46 pm   Post subject: RE:C is scary....

Exactly. I don't think we're ever gonna cure this industry of idiots, and I think the next best thing is to take away the power those idiots have. Those with true understanding can wield the power, for low level systems, compilers, drivers etc, but for the typical application, where morons abound, I think C may not be the best choice.

One nice thing about a higher level language developed using a VM style memory managed system, is that things the developers don't think of are automatically included. I hate in video games when the game crashes without so much as an error message. Ideally logs should be used, but failing that a generic error message is helpful. I understand some companies don't want clients seeing the stack trace, but that is amazingly useful for figuring out what is causing the game to crash (is it only when I open empty chests? Or when I go through this door, etc..). This is something many developers forget to do, and I understand not having a stack trace, but at least a semi-non-generic message would be amazing. ("The game failed while doing this. This has been logged, you can send the log to [email] for help"). Higher level languages do this kinda stuff by default so the code lazy/dumb programmers doesn't cause the rest of us pain.
btiffin




PostPosted: Sun Oct 07, 2012 12:58 pm   Post subject: Re: RE:C is scary....

mirhagk @ Sat Oct 06, 2012 7:54 pm wrote:
What do you mean by you use COBOL to fill that need?


COBOL is where I get to play idiot (yeah, play, it's all pretend) and do stupid things. I urge everyone to find a place to try stupid things, and try them.

Cheers
mirhagk




PostPosted: Sun Oct 07, 2012 2:14 pm   Post subject: RE:C is scary....

Oh lol, I get what you mean. I do like to play around with things (my recent favourite is .NET assembly, protect myself from doing things I don't understand all that well, while also being satisfyingly low level.
Display posts from previous:   
   Index -> Programming, C -> C Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 22 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: