WTF Bites
-
Unless that's some form of open-source code, I'd say that's an instant reason to not waste any more time on that one.
It's a commercial e-commerce website for an international company.
I don't think so.
-
@cartman82 Setting aside the access WTF (anything worth saying about it has already been said), I don't know PHP well enough to get why this is a second WTF. Could anyone elaborate on that?
-
@cartman82 Setting aside the access WTF (anything worth saying about it has already been said), I don't know PHP well enough to get why this is a second WTF. Could anyone elaborate on that?
Nothing in particular regarding PHP. This is Laravel, so a trained monkey could feel their way towards making a working website.
It's more the little things:
-
Executing DB update directly from web request (this is maybe a thing with Laravel, but I'd always put in at least a 2 layer structure)
-
Inconsistent spacing
-
Swallowing the real error message, returning that awful hardcoded text message.
It's hard to tell with laravel, as it does so much for you, but this code reeks of mediocrity.
-
-
@cartman82 said in WTF Bites:
- Swallowing the real error message, returning that awful hardcoded text message.
How do you get the error message from these calls (
update
andupdateById
)? They don't appear to throw exceptions or return a string... or maybe that's the WTF?
-
@cartman82 said in WTF Bites:
Swallowing the real error message, returning that awful hardcoded text message.
I'd suspect that this is a publicly displayed error message. In that case, that's actually the only correct thing to do.
-
I'd suspect that this is a publicly displayed error message. In that case, that's actually the only correct thing to do.
"Error with a database!"
With an exclamation mark.
Really?
-
How do you get the error message from these calls (update and updateById)? They don't appear to throw exceptions or return a string... or maybe that's the WTF?
No idea. I don't Laravel.
So maybe I am TRWTF.
-
@cartman82
Well, I meant the "hardcoded" part, not the actual message.
-
@cartman82 said in WTF Bites:
Swallowing the real error message, returning that awful hardcoded text message.
I'd suspect that this is a publicly displayed error message. In that case, that's actually the only correct thing to do.
As a developer, I prefer when the actual error appears on the screenshot the user sends us. Our application does have a "user-friendly" mode that hides the scary error messages, but I view it with equal contempt as Windows Explorer's "user-friendly mode" that hides the scary file extensions.
-
As a developer, I prefer when the actual error appears on the screenshot the user sends us.
Sorry, but database exceptions/errors absolutely have to be hidden to avoid exposing sensitive information.
-
As a developer, I prefer when the actual error appears on the screenshot the user sends us.
Sorry, but database exceptions/errors absolutely have to be hidden to avoid exposing sensitive information.
That's a good reason. Our application has no sensitive information barring the user password in login errors, and I personally made sure it's never included in error messages -- or logs.
-
Sorry, but database exceptions/errors absolutely have to be hidden to avoid exposing sensitive information.
Sort of agreed, but it's not that big a deal.
If I had to chose between user sending us error printouts and user sending us "code 500", I'd pick the former. Of course, the correct way is for system itself to report errors and all that, but that can take dev time (depending on the setup).
-
Our application has no sensitive information
Connection errors might still expose sensitive information about your infrastructure.
-
@cartman82 said in WTF Bites:
Swallowing the real error message, returning that awful hardcoded text message.
I'd suspect that this is a publicly displayed error message. In that case, that's actually the only correct thing to do.
As a developer, I prefer when the actual error appears on the screenshot the user sends us. Our application does have a "user-friendly" mode that hides the scary error messages, but I view it with equal contempt as Windows Explorer's "user-friendly mode" that hides the scary file extensions.
Meanwhile, I'm glad they don't consider that information confidential enough to make us encrypt the log file.
-
I don't Laravel much but this looks like it's actually bouncing down to Symfony's handler rather than Laravel (which uses input rather than get). These could easily be GET or POST, and while it's possible things like auth are being handled at the middleware/routing stage, not convinced of it, so this could easily not be authenticated.
The WITH part means it's going to be redirected to wherever with the message in a session flash, so god knows what will happen next.
Also, shitty error message.
-
Also, shitty error message.
Wanted to try cartmans job thingy after updating VS:
-
@swayde Does your project reference mscorlib? (if it doesn't, I guess the WTF would be that it's no longer automatically added on project creation)
-
@swayde Does your project reference mscorlib? (if it doesn't, I guess the WTF would be that it's no longer automatically added on project creation)
It seems it was just indexing or somesuch, it went away after a few minutes.
-
CEO doesn't like how PDF viewer looks in her browser, so she is now asking Team 2 to convert all documents to JPG.
She is not the most popular person around right now.
EDIT
It's the default browser PDF viewer, btw. Not some custom made crap. "It looks funny", she claimed expertly.
-
@cartman82
Has anyone told her that this will significantly affect the quality of printouts?
-
@cartman82
Has anyone told her that this will significantly affect the quality of printouts?Does it matter if it's a PDF or a JPEG, if it ends up as a screenshot on a Word document?
-
@cartman82
Has anyone told her that this will significantly affect the quality of printouts?Does it matter if it's a PDF or a JPEG, if it ends up as a screenshot on a Word document that's then printed out and photographed on a wooden table?
-
@cartman82
Has anyone told her that this will significantly affect the quality of printouts?The poor guy in charge of that looks like he's about to get a conniption. I am sure she was told.
Our CEO, an ex Microsoft manager and IT industry veteran, doesn't understand computers very well.
-
Does it matter if it's a PDF or a JPEG, if it ends up as a screenshot on a Word document?
It's worse. It will be shown to visitors in a popup. People will be asked to read that on screen.
-
@cartman82
Has anyone told her that this will significantly affect the quality of printouts?Duh, just render it to JPEG at 600 dpi...
-
@ixvedeusi said in WTF Bites:
Duh, just render it to JPEG at 600 dpi...
Why not 1200dpi or something even more outrageous? As soon as the CEO notices how long it suddenly takes the documents to load, she might backpedal quickly.
-
As soon as the CEO notices ... she might backpedal quickly.
Is that even possible? That would mean *gasp* admitting they're wrong. I'm pretty sure C-levels don't have that gene.
-
Why not 1200dpi or something even more outrageous?
More outrageous would be 12dpi. “But it is fast to print now!”
-
@cartman82 said in WTF Bites:
convert all documents to JPG.
Or worse, a PDF containing just a JPG of the document!
-
Why not 1200dpi or something even more outrageous?
More outrageous would be 12dpi. “But it is fast to print now!”
WTF I don't think printing stuff on a dot-matrix would be faster.
-
@tsaukpaetra said in WTF Bites:
WTF I don't think printing stuff on a dot-matrix would be faster.
Never seen one of those with a DPI of less than 72, not even the very cheap ones. The more expensive ones back when I got my first job could (with just a little persuasion) produce output that looked reasonable.
-
@tsaukpaetra said in WTF Bites:
WTF I don't think printing stuff on a dot-matrix would be faster.
Never seen one of those with a DPI of less than 72, not even the very cheap ones. The more expensive ones back when I got my first job could (with just a little persuasion) produce output that looked reasonable.
I once made one with a Lego MindStorms set. Maybe that was what I was thinking of. Hardest part was getting plastic to feed single sheets of paper effectively.
-
@swayde Does your project reference mscorlib? (if it doesn't, I guess the WTF would be that it's no longer automatically added on project creation)
It seems it was just indexing or somesuch, it went away after a few minutes.
I find that if Visual Studio is giving me a bunch of squiggly underlines, compiling the project fixes it sometimes, because the compile forces the stuff that fixes the squiggly underlines into the foreground.
-
@ben_lubar said in WTF Bites:
@swayde Does your project reference mscorlib? (if it doesn't, I guess the WTF would be that it's no longer automatically added on project creation)
It seems it was just indexing or somesuch, it went away after a few minutes.
I find that if Visual Studio is giving me a bunch of squiggly underlines, compiling the project fixes it sometimes, because the compile forces the stuff that fixes the squiggly underlines into the foreground.
Doesn't typically work in our UE4 project. Stuff that complies just fine gets red squiggles everywhere.
-
@tsaukpaetra said in WTF Bites:
@ben_lubar said in WTF Bites:
@swayde Does your project reference mscorlib? (if it doesn't, I guess the WTF would be that it's no longer automatically added on project creation)
It seems it was just indexing or somesuch, it went away after a few minutes.
I find that if Visual Studio is giving me a bunch of squiggly underlines, compiling the project fixes it sometimes, because the compile forces the stuff that fixes the squiggly underlines into the foreground.
Doesn't typically work in our UE4 project. Stuff that complies just fine gets red squiggles everywhere.
The web project I work on throws up hundreds of errors that only go away when you open the file. Often, after running and stopping it they come back.
When you're trying to track down the errors that are actually stopping a build, it's really annoying having to open and close multiple files that you don't care about and haven't been touched just to slim the list down
-
@tsaukpaetra said in WTF Bites:
Doesn't typically work in our UE4 project. Stuff that complies just fine gets red squiggles everywhere.
What version of VS are you on? I found that the quality of the red-squigglies--detector has improved in the last few releases (2015/2017). At this point, even fairly baroque combinations of macros+templates seem to pass, something earlier versions struggled with.
-
@tsaukpaetra said in WTF Bites:
Doesn't typically work in our UE4 project. Stuff that complies just fine gets red squiggles everywhere.
What version of VS are you on? I found that the quality of the red-squigglies--detector has improved in the last few releases (2015/2017). At this point, even fairly baroque combinations of macros+templates seem to pass, something earlier versions struggled with.
2015 update 3 I think?
It only happens on occasion, but it's really sticky when it hits.
-
This is a survey about buying gas.
-
How can the second one be true for anyone? Food is literally a source of energy.
-
How can the second one be true for anyone? Food is literally a source of energy.
"My car does not think gasoline is fuel. Gasoline contains no energy according to my car."
-
How can the second one be true for anyone? Food is literally a source of energy.
ITTM, emotionally, not physically.
-
@tsaukpaetra said in WTF Bites:
Stuff that complies just fine gets red squiggles everywhere.
You just wait until you deal with fixed-point types (e.g.,
unsigned long fract
). IDEs really don't seem to like them at all…
-
@ben_lubar said in WTF Bites:
How can the second one be true for anyone? Food is literally a source of energy.
"My car does not think gasoline is fuel. Gasoline contains no energy according to my car."
I hadn't taken you as the type to own a diesel.
-
Status: I wonder who developing for Azure Mobile Client was responsible for this particular brainfart.
Because I tried to install version 4.0 of their client into a Xamarin.Forms project and it failed due to a version mismatch. Turns out that they deprecated using PortableClassLibraries (PCL) and now demand that you use .Net Standard libraries.
Only problem: There's no easy way to switch - you'll always have to muck about in the XML-config files directly. And even then there's no guarantee that it'll actually work.
The best part: They haven't even updated their own example projects. Those are still using PCLs.
-
their own example projects
Yeah, those are made during initial development and never updated afterward.
-
@tsaukpaetra I was able to "fix" it by creating a completely new project, switch everything over to the new format and then copy over all other files.
-
Another glorious npm library.
This is the documentation page, with examples, installation instructions, rationale and license information.
And this is the code.
The entire library can be replaced with the highlighted section.
I mean, I appreciate the effort and everything, but come on. This should have been a blog article.
-
@cartman82 At least it has unit tests.
Well, a unit test:
At best, it tests one path of four through the code.
-
@cartman82 The one upside is that someone else keeps it updated for you when new wrenches get thrown into the works. Assuming you care about new wrenches, that is.
Still, four contributors for four conditionals is especially when the latest commit is "Remove trailing spaces"
-
@cartman82 I think this one is worse:
How has this literal one-line function accumulated 15 commits and 5 bug reports?