Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
qntm
Jun 17, 2009

gold brick posted:

code:
 /**
   * Returns true if this error was marked as "fatal" by the _________
   * application. Normally fatal and non-fatal errors are treated the same 
   * by an application interfacing with __________.
   *
   * @return True
   * @deprecated As of 2012 R2, this method is obsolete.  It always returns true.
   */
  
  @Deprecated
  public boolean getFatal()
  {
      return false;
  }

I'm going to guess that this is part of an API which a lot of customers use?

Adbot
ADBOT LOVES YOU

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

gold brick posted:

code:
 /**
   * Returns true if this error was marked as "fatal" by the _________
   * application. Normally fatal and non-fatal errors are treated the same 
   * by an application interfacing with __________.
   *
   * @return True
   * @deprecated As of 2012 R2, this method is obsolete.  It always returns true.
   */
  
  @Deprecated
  public boolean getFatal()
  {
      return false;
  }

Avatar/Post Combo

Seriously how could such a long as comment be completely wrong?

Zamujasa
Oct 27, 2010



Bread Liar

Optimus Prime Ribs posted:

The morons whom my boss picked to host our servers have kept up their reputation of being incompetently unreliable; just came into work to find this on every site:

:thumbsup:
Not redirecting error logging to a file in production is the real horror.

(Then again, I can't figure out which is worse; no error logging at all or publicly visible error messages. I guess it depends on how many other horrors are present.)

Doctor w-rw-rw-
Jun 24, 2008

Zamujasa posted:

Not redirecting error logging to a file in production is the real horror.

(Then again, I can't figure out which is worse; no error logging at all or publicly visible error messages. I guess it depends on how many other horrors are present.)

You redirect logging to a file? Not syslog? :stare:

tef
May 30, 2004

-> some l-system crap ->

Doctor w-rw-rw- posted:

You redirect logging to a file? Not syslog? :stare:

/dev/log :smugdog:

Optimus Prime Ribs
Jul 25, 2007

Zamujasa posted:

Not redirecting error logging to a file in production is the real horror.

(Then again, I can't figure out which is worse; no error logging at all or publicly visible error messages. I guess it depends on how many other horrors are present.)

Yeah, I know I shouldn't be doing it, but everything about the system I work with (which is outside of my control) is a horribly broken mess, so I just said "gently caress it" since at that point it would pretty much just be putting lipstick on a pig.
I don't like where I work. :(

Zamujasa
Oct 27, 2010



Bread Liar

Doctor w-rw-rw- posted:

You redirect logging to a file? Not syslog? :stare:

I mostly meant switching PHP from "puke errors onto webpage" to using error_log; not necessarily one or the other. The important part is getting it out of the webpage and into a place you can track/review without interfering with the end-user, I guess.


Optimus Prime Ribs posted:

Yeah, I know I shouldn't be doing it, but everything about the system I work with (which is outside of my control) is a horribly broken mess, so I just said "gently caress it" since at that point it would pretty much just be putting lipstick on a pig.
I don't like where I work. :(

You aren't alone. Pretty much all of the files on our server have error_reporting(0) (or a similar equivalent using ini_set) glued to the top. I've given up on trying to fix the problems.

You might be able to get away with putting a .htaccess file with logging settings in the root of your web files if you can't modify php.ini for whatever reason, though. If you're not using Apache, there might be other ways.



Speaking of copy-paste cargo-culting, my boss recently stuffed some random <meta> tag into a bunch of our Ajax results because there was some problem with IE9 or whatever. I don't think he understands how these things work... It's a good thing we always return raw HTML :downs:

(Then again, this is the same person who wanted to add some hack to every page to stop Chrome from offering to translate from Czech instead of spelling his words right.)

Optimus Prime Ribs
Jul 25, 2007

Zamujasa posted:

You might be able to get away with putting a .htaccess file with logging settings in the root of your web files if you can't modify php.ini for whatever reason, though.

Don't have access to php.ini, any server settings, or even the www folder; I also don't have a dev environment.
Crap like that is why I don't have the motivation to do proper error logging, and even if I did I don't know where error_log logs the errors to; it's certainly not in any directory that I have access to.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
That sounds like institutionalized editing in production.

I don't think I could tell someone that that's sufficient to do my job. I'd feel responsible to change that procedure or, if that's not possible, find another job.

If that sounds like too strong a reaction, think about it once more.

Bhaal
Jul 13, 2001
I ain't going down alone
Dr. Infant, MD
Yeah, if I were in that spot I'd be campaigning for changes to those open heart surgery software development conditions. That and/or keeping an eye out for an opportunity elsewhere. At least state and document up front that this limits your control of the site. When the inevitable high visibility fuckup hits and a C-level type is looking for a head to roll you can say & show that you managed this up long ago and it was dismissed.

Wozbo
Jul 5, 2010

Optimus Prime Ribs posted:

Don't have access to php.ini, any server settings, or even the www folder; I also don't have a dev environment.
Crap like that is why I don't have the motivation to do proper error logging, and even if I did I don't know where error_log logs the errors to; it's certainly not in any directory that I have access to.

Do you guys at least have a svn repo or something? Spin up a VM if you can and try and migrate people to a deployment cycle.

Zamujasa
Oct 27, 2010



Bread Liar

pokeyman posted:

That sounds like institutionalized editing in production.

I don't think I could tell someone that that's sufficient to do my job. I'd feel responsible to change that procedure or, if that's not possible, find another job.

If that sounds like too strong a reaction, think about it once more.

I've been doing this for a while; we only recently moved to using some version control as an in-between and my boss is almost always angry that he can't SFTP his files any more. And that's ignoring that most of his commits had been "a", "1", or some random mush of letters. Of course everything is live, and rather than have a real development environment we just stick some letters to the end of the live folder and use that. (Bonus points: the files are often not kept in sync, and using version control with this kind of :psyduck: setup just makes everything even better.)

Judging from the sounds of things, I'd be willing to guess that there are a lot of hard-coded paths or other crap that would be hard to replicate, especially if he doesn't even have access to any of the files that control the options... and good luck getting anybody else onto a version control platform.



Another PHP horror from me. Apparently uncaught exceptions don't actually cause any sort of error logging to occur, or at least didn't on our server; the script just silently died and I had to manually root out where it was happening by peppering the entire script with something effectively boiling down to print "at point 3"; everywhere.

I don't know what would cause this because we don't have any exception-handling code (it came from an external module) and all other errors, warnings, notices, etc. were being logged just fine. That sent me on a nice wild goose chase for a few hours... it really didn't help that the rest of the code was about as solid as a Jenga tower, either.

redleader
Aug 18, 2005

Engage according to operational parameters
Currently looking through a function that is liberally sprinkled with
C# code:
return (isNotEqual) ? false: true;
It's amazing how something so small can be so incredibly aggravating.

nexus6
Sep 2, 2011

If only you could see what I've seen with your eyes

redleader posted:


It's amazing how something so small can be so incredibly aggravating.

Null Set
Nov 5, 2007

the dog represents disdain

Zamujasa posted:

I've been doing this for a while; we only recently moved to using some version control as an in-between and my boss is almost always angry that he can't SFTP his files any more. And that's ignoring that most of his commits had been "a", "1", or some random mush of letters. Of course everything is live, and rather than have a real development environment we just stick some letters to the end of the live folder and use that. (Bonus points: the files are often not kept in sync, and using version control with this kind of :psyduck: setup just makes everything even better.)

Judging from the sounds of things, I'd be willing to guess that there are a lot of hard-coded paths or other crap that would be hard to replicate, especially if he doesn't even have access to any of the files that control the options... and good luck getting anybody else onto a version control platform.



Another PHP horror from me. Apparently uncaught exceptions don't actually cause any sort of error logging to occur, or at least didn't on our server; the script just silently died and I had to manually root out where it was happening by peppering the entire script with something effectively boiling down to print "at point 3"; everywhere.

I don't know what would cause this because we don't have any exception-handling code (it came from an external module) and all other errors, warnings, notices, etc. were being logged just fine. That sent me on a nice wild goose chase for a few hours... it really didn't help that the rest of the code was about as solid as a Jenga tower, either.

If you're having problems with uncaught/unlogged exceptions everywhere, you could use register_shutdown_function. Set it up so it sends an email or writes to a log if the script terminates abnormally- at least then you'll have some idea of what's going on.

This is assuming that your pile of code has some sort of bootstrap script you can drop it into and be assured that it will always be registered.

Wozbo
Jul 5, 2010
Not to mention I think you can fiddle with it so that by default the errors are logged in /var/log/httpd/error_log even if php doesn't feel like cooperating.

Optimus Prime Ribs
Jul 25, 2007

Wozbo posted:

Do you guys at least have a svn repo or something? Spin up a VM if you can and try and migrate people to a deployment cycle.

Nope. No version control of any kind; I doubt anyone else working here has even heard of SVN or Git.
I don't plan on being here for much longer, so I'm not going to try to fix any of this mess.

Wozbo
Jul 5, 2010

Optimus Prime Ribs posted:

Nope. No version control of any kind; I doubt anyone else working here has even heard of SVN or Git.
I don't plan on being here for much longer, so I'm not going to try to fix any of this mess.

There is no :stonk: big enough. Have you ever set up a repo before? If not, this might be good experience. Where are your backups for code? I can't believe that a hard drive crash could potentially nuke your service.

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

Wozbo posted:

There is no :stonk: big enough. Have you ever set up a repo before? If not, this might be good experience. Where are your backups for code? I can't believe that a hard drive crash could potentially nuke your service.

It wouldn't! It's all "in the cloud". :allears:

Wozbo
Jul 5, 2010
Good lord, I would make a repo just because the second that poo poo pile does break I'd probably be blamed and not find out about it till the well was poisoned at any other job that calls in to ask (</Totally not paranoid about that poo poo>).

Zamujasa
Oct 27, 2010



Bread Liar

Null Set posted:

If you're having problems with uncaught/unlogged exceptions everywhere, you could use register_shutdown_function. Set it up so it sends an email or writes to a log if the script terminates abnormally- at least then you'll have some idea of what's going on.

This is assuming that your pile of code has some sort of bootstrap script you can drop it into and be assured that it will always be registered.

Only in one spot (we didn't even have a functions include until a few days ago :downs:). Error logging is on and logs everything fine, but for some reason the uncaught exception terminated the script without any idea why.


Optimus Prime Ribs posted:

Nope. No version control of any kind; I doubt anyone else working here has even heard of SVN or Git.
I don't plan on being here for much longer, so I'm not going to try to fix any of this mess.
Yep, that sure sounds like this place a while ago. If you guys are editing files live on the server (and that's exactly what it sounds like), the chances of converting them over now are pretty much nil; to these people version control gets in the way of their rapid prototyping development testing break-fix cycle. At least, speaking from experience.


Wozbo posted:

Good lord, I would make a repo just because the second that poo poo pile does break I'd probably be blamed and not find out about it till the well was poisoned at any other job that calls in to ask (</Totally not paranoid about that poo poo>).
You'd have to get everybody else in on it too, or you'd be committing their changes with your name on it. Might actually make things worse, if you're worried about blame -- you'd go from plausible denial to "oh, there's this thing called git blame and it says everything is your fault!"

Just a lovely situation all around, no doubt.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


I really hope I'm not the only person who mostly reads this thread to regain perspective and feel better about their own workplace and craftsmanship. It's like the CoC equivalent of the Darfur War Orphan.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
For me it's half that. The "it could be worse" angle.

The other half is me thinking "what have I done that should be in this thread".

Johnny Cache Hit
Oct 17, 2011
e: ^^^ :respek:

Optimus Prime Ribs posted:

Nope. No version control of any kind; I doubt anyone else working here has even heard of SVN or Git.
I don't plan on being here for much longer, so I'm not going to try to fix any of this mess.

Losing the will to live like this is surprisingly liberating. Until you find a new job I predict days of video gaming and forums trolling. Enjoy.

Doc Hawkins posted:

I really hope I'm not the only person who mostly reads this thread to regain perspective and feel better about their own workplace and craftsmanship. It's like the CoC equivalent of the Darfur War Orphan.

Every time I think about something stupid I've done or seen, I get happier after realizing I'm not being forced to push out unversioned changes to production.

But then I think about all the massively stupid things I've done that I need to post here...

Strong Sauce
Jul 2, 2003

You know I am not really your father.





I guess I should be pretty thankful I haven't worked at companies that do _really_ stupid poo poo like no version control.

Alliterate Addict
Jul 10, 2012

dreaming of that face again

it's bright and blue and shimmering

grinning wide and comforting me with it's three warm and wild eyes

Strong Sauce posted:

I guess I should be pretty thankful I haven't worked at companies that do _really_ stupid poo poo like no version control.

Don't remind me.

Zamujasa
Oct 27, 2010



Bread Liar

Strong Sauce posted:

I guess I should be pretty thankful I haven't worked at companies that do _really_ stupid poo poo like no version control.

Both places I've had the distinction of working at had no version control. The one before this actually made all developers install a Zend Guard-ed version of their software, and would only hand out HTML mockups of pages that needed to be coded. :downs: (You were also expected to hand in archived copies of your code, and would often not see it again if any changes needed to be made by the lead.)

Needless to say, it's really fun to work on code when any sort of error (including a mistyped MySQL query*, of course) would dump you on a totally different page by Header redirect, so the back button wouldn't work for that extra middle finger. Trying to track down Fatal Error: Call to undefined function d2NXGpqscYNJATOiybAH in IJDk9X99jHGNOxBt0tx4 on line 0 is a whole bunch of fun when you can't even see what the hell is going on. Even better, it makes everything entirely obtuse, so that there's no way to see if there's a function that already does what you need, for that extra development-lengthening challenge.


* No OOP or prepared functions here, just a bunch of crap like this:
code:
function query($q) { 
  $r = mysql_query($q); 
  if (!$r) { 
    header("Location: /error.php"); 
    die(); 
  } 
  eturn $r;
}

NovemberMike
Dec 28, 2008

I feel like I should post this here as well.

NovemberMike posted:

A co-worker decided to be helpful and remove all the extra whitespace inside the jquery selectors.

Bhaal
Jul 13, 2001
I ain't going down alone
Dr. Infant, MD
Was it some home-brewed sed/awk script gone awry and he didn't notice, or just :downs:?

NovemberMike
Dec 28, 2008

Pure :downs:. I got a note from QA telling me that one of the pages wasn't grabbing data from a dropdown menu correctly and I go to look at the source. I pretty much went from "oh hey, I don't remember adding those extra lines of whitespace to organize the code" to "WHO THE gently caress DELETED THE SPACES FROM MY JQUERY" in about 10 seconds. It's not a huge deal in the long run but I'm not sure how you think that changing anything that's in quotes is a good idea when you don't want to change the functionality of the code.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
What possible benefit can be had by deleting spaces from a selector? Even assuming you've memorized the grammar and can thus do the deletions without affecting functionality, you've, what, shaved a couple of bytes?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
For the record, in connection with the FizzBuzz thread, this is why. This is why companies don't take some noob's word that he can rewrite the company's code better.

Alliterate Addict
Jul 10, 2012

dreaming of that face again

it's bright and blue and shimmering

grinning wide and comforting me with it's three warm and wild eyes

pokeyman posted:

What possible benefit can be had by deleting spaces from a selector? Even assuming you've memorized the grammar and can thus do the deletions without affecting functionality, you've, what, shaved a couple of bytes?

The last company I was at, I cut bandwidth costs by some ridiculous number and greatly increased page responsiveness...by replacing all of the <!-- --> comments in index.php with <?php /* */ ?>.

3 megs of them. Don't ask.

In this case, I'd assume someone probably was just preoptimizing with s/\s+//g, instead of explicitly only removing spaces from jquery selectors, which makes a bit more sense.

A bit.

NovemberMike
Dec 28, 2008

Ursine Asylum posted:


In this case, I'd assume someone probably was just preoptimizing with s/\s+//g, instead of explicitly only removing spaces from jquery selectors, which makes a bit more sense.

A bit.

Nope. We're talking about a net increase in file size, he was just reorganizing so it looked prettier.

Alliterate Addict
Jul 10, 2012

dreaming of that face again

it's bright and blue and shimmering

grinning wide and comforting me with it's three warm and wild eyes
Hunh. Well, I don't have an appropriate smiley for that then. Carry on.

NovemberMike
Dec 28, 2008

Apparently it also looks cleaner if you delete my variables, create your own variables with different names and forget the correct syntax for initializing variables.

:downs:

Alliterate Addict
Jul 10, 2012

dreaming of that face again

it's bright and blue and shimmering

grinning wide and comforting me with it's three warm and wild eyes

NovemberMike posted:

Apparently it also looks cleaner if you delete my variables, create your own variables with different names and forget the correct syntax for initializing variables.

:downs:

This is...still javascript, right? That language where you don't even need semicolons? How do you forget initialization syntax :psyduck:

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
JavaScript code:
var a, b = 1, 2;

NovemberMike
Dec 28, 2008

Suspicious Dish posted:

JavaScript code:
 a, b = 1, 2;

Fixed that for you.

Adbot
ADBOT LOVES YOU

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

KARMA! posted:

It wouldn't! It's all "in the cloud". :allears:

Running on an Amazon EBS volume I'm sure. Those things neeeever fail.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply