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, 07:12 PM,
#14
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Global Functions
Well, if you really want the ability to do this I will revert it, but I'm not adding any half measures to protect specific functions.

What I will do instead is add an enforced local variable to every script, _MAINFILE. This is something no other script can change, and will provide you with the guaranteed correct mainfile path. Beyond that you are on your own.

(11-08-2017, 06:50 PM)Red The Blue Color Wrote: 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.
It's not just other people, it's yourself. It is very easy to modify something's behaviour, forget you've done it, then spend hours wondering why something isn't doing what you expect only to finally find that you changed its behaviour and introduced a bug/unexpected side effect.

You should see the standard library as a foundation and build your work on top of it, rather than trying to dig up some of the foundation and redo it, leaving parts all over the place.

(11-08-2017, 07:08 PM)Kosmos Wrote: As for modifying default functions being discouraged, I do believe that the current 'standard' for libraries is to dump their contents into the global environment. And I did that for quite some time too.
This isn't modifying default functions though, this is just adding values to the global table. Which is fine, if a little crude.
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: 2 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.