|
4a. You always need to make it faster.
|
|
|
|
|
Case 1, input good, output good - answer faster,
Case 2, input bad, error message, but delayed ( is it clear )
Case 3, input bad, program sticks it's tongue out and dies
Case 4, input bad, quiet wrong result
so, who has to deal with 3, and can 4 happen? ( with malicious input ?)
( They ARE out to get you. )
|
|
|
|
|
Until I realized in the process of trying to explain them that they probably are. Just because I find something intuitive doesn't mean I can make it intuitive to others.
The secret with pointers is to enjoy the freedom they bring you rather than fearing the danger they present. Aside from that, the rest is details.
Real programmers use butterflies
|
|
|
|
|
My confusion with pointers started very early this morning, since I read the subject as, 'printers aren't confusing.'
Time for coffee...
|
|
|
|
|
Au contraire printers are very confusing.
|
|
|
|
|
If you ever PCL, then you know...blech!
|
|
|
|
|
Kris Lantz wrote: Time for coffee... Why did you do that? The only thing you should do before drinking coffee is making coffee. Any other action is futile, except you won't be assimilated.
|
|
|
|
|
On the weekends, coffee enjoyment is top of the list. The weekdays are a bit more chaotic, and coffee may not be had until about a half hour after getting to work.
|
|
|
|
|
Kris Lantz wrote: The weekdays are a bit more chaotic, and coffee may not be had until about a half hour after getting to work Make coffee at home and bring a travel mug?
All jokes aside, sipping my coffee while reading morning emails helps me settle my mind and prepare for the work day. For me there is a settling effect in sipping coffee, even during an ugly commute. I normally work early hours, so the commute isn't as ugly in the AM as the PM, and the folks in the office at my arrival time are doing the same as me, so there is not usually immediate chaos. [Anyone who arrives to immediate chaos appreciates this.]
However -- these days, going to work consists of getting up, starting a pot of coffee, and then logging in. My commute is 35 steps instead of 34 miles.
I really appreciate WFH!!!
|
|
|
|
|
Even better -- visit your favorite coffee shop.
|
|
|
|
|
Funny you should mention printers. Getting a printer fixed at a large corporation takes an army of people and a week of emails. Perhaps there is a Dilbert comic strip about it.
~d~
|
|
|
|
|
I tried to explain them to an IBM systems programmer but for some reason he would not accept the concept. Even though all the code he worked with (assembler) made use of base registers. His main beef was "C is a high level language so it shouldn't need them".
|
|
|
|
|
Except C is a "mid-level" language, and nobody considers it a high level language who has actually used "high-level" languages. It's funny when people form strong opinions around their misconceptions. Human beings in general are ridiculous creatures.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: Human beings in general are ridiculous creatures.
Yeah, just look at a few naked ones.
|
|
|
|
|
And, as any hungry lion or tiger can tell you:
"They're slow. No claws. No fangs. And you don't even get much hair stuck in your teeth."
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
This site already has quite a few articles about pointers. I haven't read any of them, but some have been favorably received. Maybe looking at some of them would give you ideas as to what more you could say.
|
|
|
|
|
Do they allow fiction writing on CP?
I'm not sure how many cookies it makes to be happy, but so far it's not 27.
JaxCoder.com
|
|
|
|
|
What's so confusing about them? They point to a memory location. Think of an address as an index into a big array of bytes. No big. =)
Real programmers use butterflies
|
|
|
|
|
In a way, back to what you noted in your original post:
How different people just see and understand things differently.
Way back in elementary school (do they still have that?) I was exceptionally good in math, and by second grade, reading. Science was a joy. Handwriting, to this day, childlike. Also, despite being able to express myself bother verbally and in written prose with some eloquence (when the mood shines), when being taught grammar (as in parts-of-speech), the more they taught the less I knew. Associating names and faces, and pure memorization in general is a horror for me - but I know where things were in (for example) a 60,000 line application I wrote some many years ago.
I had no trouble with C pointers because I learned assembly, first. I've heard that normally it can be quite a thing to grasp for learning C for those who haven't been elsewhere introduced.
The point (ah yes, yet another pun) is that we all get dealt a hand and play those cards as best we can - at least for some of us.
So - and this works out well for us as we're a herd-species - we all have different expertise and shortcomings that, when melded within the group, form a gestalt.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
...and that, right there, is pretty much all you need to know.
For some reason I was overthinking the whole thing when I started learning about them. And it's only like 2 years into college that I finally wrapped my head around the whole, basic, fundamental idea. Never had a problem with them since.
That being said, I haven't done anything pointer-related in over a decade...
|
|
|
|
|
I think that's a common trap. It doesn't help that misusing them causes faults because I think that makes them intimidating but all a fault is is an unhandled exception. Fear is a huge stumbling block to growth.
It doesn't help that I've seen lots of articles (not necessarily here) rag on pointers and state that they're scary in so many words, probably from authors that never got comfortable with them themselves.
A lot of times it's no different than accessing an array.
Real programmers use butterflies
|
|
|
|
|
probably from authors that never got comfortable with them themselves.
or maybe got paid to support some language that is safe (secure).
security or the opposite of it, fear, sells a lot in modern times.
i don't know what is it these days, but everyone is trying to jump on you with a zealot yelling that you are doing something wrong. that you're incompetent. loser. that they are going to open your eyes with this new way, new programming language, new framework...
ok, i get that. these are lamer times. instead of friendship there is mostly ridicule, which makes everybody look bad in the eye of the beholder.
although new or old things have interesting ideas, nothing is black and white.
"if somebody is selling you a technique in convincing you that there is something that you should do, they're focusing on the benefits and they are either gonna be downplaying the drawbacks or they'll be ignoring them completely" - Jonathan Blow on Software Quality at the CSUA GM2
|
|
|
|
|
Pointers are powerful and easy to use can lead to disaster when not used correctly, as can be seen when trying to debug a pointer problem.
I'm not sure how many cookies it makes to be happy, but so far it's not 27.
JaxCoder.com
|
|
|
|
|
Yeah. There is that. It's easier to use them correctly though if you understand them intuitively.
These days most of my pointer problems are caused by things i forget to initialize.
Real programmers use butterflies
|
|
|
|
|
Quote: Pointers are powerful and easy to use can lead to disaster when not used correctly, as can be seen when trying to debug a pointer problem.
Anyone trying to debug pointer problems without using valgrind is probably a masochist.
|
|
|
|