SA-MP Forums

Go Back   SA-MP Forums > Other > Everything and Nothing

Reply
 
Thread Tools Display Modes
Old 14/03/2017, 07:56 AM   #1
Toroi
Gangsta
 
Toroi's Avatar
 
Join Date: Feb 2017
Location: Venezuela
Posts: 697
Reputation: 146
Default Why do people do this?

I was quite sure I was a healthy person until few weeks ago:

I've seen it everywhere, from YSI files to tutorials, every fucking where.

Instead of this:
Code:
new variable;
people do this:
Code:
new
	variable;
Like fucking why? what's the reason behind it? Is it more readable that way? I don't fucking think so. You do it only to demonstrate to other people that you can do it? Is that why? What the fuck man.

This triggers an OCD of mine I didn't know I had.
Toroi is offline   Reply With Quote
Old 14/03/2017, 08:00 AM   #2
Luis-
High-roller
 
Luis-'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 3,926
Reputation: 401
Default Re: Why do people do this?

I find it a lot more cleaner. People do code things different you know.

pawn Code:
new
       Var
;
__________________


| Home | Server | Forum | Trailer |
Luis- is offline   Reply With Quote
Old 14/03/2017, 08:03 AM   #3
Toroi
Gangsta
 
Toroi's Avatar
 
Join Date: Feb 2017
Location: Venezuela
Posts: 697
Reputation: 146
Default Re: Why do people do this?

Cleaner? To me it looks like you're coding while drunk.
Toroi is offline   Reply With Quote
Old 14/03/2017, 08:15 AM   #4
]Kurence[
Banned
 
Join Date: Aug 2010
Location: Slovakia⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣
Posts: 257
Reputation: 215
Default Re: Why do people do this?

I hate useless whitespaces/newlines in code, you are fighting for the right thing my friend
]Kurence[ is offline   Reply With Quote
Old 14/03/2017, 08:46 AM   #5
jlalt
Banned
 
Join Date: Oct 2014
Location: Iran
Posts: 1,266
Reputation: 366
Default Re: Why do people do this?

Take a look on pattern design videos and you will know how you should program / script.

And yes its cleaner. leme show you why:
PHP Code:
new PlayerName[MAX_PLAYER_NAME], Players[MAX_PLAYERS], PlayerID[MAX_PLAYERS], string[128], Handle[1800]; 
so you judge which is more clean and easier to read:
PHP Code:
new 
    
PlayerName[MAX_PLAYER_NAME], 
    
Players[MAX_PLAYERS], 
    
PlayerID[MAX_PLAYERS], 
    
string[128], 
    
Handle[1800]

jlalt is offline   Reply With Quote
Old 14/03/2017, 09:11 AM   #6
Toroi
Gangsta
 
Toroi's Avatar
 
Join Date: Feb 2017
Location: Venezuela
Posts: 697
Reputation: 146
Default Re: Why do people do this?

That example I can understand, it does not look cleaner to me though, but it does not look bad either. However, my focus is on single variables as I showed in my first post.
Toroi is offline   Reply With Quote
Old 14/03/2017, 09:29 AM   #7
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,704
Reputation: 486
Default Re: Why do people do this?

It depends on people's perspective and styles, I do sometimes uses that method and I sometimes uses the first example.
__________________
Discord: Cipher#7353
JaKe Elite is offline   Reply With Quote
Old 14/03/2017, 11:37 AM   #8
aymel
Huge Clucker
 
aymel's Avatar
 
Join Date: Jul 2015
Location: irc.tl @ Khanz in the lunchroom w/ dylan x eric
Posts: 334
Reputation: 120
Default Re: Why do people do this?

two spaces are better than a tab
prove me wrong
__________________
I don't like you (you)
I don't like you (you)
I'll give you to the count of ten
For you to start running again
We just could've been friends
But you decided to hurt me
Decided to hurt me

aymel is offline   Reply With Quote
Old 14/03/2017, 11:42 AM   #9
Bolex_
Gangsta
 
Bolex_'s Avatar
 
Join Date: Aug 2015
Location: Croatia.
Posts: 586
Reputation: 120
Default Re: Why do people do this?

Quote:
Originally Posted by jlalt View Post
Take a look on pattern design videos and you will know how you should program / script.

And yes its cleaner. leme show you why:
PHP Code:
new PlayerName[MAX_PLAYER_NAME], Players[MAX_PLAYERS], PlayerID[MAX_PLAYERS], string[128], Handle[1800]; 
so you judge which is more clean and easier to read:
PHP Code:
new 
    
PlayerName[MAX_PLAYER_NAME], 
    
Players[MAX_PLAYERS], 
    
PlayerID[MAX_PLAYERS], 
    
string[128], 
    
Handle[1800]

This ^^
Bolex_ is offline   Reply With Quote
Old 14/03/2017, 11:58 AM   #10
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,944
Reputation: 504
Default Re: Why do people do this?

Quote:
Originally Posted by aymel View Post
two spaces are better than a tab
prove me wrong
http://softwareengineering.stackexch...verything-in-e

@op to me one space for single declaration is clearer but it might not be same for all.
SyS is offline   Reply With Quote
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
for all you people who -rep pepper Everything and Nothing 13 05/02/2013 01:53 AM
Why some people lost all their things when login and some people not? CTCCoco Help Archive 1 07/07/2011 10:05 AM
SA-MP people plz help me! KILLER190 Client Support 5 29/10/2010 09:35 PM
People Scaming People's Severs coutanche7 General 19 28/12/2008 04:06 PM


All times are GMT. The time now is 01:58 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.