Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
One program, different behaviour (DEV vs PROD)
#1
I remember once hearing about a project in which they hard-coded some paths in a javascript program.  When testing the program in the test environment, those paths had to be changed for the test server.

When the program would be approved for production, they would change the hard-coded paths for the production server before deploying the program to the production server.

And then everybody, I.T. and users, were confused when one day the production system no longer had a whole bunch of records.  They had, of course, forgotten to change the paths in the source code before deploying to production, so the production application was hard-coded to look for things on the test server.

Dumb.

First, do not hard-code.  But if you must (or if for any reason a part of a program ought to behave one way in one environment and a different way in the other, the best thing to have is all of that being in the one file, and have the behaviour of the file change depending on the current environment.

A bit in that spirit:


   
Reply
#2
Revisiting the "dev" and "prod" meta-programming macros
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  BAM: New version:Program Tags and New Program Defaults CharlieJV 2 799 07-07-2023, 01:09 AM
Last Post: CharlieJV
  BAM "dev" and "prod" directives CharlieJV 8 1,929 11-22-2022, 07:27 PM
Last Post: CharlieJV

Forum Jump:


Users browsing this thread: 1 Guest(s)