r/tinycode • • Jul 12 '12

PHP print_r()

function printR($obj){ echo "<pre>" . print_r($obj) . "</pre>"; }

I use this on every php project now, it just formats the print_r function, which is mostly used for debugging, but its so much easier on the eyes.

39 Upvotes

60 comments sorted by

View all comments

Show parent comments

2

u/novelty_string Jul 13 '12 edited Jul 13 '12

Um, I can't code without it? How did you get that out of "for fucks sake stop using printr wrappers and install a debugger".

You've yet to demonstrate why a sys admin would not be able to install xdebug. Rather you're just making wild assumptions and personal attacks. Nice one.

Fact: any sys admin or php dev capable of running a dev environment should be able to install xdebug

Fact: xdebug makes life easier

Fact: easier life === better

Fact: you work in a fucked up env and are making excuses instead of trying to fix problems

Edit, reminds me of that other guy on r/php that tried to tell me notepad was just as good as a fully fledged IDE. Turns out he was developing on a 5 year old laptop and just couldn't run a decent ide. This is your position - your tools are fucked and you are stupidly defending them despite the facts.

Also

There's a million reasons someone may not install xdebug

Give me one.

2

u/oddmanout Jul 13 '12

Um, I can't code without it? How did you get that out of "for fucks sake stop using printr wrappers and install a debugger".

Well, you're willing to get someone fired over not having it. Sounds like you can't do without it. I mean... to get a guy fired... have you even thought about that? You'd send a guy home to his wife and kids without a job, without support because you just had to have xdebug?

You've yet to demonstrate why a sys admin would not be able to install xdebug.

Not be able, there's reasons he wouldn't do it. It causes some configurations of php to crash, there's already debug software, you don't own the server (coding on a client's server), certain regulations such as HIPAA and FERPA require certain standards for software. Ever do work for DoD? They have their stuff on lockdown. If it's not required for the site to run, you don't install it. Super old versions of php. Super old servers, in general. It could be that the CIO, himself, is a douchenozzel and doesn't want what he deems unnecessary software.

Yea, if you're going to try to get my sysadmin fired, or go over my head and get me fired over that, I certainly don't want you on my team. I don't know if you realize this but your leads and your PMs shelter you from a lot of the politics that go on at your company, it's part of their job. (unless you work for a small company that doesn't have politics). There's a million things going on that you never even see.

If you can't adapt, software development is not your field.

Out of curiosity, how many developers are in your company, and how many are on your team?

0

u/novelty_string Jul 13 '12

This is obviously going nowhere. Let me sum up:

Noobs post "look at my printr wrapper". Other noobs go "wow almost as good as mine". People try to suggest xdebug and noobs say "too hard to install/boss says it's too hard to install/everyone at dumb company is too stupid to install".

My position is that it's not hard to install and if your boss says that they are incompetent, and you might try to educate them/replace them with yourself/whatever - this is very general without any context.

Your position seems to be that wanting xdebug and expecting a sys admin to install it is unreasonable. I strongly disagree based on 1) it's really helpful and 2) not hard to install and 3) the php defacto debugger. If you are in some bizarre situation where helpful tools are blacklisted, then I feel sorry for you, but that is not relevant to my point.

2

u/oddmanout Jul 13 '12

Your position seems to be that wanting xdebug and expecting a sys admin to install it is unreasonable.

My position is that if you can't deal with not having xdebug so bad that you're willing to get your sysadmin fired over it, you've got serious problems.

→ More replies (0)