Welcome, Guest. Please login or register.

Author Topic: I don't think I can learn C....  (Read 10533 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #14 from previous page: April 03, 2003, 10:36:52 AM »
Hi Crumpy,

Well, a quick summary. We went through the 'how big does the standard library bloat it out'

So we checked only the object size (not the exe). Unsurprisingly for my Win32 char mode exe attempt the stdio stuff was 20 times bigger than the actual code.

Different folks, different mileage...

Piru gave us an example of super minimalist startup code for AmigaOS and got it down to 1K :-)

I rambled about how I thought the thing worked...

You return and the thread is twice as long :-D
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #15 on: April 03, 2003, 11:47:09 AM »
Quote

whabang wrote:
AARGH! By all gods and somewhat  important deities! :-o :-o  :-o

I was planning to learn C or C++, but this is too much!
/me runs back home to give a big hug to FreePascal :-D


Fear not, for 'tis merely an exmple of confusication - with a capital C :-)

No real program would look like this. Unless part of the Win32 kernel :-D
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #16 on: April 03, 2003, 11:55:04 AM »
Have no fear matey,

C (and C++) is actually one of the most logically laid out languages there is. It's stuctured, terse and flexible. It has very few keywords, all the basic operators you could ever need and everything else is done using functions.

Before anybody starts - the above is true, once you get use to it :-)

I'm gonna be unemployed real soon so that long awaited tutorial site I was considering (see here) may see the light of day :-D
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #17 on: April 03, 2003, 01:49:17 PM »
Quote

Crumpster wrote:
How come your losing your job? (I take it you work in Software Development??)


Too much time on amiga.org :-D. Nah, sigh of the times :-(
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #18 on: April 03, 2003, 04:13:29 PM »
Wow, that's pretty titchy!

I guess the 020 code benefits from some addressing optimisations...
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #19 on: April 04, 2003, 10:10:32 AM »
It's a sequencing operator - not many C programmers even realise this, using it only to seperate declarations of variables etc.

For example

x = (f(), g());

AFAIR, the value of x is whatever g() returns, but f() is always called before g().

This seems pointless when you could write

f();
x = g();

but it does have it's uses :-)
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #20 on: April 04, 2003, 11:27:08 AM »
Hey dude, I got my hair cut 2 years ago. My avatar image just old, that's all :-D

Actually, for C code, the comma operator is often useful in function-like macros that are supposed to 'return' a result and need to do several operations without ending the statement (ie with a semicolon).

A lot less useful in C++ where you just have an inline function.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #21 on: April 04, 2003, 11:46:34 AM »
Reet canny :lol:

I'm homesick :cry:
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #22 on: April 04, 2003, 12:07:25 PM »
I had to cut me locks, man I wasn't getting hired!

Actually went to the other extreme for a bit ;-)

C++ is very cool and funky as long as yoi just don't dive in at the deep end with it - people look at the template driven STL stuff thats out there and go into cerebal meltdown.

Even without the OOP, there are many nice features you can use that aren't available in C (though the 1999 ISO standard does drag it up to date a bit).

Once you get into OOP though, you'll wonder how you did without it.

IMHO :-)
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #23 on: April 04, 2003, 12:15:24 PM »
:lol:

This guy here at work (Venkman) used to work in a music shop of some sort - this geordie came in asking for speakers.
Check his signature - you'll see ;-)
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: I don't think I can learn C....
« Reply #24 on: April 04, 2003, 03:03:03 PM »
He sure was...

But we know him better as P. H. Pete :-)
int p; // A