TIP: Click on subject to list as thread! ANSI
echo: fidosoft.husky
to: All
from: Markus Reschke
date: 2014-04-02 18:29:22
subject: Grrr

Hello!

Things to avoid when writing code:

In huskylib/huskylib/UNIX.h (also for other OSs):

typedef signed short sword;


In huskylib/huskylib/ftnaddr.h:

typedef struct _netaddr
{
    sword zone;
    sword net;
    sword node;
    sword point;
    char domain[9];
} hs_addr, *ps_addr;

Double Ouch! First one is using signed integers for the fido address. Have
you even seen a negative node number? That requires tons of type
conversions which could have been avoided. And the second one is defining a
type as pointer directly. That's a very bad coding practice because the
pointer status will be hidden later on when using variables:

hs_addr *address;
  vs.
ps_addr address;

Both are the same, but the first clearly shows that it's a pointer. A 'p'
for pointer as the first letter of the type's name doesn't help at all.

Regards,
Markus

--- 
* Origin: *** theca tabellaria *** (2:240/1661)
SEEN-BY: 3/0 633/267 280 640/384 712/0 550 848
@PATH: 240/1661 1120 261/38 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.