Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 6 7 8 9 10 … 18 Next »
Global Functions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
Global Functions
11-08-2017, 06:50 PM,
#12
Red The Blue Color Offline
TSCM Super Donating Member
****
Posts: 422
Threads: 34
Joined: Feb 2015
RE: Global Functions
(11-08-2017, 05:45 PM)Person8880 Wrote: You should not have a need to ever modify the behaviour of default functions. While it is possible in Lua by default, it is generally discouraged. A developer should never have to worry that a standard function may act differently.

If you have behaviour you want to use then you create your own functions. This is still possible.

Making the environment only protect certain functions is even worse as it's even less obvious to a developer which ones they can and can't change (even though they shouldn't be changing any at all).

What are the use-cases that people have for overriding default functions?

Well a great example would probably be code that you want to apply to already made scripts for example I have a script that overrides commonly used backdoor functions and prints a trace in console so I can see if large scripts I don't feel like digging through has a backdoor anywhere. I have recreated the starfall rendering library just to see what I could do to the basic drawing functions, and I even have an idea to optimize rendering by changing global functions. Sure I probably don't need to change global functions for the idea I have but it loses the ability to be applied to any screen instantly.

I personally don't see the huge issue with overriding global functions, if the reason why it's discouraged is because developers shouldn't have to worry about the functionality changing, i usually never give out chips that would remove or have a noticable impact on default functions so i don't think a developer has to worry about it.

Overriding global functions is just something useful to have and you never know when you might need it.

"with it's superior software, i have no doubt it will succeed in finding fuck all" - T-17, 2016

[Super Member] [ENCOM] т-ѕсм.Red The Blue Color™: server do you support Hitler?
[Server] srcds_linux: The probabilty is about 99.99%, so interpret that how you want to.
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
Global Functions - by Red The Blue Color - 10-08-2017, 09:59 PM
RE: Global Functions - by Obi - 10-08-2017, 10:02 PM
RE: Global Functions - by Skeleton - 10-08-2017, 10:08 PM
RE: Global Functions - by Salira - 10-08-2017, 10:08 PM
RE: Global Functions - by 4N0NYM - 10-08-2017, 10:08 PM
RE: Global Functions - by TheOneAndOnlyTee - 10-08-2017, 10:15 PM
RE: Global Functions - by Red The Blue Color - 10-08-2017, 10:17 PM
RE: Global Functions - by Skeleton - 10-08-2017, 10:24 PM
RE: Global Functions - by Kosmos - 11-08-2017, 04:32 PM
RE: Global Functions - by Person8880 - 11-08-2017, 05:45 PM
RE: Global Functions - by Red The Blue Color - 11-08-2017, 06:50 PM
RE: Global Functions - by Skeleton - 11-08-2017, 06:45 PM
RE: Global Functions - by Kosmos - 11-08-2017, 07:08 PM
RE: Global Functions - by Person8880 - 11-08-2017, 07:12 PM
RE: Global Functions - by Red The Blue Color - 11-08-2017, 08:27 PM

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.