Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 04-01-2012, 04:33 AM   #1
Jeremy__
 
Join Date: Mar 2012
Reputation: 1
Posts: 38
Wiki articles are really messy...

The source sdk's programming wiki has some really messy & intrusive code.

I am talking, mainly, about the article I read a couple days ago:
https://developer.valvesoftware.com/..._GameUI_Panels

First, right off of the bat, the guy starts MyPanel.cpp off as so:
Code:
 #include "cbase.h"
 #include "IMyPanel.h"
 using namespace vgui;
 #include <vgui/IVGui.h>
 #include <vgui_controls/Frame.h>
Doing that right there basically defeats the purpose of a namespace. He is giving the headers IVGui.h and Frame.h implicit access to the vgui namespace. Given that (they probably already do) work inside of the namespace, it really should not be forced on those headers.

Second thing wrong with this, is that he uses the vgui namespace and only implcitly access the namespace once, and then about a hundred other time uses the scope resolution operator...

And then for the "Calling the panel" part, he uses a seriously crippled round about implementation of a singleton. Which he could have easily implemented without using a console variable, without modifying the source engine sdk's code (which I always try to avoid unless it is really required) and simply having a simple console command (with something like):

MyPanel::getSingleton()->toggleVisible();

These kinds of mistakes are all over the wiki, and I think they should be cleaned up (maybe I'll look in to it when I get some time...)

Last edited by Jeremy__: 04-01-2012 at 05:19 AM.
Jeremy__ is offline  
Reply With Quote
Old 04-01-2012, 05:49 AM   #2
durrchet
 
Join Date: Mar 2012
Reputation: 209
Posts: 908
What do you expect, it is written mostly by amateur community. For example i've seen guy post a "fix" to the grenade tripmine compilation error, which as he reported on forums causes him to crash once he gets damaged.

Last edited by durrchet: 04-01-2012 at 05:52 AM.
durrchet is offline   Reply With Quote
Old 04-01-2012, 07:42 AM   #3
Jeremy__
 
Join Date: Mar 2012
Reputation: 1
Posts: 38
Quote:
Originally Posted by durrchet View Post
What do you expect, it is written mostly by amateur community. For example i've seen guy post a "fix" to the grenade tripmine compilation error, which as he reported on forums causes him to crash once he gets damaged.
A documentation on the source sdk engine that makes sense (seeing as it is actually a pretty complex piece of software.)

I understand your point, I was just stating that it needs to be cleaned up if anyone has some time (I will be devoting some time to it over the weekends maybe...)
Jeremy__ is offline   Reply With Quote
Old 04-01-2012, 09:08 AM   #4
Biohazard_90
 
 
 
Join Date: Jun 2008
Reputation: 351
Posts: 1,811
Quote:
Originally Posted by Jeremy__ View Post
A documentation on the source sdk engine that makes sense (seeing as it is actually a pretty complex piece of software.)
If that is what you're expecting you are majorly mislead about what this wiki represents.

While it contains some official articles, the majority of content is information from users based on assumptions or testing. Articles from a wiki open to the community can't be expected to be flawless, that would defy the purpose of the whole system.

You are definitely right that a lot of stuff should be improved. I have myself added code that could have been realized better but my intentions were not to provide information which should never be edited again but instead improve old things or just add something in general.
Biohazard_90 is offline   Reply With Quote
Old 04-01-2012, 11:39 AM   #5
durrchet
 
Join Date: Mar 2012
Reputation: 209
Posts: 908
Quote:
Originally Posted by Jeremy__ View Post
I understand your point, I was just stating that it needs to be cleaned up if anyone has some time (I will be devoting some time to it over the weekends maybe...)
It indeed requires cleaning, just like any other wiki. Sadly i am not experienced enough to do heavy "fixing", so i only change small parts of problems which i stumble upon while looking for help on wiki.
durrchet is offline   Reply With Quote
Old 04-01-2012, 03:09 PM   #6
Jeremy__
 
Join Date: Mar 2012
Reputation: 1
Posts: 38
Quote:
Originally Posted by Biohazard_90 View Post
If that is what you're expecting you are majorly mislead about what this wiki represents.

While it contains some official articles, the majority of content is information from users based on assumptions or testing. Articles from a wiki open to the community can't be expected to be flawless, that would defy the purpose of the whole system.

You are definitely right that a lot of stuff should be improved. I have myself added code that could have been realized better but my intentions were not to provide information which should never be edited again but instead improve old things or just add something in general.
Oh, lol. Sorry, I didn't mean to offend you. Thanks for your response. The code isn't horrible just a couple things that could clean it up.
Jeremy__ is offline   Reply With Quote
Old 04-01-2012, 03:40 PM   #7
Biohazard_90
 
 
 
Join Date: Jun 2008
Reputation: 351
Posts: 1,811
Quote:
Originally Posted by Jeremy__ View Post
Oh, lol. Sorry, I didn't mean to offend you. Thanks for your response. The code isn't horrible just a couple things that could clean it up.
The example you've shown is not from me. I was merely mentioning myself as an example, my account name on the wiki is the same as here.

EDIT: This is something I wrapped up because so many people were bugging me about it. It's far from a good tutorial or anything .

Last edited by Biohazard_90: 04-01-2012 at 03:43 PM.
Biohazard_90 is offline   Reply With Quote
Old 04-01-2012, 04:43 PM   #8
Jeremy__
 
Join Date: Mar 2012
Reputation: 1
Posts: 38
Quote:
Originally Posted by Biohazard_90 View Post
The example you've shown is not from me. I was merely mentioning myself as an example, my account name on the wiki is the same as here.

EDIT: This is something I wrapped up because so many people were bugging me about it. It's far from a good tutorial or anything .
Ah, my mistake.
Jeremy__ is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


Thread Tools
Display Modes

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



All times are GMT -7. The time now is 10:37 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2014, All Rights Reserved.