POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Days 1-5 Server Time
29 Jul 2024 20:23:33 EDT (-0400)
  Re: Days 1-5  
From: Darren New
Date: 20 Apr 2012 23:39:43
Message: <4f922bff$1@news.povray.org>
On 4/20/2012 1:28, Invisible wrote:
> So what /was/ the Motorola 68000 designed to be programmed in then?

I would guess C or Algol or some such. There's a separation between address 
and data registers, there's a stack pointer, there are various addressing 
modes that (IIRC) include auto-increment, etc.

The 8086 was designed to be efficient for Pascal, for example. But not too 
efficient, given that it doesn't have proper frame pointers.

>>> I dislike code that's so littered with comments that you can't see the
>>> code
>>
>> Except in assembler.
>
> ?

At least on machines designed to be programmed in assembler, one can 
generally put a useful and informative comment on pretty much every line.

> It worries me that we're still using a language who's fundamental design
> decisions are based on hardware first produced in the 1970s.

Yep.

>>> So much for C and C++ being for system-level programming. :-P
>>
>> It was never very *good* for it. It was just better than its competitors
>> of the time.
>
> Jesus, did it even *have* any competitors?!

Assembly. ;-)  Probably LISP.  COBOL to a large extent.

>> No, of course not. C doesn't provide any way to ask for a type based on
>> what you need. You can only ask for types based on what the CPU
>> provides
>
> OK, well IA-32 provides 80-bit floats. So... is there a standard way to get
> them?

AFAIK, you have float and double. Maybe there's now a long double, but I 
don't recall.

> You'd expect part of the language's basic syntax to be, you know... part of
> the language's basic syntax. But it isn't. It's just a regular operator,
> which means you can use it in places where you shouldn't be putting random
> commas, and that makes it do strange stuff. (And, being C, this isn't
> checked in any way.)

Why would you put randomg *anything* in? This isn't a sonnet. It's computer 
code.  Why would you put random commas in any more than you put random quote 
marks in?

> The /logical/ thing is for a function that doesn't mention a return type to
> default to returning nothing. And yet, it doesn't. It arbitrarily defaults
> to int. Not bool, not void*, not w_char, but int. No reason, it just does.

Remember the compilation model.  Plus, "void" is a relatively recent 
development.

> I forget who said it: comprehension = 2 ^ -precision.

You just have to think mathely.


-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.