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

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #16  
Old 02-28-2013, 10:56 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

I worked on a project a long time ago that we licensed some code for. It was in C with 1 space indents, all uppercase where possible, and with most variable/function names being 32 characters long which was the limit of the compiler. It was the most horrible thing I'd ever seen.

Even back in the dark days of 80x50 DOS terminals I'd rather break a line in the middle than indent less.
Reply With Quote
  #17  
Old 02-28-2013, 10:57 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by lerxst2112 View Post
Changing from tabs to spaces or the reverse can be a lot of fun with merges if your preferred diff program doesn't properly ignore whitespace/line endings.

http://www.hanselman.com/blog/YoureJ...InTheWall.aspx


The best standards are simple and lightweight, otherwise people just won't follow them, even at a professional job. Most of the ones I've written are 10 or fewer bullet points and all of the formatting issues are things that you can easily do with astyle or another formatting utility so that even if people prefer to work a different way they can easily make their code conformant before they check it in.

My personal preference has always been to use 4 spaces for an indent, but I'm fine with tabs too. In fact, tabs might be better for those mildly insane individuals that like 2 character indents, or the ones that were dropped on their heads repeatedly as children that use proportional fonts.
You always make me laugh.

I always use tabs and never spaces, that could be false for some of my really old stuff.

There are programs or scripts that can be gone through the source that will beautify things but really there just needs to be practices defined in the Github.

It hasn't been a problem really with SVN because the individuals that could commit were already proven to have a somewhat decent methodology. If they didn't, they got torn up in IRC or on threads.

KLS has the most professional opinion as to standards and practices not only due to the massive experience on the Emulator but 4+ years of specialized computer science/programming that only seasoned the raw skill KLS had before and during.

Trevius has also policed our practices on emulator such as how Perl exported objects are named in quest:: and $entity-> objects for example. quest::allbeinglowercase() and $entity->HavingWordsCapitalized(); are just a few small examples.

Standards and guidelines aren't bad to have, but as always they have to be enforced and kept up upon and we've done a decent job of policing that amongst ourselves but it is a different story with anyone being able to fork to the Github now, so it wouldn't be a bad idea.
Reply With Quote
  #18  
Old 03-01-2013, 12:28 AM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Most simple indent policy would be just don't mix tabs and spaces, ever. Then a Dev can use tabs if they want or spaces. Plus it is better for tools to convert.
Reply With Quote
  #19  
Old 03-01-2013, 01:18 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I knew a guy in college who did 3 space indents, cause 2 was too few and 4 was too many. Hated reading his code, cause it was just utterly bizarre trying to line it up.

I don't intend to do complicated standards.
-We need to standardize our naming conventions (especially for things like files).
-Stop mixing tabs and spaces no matter which way we go.
-I'd like to limit line length to something, maybe not a hard limit and probably a bit more than 80 characters. Its just that it sucks reading lines that are 780 characters long cause someone couldn't be bothered to break a string up.
-There's a few practices with regard to the actual coding that would be nice to clarify how it should be done rather than keep answering questions or correcting people who do it wrong.
Reply With Quote
  #20  
Old 03-01-2013, 05:49 AM
Drajor's Avatar
Drajor
Developer
 
Join Date: Nov 2012
Location: Halas
Posts: 355
Default

I have a suggestion which is related to standards, but not so much about syntax. I would love to see ALL embedded SQL moved to a single file and perhaps one day we could even transition into stored procedures.
__________________
Drajor regards you indifferently -- what would you like your tombstone to say?
Reply With Quote
  #21  
Old 03-01-2013, 06:38 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Thought of 1 more reason why I prefer to stick with tabs over spaces; If we move to spaces, that means I have 1 of 3 possible choices, which all kinda suck:

1. I change every other project I work on to use spaces instead of tabs, so I don't have to switch the configuration back and forth every time on my editors when changing between projects.

2. I change my editor settings each time I switch between projects and hope I don't forget and start mixing tabs and spaces by mistake.

3. I live without the editor config change to use spaces in the place of tabs and it makes coding in the emu a bit more annoying/time consuming.

Again, it is definitely not a huge issue, but trying to keep everything in mind before anything gets set in stone.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #22  
Old 03-01-2013, 05:06 PM
addingice
Sarnak
 
Join Date: Jan 2013
Location: United States
Posts: 33
Default

Quote:
I have a suggestion which is related to standards, but not so much about syntax. I would love to see ALL embedded SQL moved to a single file and perhaps one day we could even transition into stored procedures.
I agree on the moving out of inline, I personally would prefer a SQL folder where the SQL goes (maybe broken up by purpose? ,shrug> whatever, out of the inline at least).

i personally would be highly against the stored procedure bit though.

I agree entirely with this piece:

http://www.codinghorror.com/blog/200...s-anyways.html
Reply With Quote
  #23  
Old 03-01-2013, 06:35 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Yeah definitely no to stored procedures, we're gonna rewrite the database system soonish though. So we can at least support prepared statements as well as potentially other backends besides MySQL if people choose. That all involves cleaning up the current mess that is our SQL though.
Reply With Quote
Reply


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:31 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3