C sucks (RANT ALERT)

For everything that's not in any way related to PureBasic. General chat etc...
BasicGuy
User
User
Posts: 70
Joined: Sat Apr 26, 2003 4:37 am
Location: US

Post by BasicGuy »

C rocks! If it weren't for C, a whole lot of programming that we take for granted wouldn't even exist...

Pointers: http://cslibrary.stanford.edu/106/
I have trouble thinking in C, but little organizing my thoughts in BASIC.
So did many others. Which was one of the primary reasons BASIC was created... :wink:
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

BasicGuy wrote: Pointers: http://cslibrary.stanford.edu/106/
It says it covers pointers "as they work in C and Pascal". As if they work the same in those languages. Pascal's pointers are much better than C's pointers.
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

Post by SoulReaper »

[SOLVED] :lol:

I have programmed machine code in the early days which is important, Because theres no getting away from it then along came C, C++, forth and lisp, Pascal and interpreted basic then came Compiled Basics...

I believe that Pure Basic will be the language of the future...
Sure it needs some work, but its getting there and it can do inline assembly code - I dont think there is any limit to what Pure Basic Can DOOO! :) :wink:

waiting quietly for PB v999.999 :twisted: :lol:

C Sucks...

[SOLVED]
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

r_hyde wrote: However, I will say that I prefer the ease of dereferencing using a single operator rather than PB's Peek/Poke functions. There has to be a way to make pointer usage both consistent and simple/wrist-friendly!
Well, one *could* use pointers, but that might be a bit cumbersome now and again (typing typing etc.)

GfaBasic had an interesting approach, instead of the classic Peek / Poke you could do something like:

Word( <memaddress> ) = <value>

I liked that format. Made things readable, but it's definitely not standard PB, I guess :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
r_hyde
Enthusiast
Enthusiast
Posts: 155
Joined: Wed Jul 05, 2006 12:40 am

Post by r_hyde »

Trond wrote:But you don't need Peek/Poke. Just use a variable called *Pointer.LONG. *Pointer is the pointer and *Pointer\l is the value.
Wow, how'd I ever miss that? That'll sure come in handy!
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

r_hyde wrote:
Trond wrote:But you don't need Peek/Poke. Just use a variable called *Pointer.LONG. *Pointer is the pointer and *Pointer\l is the value.
Wow, how'd I ever miss that? That'll sure come in handy!
And a damn site quicker than Peek and Poke ! :wink:
I may look like a mule, but I'm not a complete ass.
r_hyde
Enthusiast
Enthusiast
Posts: 155
Joined: Wed Jul 05, 2006 12:40 am

Post by r_hyde »

And a damn site quicker than Peek and Poke !
By quicker, did you mean quicker to type or faster to execute? Because a simple test shows them to be about equal in terms of run-time.
BasicGuy
User
User
Posts: 70
Joined: Sat Apr 26, 2003 4:37 am
Location: US

Post by BasicGuy »

Pascal's pointers are much better than C's pointers.
Uh, ok.. :?:
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

r_hyde wrote:
And a damn site quicker than Peek and Poke !
By quicker, did you mean quicker to type or faster to execute? Because a simple test shows them to be about equal in terms of run-time.
To execute.

Actually, that was a bit of an 'off the cuff' remark there by myself! :) I seem to recall Fred saying that dreferencing a pointer was quicker than using Peek and Poke etc.
I may look like a mule, but I'm not a complete ass.
Vin
User
User
Posts: 22
Joined: Thu Oct 04, 2007 8:35 pm
Location: USA

Post by Vin »

C and C++ are still the languages of choice for system's applications (inc. OS development) and embedded systems.
Irene
Enthusiast
Enthusiast
Posts: 461
Joined: Thu Oct 04, 2007 12:41 pm

Post by Irene »

Vin wrote:C and C++ are still the languages of choice for system's applications (inc. OS development) and embedded systems.
Not only that but you can also code in C for any platform you like if GCC or something similar has been ported to it (GameCube's PowerPC Gekko CPU being a good example) ^o^
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Vin wrote:C and C++ are still the languages of choice for system's applications (inc. OS development) and embedded systems.
I wouldn't call it the language of "choice" because there's really no other choices if you want to do those things... :)
Vin
User
User
Posts: 22
Joined: Thu Oct 04, 2007 8:35 pm
Location: USA

Post by Vin »

[quote="Trond]I wouldn't call it the language of "choice" because there's really no other choices if you want to do those things... :)[/quote]
Exactly! (With the exception of Assembly) I wish there were other choices. C++ can be unnecessarily complex.

I was just listening Scott Meyers (http://www.aristeia.com/publications_frames.html) who is one of the world's foremost experts on C++. It is pretty much the only language he works with and even he states that's it's unnecessarily complex. BTW, I highly recommend his books for whoever is trying to learn it.
Irene
Enthusiast
Enthusiast
Posts: 461
Joined: Thu Oct 04, 2007 12:41 pm

Post by Irene »

Trond wrote:
Vin wrote:C and C++ are still the languages of choice for system's applications (inc. OS development) and embedded systems.
I wouldn't call it the language of "choice" because there's really no other choices if you want to do those things... :)
Sure there are. Me and some friends (mostly guys if you're curious ^o^) ported GNU Fortran to the Nintendo GameCube way back in 2002 or so.. It wasn't pretty usable but we did get a fully functional SD card manager done to be used in conjuction with an SD Gecko. O_O

PS: Do I sound too geeky here? I hope not ^_^
Vin
User
User
Posts: 22
Joined: Thu Oct 04, 2007 8:35 pm
Location: USA

Post by Vin »

That sounds pretty cool, Irene, but...

Consider these things when labeling a language a systems development language: Can you create a bootable OS with it alone? Can you use it for Emedded Systems? Does it produce fast, small compact code that require minimal RAM and CPU usage? I'm not saying poorly written C++ can't take up all the RAM and CPU usage available but I am talking about ability. For example, C\C++ would be used for developing embedded systems (like a car computer or a cell phone) where RAM and CPU speed is highly limited. I wouldn't label Fortran as being able to fulfill all those needs. This doesn't mean a language can't be used for directly accessing hardware. PureBasic can do this.
Post Reply