Salty as fuck Posted February 18, 2016 Share Posted February 18, 2016 I don't like declaring multiple variables on the same line. It tires the eye imo. Because of completion OCD I occasionally will use a "this" where it's not necessary, or sometimes I'll just do it to improve readability. I will sometimes prefer snake_case over headlessCamelCase when the latter looks awkward. But yeah. Conventions. he decompiled my script and thinks it came out the same as it went in long startTime, timeRun i don't actually know why i had timerun in there, it was never used lol this is a roast thread tbh hardly. you just decompiled a quick script I made and didn't even do it right. i don't initialize everything every single line, and using "this.npcs" and similiar is something i've never done before http://osbot.org/forum/topic/91327-sentychompys-chompy-bird-killer/?p=1013049 since you seem so interested in responding to my statement of you not deserving the scripter rank, you should do it directly, not with a half-assed thread including failed decompiling and bullshit Quote Link to comment Share on other sites More sharing options...
Chris Posted February 18, 2016 Share Posted February 18, 2016 he decompiled my script and thinks it came out the same as it went in i don't actually know why i had timerun in there, it was never used lol hardly. you just decompiled a quick script I made and didn't even do it right. i don't initialize everything every single line, and using "this.npcs" and similiar is something i've never done before http://osbot.org/forum/topic/91327-sentychompys-chompy-bird-killer/?p=1013049 since you seem so interested in responding to my statement of you not deserving the scripter rank, you should do it directly, not with a half-assed thread including failed decompiling and bullshit No one cares now. Both of you end the banter here in this thread. It's pointless fighting over something so stupid. It is just a rank. Period. Quote Link to comment Share on other sites More sharing options...
Salty as fuck Posted February 18, 2016 Share Posted February 18, 2016 No one cares now. Both of you end the banter here in this thread. It's pointless fighting over something so stupid. It is just a rank. Period. yes, father 1 Quote Link to comment Share on other sites More sharing options...
Deceiver Posted February 18, 2016 Author Share Posted February 18, 2016 he decompiled my script and thinks it came out the same as it went in i don't actually know why i had timerun in there, it was never used lol hardly. you just decompiled a quick script I made and didn't even do it right. i don't initialize everything every single line, and using "this.npcs" and similiar is something i've never done before http://osbot.org/forum/topic/91327-sentychompys-chompy-bird-killer/?p=1013049 since you seem so interested in responding to my statement of you not deserving the scripter rank, you should do it directly, not with a half-assed thread including failed decompiling and bullshit no shit u didnt do it right you idiot fuck. theres no point in calling me a shit scripter when you fuck up on your own shit learn your place you fucking sheep. you should do it directly, not with a half-assed thread including failed decompiling and bullshit this made me laugh a bit bc the first one was hidden :sarcasm: Quote Link to comment Share on other sites More sharing options...
Okabe Posted February 18, 2016 Share Posted February 18, 2016 Object Defining I prefer your bad example its more readable then again if you would have used OOP properly there probably would be less of them. 1 Quote Link to comment Share on other sites More sharing options...
Explv Posted February 18, 2016 Share Posted February 18, 2016 The real problem with those variables is that most of them are obsolete. Start xp doesn't need to be stored because all xp gain calculations can be accessed through ExperienceTracker. NPCs and Widgets shouldn't be stored globally because they are most likely going to need to be refreshed every time the method that uses them is called, same with run time. Let us all bow our heads and pray that he at least uses OOP. /roast 1 Quote Link to comment Share on other sites More sharing options...
Deceiver Posted February 18, 2016 Author Share Posted February 18, 2016 The real problem with those variables is that most of them are obsolete. Start xp doesn't need to be stored because all xp gain calculations can be accessed through ExperienceTracker. NPCs and Widgets shouldn't be stored globally because they are most likely going to need to be refreshed every time the method that uses them is called, same with run time. Let us all bow our heads and pray that he at least uses OOP. /roast what is oop Quote Link to comment Share on other sites More sharing options...
Tom Posted February 18, 2016 Share Posted February 18, 2016 CamelCase conventions, this should be nothing new if you remotely deserve any sort of Scripter rank... its a convention, meaning they don't need to be followed. ROASTIE Quote Link to comment Share on other sites More sharing options...
Chris Posted February 18, 2016 Share Posted February 18, 2016 (edited) what is oop Object-oriented programming (OOP) Edited February 18, 2016 by Sinatra 1 Quote Link to comment Share on other sites More sharing options...
GoldenGates Posted February 18, 2016 Share Posted February 18, 2016 Lol .. if only you read my post. Lol .. if only you read my post. I responded to how camelCase improves code, which from what I understand, is your point. Quote Link to comment Share on other sites More sharing options...
iJodix Posted February 18, 2016 Share Posted February 18, 2016 Lol .. if only you read my post. I responded to how camelCase improves code, which from what I understand, is your point. Camel case imroves code ? wow .. right .. i forgot i'm on osbot. Quote Link to comment Share on other sites More sharing options...
GoldenGates Posted February 19, 2016 Share Posted February 19, 2016 Camel case imroves code ? wow .. right .. i forgot i'm on osbot. Read. What. I. Wrote. Please. Quote Link to comment Share on other sites More sharing options...
BloodRush20 Posted February 22, 2016 Share Posted February 22, 2016 Casting and 'this'Bad Example: this.wait = this.widgets.getWidgetContainingText(new String[] { "Hey, JalyYt, you were in a cave only a moment ago." }); this.cont = this.widgets.getWidgetContainingText(new String[] { "Well done in the cave, here take TokKul as reward." }); this.entrance = (RS2Object)this.objects.closest(new String[] { "Cave entrance" }); this.guard = (NPC)this.npcs.closest(new String[] { "TzHaar-Mej-Jal" }); this.tzkih = (NPC)this.npcs.closest(new String[] { "Tz-Kih" }); this.tzkek = (NPC)this.npcs.closest(new String[] { "Tz-Kek" }); this.tokxil = (NPC)this.npcs.closest(new String[] { "Tok-Xil" }); this.ytmejkot = (NPC)this.npcs.closest(new String[] { "Yt-MejKot" }); this.ketzek = (NPC)this.npcs.closest(new String[] { "Ket-Zek" }); this.ythurkot = (NPC)this.npcs.closest(new String[] { "Yt-HurKot" }); In this example, the variable names are the same ones we defined earlier, therefore, we do not need this. As well, we do not need the absurd and gross looking String array and casting. Good Example: wait = widgets.getWidgetContainingText("Hey, JalyYt, you were in a cave only a moment ago."); entrance = objects.closest("Cave entrance"); guard = npcs.closest("TzHaar-Mej-Jal" ); tzkih = npcs.closest("Tz-Kih" ); Agreed, people over use this everywhere without proper understanding I think this will clear up some peoples misconceptions. 1 Quote Link to comment Share on other sites More sharing options...
lisabe96 Posted February 22, 2016 Share Posted February 22, 2016 Bad Example: public RS2Object entrance; public RS2Widget wait; public RS2Widget cont; public NPC guard; public NPC tzkih; public NPC tzkek; public NPC tokxil; public NPC ytmejkot; public NPC ketzek; public NPC jad; public NPC ythurkot; String state; int startHPExp; int startATTExp; int startDEFExp; int startSTRExp; int completed; long startTime; long runTime; This is an example of bad code! Most of us have probably defined our variables like this before and thought it is correct. Though it is correct and will work, it is not the most efficient and clean way to define them. Good Example: int profit, age; int a = 4, b = 6; long startTime, timeRun RS2Object guard, target, chicken; RS2Widget selectX, makeAll; ..... so forth Fewer lines of your code, all your variables are still there and it looks neater and easier on the eyes. I personally find the first example a lot cleaner and easier on the eyes. Quote Link to comment Share on other sites More sharing options...