Raised This Month: $ Target: $400
 0% 

charmax & sizeof


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-29-2013 , 19:38   Re: charmax & sizeof
Reply With Quote #1

Quote:
Originally Posted by Leon M. View Post
I never use charsmax for known array sizes anyways. More readable for me since you always get remembered how long the string can be
I also dont use charsmax anymore because it faster to write number
.Dare Devil. is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-30-2013 , 05:39   Re: charmax & sizeof
Reply With Quote #2

Quote:
Originally Posted by .Dare Devil. View Post
I also dont use charsmax anymore because it faster to write number
i can write charsmax(blabla) in 0.5 seconds
EpicMonkey is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-28-2013 , 04:43   Re: charmax & sizeof
Reply With Quote #3

if we have:
Code:
new string[20];
sizeof(string) will return 20
sizeof(string)-1 will return 19
charsmax(string) will return 19

That's everything you have to know
didoWEE is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 04-28-2013 , 16:39   Re: charmax & sizeof
Reply With Quote #4

A smart coder doesn't try to hardcode everything.
Backstabnoob is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 04-29-2013 , 00:19   Re: charmax & sizeof
Reply With Quote #5

I didn't said I hardcode everything (there is a high dynamic ml message system by me). You will find hardcoded things in any engine/code or whatever because it makes no sense on certain points. Some variables just have a max size.

What a shitty discussion -.-


---
Two things are infinite the universe and human stupidity; and I'm not sure about the universe. - "Albert Einstein"
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015
Leon M. is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-29-2013 , 04:51   Re: charmax & sizeof
Reply With Quote #6

Quote:
Originally Posted by Leon M. View Post
Two things are infinite the universe and human stupidity; and I'm not sure about the universe. - "Albert Einstein"
scientists are still not sure about the universe, if it is infinite or finite

Last edited by EpicMonkey; 04-29-2013 at 04:52.
EpicMonkey is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 04-29-2013 , 10:52   Re: charmax & sizeof
Reply With Quote #7

Quote:
Originally Posted by Leon M. View Post
I didn't said I hardcode everything (there is a high dynamic ml message system by me). You will find hardcoded things in any engine/code or whatever because it makes no sense on certain points. Some variables just have a max size.

What a shitty discussion -.-


---
Two things are infinite the universe and human stupidity; and I'm not sure about the universe. - "Albert Einstein"
I'd appreciate if you stopped acting hostile towards everyone on these forums. I'm going to report every single post from you I find hostile if you do this one more time. You're just forcing your opinion (which is untrue, by the way) on others.

@OP:
The 64 size of name can be used for multiple purposes. I, for example, send the name to a SQL database in many cases where certain symbols in the name need to be escaped by another character. For example ' would need to become \' or the query will never be successful.
Backstabnoob is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 04-29-2013 , 18:54  
Reply With Quote #8

@backstabnoob
Not against everyone, just against you because you didn't read previous posts. You should read them accordingly. Nobody can help you if won't do it.
Quote:
Originally Posted by Leon M. View Post
I never use charsmax for known array sizes anyways. More readable for me since you always get remembered how long the string can be
... without scrolling back and rechecking the variable definition.

It is just my opinion and I explained it why. That was all. If anyone is doing it different then it's fine, I don't care. But answering with
Quote:
Originally Posted by Backstabnoob View Post
A smart coder doesn't try to hardcode everything.
shows that you didn't understand or even read the previous posts. In such cases you need to calculate with it. Also don't be so sensitive, *jesus*.

Quote:
Originally Posted by Backstabnoob View Post
You're just forcing your opinion (which is untrue, by the way) on others.
Where I do it?

I was always talking about me. I said "I prefer". I never said YOU MUST do it like me. And what is my untrue opinion? At the moment you are forcing your opinion on me. There are and will be always hardcoded things. You know that the string length of the name is limited at 32 by the engine? Hardcoded!

However I'll stop the discussion. Both ways are fine, I just said "I PREFER" and have given an explanation. I should shut up my mouth since you can't tolerate my opinion.

EDIT: The funny part is that you have suggested to use hardcoded things recently *trololol* I guess you just like to mess up with others. Take a look for another sparring partner, thanks.
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015

Last edited by Leon M.; 04-29-2013 at 19:28.
Leon M. is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 04-30-2013 , 10:21   Re: charmax & sizeof
Reply With Quote #9

Quote:
Originally Posted by Leon M.
Not against everyone, just against you because you didn't read previous posts. You should read them accordingly. Nobody can help you if won't do it. ... without scrolling back and rechecking the variable definition.
I have. It's not just me, I wouldn't mind as much if you were attacking only me. Nearly every post I see from you is basically attacking someone who has given their opinion on a public board, or is trying to explain as of why is their method better. All you're doing is state your opinion on the forums as if it was a fact and when someone reacts to it, you go douche mode.

Quote:
Where I do it?

I was always talking about me. I said "I prefer". I never said YOU MUST do it like me. And what is my untrue opinion? At the moment you are forcing your opinion on me. There are and will be always hardcoded things. You know that the string length of the name is limited at 32 by the engine? Hardcoded!
You said this: "A smart coder thinks earlier about it." So simply judging from your context, you're stating that everyone who uses charsmax for better readability is not a smart coder. That's forcing opinions on others and making assumptions. Stop doing it - in all honesty, it makes you look like an asshole. No offense.

Quote:
However I'll stop the discussion. Both ways are fine, I just said "I PREFER" and have given an explanation. I should shut up my mouth since you can't tolerate my opinion.
I do tolerate your opinion, I never said it was wrong, I just reacted to the message I talked about ^.

Quote:
EDIT: The funny part is that you have suggested to use hardcoded things recently *trololol* I guess you just like to mess up with others. Take a look for another sparring partner, thanks.
wat
Backstabnoob is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-29-2013 , 03:14   Re: charmax & sizeof
Reply With Quote #10

It seems you fail to see the purpose, looking at your answers.
__________________
Arkshine is offline
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:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode