5 registered members (clonman, TipmyPip, Niels, dBc, 1 invisible),
18,961
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: TUST or "The community library"
[Re: PadMalcom]
#423073
05/23/13 19:31
05/23/13 19:31
|
Joined: Nov 2011
Posts: 274 de
lemming
Member
|
Member
Joined: Nov 2011
Posts: 274
de
|
I'd prefer a 100% working GSTNet or ANet solution. Just one network component is easier to maintain than 3 different ons. But you'd have the advantage to maintain only 1 file, as you don't do direct calls anymore. Example:
/// @brief (Server) Entfernt eine Entity im Spiel.
///
/// @param nethandle das globale Handle der Entity
void net_EntRemove(var nethandle)
{
#ifdef NET_USE_ANET
enet_svent_remove(nethandle);
#else
#ifdef NET_USE_GSTNET
GSTNet_ent_remove(net_GetPointer(nethandle));
#else
#ifdef NET_USE_ACKNET
return;
#endif
#endif
#endif
}
So if GSTNet would change its function to accept only handles or ANet changing to entity pointers, you'd have to change it for the whole code only one time. And someone having an ANet License could use it, where someone without could use GSTNet. That increases the potential user count for the libs.
|
|
|
Re: TUST or "The community library"
[Re: lemming]
#423076
05/23/13 21:41
05/23/13 21:41
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
So if GSTNet would change its function to accept only handles or ANet changing to entity pointers Other people who didn't know about API design also bought "I built my first library and used naming conventions that no one else used (PS: I used tabs for alignment. They call me edgy)". Seriously, why should I use a library whose author can't even get the pre-processor directives right? I'm not going to lie, this is useless. And I'm not even talking about the issue that you are going with the lowest denominator here. This is just asking for trouble and maintainability problems.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: TUST or "The community library"
[Re: HeelX]
#423082
05/23/13 23:40
05/23/13 23:40
|
Malice
Unregistered
|
Malice
Unregistered
|
@JustSid just so I don't get belittled on a public forum, can you tell a beginning coder(me) where I can learn these API design rules and the common naming conventions I should know?
EDIT_reply* Thanks JustSid. I'll learn the info.I have a question but will pm or new thread and stop hijacking.
Last edited by Malice; 05/24/13 00:38.
|
|
|
Re: TUST or "The community library"
[Re: HeelX]
#423085
05/24/13 00:16
05/24/13 00:16
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
@JustSid: I didn't followed this thread enough Me neither. I was just commenting about the post above mine. 1) The documentation: Look at the param, it's aligned with two tabs. The problem is that tab width differs on systems, so while indentation is fine using tabs (and the way it should be done), aligning lines is not. Use spaces for that, and the code will show up fine on every machine no matter the tab width. 2) Look at the #ifdef, #else and #endif spaghetti blob there is in the function. It's not only lacking any kind of indentation. @malice There has been a google TechTalk called "API design and why it matters" (or so). Pretty sure you can find the slides and the talk itself via google. And with naming convention I meant that he uses a naming convention that is neither compatible with Acknex nor either of the two libraries that's getting wrapped there. So now you have three different naming conventions for three libraries. Though to be fair, he appears to be consistent in ignoring the other naming conventions and sticking to his own (which in itself is already a mix of two naming conventions). There is no common naming convention, but the rule of thumb is to stick with whatever the environment you are in uses.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: TUST or "The community library"
[Re: WretchedSid]
#423100
05/24/13 06:30
05/24/13 06:30
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
If you ask me (i know you did not) but im amazed like that ,that i will cimment ..@justsid not to attack on a personal level but really ? oh cry me a thousand rivers .. You complain about nonsense and thats okay you guys get to choose what you want for the project wich i can agree on is fine to turn down based on whatever reasons but to be frank you sound like a ninny coder ..dude dont make love to the code
Compulsive compiler
|
|
|
Re: TUST or "The community library"
[Re: Wjbender]
#423101
05/24/13 07:01
05/24/13 07:01
|
Joined: Mar 2006
Posts: 1,993 Karlsruhe
PadMalcom
Serious User
|
Serious User
Joined: Mar 2006
Posts: 1,993
Karlsruhe
|
Sid says true things but he cannot put it (socially) into words  Using tabs for distances between multiple expressions is not regarded as "good design". Example:
@param[TAB]nethandle[TAB][TAB]das globale Handle der Entity
Instead you should write:
@param[SPACE]nethandle[SPACE][SPACE]das globale Handle der Entity
Because spaces look the same on all machines while tabs don't. Nevertheless, I think lemmings idea is a good one and I'd like to see the solution in TUST. (BTW what you do there technically is called a Fascade Pattern that hides multiple functions, libraries and versions behind static code. I like it a lot and we use it quite often at wort.)
|
|
|
Re: TUST or "The community library"
[Re: Wjbender]
#423102
05/24/13 07:01
05/24/13 07:01
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
@justsid not to attack on a personal level Go for it, sticks and stones may break my bones, but words... Nah, I have a pretty big ego, just go for it. I think good API design is important, I'm not the only one who thinks so (yes, I would also jump from the bridge if my friends jumped from it. Because I would no longer have friends anymore). The problem is, arbitrary API design is going to bite you and your users in the ass at some point, and statements like "what if Anet changed from handles to pointers", simply shows that the one who made that statement has no idea of API design. Not to mention that shims in general are just asking for trouble. There are a million out there, and the older they get the more broken they become. Look at the _stat() function in the Windows POSIX shim, it's broken beyond recognition because Windows ACL system just doesn't fit on top of the unix groups and user ideology. You are going for lowest denominator here, is that really desirable? I'm sorry for saying that directly, but what do you want me to do? Pretend like it's super awesome and like baked awesomeness, "but..."? I wrote, and still do, awful code too, and if people didn't tell me, I would never learn.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: TUST or "The community library"
[Re: sivan]
#423109
05/24/13 08:34
05/24/13 08:34
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
Agree on alot you say sid , you make good and valid points true , but isint that just a commented line with the tabs ? Really ? I dont get it ..simple comments wit tabs in them is an issue ? I think that could be easily corrected...
As for the technical stuff i wont take you on and no not on a personal level ..
Compulsive compiler
|
|
|
|