Re: [BLACKBOX] Go

From: [at]} <Chris>
Date: Fri, 13 Nov 2009 17:21:30 +1030

----boundary-LibPST-iamunique-919410058_-_-
Content-type: text/plain

From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
Danforth
Sent: Thursday, 12 November 2009 9:09 AM
To: BLACKBOX{([at]})nowhere.xy
Subject: [BLACKBOX] Go
        
Google is releasing a new open source language called 'Go'
        
http://golang.org/
        
-----------------------------

Thanks for the link Doug - good to see Oberon getting some of the credit. An
interesting review is here:

http://scienceblogs.com/goodmath/2009/11/googles_new_language_go.php

That link was from a message in the comp.arch.embedded newsgroup. They
added:

< The best, though, was from commentator James H G Redekop: "I get this
feeling they picked the name so that when they put out the next version of
the language, they can call it Go2 and make Dijkstra jokes." >

Who said programmers didn't have a sense of humour?

-----------------------------

I haven't looked too closely at Go yet but I hope they have made it more
difficult for non-Pascal/Modula/Oberon programmers to make the following
mistake. This is part of an actual conversation about a C programming
problem in the LPC2000 newsgroup:

======
I've come across a problem with fabsf() in 'Product X'. Here is a code
snippet:

ftemp=fabsf(FloatArray[0]);
ftemp2=fabsf(FloatArray[1]);

For some reason every once in a while (maybe 5-10% of the time) ftemp and
ftemp2 are set to 0 even though FloatArray[0] and [1] are non-zero.

-----

Make absolutely sure you have #included <math.h>.

=====

D'ohh. This was the first time I made any math calls from this file, so I
didn't have math.h in there. my mistake. Not the first time I've done this,
but in past cases the functions always failed, not just intermittently
failed. Is there another fabsf() that gets used if math.h is not included?

-----

No. It's just if that you have not prototyped f then by the "rules of C",
fabsf get defined as:

int fabsf();

Note that this is *not* the same as

int fabsf(void);

That's another common misconception. Perhaps you should mull that one over
too. :-)

===============================

I think it is sad that in this case the programmer blamed himself rather
than the system. Maybe that is part of the reason such systems still exist?

Regards,
Chris

Chris Burrows
CFB Software
http://www.cfbsoftware.com


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-919410058_-_-
Content-type: application/rtf
Content-trans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5vdCBwcm90
b3R5cGVkIGYgdGhlbiBieSB0aGUgInJ1bGVzIG9mIEMiLFxwYXINCmZhYnNmIGdldCBkZWZpbmVk
IGFzOlxwYXINClxwYXINCmludCBmYWJzZigpO1xwYXINClxwYXINCk5vdGUgdGhhdCB0aGlzIGlz
ICpub3QqIHRoZSBzYW1lIGFzXHBhcg0KXHBhcg0KaW50IGZhYnNmKHZvaWQpO1xwYXINClxwYXIN
ClRoYXQncyBhbm90aGVyIGNvbW1vbiBtaXNjb25jZXB0aW9uLiBQZXJoYXBzIHlvdSBzaG91bGQg
bXVsbCB0aGF0IG9uZSBvdmVyXHBhcg0KdG9vLiA6LSlccGFyDQpccGFyDQo9PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09XHBhcg0KXHBhcg0KSSB0aGluayBpdCBpcyBzYWQgdGhhdCBpbiB0
aGlzIGNhc2UgdGhlIHByb2dyYW1tZXIgYmxhbWVkIGhpbXNlbGYgcmF0aGVyXHBhcg0KdGhhbiB0
aGUgc3lzdGVtLiBNYXliZSB0aGF0IGlzIHBhcnQgb2YgdGhlIHJlYXNvbiBzdWNoIHN5c3RlbXMg
c3RpbGwgZXhpc3Q/IFxwYXINClxwYXINClJlZ2FyZHMsXHBhcg0KQ2hyaXNccGFyDQpccGFyDQpD
aHJpcyBCdXJyb3dzXHBhcg0KQ0ZCIFNvZnR3YXJlXHBhcg0KaHR0cDovL3d3dy5jZmJzb2Z0d2Fy
ZS5jb21ccGFyDQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBt
ZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZATElTVFMuT0JF
Uk9OLkNIXH19AGFpbA==
----boundary-LibPST-iamunique-919410058_-_---
Received on Fri Nov 13 2009 - 07:51:30 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:40 UTC