|
Today I discovered that FTP has no capability to "get" a complete directory and all of its subdirectories. This isn't really a coding horror, it's more of an absence-of-coding horror. What is the thought process that leads to an omission like that? I have severe problems attributing this to malice or incompetence, it has to be literally "I'm writing a program which lets people retrieve files and directories from remote locations. Oh, but not directories. I think I'll leave that bit out."
|
# ¿ Apr 16, 2010 17:50 |
|
|
# ¿ Apr 25, 2024 01:08 |
|
ToxicFrog posted:This isn't a horror at all. As others have pointed out, the protocol has everything you need to easily implement recursive transfers, and any decent ftp client - nsftp, lftp, filezilla, wget, etc - supports them. Yeah, it's the ftp command that I'm complaining about, not the protocol itself. If it's so easy to implement clever recursive transfers on top of ftp, why hasn't it been done and incorporated into ftp?
|
# ¿ Apr 17, 2010 00:23 |
|
Ari posted:You know what the worst part is? $this. What's wrong with $this?
|
# ¿ May 12, 2010 19:09 |
|
NotShadowStar posted:You mean ==? I'm not sure how that even works without a compiler/parse error. But hey even long veterans mix up =/== sometimes when not paying attention and they can be a bitch to find. I blame no language since C having the balls to go back to using := for assignment for visual distinction. I really used to like my graphing calculator which used "->" as its assignment operator, e.g. code:
code:
|
# ¿ May 18, 2010 17:16 |
|
TRex EaterofCars posted:Weak, JCL for life. Significant whitespace and hard to distinguish characters weed out the scrub tier pretty quickly. Call me a scrub. JCL: Significant whitespace. "Case-sensitive" in the sense that everything has to be in capitals. Line length limit of 80 characters, 2 of which are the "//" which has to be at the beginning of every valid line and 8 of which are mandatory card sequence numbers. Comments aren't delimited, they're just anything you manage to fit in the space left after the end of the statement. I'm pretty sure it can't do loops which means it's not Turing-complete. And whenever you call a JCL procedure, you can also manually override the datasets (input/output streams) used at any labelled line in that procedure. Since every line has to have label, the result is that as soon as your useful procedure becomes public you can never modify the name or function of any line in that procedure without breaking someone else's code.
|
# ¿ May 19, 2010 22:35 |
|
http://en.wikipedia.org/wiki/Python_%28programming_language%29quote:While many programming languages round the result of integer division towards zero, Python always rounds it down towards minus infinity; so that 7//3 is 2, but (−7)//3 is −3. ??!
|
# ¿ Jun 12, 2010 20:37 |
|
This, then, could be a variant upon Poe's Law?
|
# ¿ Jul 8, 2010 00:19 |
|
quiggy posted:Is it bad that this would work on me? The best chat-up lines are the insanely geeky ones because anybody they work on is an insane geek.
|
# ¿ Sep 1, 2010 23:21 |
|
In Python, to quote the Python thread, a folder is a package. In Perl, this is not true. When you use the "use" function, all the terms are directories except the last one which is the file. And the double colon :: is the delimiter between each term. ...But the file can contain a package or packages plural which are named completely differently. You have absolutely no idea what semantics you just imported. Plus, when you do start to make use of stuff in that package, suddenly all the terms are levels in the package heirarchy except the last term which is a function or variable inside the file, and the double colon is now magically the package heirarchy delimiter. Only now have I realised that any agreement between the package heirarchy and the filesystem heirarchy is basically just a huge coincidence, and even now I probably still have most of this wrong. Why would a programming language even allow you to do such confusing things?
|
# ¿ Sep 30, 2010 21:34 |
|
Otto Skorzeny posted:You seem to have thoroughly confused the default place perl looks for a Perl package based on its namespace with some sort of deep meaning, and also forgotten that you have very, very fine grained control of what semantics you import. Well, by all means explain it. As I understand it, "use Foo::Bar;" will make Perl look through all of the directories in @INC for a file named "Foo/Bar.pm", NOT for a file containing "package Foo::Bar;". That is, it is a command to import a specific file, and "::" is being made into a directory separator. Meanwhile, Foo/Bar.pm could start off with "package Something::Else;", so that when, later in the script, you start calling Something::Else::function(), (1) the "::" suddenly has a completely different meaning and (2) the reader has no idea where this function has mysteriously appeared from.
|
# ¿ Sep 30, 2010 23:57 |
|
ToxicFrog posted:
Except this doesn't work, because outside of a pair of square brackets, the ^ metacharacter isn't "negation", it matches the end of the string. So /^\s+/ will match nothing. I think what's needed is either /[^\s]+/ or /\S+/.
|
# ¿ Oct 14, 2010 12:55 |
|
seiken posted:Woah, why have I never thought of the !! operator before? Since it doesn't do anything you can pepper it around your code to indicate the important bits! I guess !! is equivalent to a boolean cast? Like, if the input was appState.length, which is an integer from 0 upwards, !!appState.length will be FALSE if appState.length was 0 and TRUE if appState.length was greater than 0. I've seen code where !!! was used to call special attention to negation operations.
|
# ¿ Nov 11, 2010 14:41 |
|
h_double posted:I once had to maintain a whole mess of Perl code written by a guy who "didn't believe in" modules or CPAN. What if you are on a secured network that can't readily pull packages from CPAN? What if you update a module and it breaks your code? We have that kind of scenario where I work, but the problem is our Perl needs to be run on about 65 different machines all running different operating systems. "Getting a module from CPAN" becomes such a tall order that if something isn't included in every Perl installation by default, rolling your own or figuring out how to do without it almost always ends up being quicker and easier.
|
# ¿ Dec 14, 2010 12:26 |
|
ErIog posted:The better question at this point is, why are your 65 machines running different operating systems? They're test machines. The software I work on is available for almost every platform you've ever heard of, so we need to test it in a fairly hefty variety of environments. The Perl in question is our test material. You would be amazed how many otherwise robust and useful Perl modules have never been tested on an EBCDIC system.
|
# ¿ Dec 14, 2010 19:39 |
|
Janin posted:I'm honestly shocked that Perl runs at all on a EBCDIC platform EBCDIC is the real coding horror.
|
# ¿ Dec 14, 2010 20:49 |
|
YeOldeButchere posted:Well, no, but I meant other than that. Or is it really all it's used for? IBM makes literally billions of dollars from ensuring that the banking and airline software that these banks and airlines use - software which was indeed written in the 1970s, for original System/360 machines, in COBOL, in EBCDIC, whose original source code is lost, and whose original programmers probably retired in the 1980s and died in the 2000s - continues to work and does not need to be replaced. When you look at the amount of commerce which passes through those systems (since these are investment banks, they're running into the trillions each year), the track record of reliability that those programs have proved themselves to have (a level of reliability which any replacement program would have to match) and you realise just how much there is to lose if the replacement program fails, and how likely it is that the replacement program will in fact fail somehow, you find yourself willing to pay really insane amounts of money not to have to make that change. It's actually not a terrible business partnership. The customer gets a fairly strong guarantee that their system is bulletproof and IBM doesn't have to do much beyond gradually improve the performance and capacity of each year's new mainframe. If you want to work with the same system for thirty years and never learn anything new, which a frightening number of IT people inexplicably seem to want to do, a job writing COBOL is a job for life, or at least for the forseeable future. Of course, if you're a fresh-faced newcomer to the world of software engineering and you're used to the natural state of information technology being one of continuous rapid change (and improvement), then using green screen terminals is quite a culture shock. And realising that the green screens are never, ever going to go away is worse. And converting everything from EBCDIC to ASCII in order to edit it locally (instead of editing it on the remote machine using vi - not vim, vi) gets old fast.
|
# ¿ Dec 14, 2010 22:50 |
|
tef posted:this just shows how far we've come in 40 years of software engineering. Not really, it's just impossible for a computer program to demonstrate 40 years of continuous reliability under heavy load without having been written 40 years ago. There's plenty of code out there which was written "only" 20 years ago or 10 years ago and has done its job perfectly ever since and will continue to do so long into the future. If you want someone to replace your working but antiquated COBOL with something modern i.e. recently-made, then proving that any possible replacement can meet the task means testing it to breaking point and under NASA-level intensity and scrutiny. There is nothing to stop people writing programs right now, in modern languages, which will operate perfectly for the next 40 years. It happens all the time. The problems are (1) getting explicit requirements out of a program which was invariably programmed with a great deal of skill and subtlety but has little to no surviving documentation (those requirements could be met if they were clear), (2) proving that the replacement matches those requirements to the satisfaction of the person with the money and the severe disinclination to switch, and (3) making the switch seamlessly. We could do this. There's nothing stopping any of this happening, other than the fact that it's cheaper for the customer and more profitable for the provider for everybody to stick with what works.
|
# ¿ Dec 15, 2010 01:03 |
|
When in history has anybody charged money for an alpha release of something? In fact, when has an alpha release ever been made available to the general public? Notch is charging money for an unfinished product and using "alpha" as an excuse for poor quality control.
|
# ¿ Jan 8, 2011 14:31 |
|
That's why you can simply use === and !== in every situation. It's a universal rule that always ensures that two things being compared are exactly identical. Oops, unless they're objects, in which case you have to use ==. Got me again, PHP!
|
# ¿ Mar 3, 2011 21:55 |
|
yaoi prophet posted:
That statement there is a pretty big horror. code:
|
# ¿ Mar 26, 2011 14:03 |
|
yaoi prophet posted:
No, it's no good. I have read this three times and I have absolutely no idea why you are having a problem at all. Yes, there is almost certainly a hilarious way to embed UPDATE/DELETEs into a SELECT. Yes, there are many other much more damaging things that could be done to your database than simply deleting data from it. No, the database being "not secret or anything" doesn't mean you don't need to protect against this. No, the fact that it would take "a weekend of number crunching" to repair the database doesn't mean you don't need to protect against this. At the outset, you should have been able to completely solve your problem by wrapping single quotes and mysql_real_escape_string() around all of your fields. If this didn't work, you must have been doing something very wrong, but the fact that you haven't even mentioned trying this is even wronger. Prepared statements, almost by definition, have absolutely no problem with the escaping of backslashes because correct quoting and escaping is handled automatically. You can't even override it! So if you're still having problems there, then, again, something is very wrong. There is no circumstance in which you should be escaping a PHP variable for inclusion into a MySQL query manually. Also, as I mentioned, the function you're using to "escape" your string is apocalyptically broken. And even if it wasn't, which it is, you should be using str_replace(), not preg_replace(). yaoi prophet posted:Fortunately nobody is going to be searching for stuff including backslashes in our data. yaoi prophet posted:At least it'll fail safe If people searching for backslashes can break your query then your query is broken. It is very easy to make dynamic MySQL queries 100% safe, and there is no excuse for not doing so. I have no idea what "fail safe" is supposed to mean. Basically what I'm saying is that everything in this scenario is a horror except for PHP and MySQL.
|
# ¿ Mar 27, 2011 21:27 |
|
code:
|
# ¿ Mar 28, 2011 10:18 |
|
Toady posted:Every time I read $your_favorite_language code or the bizarre things that $your_favorite_language does I wonder how the hell that language caught on. It's like someone's academic experiment that broke out of the lab. So what you're saying is that every single programming language has serious horrors in it and none of them are good, let alone perfect. I agree entirely.
|
# ¿ Mar 29, 2011 18:41 |
|
revmoo posted:132 Errors, 77 warning(s) To be fair, one unclosed paragraph tag can result in 1 error for every following paragraph, so you can cause 100 errors with one mistake quite easily. Also, since when is XHTML 1.0 Strict deprecated?
|
# ¿ Mar 31, 2011 20:21 |
|
BonzoESC posted:The best part was the simple XSLT used to rename a variable, and Tim Bray crying from laughter in the audience. Is there supposed to be audio with that presentation?
|
# ¿ Apr 4, 2011 19:04 |
|
yaoi prophet posted:
PCREs support whitespace and comments so I think this would work: code:
|
# ¿ Apr 8, 2011 09:29 |
|
bobthecheese posted:php quine No, this PHP quine is cheating: code:
|
# ¿ Apr 15, 2011 10:08 |
|
Janin posted:Perhaps IBM's customers are paying by the byte. Paying by the processor cycle is actually closer to the truth.
|
# ¿ May 2, 2011 12:52 |
|
HFX posted:Sometimes they do. Like when you coworker puts empty lines between every line of a method like it was some double spaced paper. Arg list too long, yeah, double space that too. Some time ago I had the idea for a code editor where each blank line would be half the height of a line with text in it, just to make it more pleasant to read. I never got around to looking for an editor which actually does this but I think it'd be neat.
|
# ¿ May 10, 2011 18:33 |
|
bobthecheese posted:American English, that is And it's text-align "centre" too while we're at it I think we're stuck with the "Referer" HTTP header, though.
|
# ¿ May 16, 2011 00:05 |
|
Wait, so http://twitter.com/!/forrst/status/40425431857512448 says quote:Staff Pick: Can you write a FizzBuzz program without if/else/switch? http://t.co/RBecdHr which links to http://forrst.com/posts/Why_Cant_Programmers_Design_Software-gOg which says, among a great many other things code:
code:
So I guess the real challenge overcome here was to slightly obfuscate the location of the "if" statement!
|
# ¿ May 21, 2011 17:18 |
|
code:
|
# ¿ May 24, 2011 00:07 |
|
Aleksei Vasiliev posted:The site is also a horror itself: http://phpsadness.com/?page=sad/18 Possibly the author is expecting static variables to be bound to the class itself in some way, like you see in Java?
|
# ¿ May 28, 2011 18:47 |
|
aux posted:Worst part is the "return OK" at the end, I'm ok with nested if statements to some extent (I've seen some horrible horrible nested if's in my time) I like the implication that the variable OK could be set to false, and "return OK" could therefore be a very bad thing.
|
# ¿ Jun 14, 2011 09:17 |
|
A boolean called "OK", like "TRUE", "FALSE", "SUCCESS" and "FAILURE", looks like a constant. Especially when you start using it in conditionals. "if(OK)" reads like "if(true)" or "if(1)". "if(OK == false)" just looks like nonsense. "isOK" would be an improvement, but "isValid" would be better.
|
# ¿ Jun 14, 2011 12:48 |
|
Wheany posted:var LOG_OK = 1; My favourite is a big chunk of code which made extensive use of a variable called $noRetries. It was about half an hour before I realised that this was intended to mean "number of retries", not "disable retries".
|
# ¿ Jun 16, 2011 18:21 |
|
duck monster posted:Ignore the retarded image macros in the thread on this patch: I don't know much about bash but doesn't this change fix the line of code which deletes /usr? Surely the change where that error was introduced would be more of a facepalm. EDIT: Here we go. qntm fucked around with this message at 18:35 on Jun 16, 2011 |
# ¿ Jun 16, 2011 18:28 |
|
Thel posted:You're not thinking Is it good that I couldn't come up with nonsense like this even if I tried?
|
# ¿ Jul 7, 2011 10:14 |
|
Presto posted:This is C/C++, plus is higher precedence than shift This is a horror.
|
# ¿ Jul 13, 2011 19:04 |
|
|
# ¿ Apr 25, 2024 01:08 |
|
Aleksei Vasiliev posted:There are languages that prioritize shifts over addition/subtaction? I would have thought every language did this. A shift is, after all, a glorified multiplication or division in most cases. But apparently not, and it trips me up every single time.
|
# ¿ Jul 13, 2011 20:37 |