|
Ithaqua posted:It's not necessarily intuitive, but it's well-defined behavior. A lot of the things PHP does are "well-defined behavior" too, that doesn't make them any less of a horror. This is unjustifiable behavior. Anyone who has ever written code in any language but Powershell is going to be surprised by this. And if you're lucky you'll be surprised by it when writing some one-off script. If you're me, today, you'll find out about it because your deployment system written entirely in PS (which is, itself, a horror) decided to take a code path that no one expected, taking down several production servers. I wasn't the one that wrote the offending code, but if four devs staring at the code (two of whom write PS daily) can't figure out what's happening for hours then I don't know if you can really blame the person who did.
|
# ¿ Apr 15, 2015 22:58 |
|
|
# ¿ May 10, 2024 23:14 |
|
Returning false from my script is success you say? Throw an exception you say?code:
|
# ¿ May 1, 2015 04:01 |
|
Dr. Stab posted:Are you sure you want to cancel? If the order of the buttons were flipped this would be fine, since you should also follow the convention that the operation being confirmed will happen when pressing the rightmost button.
|
# ¿ May 6, 2015 00:46 |
|
*huff, puff* Is this where the indentation and braces style debate is happening? I'm not late, am I?
|
# ¿ May 6, 2015 18:53 |
|
ExcessBLarg! posted:holy poo poo I don't care.
|
# ¿ May 6, 2015 23:02 |
|
Biowarfare posted:
lol if this works, because it means php returns a float result from integer division
|
# ¿ May 14, 2015 04:46 |
|
WHERE MY HAT IS AT posted:PHP doesn't have integer division. When would you ever need that? Why isn't there a :php: yet?
|
# ¿ May 14, 2015 04:52 |
|
zergstain posted:I love how that will overflow if n is odd. My favorite part is just what the gently caress is it even doing?
|
# ¿ May 14, 2015 18:41 |
|
My mental image is something like a dude on a skateboard, going "Oh my god, I think I finally got this, you gu-" and then faceplanting right into some stairs.
|
# ¿ May 19, 2015 04:40 |
|
Harik posted:I'm well aware. It's only c++11 in that they're abusing the new features 11 brought. Are there good examples of operator "", or is it just there to be a lurking horror? Well, a trivial example would be your own bespoke artisanal string class. Saves on the macros. The builder pattern isn't too bad to use, but it's a huge pain in the rear end to implement.
|
# ¿ May 20, 2015 10:13 |
|
loinburger posted:eliminate the unlikely chance that he'd generate two identical UUIDs out of a hundred million ids Heat death of the universe.
|
# ¿ May 21, 2015 21:53 |
|
quote:*** Bug 260998 has been marked as a duplicate of this bug. ***
|
# ¿ May 25, 2015 22:12 |
|
Internet Janitor posted:Why on earth would this be considered desirable behavior? ~omakase~
|
# ¿ Jun 9, 2015 16:40 |
|
No Safe Word posted:So, someone took a moderately objective and somewhat constructive view of the old classic bastion of coding horrors: TempleOS I don't remember who called TempleOS "outsider art" but that seems like the most apt description of it, and when I saw it called that I immediately understood why my friend was so interested in the music I created before I knew anything about making music. The dude created an entire OS from scratch by himself with tons of interesting features. He may be crazy but he is also a genius. Dessert Rose fucked around with this message at 19:54 on Jun 9, 2015 |
# ¿ Jun 9, 2015 19:51 |
|
C# is a great language and ASP.net MVC is a ... good framework.fleshweasel posted:If you just want to get started with something quick, node.js is alright but I'm skeptical of it for anything big or important. I think node.js might be one of the only frameworks you could have picked that is actually worse than Rails. Probably your first concern when picking a framework is picking a language.
|
# ¿ Jun 10, 2015 08:12 |
|
Drastic Actions posted:Bug, assigned to me. People have no sense of humor, I swear.
|
# ¿ Jun 10, 2015 20:14 |
|
I enjoy "expected result: unexpected xxx should not.." Thanks for the detail!
|
# ¿ Jun 10, 2015 20:41 |
|
In 1995 or so, everyone freaked out about this crazy problem where a bunch of idiots decided to save space by storing the year in two digits instead of four, and the world was going to end in 2000. 2000 rolled around and nothing happened. Because people realized there was a problem and worked hard to fix it.
|
# ¿ Jun 11, 2015 21:56 |
|
Ntfs has always supported symlinks
|
# ¿ Jun 19, 2015 21:46 |
|
Plorkyeran posted:It's only supported symlinks since XP/2003, and it wasn't until Vista that you could create them in user mode (in XP you needed to install a helper driver). oh huh. i could have sworn they were in nt4. welp
|
# ¿ Jun 19, 2015 23:41 |
|
Plorkyeran posted:There were always junction points, but having a single directory appear at multiple paths won't help you with the problem at hand. Oh, that's what I was thinking of. Glad to know I'm just wrong and not insane.
|
# ¿ Jun 20, 2015 00:08 |
|
Snapchat A Titty posted:Maybe you're both!!!! Yes that is a possibility I am considering.
|
# ¿ Jun 20, 2015 02:01 |
|
I've never seen the term "all hell breaks loose" in official, public documentation before.
|
# ¿ Jun 25, 2015 21:12 |
|
IT BEGINS posted:Half of my coworkers still don't understand how to use rebase in mercurial. As a result, our repository log often looks like this: I think it looks pretty
|
# ¿ Jun 26, 2015 22:09 |
|
Hammerite posted:One could imagine a sort of "generalised switch" statement that takes two arguments, a comparison function and an operand. So basically condp.
|
# ¿ Jul 5, 2015 07:27 |
|
Milotic posted:I'm possibly missing some subtlety above, but null is useful in imperative based programming languages where you don't know what the value of a variable to be assigned will be yet, and it doesn't have a sensible default value. quote:It also fulfills the useful requirement of failing hard and fast when one arises unexpectedly - it means you've got a logic error or a failure to respect the interface of a method call. I think most .NET programmers wouldn't mind as much if the null reference exception just listed the variable name somehow (or if the runtime was able to infer the type the object was meant to be). quote:e: I guess you're encoding that it can return a unit in the signature of the method, which could be useful - but isn't unit in danger of becoming a bucket type like null then? i.e. It's undefined, or the method does something under the covers. If it's encoded in the signature of the method and I have to unwrap it explicitly (like returning a Maybe or an Either) then it's obvious from the caller side that I have to handle both cases. When null is allowed by default it is terrible because every method that returns an object could be returning null. Maybe this one returns null on error! Maybe it throws an exception! We just don't know. Eric Lippert has said that he wishes .NET had non-nullable references by default. But now it's too late. Null is not a good idea. The "problems" it "solves" either don't really exist or have much better solutions.
|
# ¿ Jul 5, 2015 10:39 |
|
Milotic posted:Yes, but it would likely not cover every edge case and possibly bloat compile times. As to the latter: compile times are like the last thing I care about, compared to getting a crash report from production because of a nullref. I'll happily blow an hour a day on automated tools that tell me when I could be loving up. Isn't the entire point of a managed language to help you not blow your foot off? That's what we're spending all those runtime resources on, right? If you don't want compiler warnings for every possible mistake in your code, why not just write native code? As to the former: The point is not to cover every edge case, necessarily, but to make it very difficult to make this kind of mistake. It may be possible to "trick" the compiler one way or the other (usually managed compilers err on the side of, well, errors, if they can't figure things out) but that is a sign that you are doing something wrong too. If a machine can't figure out your code's intent, you should probably restructure it.
|
# ¿ Jul 5, 2015 17:25 |
|
It's a pretty good comparison, because programmers expend tons of effort to ensure that the enormous mistake from the past doesn't actually cause that much damage.
|
# ¿ Jul 6, 2015 18:57 |
|
No Safe Word posted:http://www.diogonunes.com/blog/custom-build-configurations-visualstudio/ I sort of did this with an iOS app, back before IAP when the way to let people purchase "consumables" was to distribute multiple versions of an app at different prices.
|
# ¿ Jul 6, 2015 22:07 |
|
Subjunctive posted:I guarantee that there are SDETs in Redmond wrong!
|
# ¿ Jul 28, 2015 18:06 |
|
Sinestro posted:The Something Awful Forums > Discussion > Serious Hardware / Software Crap > The Cavern of COBOL > Coding horrors: how is T_PAAMAYIM_NEKUDOTAYIM formed. how girl get preg_match() not emptyquoting.
|
# ¿ Aug 13, 2015 23:31 |
|
ChickenWing posted:I'm relatively new to work-programming and I started to worry that I was overusing hashmaps. Hash maps are so good that in Clojure you just use them for everything vaguely object-like. The language provides tools to create actual objects that still act exactly like hashmaps so that you can improve performance on the "expected" fields without changing all of your code that you wrote back when your object was just a map. Like was said above, use them until you have a reason not to.
|
# ¿ Aug 17, 2015 21:44 |
|
Ender.uNF posted:Second horror is that Windows is crap at allowing apps to specify awareness flags or SDK versions they link against so you can't just say "oh you linked against Windows SDK 8.0? OK, MAX_PATH for you is 32k". this would be super exciting for Subjunctive's reason but also because my class which declares an array of char[MAX_PATH] would suddenly grow by 32KB per instance depending on which OS I was compiling for.
|
# ¿ Aug 18, 2015 21:11 |
|
One of Perl's uses is in shell one-liners, and writing "use sloppy;" at the beginning of those would be kind of a pain.
|
# ¿ Aug 26, 2015 15:07 |
|
Checking .elems == 1 is the new != null
|
# ¿ Aug 27, 2015 00:35 |
|
Bognar posted:
There's a reason DateTimeOffset exists and all new code should use it. ExcessBLarg! posted:The first horror is that, that timestamp doesn't include a zone offset. I imagine that the result would still be amusing (and probably useless) if it did, though. The parsed string does, in fact, include a zone offset ("Z" means Zulu, or UTC, or GMT, or whatever other name we're using today). The default ToString() on a DateTime doesn't include the time zone because timezone information is not included in the DateTime struct. Again, the DateTimeOffset struct was introduced to address this exact shortcoming, and all new code should avoid use of DateTime and only use DateTimeOffset. Dessert Rose fucked around with this message at 22:27 on Sep 17, 2015 |
# ¿ Sep 17, 2015 22:24 |
|
fleshweasel posted:Aren't there problems with serialization of DateTimeOffsets? Some cursory searching suggests that XmlSerializer doesn't do it out of the box, but if you use a DataContractSerializer it's fine. You're going to have to do some work either way: you have to send the timezone offset separately if you use a DateTime (or standardize on UTC), or you have to do a little bit of lifting to serialize a DTO properly. Seems like a pretty poor oversight, though.
|
# ¿ Sep 17, 2015 22:38 |
|
Bognar posted:I agree that DateTimeOffset should be used for capturing timezone information, but don't you think that parsing a time should result in the same representation of that time? If DateTime doesn't have timezone information, then parsing "5:30 AM" should result in 5:30 AM and not be converted based on whatever your local timezone is. So I dug deeper. First, I would argue that there is a bug here, but it's simply in DateTime.operator==: code:
code:
To address your argument that it shouldn't be converted to your local timezone, the interface of Parse() is more complicated than you're making it out to be, and if you bothered to read the documentation, you would find that you can get the behavior you want: code:
In summary, time is never as simple as developers want it to be. News at 11. Dessert Rose fucked around with this message at 00:33 on Sep 18, 2015 |
# ¿ Sep 18, 2015 00:31 |
|
Bognar posted:No need to be a dick about it. I'm well aware of the Parse overloads, but I still don't understand why Parse(string) defaults to converting to local time instead of just setting Kind to Utc. Sorry, I just have low patience when people call things horrors without doing much research Think about this: if you have a time in any other timezone but your own or UTC, what should happen by default? It has to get converted to something, because DateTime doesn't have offset information. It can only be "local timezone" or "UTC", so it has to pick one. I would argue that, given the rest of the API defaults to local time, converting to local time is consistent with the semantics of DateTime. For example, DateTime.Now returns the local time; you need to call UtcNow if you want UTC, instead of Now returning UTC and LocalNow returning local time. So what should happen if you call Parse with a UTC time? Should it suddenly decide to leave it alone? That would be pretty surprising, because in every other case Parse is converting to local time. If I test my app with a couple random timezones (but not UTC) and see that Parse is converting to local time, I'm going to be pretty mad and probably even post in this thread if it suddenly decides not to convert UTC times. The single-parameter Parse is a convenience method. It's going to make some decisions for you that might not be the right ones, and that's totally fine! That's why you should always look at the other overloads and understand the decisions you can make, that the convenience method is making for you. The lesson here is pay attention to the APIs you're calling. Especially with something as complicated as time, don't assume that the defaults fit your use case.
|
# ¿ Sep 18, 2015 18:52 |
|
|
# ¿ May 10, 2024 23:14 |
|
HardDisk posted:I think the biggest horror is that people were being confused by the arcane term "Transfer money". What makes you say that?
|
# ¿ Sep 30, 2015 19:41 |