Author Topic: [C] Pointers - what is the point?  (Read 25730 times)

0 Members and 2 Guests are viewing this topic.

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23018
  • Country: gb
Re: [C] Pointers - what is the point?
« Reply #200 on: July 22, 2018, 11:02:18 pm »
I dip out of this thread and come back and find Perl mentioned. No. Just no.

Back in 2004 I got a 3 month contract to port an application to .net from “unknown”. Unknown happened to be Perl + cgi + DBI + MySQL on a RH7 box they lost the password for. Everything running as root of course. The original maintainer was killed in a motorcycle accident, probably because his motorcycle was bodged up like the rest of his life. One of those places where you know they were relieved he was dead because they didn’t have to fire him for being a dick.

I took one look at the vomit which was write only and proceeded to rewrite the damn thing from the schema and the screenshots only.

Even the worst C doesn’t get anywhere near middle of the road Perl.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3143
  • Country: ca
Re: [C] Pointers - what is the point?
« Reply #201 on: July 22, 2018, 11:09:27 pm »
Quote
Quote
Any architecture that has different sized pointers for different types is a bad architecture.
Is this referring to "near" pointers and "far" pointers?
And "bank switched" (in multiple forms.)  Especially with Harvard architectures.
Many an 8-bit CPU will have different sized pointers for data and for code (64k RAM address space, 256k Flash program address space.)I think avr-gcc currently has 16, 24, and 32bit "pointers" in use :-(

Microchip's XC8 compiler, for every pointer, analyzes its uses,  and then assigns the size. So, each individual pointer has its own size.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4028
  • Country: nz
Re: [C] Pointers - what is the point?
« Reply #202 on: July 22, 2018, 11:25:54 pm »
The reason software and device firmwares are so crap today, is a direct consequence of programmers having the same attitude as brucehoult here.  I just can't help but fight against that kind of crap.  It seems to be my hobby, I guess.  :horse:

Dude, chill. Code presented in a thread like this is sketches, not finished paintings. I make errors, you make errors, what's the problem? The discussion is about style.
 

Offline bsfeechannel

  • Super Contributor
  • ***
  • Posts: 1667
  • Country: 00
Re: [C] Pointers - what is the point?
« Reply #203 on: July 22, 2018, 11:40:29 pm »
Are you two playing got you!
No.  I just absolutely hate programmers with a lot of experience, who give out bad advice, leading new programmers to directions that yields just more crap software into the world.  It seems that that type of people have one universal factor: they will never ever admit an error.  They also seem to think "correctness" is something someone else can work out afterwards; their work is to get the "product" out there as soon as possible.

The reason software and device firmwares are so crap today, is a direct consequence of programmers having the same attitude as brucehoult here.  I just can't help but fight against that kind of crap.  It seems to be my hobby, I guess.  :horse:

The problem with this approach is that you turn a simple Q&A thread into a debate. Debates are fine. I like debates. But they're incompatible with Q&A. In the future, if other people come with the same kind of doubt, we won't be able to recommend this thread because the meaningful answers will be so buried in parallel discussions that it will be discouraging to read.

My suggestion is that on spotting those "programmers with a lot of experience" (by the way someone with a lot of experience is someone that made a lot of mistakes) giving "bad advice" to "new programmers" one counterargument be given maximum. If that is not enough let's create a new thread, invite everyone and debate that idea there.
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3634
  • Country: us
  • If you want more money, be more valuable.
Re: [C] Pointers - what is the point?
« Reply #204 on: July 23, 2018, 04:58:23 am »
Enjoying this thread....joining.
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: [C] Pointers - what is the point?
« Reply #205 on: July 29, 2018, 06:04:55 pm »
Saw this amusing image today and was reminded of this thread...

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf