|
|
|
|
|
by nl
5473 days ago
|
|
But I don't agree that pointers are evil, and should be avoided. No one is saying that at all. Pointers aren't evil, but they are dangerous. Perhaps a better analogy is a sharp chef's knife. In the right hands it's an effective and efficient tool that lets you do things quicker and just as safely as any other tool. In the wrong hands it is dangerous to the person using it and to those around them. There are numerous other examples: welding torches, motorbikes, explosives etc etc. |
|
So, for the avoidance of doubt, I believe: pointers are awesome, powerful tools and you can do some great things in C/C++ using them and I sometimes miss them (a little bit) when using other languages. But you can also do some terrible things with them - and I have done some spectacularly bad things with them in the past. But that doesn't mean they are bad - it just means that I am reckless.