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
Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Beardless Woman posted:

And this guy's code is actually in production.
So what if it is? The code you posted apparently works; it's the broken code you should worry about first. People shouldn't feel obligated to use every redundant feature of a language.

Gazpacho fucked around with this message at 09:51 on Apr 12, 2009

Adbot
ADBOT LOVES YOU

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I don't see the point of arguing whether Perl has redundant features. Larry Wall admits it and is proud of it.

Once upon a time in the 1990s, I wrote a fair amount of Perl code where I tried to be as concise as the language allowed, and a guy who had to maintain it later told me "WTF?" I don't write Perl like that anymore.

Gazpacho fucked around with this message at 20:26 on Apr 12, 2009

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I understand that everyone has their own sense of code aesthetics, I just wouldn't use it as the basis for calling something a coding horror when my solution is not really much better in production.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Mogomra posted:

I'm actually really interested to hear what the issues with Node.js are.
The issues maybe aren't so much with node.js, but with its promoters' tendency to ignore the long history of the events vs. threads question, and say things like "node.js never blocks" because they don't realize that the thing node.js does actually is blocking.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

duck monster posted:

Today I stumbled across a simple set of words that describe a real thing that ought cause any coder with a sense of his industry to imediately break out into a rash.

"LegacyJ : Enterprise JavaBeans and XML with COBOL"
If you consider COBOL dead maybe your "sense of the industry" isn't quite as good as you think. :smug:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Contero posted:

I'm not a professional web dev by any means, but why is this such a horror?
It's a horror because the dev is going out of his way to avoid HTML templating in an HTML template language. It's not unique to PHP. I've seen the same thing in Mason from devs who just don't "get" templates.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Smash dogmatism while holding high the banner of modularity. :china:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

pokeyman posted:

I think I understand what you mean, but could you expand on this a bit? Why are text nodes XML's most powerful feature?
Because you can encode non-XML formats in them of course! :downs: (and more!)

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

MrMoo posted:

It's not for configuration files or for storing data which is what most muppets end up using it for.
Developers use it for those things because it provides code reuse advantages over what was done before, namely defining a binary or otherwise ad hoc format. Trying to confine a technology to some historical vision is generally a losing bet.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Fren posted:

Douglas Crockford's shtick is really getting old.
You could say he's become one of the Bad Parts. :mmmhmm:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

pokeyman posted:

How does anyone justify using PHP for a new project?
It's not like anyone is going to get fired for using it.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Scaramouche posted:

Are you talking about CGI 'classic'? Out of process? Single threaded?
While the overhead of CGI is considerable, you can at least say that it lets the operating system do its job, namely resource allocation and task scheduling, rather than creating an inner platform to do those things.

The bug at issue here is clearly a PHP bug, not a CGI one.

Gazpacho fucked around with this message at 23:22 on May 5, 2012

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I think it's been made clear that the issue re: CGI is not whether such things exist, but whether they introduce problems of their own. :spergin:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I knew before I clicked that reddit link that someone would make a comparison to APL.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Yeah yeah, misindented code. Worked on some for four years, then later worked in a job where the offshore devs regularly sent misindented code for review and refused to correct it to standards. Cry me a river and go learn Python you baby. :twisted:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Ender.uNF posted:

The compiler has the best knowledge about what each symbol in the code means. It knows the difference between a type named Foo and a local variable named Foo, something that is extremely difficult to get right with a regex. That's part of the reason MS is exposing the compiler as a service in the next version of VS - so you can write code that writes code, with full access to the compiler and intellisense. It's an extremely powerful concept once you wrap your brain around it.
All true, but oh the WTFs we'll see! :buddy:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

MEAT TREAT posted:

"php" == 0 is :wtf:.

Someone explain that to me.
It follows the tradition of Microsoft BASIC and Perl so there's nothing to explain. :smug:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
A universal Turing machine.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
When I used Matlab about 15 years ago it didn't have a reputation of being a broken piece of poo poo. Maybe Mathworks has had some major developer rotation since then.

Although anyone who approaches Matlab with the idea that they won't have to translate their problem into matrix-crunching terms has already lost.

Gazpacho fucked around with this message at 00:08 on May 18, 2012

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Suspicious Dish posted:

That is not a CSV file.
You say that as if anyone ever gets CSV output right. This file is saner than most.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Zorro KingOfEngland posted:

I am a relatively new developer and this is the first time I've heard about these control characters being used. Do you have anything that explains their usage? Wikipedia doesn't go into too much depth. The only article I've found has said that the characters' meanings have to be defined on a per-application basis, but I'm looking for a best practice type document.
Well, they really were application specific. However, defining the hierarchy like that makes it possible to write a library that will seek a magnetic tape to the beginning/end of a unit/record/group/file if you ever happen to fall through a time warp into 60s.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Mogomra posted:

I know everyone in this thread loves node.js and PHP, so why not leave the two of them alone in a room together to see what happens?
As the internet creates a fetish subculture for everything, so does project hosting create...

Harmony Framework - PHP is now in your browser!

(Inactive since 2009 thankfully, but it's only a matter of time.)

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Munkeymon posted:

It fills two arrays with hour names (like '11am') for each hour in the day. $grandma is the 24-hour hour, somehow.
When can you start?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
e: Really, given the context, I have to agree with Janitor. A better solution would be "then don't do that."

Gazpacho fucked around with this message at 10:41 on Jun 29, 2012

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Plastic Snake posted:

code:
parseInt(1/0, 19); //18
I love Javascript so much.
Here's a little advice:

https://www.youtube.com/watch?v=zCh7z5EwYF8&t=1s

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Whenever you see comments left in an exploit like "It doesn't work. Now it does! Or does it?" that alone should be a strong indicator that it's crap.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Optimus Prime Ribs posted:

I just got assigned just about the most retarded task imaginable:

We need to have a bunch of SWF objects which act as slides for a presentation; they contain text transitions and whatnot. These need to be pushed live, and the only way our platform can do that is to stick it in an iframe, and then on that page periodically check if a new SWF should be shown.

On those SWF objects is a black box where an SWF player (which is playing a live stream) needs to be absolutely positioned over, but that cannot go in the iframe as each slide change will gently caress up the stream, so I need to position it over the iframe. And then that page is going into another iframe.

:suicide:
Sounds kind of fun really :buddy:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
The command prompt has to do wildcards that way to maintain compatibility with DOS, which had to maintain compatibility with CP/M, in which each command implemented its own file pattern rules. In CP/M it was possible for a filename to be valid to one command and invalid to another. :byodood: DOS provided the wildcard expansion APIs as a way to standardize the patterns but expanding them up front the way Unix does wasn't a feasible option.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

ToxicFrog posted:

If you leave it up to individual programs, you end up with different expansion behaviour for each command, each with its own documentation and configuration mechanism (if it can be configured at all).
DOS didn't just leave it up to the programs. It also set global rules on what characters could be valid in a filename, something that CP/M never did. You could not create filenames with * or ?. So yeah, maybe there were stupid programmers who didn't call the APIs right in front of their faces and made their own. I think we've all come across someone like that. But the valid filename rules limited the damage they could do.

ToxicFrog posted:

If you leave it up the filesystem, suddenly rm behaves differently depending on whether you're using it on a local filesystem, a USB key, or a network mount.
I would need to see some evidence that expansion is handled by the file system driver and not by the Windows file API. Microsoft documents the behavior of the wildcard patterns, something they wouldn't be able to do if expansion depended on the device.

Gazpacho fucked around with this message at 22:35 on Jul 20, 2012

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
That too, and the fact that its dominant use case was not batch scripting but starting up an interactive program and then sitting in the background. Many reasons, but CP/M compatibility guided the design.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

PrBacterio posted:

But really, though, isn't that just piling workaround on workaround to get a fundamentally broken system working at that point, like this thread has so many times before (rightfully, imho) criticised, for example, PHP for?
Well yes, I suppose, but the shell's purpose is to call out to programs that are free to do their own thing. PHP on the other hand pisses people off so much because its problems involve things that are under its own control.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Suspicious Dish posted:

I blame it on the C standard library. sprintf is in there, but asprintf is not.
Having worked on a platform with spectacular facilities for dynamic allocation and management, I can assure you that the real problem is programmers just not knowing what memory is.

I guess it counts as a horror that on this platform, a problem I had to clean up again and again was local string buffers sized according to the maximum filename length, which had nothing to do with filenames. And this at more than one company, it wasn't an issue with a particular programmer.

Gazpacho fucked around with this message at 20:43 on Jul 23, 2012

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Gazpacho posted:

I can assure you that the real problem is programmers just not knowing what memory is.
Followup: http://blogs.msdn.com/b/oldnewthing/archive/2012/07/25/10333134.aspx

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Zamujasa posted:

A new day, a new horror... If I'm becoming grating with Tales from The Boss, then let me know and I'll cut back on sharing them.
I don't have any problem with the series but just keep in mind that you never know who's reading and what they might do if they're able to somehow identify the site you're talking about.

Gazpacho fucked around with this message at 17:57 on Aug 1, 2012

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Otto Skorzeny posted:

Joel Spolsky's first summer job was working in a bread factory, therefore making software is like making bread http://www.joelonsoftware.com/items/2012/07/09.html
He stops talking about bread 1/5 of the way into the article. The advice from there on seems pretty good to me. Just the phrase "bug bankruptcy" makes it worth the read.

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.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Aleksei Vasiliev posted:

what an excellent example of try statement use
This is what compiler bug reports usually look like: Long enough to manifest the bug and no longer. The usefulness of the code isn't a consideration.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
At least the sentence is complete. I've torn my hair out so many times over comments in legacy code with an unspecified "it" or "this".

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
While I understand that there are many design horrors in PHP, and to a lesser extent Javascript, this hand-wringing over implicit conversion reminds me of the arguments when I was learning BASIC against using = for assignment (as well as comparison), because some poor stupid programmer might flip out over a statement like X = X + 1.

Similarly Dijkstra argued that no language should have lazy logical and/or operators because they do not have exact mathematical precedents and therefore programmers can never possibly understand them.

Gazpacho fucked around with this message at 03:55 on Sep 2, 2012

Adbot
ADBOT LOVES YOU

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Not quite as bad as (maybe I've posted this already) allocating all string buffers to MAX_PATH. Regardless of whether they are for filenames.

MAX_PATH in Windows is an unbelievably immense number. Two hundred and sixty, to be exact.

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