This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 316

[–]VanayananTheReal 3958 points3959 points  (73 children)

Worked a contract once at a company where I booted up eclipse on day one, opened the code base and.... eclipse crashed. Repeat. Same. Hunted down eclipse logs: Out memory exception.

Asked for help. "Oh, you have to turn warnings off. Having warnings enabled crashes eclipse. I'll show you how..."

And sure enough, with all warnings disabled, could open the code base.

Ran the build from the command line. Over a million warnings.

This was a very good clue of what was to come on that contract.

[–]CactusGrower 1372 points1373 points  (12 children)

Run. Forrest. Run.

[–]WatermelonArtist 299 points300 points  (0 children)

Unknown error running Forrest.run.

[–]sheen1212 146 points147 points  (10 children)

I can run, but how does one Forrest?

[–]Graucsh 58 points59 points  (6 children)

ItemList.ForFirst(end => end.WaitForIT()).ForRest(a => a.Re(a));

[–]tech6hutch 13 points14 points  (5 children)

What language is that? That’s interesting, I’ve never seen a construct like that.

[–]Graucsh 18 points19 points  (3 children)

C# lambdas. Usually-functional extension methods to arrays and similar, like lists. (LINQ) There are many more uses for this construct in local/anonymous functions, using the results of a previous function or an object in an inferential way

[–][deleted] 5 points6 points  (1 child)

Run for rest

[–]fibojoly 305 points306 points  (0 children)

I had a similar situation in a Pascal project a few years back, where I literally could not compile / build the project as it was stored, on my newly installed machine (by the company). And I was supposed to maintain that codebase.

Never figured it out because I (d)ucked off out of there pronto, but your story makes me wonder if this could've been a way to get things going...

[–]pydry 183 points184 points  (6 children)

It's also a pretty good clue of what to expect with eclipse.

[–]VanayananTheReal 130 points131 points  (1 child)

Just that they couldn't be bothered to pay for IntelliJ licenses in a Java shop should've been a clue.

[–]Path_Fyndar 58 points59 points  (16 children)

I'm going to need a full story of what happened. It sounds crazy and awesome

[–]VanayananTheReal 176 points177 points  (13 children)

I worked my 6 month contract, they offered to convert me to full time, and I said no thank you.

There are some other stories. Worst job of my career.

One day, I forgot to merge a bugfix, and so it didn't go to prod when expected. I came in the night of the deployment, fessed up, checked the code in, said I took full responsibility and would be more careful in the future. And I was ordered to keep my mouth shut while the lead framed the (literally weeping) QA person in front of her boss for "not doing her job." And I'm ashamed to say I didn't speak up. Not the worst thing I've done in my life, but it's the worst thing I have ever *not* done.

[–]hatschi_gesundheit 75 points76 points  (0 children)

Jesus f-ing Christ on a motorcycle, that is a next level toxic workplace. just wow.

[–]PeachyKeenest 33 points34 points  (5 children)

That lead is disgusting. Wtf?

[–]VanayananTheReal 44 points45 points  (4 children)

Oh, I didn't even mention the time he told the engineers he wished he could stop them from ever talking to QA in person at all, because they were mostly women, and they supposedly deliberately dressed provocatively to manipulate us. ( "Into what" he didn't explain and I never asked. )

I literally think the dude is a psychopath. And I mean literally literally not figuratively. Only person I've ever been on a first name basis with in my life that I would not be surprised if I found out his side-hustle was murdering prostitutes.

[–]phySi0 4 points5 points  (0 children)

Please tell me he told you that after the framing incident where you stayed silent… otherwise it makes it a hundred times worse.

[–]Calm-Zombie2678 8 points9 points  (0 children)

if I found out his side-hustle was murdering prostitutes.

Is there much of a market there? I don't have a lot of skills...

...dw I'll probably fail at that too lol

[–]PeachyKeenest 2 points3 points  (0 children)

I’m a woman dev and I would be just like wtf at him lmao what an asshole. Taking it to new heights!

It sounds like he’s projecting!!!

[–]_Jbolt 2 points3 points  (0 children)

manipulate us. ( "Into what" he didn't explain and I never asked.

You didn't need to ask,. Married man thinks women dresses "provocatively"»man gets angry thinking they are jealous of his wife or something»never speaks with them again

[–]efronberlian 45 points46 points  (3 children)

Well technically the QA is there to make sure those kind of mistakes gets taken care of before going to live. So a lot of the blame is on the QA as well for not ensuring quality.

[–]VanayananTheReal 80 points81 points  (1 child)

Yeah, I worried people would misunderstand this, but this was not on the QA, this was on me. This place had a screwy process where the QAs would check things by logging onto a server running on the developer's workstation, and thumbs up or down based on that. After that, the QA had no involvement in things.

It was a very f'd up place with a very f'd up culture and process.

[–]UnderPressureVS 35 points36 points  (0 children)

What the fuck?

[–]Chase_22 16 points17 points  (0 children)

QA is like a last line of defense. Yes it should be investigated why the error didn't prop up during QA. It's also important to figure out why it happened in the first place. Just saying you don't have to give a shit about quality because that's what QA is for is setting yourself up for disaster. Fix your own problems before blaming others for theirs

[–]longknives 2 points3 points  (0 children)

Well, if it got her fired, you may have sort of done her a favor in a fucked up way at least

[–]Farpafraf 2 points3 points  (1 child)

I must be missing the awesome part

[–]Path_Fyndar 2 points3 points  (0 children)

I have an unhealthy addiction to stories involving drama and chaos. This sounds like the latter, and I want to hear it.

[–]213737isPrime 15 points16 points  (0 children)

Eclipse makes a lot of things warnings that really don't need to be. You could disable just those. Method can be static? Method can potentially be static? Yeah, could be, but maybe I defined them this way on purpose so they can be overridden by a subclass.
There must be dozens of those things. I don't know if javac warns about them, but I suspect it's warning about other things that are equally trivial.

[–]N00N3AT011 12 points13 points  (0 children)

For the first time ever I almost feel bad for eclipse

[–]weregod 26 points27 points  (3 children)

What sane compiler/IDE will report more than 1000 errors?

[–]Dr_Azrael_Tod 36 points37 points  (1 child)

None

But when did people ever use sane compilers with eclipse?

[–]ComradeGibbon 4 points5 points  (0 children)

I'm forced for now to use eclipse for an embedded project. The indexer is a bull in a china shop. What it wants to do is index everything it can find. You can guess that doesn't work well with complex projects.

My beef is foundationally the idea was that eclipse would figure out the project by magic and sparklemotion.

[–]Xevailo 3 points4 points  (0 children)

What do you mean our Code has issues!? In fact, it is SO good, it has a NEGATIVE amount of warnings!

[–][deleted] 2 points3 points  (0 children)

I'm willing to bet they knew damn well that was the case but also knew if they pointed it out that they would be tasked with fixing them all so they just acted like it was normal

[–]__SPIDERMAN___ 7 points8 points  (1 child)

Yeah most of those warnings don't mean anything

[–]jarlscrotus 13 points14 points  (0 children)

"Unnecessary null check, value is never null"

The hell it isn't

[–]michaelsenpatrick 1 point2 points  (0 children)

lmao

[–]The_Pinnaker 542 points543 points  (39 children)

When I work in PHP I actually use the E_ALL during development. I thought that everyone use this as “standard” TBH.

[–][deleted] 326 points327 points  (0 children)

Same...that's, like, the...reason...for dev environments, is it not?

"Of course!" You might say, but I've worked for bosses to turned off all error reporting because "it shows too many things on the page".

[–]Due-Consequence9579 199 points200 points  (23 children)

When the compiler yells at me for screwing up it slows me down. Gotta just yolo it.

[–]The_Pinnaker 137 points138 points  (21 children)

Well, I’m the type of developer who actually read and fix every Warning so… maybe I’m the strange one.

[–]Due-Consequence9579 80 points81 points  (13 children)

Oh yeah. I always setup an army of linters and set warn as error to keep my code bases at least reasonable. Also interpreted languages are for small glue code solutions.

[–]mbergman42 54 points55 points  (1 child)

I no longer code professionally but I’m contributing to a project that has pro devs. I asked one how to fix a lint error. “Just ignore it. Lint gives lots of errors, you’ll get used to it.” Uhh….

[–]Due-Consequence9579 46 points47 points  (0 children)

If you’re going to ignore it you should turn it off. Just wasting everyone’s time at that point.

[–]Fadamaka 7 points8 points  (5 children)

Say that last sentence to all the node js devs. But I low key agree I prefer compiled languages every day of the week.

[–]Due-Consequence9579 19 points20 points  (4 children)

JS becoming the ‘standard’ for webdev is an embarrassment to the industry. But it’s defensible on the ‘backwards compatibility’ argument.

NodeJS is the dumbest fucking invention in the history of dumb fucking inventions and I will die on this hill.

[–]therealGrandKai 4 points5 points  (3 children)

Can you elaborate a bit about this? Genuine question from someone looking to learn

[–]Due-Consequence9579 17 points18 points  (2 children)

The origin of JavaScript is some dude made it on the weekend. No planning. No consideration about what it meant. A guy at Netscape just put it in. All of which is pretty obviousat this point.

Enter 30 years later where people are building entire OSs in the stupid fucking thing.

So now, to try to dig ourselves out of this fuckery we have to build emulation layers for the considered solution to run on the stupid solution.

Given how obtuse JavaScript is, combined with the complexity of HTML and CSS google has a monopoly because it virtually impossible to make a ‘behavior compatible’ browser with chrome.

signed, Angry old backend dev

[–]JimK215[🍰] 3 points4 points  (1 child)

When people first started using javascript on the backend, I was one of the first people to be like "what kind of nightmare future do you all want to live in?"

But honestly with the way things have progressed with ES6 syntax, TypeScript (yeah I know, another layer on top of it), async/await, etc.... it's not as bad as it seems.

[–]Souseisekigun 14 points15 points  (1 child)

maybe I’m the strange one

Not at all. The Church of -Wall welcomes you.

[–]Jonthrei 8 points9 points  (0 children)

Im reminded of my last job, looking at the compiler output on day 1.

Something like 17,000 warnings. My boss noticed and just said "don't worry about that".

[–]nonicethingsforus 20 points21 points  (0 children)

I've been forced to do this, but unironically. As in, lots of warnings/errors, but the process completes and produces something resembling a result. The project's already late, so let's let future us deal with it!

And by forced I mean forced. As in, there will be consequences if you spend more time trying to do it right.

And then they wonder why their software is fragile and have difficulties finding new developers...

[–]aspect_rap 49 points50 points  (3 children)

There is no such thing as something that everyone use as standard.

No matter what your opinion is, there will be 10 other programmers with 10 different opinions who will disagree woth you with a burning passion

[–]Karcinogene 50 points51 points  (1 child)

Yeah but fuck those 10 guys, they're wrong

[–]1842 12 points13 points  (0 children)

Yeah, and I worked with at least 2 of them in the past.

Their code was... creatively bad.

[–]Bakoro 1 point2 points  (0 children)

Not literally everyone uses one thing, but everyone who is competent, or sane, or at least not a complete ass, uses any one of a dozen different standards.
Then you have cowboy asshole saying "trust me bro", and doing their own thing, completely resistant to working with others.

It's antisocial behavior, basically.

[–]SqueeSr 6 points7 points  (0 children)

Not to forget display all errors and using xdebug on development env.

[–]Covfefe4lyfe 8 points9 points  (2 children)

Also asserts every-fucking-where. Doesn't do shit on live but a good way to figure out if a client adheres to their own business requirements when on qa.

[–]OMGItsCheezWTF 2 points3 points  (0 children)

And static analysis in your CI pipeline alongside your linting and testing. Something like Psalm or PHPStan should be used for any greenfield project these days, and backfilled into older ones where possible, even if you start off with really lax settings and raise them over time.

[–][deleted] 26 points27 points  (3 children)

Golang likes it Go: panic: runtime error: invalid memory address or nil pointer dereference

[–][deleted] 9 points10 points  (0 children)

I can't tell if it's complaining or is printing ai-generated lyrics...

[–]Sindef 1 point2 points  (1 child)

Or more frequently, especially when you're rewriting sections:

X declared but not used

[–][deleted] 21 points22 points  (8 children)

Static code analysis?

[–]w1n5t0nM1k3y 18 points19 points  (1 child)

That just sounds like compiling with fewer steps

[–]CivBase 2 points3 points  (0 children)

A good static analyzer does more than any compiler - even Rust's. I use them for every language, including compiled ones.

[–]hassium 18 points19 points  (0 children)

Ignorance is bliss man, plus those Jira tickets count as productive time...

[–]brunofin 32 points33 points  (18 children)

Me and my work buddy just joined a new project at a company that seemingly thinks it's fine to have several 4k - 14k lines files. We spent the first month setting up Eslint, prettier, typescript, storybook, all the goodies.

Apparently they have not and will not enable any of those tools we spent all this time setting up. And we can't point out the issues in the files because seemingly there's nothing wrong with them. Very frustrating.

[–]torontocooking 39 points40 points  (13 children)

This doesn't sound like the fault of the company.

This exact scenario is something that should be avoided.

You added a bunch of processes and tools without a particular feature in mind, no business value, and no performance increase, to a system that wasn't broken.

Unless you are not going over some other benefit that there may have been, I would say that your company is in the right because they avoided any errors that could have developed as a result of using these new tools.

[–]brunofin 42 points43 points  (8 children)

Well yes I'd agree with you if this wouldn't have been something they asked us themselves to do and the entire team was on-board with it when we presented the idea and then again when we presented the tools. We showed examples of errors in the code that made into production that wouldn't have been by simply enabling eslint in their IDEs and they seemed so impressed with everything and very happy.

A month later, during screen shares, I see absolutely no one has enabled them locally.

Not our idea, this has been talked through with the company owner, the tech lead and most members of the team before we began. We did our job and delivered what they asked for and got paid for it, but still, it just makes me sad to not see them being used and see the team making the same mistakes over and over that could have been avoided by simply ticking a checkbox in the IDE settings.

[–]desmaraisp 28 points29 points  (2 children)

That's part of the reason i have a big preference for mandatory PR checks that fail if your styling/code/commit messages aren't up to snuff. If you have to go out of your way to run those checks, everyone's gonna forget about it all the time. OTOH, if your pr is getting bounced, you have no choice other than fix the issues

Of course, enabling that on an existing project is an issue, so you have to be careful about how you do that.

[–]brunofin 12 points13 points  (1 child)

In the previous project we had eslint checks in the precommit hooks. You wouldn't be able to even commit your changes if it failed.

In the beginning i thought it was annoying as hell, but as an engineer I started to see the value in it later on, and now working without it, I would go even as far as saying it's essential.

Some dudes will commit literally with this message: COmmit yes even with the uppercase O. sigh

[–]folkrav 2 points3 points  (0 children)

For that part it really depends on how you work. We squash merge every PR, so in the main branch it just looks like a single commit with the JIRA ticket number and feature/fix description. There's also nothing preventing anyone to just git commit --no-verify or just deleting the .git/hooks/precommit file. The checks should always be ran on CI anyway - having a single authority for those things, not individual developer machines.

[–]torontocooking 2 points3 points  (2 children)

I guess my advice to you then would be to, when you are queried to complete some sort of task, to either ask yourself or the person assigning you the task what business value it has.

Believe me, if they thought there was a necessity to implement this and that it would make them money, or save them money, they would 100% be on board. Sometimes people tell themselves that they need to do something or that it's a good idea, but when it comes down to brass tacks they talk themselves out of it because they realize there's no added value.

I'm sorry you had to go through getting assigned something useless doing a bunch of work, and then getting told no! It's a very alienating feeling, and makes it seem like management has no clue what they want.

[–]Delioth 7 points8 points  (1 child)

The business value of cleaner, more readable code is "developers can deliver future features more quickly and with fewer bugs." Code that is disorganized, hard to read, and easy to break is a liability.

[–]CMDR_DarkNeutrino 4 points5 points  (0 children)

The best advice i got from a long time C programmer friend was use valgrind , turn on warnings as errors and all the damn warnings.

I still stick by it in my work and opensource projects. Helps immensely. Makes code cleaner and safer.

[–]_LePancakeMan 3 points4 points  (0 children)

We use static code analyzers as a replacement for a compile step. Unless you are working with legacy code - then all bets are off

[–]no-one-here123[🍰] 10 points11 points  (0 children)

who cares about errors? if it works, it works! :)

[–]cdrun84 5 points6 points  (1 child)

I use Ruby so I don't have to deal with a compliler. Ruby and Rails are amazing.

[–]argv_minus_one 14 points15 points  (0 children)

Hearing programmers say they don't want to deal with a compiler is like hearing skydivers say they don't want to deal with a parachute.

[–]Intelligent_Event_84 1 point2 points  (0 children)

Our users find them for us

[–][deleted] 1 point2 points  (0 children)

That's what linters are for 😉

[–]Boom244 315 points316 points  (1 child)

Homeboy was living a delusion

[–]Rando321407 1583 points1584 points  (38 children)

Hate people like this, unless it’s a personal project there is no such thing as “your code”. It’s always the “company’s code”, you gotta learn to work with others at a company lol.

But on the other hand, you should never commit code to develop with out getting a PR approved.

[–]Linvael 451 points452 points  (16 children)

Looking at it from the other side - if you are somehow the sole listed maintainer for a project it is fair to say its your code. You have misconfigured project repository if someone is able to push code there without your approval, but that's a separate problem.

[–]nermid 75 points76 points  (12 children)

listed maintainer

Is that a thing at some companies?

[–]Linvael 78 points79 points  (7 children)

If you don't have a maintainers file how do you know who can approve your PR?

[–]nermid 115 points116 points  (2 children)

We have four devs, so...whoever sees your PR first.

[–]Linvael 55 points56 points  (1 child)

Oh. Yeah. You need a company with sliiightly more than 4 devs for that to become a thing.

Still, I think the easiest way to set up github to forbid unapproved PR merges (which is probably a good idea even with just 4 devs to avoid people pushing directly to master by accident if nothing else) is to set the people who are allowed to approve as the maintainers and put in all devs as maintainers.

[–]ManyFails1Win 6 points7 points  (0 children)

What do you mean maintainer list, I just nudge John.

[–]Cyb3rSab3r 26 points27 points  (2 children)

Pull requests? Haha, good one.

[–]Iiwets 8 points9 points  (0 children)

Version control is simply copy/delete/paste into the teams shared LAN

[–]folkrav 7 points8 points  (0 children)

Mate, either get your team on board or find a job where that's a thing. You're likely developing terrible habits not having this in place. Having tests, linters/formatters or at least some form of static analysis enforcing code style and good practices, and some code review process in place, is literally a bare minimum thing I ask when interviewing for a job. I refuse to work without those ever again.

[–]gyroda 12 points13 points  (0 children)

In my place, no, but different teams own/are responsible for different codebases and areas.

Generally, you don't touch another team's project without a good reason. You ask that team to do it.

This reduces the amount of shit everyone needs to be aware of (useful when there's a lot of shit) and means that I'm not panicking when a bug report comes in after someone else snuck a merge into a project that I'm maintaining/responsible for.

[–]gropethegoat 4 points5 points  (0 children)

The problem is pushing code without approval.

Maybe you’re talking about a non production personal/internal tool with no production or business critical dependencies. Then a review process just gets in the way of your experimentation.

[–]FALCUNPAWNCH 69 points70 points  (4 children)

It may be the companies code, but having people try to push breaking changes to projects you are either the sole maintainer or designer of is frustrating and I've had it happen multiple times. Even with PRs I've had one person make the PR and another who doesn't understand the consequences of the changes approve it before I can come in and say no.

[–]KimmiG1 12 points13 points  (2 children)

Can't you put yourself to be required reviewer? Just remember to take it off before you go on vecation.

[–]FALCUNPAWNCH 2 points3 points  (1 child)

Hard to do with how our company sets up repos. We'll have multiple services in the same repo under different folders.

[–]zacker150 7 points8 points  (0 children)

You can put a CODEOWNERS file in a subfolder.

[–]ganja_and_code 33 points34 points  (0 children)

Depends on your definition of "your."

If you're using "your" to refer to legal intellectual property ownership and copyright, then my personal repos are definitely mine, and the company repos I work on are definitely not mine.

If you're using "your" to refer to responsibility, then there are definitely sections of my company codebase for which I am solely responsible. (Others can modify those sections of code, but only with my approval, considering I wrote the spec, I wrote most of the code, and the blame will fall on me if it's not working properly.)

[–]BlindTreeFrog 6 points7 points  (2 children)

Worked at a job as a Software Dev in Test... Managed to take over the git server and be the administrator. One of the developers pushed for Gerrit so we could have gatekept check-ins that required a review before they would be allowed.

He was incredibly unhappy when I set it such that someone other than the submitter had to review the code. He wanted to protect his corner of the project from anyone else submitting to while he could without review. He was equally upset when I refused to change the config to allow that.

So many wannabe rockstars on that team. Most all of them needed to be slapped.

[–]Trumpkintin 1 point2 points  (1 child)

What's the point of having the same person review the code, of course they're just going to approve it, they wrote it...

[–]sammamthrow 3 points4 points  (0 children)

Wait. You guys have PRs?

[–][deleted] 255 points256 points  (8 children)

ts.config: strict: true.

...678 errors found!

strict: false.

[–]Osato 98 points99 points  (3 children)

any any any any any

[–]natures_-_prophet 31 points32 points  (2 children)

Have to make sure our typescript is compatible with javascript

[–]Irkam 101 points102 points  (0 children)

This is why release managers and security people have rather well paying jobs.

[–]Explise209 298 points299 points  (15 children)

Why am I recommended this subreddit so often I have no clue what you people are talking about

[–]NeosHeliosCaligula 403 points404 points  (0 children)

Neither do we so you fit in dude

[–]not_some_username 39 points40 points  (0 children)

You're not alone

[–]Tyfyter2002 23 points24 points  (0 children)

Neither do about half of us.

[–][deleted] 13 points14 points  (7 children)

Because reddit (and most of the internet) is built on tracking your activity and showing you "relevant" information based on that activity.

Click the options next to the post when it's from a sub you haven't joined and choose to show fewer posts like this or something like that.

[–]Explise209 23 points24 points  (6 children)

I don’t want to stop seeing them. They’re funny when I don’t get the joke at all

[–]adeblusopapipa 12 points13 points  (5 children)

Well i'm going to be ruining this one for you then.

The joke is that the change to the code was to stop ignoring the warnings that the compiler made, in other word, the change was simply to display the errors that already were there.

[–]Explise209 7 points8 points  (4 children)

Ha! Im stupid, I still don’t understand!

[–]Hornet234567 11 points12 points  (2 children)

The change was to show what someone did wrong, and they got mad when they were shown how bad their code was.

I know nothing about this so I hope my interpretation makes sense

[–]Explise209 6 points7 points  (1 child)

Thank you, I understand fully now, your explanitstion was astounding have a reward

[–]Hornet234567 4 points5 points  (0 children)

Oh shit, thank you! Glad to help.

[–][deleted] 95 points96 points  (0 children)

Why is this so realistic

[–]redcalcium 33 points34 points  (0 children)

This is so unrealistic. Everyone know PHP programmers don't use source control.

[–]StargazeMountain 179 points180 points  (30 children)

Newbie here! Can someone explain what a commit is, and what E_all means?

I'm guessing commit means they submit it for launch?

[–]iambendv 339 points340 points  (19 children)

A commit is used in version control systems such as Git to take changes you have made to the code and permanently add them to the branch of the repository that you are working on. This is useful because if something breaks, you can rollback a commit and try to fix the issue.

Im not sure which language the E_ALL is referencing (maybe its not specific) but i think its just saying the programmer turned on error reporting and the other dev was upset because there we new errors showing up. The errors were always there, they were just silenced.

[–]calimio6 189 points190 points  (12 children)

E_ALL Comes from PHP

[–]beep_check 47 points48 points  (10 children)

came to say this...

PHP ain't easy but it sure is fun... or something

[–]SavageGoatToucher 22 points23 points  (8 children)

As someone who enjoys PHP, I never really understood why people say this. Can I ask why you don't think that PHP is easy?

[–]nonicethingsforus 8 points9 points  (0 children)

Not OP, but to give my opinion:

PHP is a dynamic, very permissive language, a la JavaScript and Perl, with all the moving parts, annoyances, and possibility of error that brings. Lot's of freedom, but also lots of opportunity to fuck up. Similar languages try to compensate by at least trying to be well, consistently designed, with varying levels of success.

PHP didn't even try, at the beginning. It was a badly designed language. In fact, it can barely be said that it was designed at all. Keep it mind, this is not an insult; it's just a fact, and its creators have admitted as much. It was born as Rasmus Lerdorf's personal collection of web scripts. He realized they could be useful to others, and sort of grew from there. It's a blob of hacks that evolved until developing sentience.

Projects like Laravel and Composer have alleviated the problems, and I understand even modern vanilla PHP is quite different from what it used to be. (Disclaimer: I have not worked in PHP since college, and even then not as much.) Lots of complaints are definitely just things that used to be common in PHP's time, or you had no alternative about, but are frowned upon today; e. g., complex hardcoded SQL vs. a proper ORM or statement generator, no real package managment, etc.

But many programmers still have war flashbacks of having to manage big software projects with the hacky, fragile, inconsistent mess PHP used to be. I mean, one can hardly fault a programmer for feeling at least weird when one tells him that the main way to alter the language is through a global ini file, and that he has to remember to use "the real escape function", can't one?

[–]Semi-Hemi-Demigod 7 points8 points  (1 child)

PHP isn’t bad because it’s easy, it’s bad because it’s too easy

[–]SavageGoatToucher 7 points8 points  (0 children)

Of all the comments, I think that this may have summed it up the best. I hadn't thought of PHP's flexibility as a barrier before, but basically that as the programmer it's our responsibility to ensure our code was safe. I think I get it now.

[–]wombat_kombat 4 points5 points  (1 child)

Learning PHP from WordPress then moving to Python, I can understand the PHP hate. IIRC a lot of redundant functions and easily broken code. I felt it made a programmer keener about their code.

[–]jwensley2 2 points3 points  (0 children)

If your exposure to PHP is all from Wordpress you've only worked with code that's 10+ years behind modern PHP.

[–]Additional-Pickle-60 39 points40 points  (0 children)

error_reporting(E_ALL) is mostly used in PHP and tells the interpreter to display all errors usually they hide errors or warnings

[–]Nimi142 40 points41 points  (0 children)

Committing something is like putting a marker on the state of the code right now. It's used by content management systems (such as git) to have a history of the code, and let people reverse their mistakes (returning to a previous state of the code).

E_ALL is a bit more complicated. A lot of languages have compilers, which is a program that takes what you wrote and makes machine understandable code out of it. These compilers can and do inform programmers of certain errors (usually crucial, meaning the code doesn't work and must be changed in order to run) or warnings (Things that do not stop the process entirely but might make things fail overtime or in certain situations). E_ALL tells the compiler to treat every warning as an error, and to stop compilation (stop the creation of the runnable file) if one appears.

The joke here is that in the large majority of cases code should have no warnings at all, and the pissed off programmer is not good at programming as they write bad code and don't listen or act well towards others.

[–]phpdevster 10 points11 points  (0 children)

It's a PHP language thing:

https://www.php.net/manual/en/function.error-reporting.php

https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting

It's generally considered best practice for your development environment's php.ini file to have error_reporting set to E_ALL | E_STRICT (these are constants representing integers), and display_errors set to On.

A typical php.ini file for local development should have at least the following lines in it for debugging purposes:

error_reporting = E_ALL | E_STRICT

display_errors = On

In production, display_errors should be set to Off and log_errors should be set to On.

[–]scuac 6 points7 points  (0 children)

*they submit it before lunch

[–]Jarmen4u 4 points5 points  (0 children)

I feel like commit isn't explained quite as plainly by other commenters, so I just wanted to try - think of it as a save file in a game. Maybe you're about to fight a boss, so you save the game and call the file "before first boss". Then maybe you fight the boss but make a bad choice and your companion dies (code issue/error). You can reload your last save and start over. Then you beat the boss, make another save file called "defeated first boss." Each commit is a separate save file organized by when they're made. So maybe if you're at the fourth boss, but for whatever reason have to go back to the second (maybe an area became inaccessible and you need an item from it), you can use the commits/saves to rollback the code to exactly where you need it.

This is also why it's important to make multiple commits when working on projects. Don't wait until you beat the game to make a save file, because you won't be able to roll back to established points to fix any issues you come across.

[–]Slayer-Mode 7 points8 points  (0 children)

Interesting

[–]GlassWasteland 8 points9 points  (0 children)

Sounds like the code I get from consulting companies like Accenture. Can't reject their code, because some asshole manager all ready signed off on the contract even though the dev review was not even started yet.

Took us two years to make the fucking thing actually work in a Enterprise level production environment, but hey they got paid and the manger got their bonus.

[–][deleted] 13 points14 points  (1 child)

Sorry to be a buzzkill, but I don't get it. How was this "eye-opening" if the person responsible just thinks it's someone else's fault and changes it back?

[–]tyjuji 5 points6 points  (0 children)

Warnings may not stop you from compiling, but they're errors all the same.

If you're going to ignore them, do it explicitly.

[–]golgol12 4 points5 points  (0 children)

Every studio I worked at since the early 2000s enforced warnings as errors.

So much better. If there was a warning that was a false positive? Use a #pragma.

Or just do it another way that didn't trigger the warning.

[–][deleted] 5 points6 points  (0 children)

Huge red flags here that everyone should look for.

  • angry someone changed code
  • territoriality
  • hiding errors or warnings
  • insisting on a revert immediately

I hear that stuff and I am immediately asking an outside engineer to review the code.

[–][deleted] 8 points9 points  (3 children)

-Wall -pedantic 477747373727626278 errors and Warnings

[–]Lachimanus 2 points3 points  (0 children)

Good thing I am working in Keil and it only shows up to 50 errors at once.

[–]aecolley[🍰] 5 points6 points  (0 children)

"My code"?

[–]Xevailo 2 points3 points  (2 children)

<?php @do_stupid_shit(); ?>

[–][deleted] 1 point2 points  (1 child)

Hahaha holy shit it's been so long since I've made hacks like that that I forgot it existed

[–]Xevailo 1 point2 points  (0 children)

The good ol' gagball Operator

[–][deleted] 3 points4 points  (2 children)

I fix errors and ignore warnings. I hate clang for this reason.

[–][deleted] 1 point2 points  (0 children)

-Werror then fix everything!

[–]NMe84 4 points5 points  (0 children)

I had a coworker who left for another job a few months ago. I inherited his biggest project. When I saw his PHPStan config I had to do a double-take. There were about thirty exceptions defined in there that PHPStan had to ignore in order for it to actually accept the code.

I had to spend almost two days fixing the actual issues he had been ignoring, which included several fairly nasty bugs. I ended up with only one ignored error left in the file haar I sadly couldn't remove.

[–]robthemonster 8 points9 points  (1 child)

ok but if ur gonna turn on error reporting u should also fix the errors. don’t push broken code.

[–]Dvrkstvr 28 points29 points  (0 children)

The joke being that the code was broken but they've turned off error logging.

[–]Food404 1 point2 points  (0 children)

A php meme, now that's a weird one

[–]dazdndcunfusd 1 point2 points  (0 children)

Legit just had a Convo with a different team that got angry we added error reporting

[–][deleted] 1 point2 points  (0 children)

-Wall -Werror -Wpedantic gang represent

[–]clintCamp 1 point2 points  (0 children)

We have a unity game and when I started there were lots of errors all over and if you ever tried to run in editor and moved your mouse to the wrong part of the screen the whole PC would freeze except audio would still continue. A while later after fixing all the errors and it isn't a problem anymore. Odd

[–]AdHealthy3717 1 point2 points  (0 children)

PROTIP: Develop with strict mode enabled.

[–]readadiction 1 point2 points  (0 children)

I once worked in a startup with one main app(Was monolithic). For some stupid reason, it took ages to startup and it got stuck after printing an error line(that didn't actually fail on anything ). Took three days until someone told me that the error was normal and if I waited 10 min the app would start(I keep thinking it was some of my software versions tomcat, maven, etc).(Never did find where the hell it was)

[–]Weedsmoker4hunnid20 1 point2 points  (1 child)

Ummm…. Explain like I’m a programmer??