www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Contradiction?

reply James Dunne <james.jdunne gmail.com> writes:
Direct quote from Phobos documentation:
"No pointless wrappers around C runtime library functions or OS API functions. D
provides direct access to C runtime library functions and operating system API
functions. Pointless D wrappers around those functions just adds blather, bloat,
baggage and bugs."

std.cstream:

class CFile : Stream
A Stream wrapper for a C file of type FILE*.

:-)

Regards,
James Dunne
Aug 23 2005
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
James Dunne wrote:
 Direct quote from Phobos documentation:
 "No pointless wrappers around C runtime library functions or OS API functions.
D
 provides direct access to C runtime library functions and operating system API
 functions. Pointless D wrappers around those functions just adds blather,
bloat,
 baggage and bugs."
 
 std.cstream:
 
 class CFile : Stream
 A Stream wrapper for a C file of type FILE*.
On what basis have you concluded that this is a _pointless_ wrapper? Does the addition of functionality and potential robustness not constitute a point? OTOH look at std.math. Half the stuff in there looks more like pointless wrappers from where I am. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Aug 23 2005
parent reply Don Clugston <dac nospam.com.au> writes:
Stewart Gordon wrote:
 James Dunne wrote:
 
 Direct quote from Phobos documentation:
 "No pointless wrappers around C runtime library functions or OS API 
 functions. D
 provides direct access to C runtime library functions and operating 
 system API
 functions. Pointless D wrappers around those functions just adds 
 blather, bloat,
 baggage and bugs."

 std.cstream:

 class CFile : Stream
 A Stream wrapper for a C file of type FILE*.
On what basis have you concluded that this is a _pointless_ wrapper? Does the addition of functionality and potential robustness not constitute a point? OTOH look at std.math. Half the stuff in there looks more like pointless wrappers from where I am.
Yes, they are just removing the "l" from the std library names. std.c.math: ------------------------- extern (C): real acosl(real); ------------------------- std.math ------------------------- real acos(real x) { return std.c.math.acosl(x); } ------------------------- Why not, in std.math: alias std.c.math.acosl acos; Or could we even extend the syntax for extern and/or alias so that you could write: alias extern (C): real acosl(real) acos; or (nicer) extern (C): alias real acosl(real) acos; and remove std.c.math entirely? There does not seem to be any purpose in having 'acosl' defined. Don.
Aug 23 2005
parent reply "Walter" <newshound digitalmars.com> writes:
"Don Clugston" <dac nospam.com.au> wrote in message
news:degfdm$185$1 digitaldaemon.com...
 Stewart Gordon wrote:
 OTOH look at std.math.  Half the stuff in there looks more like
 pointless wrappers from where I am.
Yes, they are just removing the "l" from the std library names. std.c.math: ------------------------- extern (C): real acosl(real); ------------------------- std.math ------------------------- real acos(real x) { return std.c.math.acosl(x); } -------------------------
It isn't quite pointless. The idea is to remove the "hungarian notation" postfixes as they are unnecessary in a language that supports overloading.
 Why not, in std.math:

 alias std.c.math.acosl acos;

 Or could we even extend the syntax for extern and/or alias so that you
 could write:

 alias extern (C): real acosl(real) acos;

 or (nicer)

 extern (C):
 alias  real acosl(real) acos;


 and remove std.c.math entirely?
Aliases cannot change the type or calling convention, after all, they are merely another name for a symbol. What's in an alias? That which we call a rose by any other alias would smell as sweet.
Aug 24 2005
parent reply "ElfQT" <dethjunk yahoo.com> writes:
 It isn't quite pointless. The idea is to remove the "hungarian notation"
 postfixes as they are unnecessary in a language that supports overloading.
Are you aware of the origin(al) of Hungarian notation? http://www.joelonsoftware.com/articles/Wrong.html (Starting at "I'm Hungary" section.) ElfQT ps, I'm from hungary, by the way ;). really. "Walter" <newshound digitalmars.com> wrote in message news:dejco0$1toc$3 digitaldaemon.com...
 "Don Clugston" <dac nospam.com.au> wrote in message
 news:degfdm$185$1 digitaldaemon.com...
 Stewart Gordon wrote:
 OTOH look at std.math.  Half the stuff in there looks more like
 pointless wrappers from where I am.
Yes, they are just removing the "l" from the std library names. std.c.math: ------------------------- extern (C): real acosl(real); ------------------------- std.math ------------------------- real acos(real x) { return std.c.math.acosl(x); } -------------------------
It isn't quite pointless. The idea is to remove the "hungarian notation" postfixes as they are unnecessary in a language that supports overloading.
 Why not, in std.math:

 alias std.c.math.acosl acos;

 Or could we even extend the syntax for extern and/or alias so that you
 could write:

 alias extern (C): real acosl(real) acos;

 or (nicer)

 extern (C):
 alias  real acosl(real) acos;


 and remove std.c.math entirely?
Aliases cannot change the type or calling convention, after all, they are merely another name for a symbol. What's in an alias? That which we call a rose by any other alias would smell as sweet.
Aug 25 2005
next sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
ElfQT wrote:
 It isn't quite pointless. The idea is to remove the "hungarian notation"
 postfixes as they are unnecessary in a language that supports overloading.
Are you aware of the origin(al) of Hungarian notation? http://www.joelonsoftware.com/articles/Wrong.html (Starting at "I'm Hungary" section.)
<snip> Strong typedefs can be an even safer alternative ... up until you get bitten by this issue.... http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3843 Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Aug 25 2005
parent "ElfQT" <dethjunk yahoo.com> writes:
 http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3843
Nice one. When I first read of alias and typedef, I've felt that typef should work as really a different type (so it should find the "right" overload). (Now I'm not that sure about it's design goal...) So is that still a bug? ElfQT
Aug 25 2005
prev sibling next sibling parent reply Hasan Aljudy <hasan.aljudy gmail.com> writes:
ElfQT wrote:
It isn't quite pointless. The idea is to remove the "hungarian notation"
postfixes as they are unnecessary in a language that supports overloading.
Are you aware of the origin(al) of Hungarian notation? http://www.joelonsoftware.com/articles/Wrong.html (Starting at "I'm Hungary" section.) ElfQT ps, I'm from hungary, by the way ;). really. "Walter" <newshound digitalmars.com> wrote in message news:dejco0$1toc$3 digitaldaemon.com...
"Don Clugston" <dac nospam.com.au> wrote in message
news:degfdm$185$1 digitaldaemon.com...

Stewart Gordon wrote:

OTOH look at std.math.  Half the stuff in there looks more like
pointless wrappers from where I am.
Yes, they are just removing the "l" from the std library names. std.c.math: ------------------------- extern (C): real acosl(real); ------------------------- std.math ------------------------- real acos(real x) { return std.c.math.acosl(x); } -------------------------
It isn't quite pointless. The idea is to remove the "hungarian notation" postfixes as they are unnecessary in a language that supports overloading.
Why not, in std.math:

alias std.c.math.acosl acos;

Or could we even extend the syntax for extern and/or alias so that you
could write:

alias extern (C): real acosl(real) acos;

or (nicer)

extern (C):
alias  real acosl(real) acos;


and remove std.c.math entirely?
Aliases cannot change the type or calling convention, after all, they are merely another name for a symbol. What's in an alias? That which we call a rose by any other alias would smell as sweet.
That was brought up before ... "Making Wrong Code Look Wrong" <<< that is wrong What we should do instead, is "Make wrong code produce a compiler error" , with strong typing.
Aug 25 2005
parent Stewart Gordon <smjg_1998 yahoo.com> writes:
Hasan Aljudy wrote:
<snip>
 That was brought up before ...
 "Making Wrong Code Look Wrong"  <<< that is wrong
 What we should do instead, is "Make wrong code produce a compiler error" 
 , with strong typing.
See also http://www.digitalmars.com/d/archives/digitalmars/D/11512.html Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Aug 25 2005
prev sibling parent reply "Walter" <newshound digitalmars.com> writes:
"ElfQT" <dethjunk yahoo.com> wrote in message
news:dekh99$1m7a$1 digitaldaemon.com...
 It isn't quite pointless. The idea is to remove the "hungarian notation"
 postfixes as they are unnecessary in a language that supports
overloading.
 Are you aware of the origin(al) of Hungarian notation?
 http://www.joelonsoftware.com/articles/Wrong.html
 (Starting at "I'm Hungary" section.)
Yes (I like reading Joel's essays, he's very good). I was using the popular meaning of the term. I think the original meaning is gone for good, like the original meaning of "hacker" <g>.
Aug 26 2005
next sibling parent "Ameer Armaly" <ameer_armaly hotmail.com> writes:
"Walter" <newshound digitalmars.com> wrote in message 
news:denmf2$1na3$2 digitaldaemon.com...
 "ElfQT" <dethjunk yahoo.com> wrote in message
 news:dekh99$1m7a$1 digitaldaemon.com...
 It isn't quite pointless. The idea is to remove the "hungarian 
 notation"
 postfixes as they are unnecessary in a language that supports
overloading.
 Are you aware of the origin(al) of Hungarian notation?
 http://www.joelonsoftware.com/articles/Wrong.html
 (Starting at "I'm Hungary" section.)
Yes (I like reading Joel's essays, he's very good). I was using the popular meaning of the term. I think the original meaning is gone for good, like the original meaning of "hacker" <g>.
I agree-the popular definition accomplishes little if nothing.
 
Aug 26 2005
prev sibling parent Stewart Gordon <smjg_1998 yahoo.com> writes:
Walter wrote:
 "ElfQT" <dethjunk yahoo.com> wrote in message
 news:dekh99$1m7a$1 digitaldaemon.com...
<snip>
 Are you aware of the origin(al) of Hungarian notation?
 http://www.joelonsoftware.com/articles/Wrong.html
 (Starting at "I'm Hungary" section.)
Yes (I like reading Joel's essays, he's very good). I was using the popular meaning of the term. I think the original meaning is gone for good, like the original meaning of "hacker" <g>.
So, what is your opinion on Apps Hungarian? I guess the style guide ought to address both kinds. The current version of the page could be construed by the knowledgeable as condemning both. The term "Apps Hungarian", or even "Hungarian notation" with this meaning, may have gone out of fashion, but the concept certainly lives on to an extent. I've frequently used variable names such as iRow and iCol, where "i" stands for "index". And I recall seeing cbSize in some Windows API structures, which uses an example given in Joel's piece. Though others use lStructSize for the same. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Aug 31 2005