I was going to write an article about how pointers aren't confusing
-
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. :doh: 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
I guess your article should point that out ;p
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
But they're so cute and cuddly. Especially my precious little void*. Who's a good little typeless pointer? YOU ARE!
Real programmers use butterflies
-
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
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.
-
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.
Had never heard of Valgrind.
I'm not sure how many cookies it makes to be happy, but so far it's not 27. JaxCoder.com
-
My confusion with pointers started very early this morning, since I read the subject as, 'printers aren't confusing.' Time for coffee...
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. :laugh:
-
They're not confusing at all. ( I removed the link ) use the wikipedia instead : [Pointer (dog breed) - Wikipedia](https://en.wikipedia.org/wiki/Pointer\_(dog\_breed))
I'd rather be phishing!
I thought about that pointer, yesterday, but thought it would destroy the tattered remains of my reputation. Perhaps that is why you can use a pointer to fetch data.
"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
-
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. :laugh:
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. :^)
-
weird, it passed out over zealous web nanny on my office computer. I removed the link and put the wikipedia link instead. :thumbsup:
I'd rather be phishing!
I suppose it was a google ad or similar... they don't necessarily have to be the same for you as for me or when you took the link as to when I visited the site.
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
-
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. :doh: 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
I remember learning pointers being a real "light bulb" type of learning experience for me. I felt like I was banging my head against a wall trying to figure them out, then with a single revelation, they suddenly made complete sense to me. I've never been able to figure out what caused that revelation.
-
I remember learning pointers being a real "light bulb" type of learning experience for me. I felt like I was banging my head against a wall trying to figure them out, then with a single revelation, they suddenly made complete sense to me. I've never been able to figure out what caused that revelation.
I've had several of those epiphanies in development over the years. Like when I finally understood COM on its terms (a binary vtbl based contract) I really enjoy them. I can't remember if pointers was one because it was so long ago.
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...
-
I've had several of those epiphanies in development over the years. Like when I finally understood COM on its terms (a binary vtbl based contract) I really enjoy them. I can't remember if pointers was one because it was so long ago.
Real programmers use butterflies
I know what you mean, but my "pointer epiphany" was memorable enough to still be clear to me more than 30 years later... now if I could just remember where I put my glasses.
-
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. :laugh:
Even better -- visit your favorite coffee shop. :-)
-
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!!!
-
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. :doh: 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
the C abstract machine there is no problem with pointers if you look straight at them. the problem is when somebody tries to wrap them in some obscured "politically correct" story that doesn't hurt a chipmunk if you step on it. i know this line is confusing, but Pascal was my first programing language and when the time came to grow up and use pointers normally i reached for a Pascal programming book... well, that book in it's chapter of pointers had everything else, about lists, about binary trees... but i could not tell what pointers are. i mean, the person who wrote that book constantly repeated how pointers are really useful although you should avoid to use them as much as possible... he doesn't know about pointers. then i read a chapter about pointers from a C tutorial and everything became crystal clear. there was i happy and using pointers in Pascal. the same thing was with win32 programming. you can not learn it from a Delphi book, you need a C book for that. but you can sure as hell do that in Pascal as good (or better) as in C if you learn the right way. pointers are a fundamental thing. the 8086 processor has a few general purpose registers and about the same number of Index registers. out of this bunch SI and DI are your pointers. and i bet you will understand pointers even better if you learn assembly than C, but C is good enough.
-
the C abstract machine there is no problem with pointers if you look straight at them. the problem is when somebody tries to wrap them in some obscured "politically correct" story that doesn't hurt a chipmunk if you step on it. i know this line is confusing, but Pascal was my first programing language and when the time came to grow up and use pointers normally i reached for a Pascal programming book... well, that book in it's chapter of pointers had everything else, about lists, about binary trees... but i could not tell what pointers are. i mean, the person who wrote that book constantly repeated how pointers are really useful although you should avoid to use them as much as possible... he doesn't know about pointers. then i read a chapter about pointers from a C tutorial and everything became crystal clear. there was i happy and using pointers in Pascal. the same thing was with win32 programming. you can not learn it from a Delphi book, you need a C book for that. but you can sure as hell do that in Pascal as good (or better) as in C if you learn the right way. pointers are a fundamental thing. the 8086 processor has a few general purpose registers and about the same number of Index registers. out of this bunch SI and DI are your pointers. and i bet you will understand pointers even better if you learn assembly than C, but C is good enough.
I first used pointers in asm, because it was the first thing other than basic i could really write code in for the 6502. I learned C later. I'm fine with them. it seems many other people aren't, hence the idea for the article. :)
Real programmers use butterflies
-
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
-
I first used pointers in asm, because it was the first thing other than basic i could really write code in for the 6502. I learned C later. I'm fine with them. it seems many other people aren't, hence the idea for the article. :)
Real programmers use butterflies
yeah, i was on the 6502 too. the most close to pointers out of the top of my head was this addressing mode like: lda ($fb),y or lda ($fb,x) hell, i don't even remember was there a comma or a dot in front of the index register. much less how these two modes were called.
-
I first used pointers in asm, because it was the first thing other than basic i could really write code in for the 6502. I learned C later. I'm fine with them. it seems many other people aren't, hence the idea for the article. :)
Real programmers use butterflies
> it seems many other people aren't, hence the idea for the article. than it's just a matter of time. just do it!
-
yeah, i was on the 6502 too. the most close to pointers out of the top of my head was this addressing mode like: lda ($fb),y or lda ($fb,x) hell, i don't even remember was there a comma or a dot in front of the index register. much less how these two modes were called.
YAY the bad old days!
Real programmers use butterflies