.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > United Bot
United Bot The ultimate beast is being given birth right here! Half-Life 2

Reply
 
Thread Tools
Re: Strings In United Bot
Old
  (#11)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Strings In United Bot - 27-05-2004

botman spoke

inheritance hasnt been added just for fun


  
Reply With Quote
Re: Strings In United Bot
Old
  (#12)
Magnus
Guest
 
Status:
Posts: n/a
Default Re: Strings In United Bot - 29-05-2004

I Read the source for the STL version of string. Its bulky! My String is lighter, faster and more robust. What do I do now?
  
Reply With Quote
Re: Strings In United Bot
Old
  (#13)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Strings In United Bot - 29-05-2004

What problem are you trying to solve? Or is this just a learning exercise?

botman
  
Reply With Quote
Re: Strings In United Bot
Old
  (#14)
Magnus
Guest
 
Status:
Posts: n/a
Default Re: Strings In United Bot - 30-05-2004

Problems I am trying to solve:
1) STL Strings dont have advanced string search functions
2) STL Strings involve using the null character
3) STL Strings have confusing syntax (there are lengths with and without the null)
4)STL Strings are as prone to buffer overflows as are the C-Style Strings

Isnt it enough to warrant starting from scratch?
My Strings can:
1)Split
2)Find Strings ignoring case and punctuation or takign them into account if desired
3)Change Case Easily
4)Prevent Buffer Overflows
5)Be Easily tailored to needs
6)Compare, the Advanced way, taking into account or ignoring (if desired) Caps and Punctuation
7)Be Added
Output to string, C-Style Strings and individual chars
9)Dont involve the null. It is automatically handled
10)Length is always without the null
  
Reply With Quote
Re: Strings In United Bot
Old
  (#15)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: Strings In United Bot - 31-05-2004

well in Bjarne Stroustrup's "The C++ Programming Language: Special Edition" on page 127 it says..
Quote:
Originally Posted by Bjarne StrouStrup
you should measure carefully before believing that some piece of handcrafted code outperforms library functions

Last edited by sPlOrYgOn; 31-05-2004 at 05:29..
  
Reply With Quote
Re: Strings In United Bot
Old
  (#16)
Magnus
Guest
 
Status:
Posts: n/a
Default Re: Strings In United Bot - 31-05-2004

Yes you are probably right. I will measure it and then be back with the numbers
  
Reply With Quote
Re: Strings In United Bot
Old
  (#17)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Strings In United Bot - 31-05-2004

You can almost always make something faster than what's provided in a standard library, but usually only for specific cases (i.e. you usually can't make something significantly faster that handles the same features that the standard library function handles, if you could, someone would have replaced the standard library function with faster code long ago).

Magnus, I think you are focused on a few issues with STL strings (such as using a null terminator or splitting a string) that you assume other people would want (when they might not need or care about those).

If you want to create your own string library then other coders are required to learn your syntax instead of using what they already know. It would be sort of like replacing the C++ stream I/O (cout, cin, cerr, etc.) with your own input/output library of functions because some of the stream I/O functions were slow or confusing.

I'm not sure that speed is that big of an issue for string operations unless you are doing LOTS of string operations very frequently. For something like a database application or a word processing application, string operation speed would be critical, but for something that's using mostly mathematical operations, string performance probably isn't that critical.

botman
  
Reply With Quote
Re: Strings In United Bot
Old
  (#18)
Magnus
Guest
 
Status:
Posts: n/a
Default Re: Strings In United Bot - 31-05-2004

Syntax is same. Just Go through it. You are right i am developing a specific version of this string: advanced tuncate, find delete functions that i think United Bot needs. If I can make it **suitable** can you use it in United Bot? If not, tell me, i will trash this project.
  
Reply With Quote
Re: Strings In United Bot
Old
  (#19)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Strings In United Bot - 31-05-2004

if you want to speed up the main string operation, the comparision, you need hashtables anyway, so no difference here.

I somehow like STL stuff better, since it's for sure more stable and bug free. I dont wanna say that your code is buggy, but like botman said, the STL was already improved for some time, and it's just a fact that it's stable


  
Reply With Quote
Re: Strings In United Bot
Old
  (#20)
Magnus
Guest
 
Status:
Posts: n/a
Default Re: Strings In United Bot - 01-06-2004

ok thanks anyway.

Last edited by Magnus; 01-06-2004 at 17:13..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com