|
Vanadium posted:There is at least one C-inspired language that requires that return is used like a function with parentheses and all, as far as I can tell it is mostly because the compiler guy could not be bothered to specialcase return's syntax. PHP?
|
# ¿ Apr 4, 2008 08:20 |
|
|
# ¿ Mar 28, 2024 22:03 |
|
chocojosh posted:For simplicity? Am I missing something here or does it just seem to be much easier to use a vector<bool> (or bitset) and just count the enumerated bits? I honestly don't see what advantage there is to factoring prime numbers. He's not looking for things that multiple together uniquely, it's addition.(I think)
|
# ¿ Apr 25, 2008 08:53 |
|
chocojosh posted:How would you be able to factor primes by addition?
|
# ¿ Apr 25, 2008 18:39 |
|
chocojosh posted:I simply want somebody to show me how they can implement something using prime factorization or whatever in a way that is better than bitmaps. Nobody has been able to so far, or I am not understand them if there is a better way. I don't see anything wrong with the bitmap solution, the numbers I used I randomly made up because they worked, I'm sure I could extend that technique for at least another 10 numbers :P , my point was that multiplying primes seemed wasteful.
|
# ¿ Apr 25, 2008 21:06 |
|
Victor posted:I think this looks best: I think there is something to be said for code:
|
# ¿ May 16, 2008 02:34 |
|
EssOEss posted:== is generally defined as reference equality, not data equality. Overriding it to perform data comparison would be a Coding Horror. Not necessarily, in python for example `is` is used for reference equality.
|
# ¿ May 16, 2008 19:17 |
|
web2py. The English language doesn't contain the appropriate verbiage to describe this, but I'll give it a shot. 1) Web based code editing tool. That is you edit your code in a web browser, and it just runs. The security risks... I can't even describe. 2) It automatically imports stuff, in many languages this may be the norm, but in Python it's the antichrist, this is advertised as a feature. 3) It automatically does migrations for you, as in it detects a change in your models, and it just changes the DB accordingly. 4) It encourages a disk based session store and in memory caching. 5) It has various DOM helper classes, basically so you can write html in python with stuff like HTML(HEAD(TITLE("my title")), BODY(DIV(A))) etc.... Also, the creator, Massimo di Pierro, just about trolls the internet (reddit in particular) advertising it. Plus he thinks the only difference between Python and Java is "exec".
|
# ¿ Jun 4, 2009 18:53 |
|
TSDK posted:I came across a good one-liner today: I guess technically in C++ with an overloaded bool operator it does something useful :/
|
# ¿ Jun 26, 2009 18:47 |
|
Well, this morning when trying to use a subversion python binding for pyvcs/django-vcs I managed to segfault the interpretter just by attempting to open a client to a local svn repo
|
# ¿ Jul 3, 2009 19:46 |
|
dancavallaro posted:] What do you mean "it was the case in Python", no one in the Python community writes print with parens in Python 2.x, especially not as a performance hack as the OP suggests.
|
# ¿ Aug 22, 2009 06:33 |
|
geetee posted:We were so close to getting past the PHP side tracking and here you (we) go bringing it back up. See ya in 5 pages and 3 more threads. It's not our fault PHP is a coding horror.
|
# ¿ Aug 22, 2009 19:29 |
|
Otto Skorzeny posted:I was assuming that any taint feature in PHP would be a shittier and dumber cargo-cult-copy of its Perl analog (like every PHP feature) magic_quotes, that is all.
|
# ¿ Aug 30, 2009 06:26 |
|
Otto Skorzeny posted:cout << 0[your_good_posts]; invalid types ‘int[int]’ for array subscript
|
# ¿ Sep 20, 2009 21:46 |
|
Lexical Unit posted:C++: I'm brought comfort by the knowledge that the optimizer is probably sorting that out.
|
# ¿ Sep 29, 2009 14:19 |
|
Zombywuf posted:
Trailing whitespace, mixed spaces and tabs, and 8 space indents are never right
|
# ¿ Sep 29, 2009 15:52 |
|
Presto posted:An off-by-one error. 's' - 'a' != 1
|
# ¿ Nov 6, 2009 22:59 |
|
code:
|
# ¿ Nov 6, 2009 23:45 |
|
yaoi prophet posted:look at your keyboard oh... I don't want to talk about it, mine's still sort of funny thought... right?
|
# ¿ Nov 7, 2009 01:42 |
|
dimebag dinkman posted:That's kind of scraping the bottom of the Coding Horror barrel. Unless I am missing something, it doesn't seriously impact performance, code readability, logical correctness, or anything like that - it's just a bit redundant. Also, are you sure this is the final form this function will take? I can imagine sometimes I might write a function like that if I know that pretty soon there's going to be more going on in it. Yeah, no it's terrible. It decreases readability.
|
# ¿ Nov 14, 2009 18:30 |
|
Hey guys, we're on reddit: http://www.reddit.com/r/programming/comments/a4f97/coding_horrors_code_that_makes_you_laugh_or_cry/
|
# ¿ Nov 15, 2009 03:45 |
|
poopgiggle posted:I have authored regular expressions which were about 4" wide on the screen. http://github.com/brosner/everyblock_code/blob/master/ebdata/ebdata/nlp/addresses.py I hope this makes you feel tiny.
|
# ¿ Nov 16, 2009 05:40 |
|
Janin posted:While we're at it: As I recall this doesn't actually perfectly parse emails, RFC822 allows infintely nested comments, this just allows REALLY nested comments. regex aren't powerful enough to parse 822.
|
# ¿ Nov 16, 2009 06:48 |
|
Guys you should be using ruby so you can just monkeypatch a to_radians and to_degrees functions onto int.
|
# ¿ Dec 8, 2009 02:43 |
|
Broken Knees Club posted:I see your clever ruse. No clever ruse intended . I seem to recall rubies integer class isn't actually named that though, is that the alleged ruse?
|
# ¿ Dec 8, 2009 04:28 |
|
dis astranagant posted:No one sane uses an integer for radians. Doh. I'm going to go somewhere and pay penance for my insanity.
|
# ¿ Dec 8, 2009 04:47 |
|
CanSpice posted:Not really a coding horror but it's about codinghorror.com: That he wasn't doing backups? (No, backups on *the same server* aren't backups).
|
# ¿ Dec 11, 2009 22:40 |
|
CanSpice posted:Not really a coding horror but it's about codinghorror.com: http://74.125.95.132/search?q=cache...lient=firefox-a
|
# ¿ Dec 11, 2009 23:06 |
|
Anyone here ever parsed psycinfo or scopus records (some medical bibliography format). I'm dealing with a code base for parsing them out, and it's a fracking clusterfuck. It's actually open source
|
# ¿ Dec 19, 2009 00:31 |
|
Does $ret implicitly get set to "" when something is concatinated to it (and it doesn't already exist).
|
# ¿ Dec 22, 2009 04:01 |
|
gibbed posted:Yes, but you'll also get a warning (unless you're dumb and have warnings set to something other than E_ALL). ... that's the real coding horror.
|
# ¿ Dec 22, 2009 06:04 |
|
WTF does he create the parameter, how is __import__("poo poo").create() any worse than that disaster.
|
# ¿ Jan 26, 2010 06:21 |
|
The real coding horror is not knowing the difference between strong/weak typing and static/dynamic typing.
|
# ¿ Jan 27, 2010 20:54 |
|
Monkeyseesaw posted:Lambdas are awesome, I can't imagine why anyone would think otherwise. The alternative is the old 2.0 anonymous delegate syntax which was ugly as hell and hard to read. Unless you've been in bracket land your entire programming career, lambdas read very naturally. Congrats, you don't know the difference between strong/weak typeing and static/dynamic. Have a cookie.
|
# ¿ Jan 28, 2010 07:11 |
|
Ah java, was my_str == "foobar" really that hard.
|
# ¿ Feb 7, 2010 02:23 |
|
6174 posted:You have no idea what a break really is, do you? And you apparently don't understand the purpose of a syntax more expressive than asm.
|
# ¿ Feb 27, 2010 20:00 |
|
Bhaal posted:Well no, it can't be less than the current balance. It doesn't make sense for the balance to be a larger amount BEFORE you deposit the money, so you have to check for it. This is a phenomenal troll. Now please go away.
|
# ¿ Mar 3, 2010 02:41 |
|
Dijkstracula posted:I'm trying to debate whether this guy is the douchiest of all Ruby developers, or the one Ruby dev I'd actually want to have a beer with. Zed doesn't drink, but he's quite fun to have a beer.
|
# ¿ Mar 25, 2010 04:05 |
|
Otto Skorzeny posted:Does PHP's core or standard library have any other data structures besides its array/hash mashups? Depends how you define "standard library" do you mean the unholy mess of everything they just threw in the global namespace, or the *actual* SPL. I think the SPL has some more datastructures, they probably suck though.
|
# ¿ Apr 8, 2010 18:30 |
|
Not a coding horror the way everything else in this thread is, but a friend of mine hates writing functions. I have no idea why, or what caused him to think this way, but he does. He often asks me things like, "Can I do this without writing an extra function?", and I don't get it. Luckily he's still a student, maybe they can beat it out of him.
|
# ¿ Apr 16, 2010 07:15 |
|
|
# ¿ Mar 28, 2024 22:03 |
|
shrughes posted:That's pretty funny. Is it because he thinks that function calls are expensive? Nah, nothing like that (my amusing rationale was API bloating :P), I think he doesn't quite "think like a programmer" yet.
|
# ¿ Apr 16, 2010 07:19 |