Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-12-2003, 03:21 AM
Eglin
Hill Giant
 
Join Date: Nov 2003
Posts: 168
Default coding standards

I'm just getting to know your codebase, and I find the lack of coding standards to be a bit overwhelming. I guess this is just symptomatic of having a lot of cooks in one kitchen. It feels like the early Java API, where you could clearly tell which routines were written by which authors because the interfaces were so wildly different! hehe... I noticed that at least one major developer is intimately familiar w/ STL (the single biggest source of my rejuvenated love for c++), while others are ingrained in basic c.

Sorry if my post seems inflammatory... At any rate, I thought I'd mention that I found the i/o functions (and the makeanylengthstring) to be dangerous. Instead of c++ style i/o where the object to be output is asked to serialize itself into a stream or the really new style i/o where you use output iterators to walk structures, most i/o uses the va_args stuff that died back with the stdio stuff a decade ago. The problem with the va_args stuff is that it totally disables c's very refined type-checking. As an example of why this could be problematic, consider the following snippet:
Code:
std::string msg = "teststring";
c->Message(0, "test: %s", msg);
This, of course, isn't correct code. However, it is a very easy mistake to make. By bypassing the type-checking of parameter passing, we have also taken away the compiler's ability to warn us of this error. So, by using msg (like we're used to w/ most library i/o routines) instead of msg.c_str(), we've introduced a runtime error that could easily bring down the entire system. Also a very insidious error to track down.

Not really sure what I hoped to accomplish by posting this (maybe just a gotcha! warning). I certainly don't mean to talk trash about your codebase (or I wouldn
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:16 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3