|
ultramiraculous posted:Yeah, I know that. Sadly this is the way we got the Xcode project itself. The classes group has 200 objects in it, most of the files being independent .h/.m sets subclassing one of the AppKit components. Basically there's a component subclassed for every little bit of weird behavior, despite a lot of it being similar/generic enough that a handful of abstract components would make a huge dent in the class count. Sounds like they come from a completely different background. Generally you shouldn't even subclass AppKit classes (except a few things like Controllers), but use Delegates and Data Sources and such.
|
# ¿ Aug 5, 2011 06:55 |
|
|
# ¿ Apr 27, 2024 18:16 |
|
Was feeling nostalgic for the late nineties and decided to look up the clusterfuck that was Hotline (basically Mac BBS software) back in the day. Most of it is management fuckups (terrible oversight) and hinks being horrible at dealing with people, but this stood out:quote:36. According to Mr. Spearritt, on two occasions (one in late 1996 or early 1997 and the other in August 1997) he requested Mr. Hinkley to backup all source code on Redrock's A2BNT1 UAM server. This occurred after Mr. Hinkley was unable to make a change to SPFS because he was unable to locate all the source code. In his witness statement dated 16 July 2000 (Exhibit H 16) Mr. Spearritt said: I know Subversion & git etc are all newer than this, but CVS was hardly unknown at the time. Uploading a compressed archive of the source tree each month...
|
# ¿ Aug 25, 2011 22:35 |
|
Scaramouche posted:Man are you kidding, Hotline was napster before it was cool. I ganked so much stuff on my broadband modem. I didn't think anyone bothered to use the actual community/talking stuff. Oh it ruled alright, but the software was terrible. I was on lovely 56k so I wasn't a huge pirate and used it mostly for the community - I actually still talk to a handful of people from back then.
|
# ¿ Aug 26, 2011 09:44 |
|
As far as I know, image decoding etc itself isn't done in WebKit but whatever OS it's running on. Except in some instances I think Chrome handles images itself instead of the OS. So the GIF thing was an issue with Core Image on OS X in earlier versions and the JPEG issue sounds like a problem in WebKit not hooking up to Windows properly.
|
# ¿ Sep 30, 2011 15:26 |
|
Here's one from myself (not actually a coding horror but a case of severe retardation):code:
|
# ¿ Jan 20, 2012 17:17 |
|
yaoi prophet posted:Haha, apparently by default exit is bound to a Quitter object whose __repr__ is that 'Use exit()' message. Honestly when it's put like that, I gotta go with pokeyman. Python is being a dick right there. And lord knows I've typed exit so many times.
|
# ¿ Jan 21, 2012 13:16 |
|
ctrl Z kill %1 You're not my dad, don't tell me what I can and cannot do
|
# ¿ Jan 21, 2012 17:01 |
|
You can do the same thing in perl if you don't use strict;, and it's a really bad idea that makes code unmaintainable.code:
Carthag Tuek fucked around with this message at 23:59 on Feb 13, 2012 |
# ¿ Feb 13, 2012 23:48 |
|
npe posted:With use strict your code fails due to the "b" in your values, but that's hardly fair because the discussion was barewords in keys, and this indeed works just fine with strict: Yeah my example was crap. Perl does the same poo poo as PHP without strict (that is, any non-keyword bareword is a string). code:
|
# ¿ Feb 14, 2012 04:55 |
|
Immutable types rule.
|
# ¿ Feb 16, 2012 16:47 |
|
Here I was thinking that an expected failure was something like assert(functionThatShouldReturnTrueFor(args) (don't ask me why you wouldn't do it the other way around though).
|
# ¿ Mar 3, 2012 07:49 |
|
^^^ I'd start with success = false though, much cleaner that way. ^^^moynar posted:The latest software scandal in Norway is a pretty big horror. Reminds me of every time I hear about all the crap software the government has here in Denmark. I guess it's just a perfect storm of wrong specs and terrible consultants. Has there ever in the history of computing been a success story? One day I'll start a consulting firm and sell lovely software to governments. Carthag Tuek fucked around with this message at 20:51 on Mar 23, 2012 |
# ¿ Mar 23, 2012 20:49 |
|
Optimus Prime Ribs posted:I definitely agree with that, but then the for loop would need something like this: Actually I'm not too fond of naming vars "success", I prefer something semantic, it'll also make the code more like sentences. You could do something like this. Granted, it'll keep counting in all cases, but after the first false, lazy evaluation should keep the rest of the loop from taking too much time. code:
|
# ¿ Mar 23, 2012 21:39 |
|
Not to get all Bret Victor up in here, but seriously why is it still necessary to even discuss brace-style & indentation? Code is easily tokenizable; after all that is a criteria for compilation (and if it isn't tokenizable, modern compilers can usually figure out the syntax errors or make and educated guess - for display only mind you). Why doesn't every IDE just represent - by default - the code in whatever format the user likes? We don't need to actually look at the raw txt unless something is seriously broke. Make that the fallback; show the token stream indented as the user prefers by default. Make indentation a as low level as choosing whether line endings are \n or whatever else. Carthag Tuek fucked around with this message at 11:03 on Mar 25, 2012 |
# ¿ Mar 25, 2012 10:54 |
|
tef posted:It's a topic everyone can have an opinion on. In the sense that there is no understanding or insight required to participate. That's exactly my point though, it's not important for the end result, and it's not important to you how I like to format my code. We should both just set up our dev environment to display the code how we like it and the underlying representation can be whatever (as long as its readable). This way, if you like 8-space tabs and GNU-style braces, and I like 2-space tabs and banner braces, we can both do our own thing, and not care at all what the other does. Also it makes diffs more readable.
|
# ¿ Mar 25, 2012 11:10 |
|
In short: Neither of us care, so hide the crap from us.
|
# ¿ Mar 25, 2012 11:14 |
|
Suspicious Dish posted:Yeah, arguably that's data with a mustache on. The interface builder in XCode doesn't even generate code, it just serializes the objects you set up, so it literally is data. You can set up stuff in code too, but usually there's no need unless you have some complex stuff going on. Suspicious Dish posted:I was thinking of code with logic and that sort of fun stuff. Something like this. Just had a look, it looks like if you try to do anything more advanced than very very simple stuff, it'll turn into a world of poo poo in 5 seconds.
|
# ¿ Mar 26, 2012 19:42 |
|
I bet whoever wrote this saw this or something like it: http://developer.apple.com/library/...SKeyValueCoding Being able to dig into some object by names in one go is pretty neat, but that impementation is poo poo.
|
# ¿ Apr 1, 2012 08:07 |
|
A horror by mine own hand:code:
|
# ¿ May 11, 2012 10:58 |
|
Was leafing through the camel book yesterday and came across use constantcode:
code:
|
# ¿ May 13, 2012 15:46 |
|
Zombywuf posted:It's pretty simple really, the constant package is terrible. I forgot to mention that it hilariously implements the constant as a function that takes no parameters and returns the value.
|
# ¿ May 13, 2012 21:42 |
|
its an elephant on pcp.
|
# ¿ Jun 2, 2012 09:02 |
|
Plorkyeran posted:FWIW my experience has been that I end up spending about the same amount of time thinking about resource management in C# and C++, and both are way simpler than Objective-C with automatic reference counting. The learning curve for C++ memory management is definitely steeper than for garbage collected languages, though that's a problem with the language in general. Are you saying that ARC is complex to think about? If you aren't working with CF classes, the only gotcha I can think of is making sure you don't have retain-cycles, which would be an issue in any language. And those are easily solved by using weak references where appropiate.
|
# ¿ Sep 14, 2012 02:13 |
|
Yeah I think it was brought up before butcode:
|
# ¿ Sep 27, 2012 03:10 |
|
McGlockenshire posted:As long as you manually pick a large enough cost parameter, yes, plain old PHP crypt() will do the job fine: Putting configuration parameters inside a string like that is a horror.
|
# ¿ Oct 7, 2012 00:13 |
|
if you have some old function that only takes some number of parameters, and you want to add functionality that those parameters are insufficient for, wouldn't the right way to do it be to make a new function that takes more parameters, and then have the old function just transparently keep working the way it always did (either by calling the new function with certain additional parameters, or just by not altering it at all).
|
# ¿ Oct 7, 2012 00:51 |
|
Suspicious Dish posted:I'm actually curious, is there a good public API to get those? It seems like it should be an API provided by some government agency somewhere. KaneTW posted:The european central bank has one I think. I had to set that up at a former job. Some things to take into account: - The feed only updates on normal weekdays (at 3 pm CET). - There may be problems obtaining the feed, so have a policy for how long to retain the rates, and what to do if you can't get new data. - Consider how to handle your historical data. Rates change over time, and using the rates from today to do calculations on data from 2006 (or even last week) makes a significant difference. Two ways of doing it is either saving the rates in versioned tables by date, or getting the full historical feed when needed. Note the full feed does not have entries for dates where the daily feed was not updated. - Have an alert go off if an exchange rate changes more than some percentage day-to-day; you'll probably want to take special action (for instance with the Icelandic Krona a couple years back, we changed the way we handled that market to be less at risk). - You can do intra-currency conversions (GBP <> USD) by dividing their EUR rates, but as always, be wary of using floating point with money (better to use fixed point).
|
# ¿ Oct 19, 2012 07:41 |
|
Tiny Bug Child is trolling, but the sad thing is there are people out there who literally believe the things he says.
|
# ¿ Oct 25, 2012 07:59 |
|
tef posted:Similarly, http://qntm.org/gay There's a proposed genealogy data exchange format being developed by FamilySearch, a mormon company, and (surprisingly?) it will support gay marriages The old standard (Gedcom) has hardcoded HUSB/WIFE fields; GedcomX Couple relationship types will allow any two persons. https://github.com/FamilySearch/gedcomx/blob/master/specifications/conceptual-model-specification.md
|
# ¿ Oct 25, 2012 17:54 |
|
ohgodwhat posted:You'd think they'd generalize it to handle polygamy? Yeah actually that'd make sense. Though I guess they'd just model a polygamous person by having them in several concurrent marriages. Depends on the exact nature of the marriage I guess, I mean if it's an "equal" one where everybody is married to everybody, or it's one dude with 5 wives. I should open an issue on github
|
# ¿ Oct 25, 2012 20:22 |
|
A A 2 3 5 8 K posted:
It's like that old pigs with numbers on them urban legend, but with hacks. Now you'll never know if you found all the hacks.
|
# ¿ Nov 8, 2012 18:06 |
|
The Gripper posted:easily distinguished from eachother That's pretty facilIlIlIlIlIlIlIlIlIe
|
# ¿ Nov 18, 2012 08:48 |
|
Dicky B posted:On a more serious note I have to look at other people's code a lot, and it is difficult. The nature of this difficulty usually has nothing to do with the trivial details of their coding "style" such as the names of temporary variables and the lengths of functions. It is higher up, in the way the program is structured, how things are encapsulated etc. It's always a good idea when you're writing code to mimic the conventions of the standard libraries for that language. Whatever your own preferences are. That'll at least make it easier for others to get a grasp on how your thing is structured. For example, when I write Objective-C code, I try to use as many Cocoa conventions and patterns as apply to the project - delegates, notifications, key-value coding/observing, etc.
|
# ¿ Nov 25, 2012 22:38 |
|
thelightguy posted:The horror there is that the LDS church has created the specification for the most commonly used genealogy format, and purposefully crippled it to fit their moral standards. Well the original Gedcom format was introduced in 1984, before any countries had any notions of same-sex partnerships (in a legal sense). FamilySearch (a mormon company) are currently working on Gedcom X which does not have those restrictions. See here, it came up earlier in the thread: http://forums.somethingawful.com/showthread.php?threadid=2803713&pagenumber=370&perpage=40#post408911070 Carthag Tuek fucked around with this message at 16:01 on Dec 16, 2012 |
# ¿ Dec 16, 2012 15:56 |
|
I don't really see any problems with it. I mean I probably wouldn't make a grep in javascript, but whatever, my eyes aren't bleeding.
|
# ¿ Jan 25, 2013 17:12 |
|
It checks the length, and then uses macros to check the buffer against n characters by bit-shifting.
|
# ¿ Jan 29, 2013 21:54 |
|
Yeah that's the one thing you can't learn except by doing. You have to make some really awkward code at first and only then will you realize how and why object reuse, inheritance, & composition are great ideas. At some point you'll have enough "tools" sitting in your spine that you'll start to see the similarities between different problems and how they can be solved using those tools. But I haven't met anyone who really got it without writing some really awful horrors first, including myself.
|
# ¿ Feb 15, 2013 22:41 |
|
Back around 1999 ish I started a website originally for putting up Aphex Twin lyrics, and later for general IDM lyrics. I still have the code around, and it is hilariously bad. The first couple of versions actually took down the server a couple of times cause they spammed the apache logs with so many perl errors that the hard drive would fill up in less than a week (and the traffic was seriously very very low). This is how it looked in 2001: http://web.archive.org/web/20011204041630/http://idmlyrics.vectorx.org/ In the first couple of versions, it was like, all HTML output was through print statements, GET params being used as file paths, etc, etc. Loops were retarded: Perl code:
|
# ¿ Feb 16, 2013 00:27 |
|
yaoi prophet posted:Hey, writing a webpage in the year 190 is seriosuly impressive. ya the year 190 was p chill
|
# ¿ Feb 16, 2013 09:36 |
|
|
# ¿ Apr 27, 2024 18:16 |
|
DaTroof posted:it's better than a system-wide salt by itself, but it adds the stipulation that changing the username invalidates the password. it still makes more sense to give every account its own salt and leave the other fields out of the equation. Don't most sites require a password to change the username anyway (if changing it is even possible)?
|
# ¿ Mar 1, 2013 04:31 |