generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Is It Better To Use Code That Is Readable To Other Users?

Previous Thread :: Next Thread 
Mansion111 is not online. Mansion111
Joined: 12 Jul 2008
Total Posts: 78
14 Dec 2013 10:40 AM
I plan to release something with Surface UIs and I'm about to code it, but I feel I should make it readable in case the people who take it want to see the code.

Normally I'd set up the variables like so:

local set = {
["numpad1"] = script.Parent.keypad.button1,
["numpad2"] = script.Parent.keypad.button2,
...
["numpad9"] = script.Parent.keypad.button9,
["submit"] = script.Parent.miscButtons.submit,
["clear"] = script.Parent.miscButtons.clear,
["code"] = script.Parent.keypad.code.Value,
["enteredL"] = script.Parent.input.entered,
["enteredC"] = script.Parent.input.enteredCode,
["loc"] = Vector3.new(script.Parent.keypad.teleLocation.Value)
}

Should I make it simpler?

~ Trust me, I'm a doctor (@RBX_Dev) ~
Report Abuse
nukeysaurusrex is not online. nukeysaurusrex
Joined: 24 Oct 2013
Total Posts: 2451
14 Dec 2013 10:45 AM
If you're making it public domain, you want it universally readable.
Report Abuse
HD188753 is not online. HD188753
Joined: 13 Jun 2012
Total Posts: 5021
14 Dec 2013 11:25 AM
For the most part, yes, even if you don't plan on handing it out, its good if you leave the project, and then come back later, so you know what got done, what didn't, ect.
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
14 Dec 2013 11:31 AM
I tend to stick to the same messy variable naming practices, and I can easily identify what does what, which is why I continue to do so. If you think you will not remember what something does later on or you think you will share it expecting others to edit it, then use more universally understandable names.
Report Abuse
EchoReaper is online. EchoReaper
Joined: 14 Oct 2008
Total Posts: 4323
14 Dec 2013 11:54 AM
@Mett: That's a bad habit to get in to if you ever plan on getting a job as a programmer.
Report Abuse
RaidenJPN is not online. RaidenJPN
Joined: 22 May 2013
Total Posts: 6920
14 Dec 2013 12:17 PM
I name my variables crap like 'b', 't', 'hurrdurr', or 'x'

when I do not expect others to read my code.
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
14 Dec 2013 12:38 PM
[ Content Deleted ]
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
14 Dec 2013 12:39 PM
I'd definitely try to make it fairly readable especially for yourself. If you go back to it a month later you might be a little lost... That sometimes happens to me when I don't provide proper commenting, so if you're going to do something a bit unusual you may want to explain it with a comment.
Report Abuse
Mansion111 is not online. Mansion111
Joined: 12 Jul 2008
Total Posts: 78
14 Dec 2013 12:52 PM
@Oysi

I'm aware. I set it up like that so I can just go set.button1 etc.

Also, my thought was for releasing items here on ROBLOX.

~ Trust me, I'm a doctor (@RBX_Dev) ~
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
14 Dec 2013 01:10 PM
You should always make code readable to you. You should almost always make code readable to others.

I use 'a' and 'i' an awful lot for loops. Except those time, all my variable are named for their purpose. I tab and occasionally comment. I should comment a lot more.

To anybody who makes code without tabbing:

You will regret it later on. I did this, and converting all the code is not a nice job.
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
14 Dec 2013 01:35 PM
I know it is a bad practice, and I have no problem with using recognizable variable names, it is just I am too lazy to, and often times with my "all in one" scripts, I end up just using acronym variable names when creating a lot of instances to save time.
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
14 Dec 2013 02:13 PM
I dont think you need the [" "] there...

Just do

local object={
a = this,
b = that,
bleh = bloh
}
Report Abuse
chickenman158 is not online. chickenman158
Joined: 18 Jan 2011
Total Posts: 915
14 Dec 2013 02:19 PM
It is better to use code which is impossible to read because security thru obfuscation olol.
Report Abuse
OneTrueGodTheHolyCow is not online. OneTrueGodTheHolyCow
Joined: 24 Oct 2013
Total Posts: 9350
14 Dec 2013 02:49 PM
@chicken,

if you're worried about that then don't write it poorly, obfsucateted it later
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
14 Dec 2013 10:19 PM
ah i was just reminded of this: https://www.thc.org/root/phun/unmaintain.html follow it carefully.
Report Abuse
Merely is not online. Merely
Joined: 07 Dec 2010
Total Posts: 17266
15 Dec 2013 12:04 AM
@MrGamesNwatch

DIED LOL
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
15 Dec 2013 12:13 AM
Perfect to give new developers, gonna bookmark it and read again it later if I get bored right now, or just can't stand laughing with my headache anymore.
Report Abuse
Jswagge is not online. Jswagge
Joined: 15 Mar 2009
Total Posts: 2924
15 Dec 2013 10:47 AM
I always find the s "function" In [workspace] to give the code some texture in the algorithem of b minor
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image