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, 08:27 PM,
#15
Red The Blue Color Offline
TSCM Super Donating Member
****
Posts: 422
Threads: 34
Joined: Feb 2015
RE: Global Functions
(11-08-2017, 07:12 PM)Person8880 Wrote: 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.

Thanks for reverting it and sorry for wasting your time in the first place.

"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.