2 registered members (3s05bmmc, flink),
650
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: TUST or "The community library"
[Re: Wjbender]
#423117
05/24/13 08:59
05/24/13 08:59
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
I mentioned the alignment problem with just one sentence in my original post, and just clarified what I meant when Christian asked me. But I actually think it's an important issue, take a look at these two gists: https://gist.github.com/JustSid/211378039a4d53a83848https://gist.github.com/JustSid/14004276a0a6b27d342eThey both align correctly in my IDE and with my settings, but the second version with tabs breaks everywhere where users use different settings. I just assumed that, if there are tabs in the comments, he also used tabs in the actual source (maybe I shouldn't jump to conclusions, but that would make flame wars much harder)
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]
#423118
05/24/13 09:28
05/24/13 09:28
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
Agree that tabs could make code not easy to read or follow or display in a nice coherent manner ..totaly in agreement .
Perhaps it could be said that for future contributers that a standard has to be followed to somw degree , as for what precisily , you or a collection of the team could decide on a template to follow?
Compulsive compiler
|
|
|
Re: TUST or "The community library"
[Re: Wjbender]
#423120
05/24/13 10:18
05/24/13 10:18
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
about GSTNEt/Anet: Used GSTNet before Anet arrived. GSTNet is quite good, but NFS is not around here anymore. So in case of (internal)problems, noone can help.
Anet has some more features iirc, too. I know you have to buy anet, but its worht it.
I'll just stick to Anet.
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: TUST or "The community library"
[Re: MasterQ32]
#423141
05/24/13 14:51
05/24/13 14:51
|
Joined: Nov 2011
Posts: 274 de
lemming
Member
|
Member
Joined: Nov 2011
Posts: 274
de
|
Wow, I didn't expected so many replies. To clarify a few things: Unfortunately it seems you thought this is meant to be some sort of plan. It is not. It is an IDEA. I posted the code just to show what I mean, not to show what great coder I am. Here I want to quote myself: At the moment it needs to be cleaned up and is very incomplete.
And because I made every mistake a programmer can make in my very little snippet, I shall comment on this, too: Sid is right. Thank you for pointing on my mistakes (yeah really!). And I have no problems with his words, I grew up with the internet. My code is poorly (if not horribly) written and I know NOTHING about API design. That handle example was the very first I came up with and it even sounded stupid to me, but I had no better idea when I posted it. But Anet for example had an API change in some version that was not so minor. The precompiler stuff is just that bad, because, well, I never did something that "complex" (more than one IF in a file) with precompiler commands. So I looked in the command list, "Ah, that might possibly work.", and it worked in the first test run. The rest was copypasta. I hate it when I do it Quick'n'dirty, but sometimes I fall for it. Tabs? Well, dunno. Never thought about that. They are just easier to navigate than spaces. Naming convention: Yeah, the code was written longer ago. I made several naming convention changes in my life just to find out which one just feels right to me. This one was very close to what I stick now (and believe is called "Camel Case") void prefix_someFunction(var someVar). (But for the CLTEXT lib I changed it to be compatible to the TUST convention.) So much for my excuses. About the lowest dominator: Of course the lib covers only the stuff every other lib has in common. Everything else would be a pain to code. My intention was to ask "Does anyone need something like that?". And we are discussing about that. That's what I wanted.
|
|
|
Re: TUST or "The community library"
[Re: lemming]
#423149
05/24/13 15:51
05/24/13 15:51
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
OP
Expert
|
OP
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
I've added a small function: draw_font. It's usage is basically the same as draw_text, but allows you to render with custom bitmap fonts and some other features of TEXT
draw_font("Hello World", 16, 16, vector(0, 255, 0), font, SHADOW, 100);
|
|
|
Re: TUST or "The community library"
[Re: Wjbender]
#423158
05/24/13 19:33
05/24/13 19:33
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
I don't know why but somehow the tab- and the #define-thingy didn't caught my attention, for whatever reason - of course, I agree. Tabs are in a line a bad idea. Though, I still think that tabs are useful for indentation in if/else blocks, functions, and so on. It is just easier to use. On work, we have a coding policy which also requires whitespace as tabs. Since we use Eclipse as preferred IDE, you can still jump from indendation to indendation with just pressing a key, although they contain whitespace. For Lite-C, I use a pretty simple texteditor which doesn't support this (Programmer's Notepad; before that I used ConTEXT - but I found out that Notepad++ is neat, too). So in these cases, tabs make sense, because they are faster and easier to maintain than whitespace-tabs. By the way, the slides of "How to Design a Good API and Why it Matters" of Joshua Bloch are to be found here: http://lcsd05.cs.tamu.edu/slides/keynote.pdf, thanks for the hint! There is also a short summary of all important points of the talk to be found here: http://www.infoq.com/articles/API-Design-Joshua-Bloch. --- But I guess it might be too abstract for most people - give them a coding guideline and they will read it; but give them a tech talk about API design, they certainly get questionsmarks raised above their heads. But you are absolutely right, the talk is great and the hints are very nice. Personally, I think the remark that "Code should read like prose" is the strongest one, it rings my bell.
Last edited by HeelX; 05/24/13 19:35.
|
|
|
|