|
Lone_Strider posted:"well I'm just making sure" aka "I can't be bothered to learn something new or correct my gross misunderstanding of something."
|
# ? Dec 8, 2008 20:06 |
|
|
# ? May 14, 2024 06:20 |
|
Mustach posted:You can't subclass java.lang.String. welp, you can in C++ using gcj's java interface.
|
# ? Dec 8, 2008 20:13 |
|
Sorry, I was talking about Java, not GNU Gava or whatever
|
# ? Dec 8, 2008 20:42 |
|
Lone_Strider posted:Holy poo poo, this is like a tell-tale mark for crappy devs. I bet when he was called on it he said "well I'm just making sure"
|
# ? Dec 8, 2008 21:58 |
|
Vanadium posted:welp, you can in C++ using gcj's java interface. GCJ Can't Java
|
# ? Dec 9, 2008 01:50 |
|
My co-worker told me today that const-correctness isn't worth the speed hit.
|
# ? Dec 9, 2008 02:08 |
|
Painless posted:GCJ Can't Java It's getting there: http://en.wikipedia.org/wiki/Icedtea
|
# ? Dec 9, 2008 02:27 |
Vanadium posted:That just makes the code more portable. In Ruby it is common practice to call .to_s on string-like objects That's for when you're anticipating receiving either a symbol or a string and want one or the other. It's not just to make sure.
|
|
# ? Dec 9, 2008 04:09 |
|
I saw this in some research code recently:code:
|
# ? Dec 9, 2008 04:47 |
|
GT_Onizuka posted:I saw this in some research code recently: I work with a guy that just changes random poo poo until it appears to work as he intends. Nonsense like this is (unfortunately) a daily occurrence for me
|
# ? Dec 9, 2008 06:02 |
|
Lexical Unit posted:My co-worker told me today that const-correctness isn't worth the speed hit. My co-worker said that having a single 'int i' in the beginning of a function instead of one per for loop saves memory.
|
# ? Dec 9, 2008 10:38 |
|
geetee posted:I work with a guy that just changes random poo poo until it appears to work as he intends. Nonsense like this is (unfortunately) a daily occurrence for me Unfortunately, when someone write codes like that, the only way to get it to work is to rewrite it or jiggle the handle a bit to try and get it to work.
|
# ? Dec 9, 2008 16:23 |
|
This is what I'm faced with during my continued attempts to stop using a table called "guid" (with 1 row and 1 bigint column) that is locked and incremented upon every insert.quote:What they don't mention are all the real-world issues people have run into. Matt, if you're a goon, surely you'll understand that I think you're a giant douchebag.
|
# ? Dec 9, 2008 16:23 |
|
geetee posted:This is what I'm faced with during my continued attempts to stop using a table called "guid" (with 1 row and 1 bigint column) that is locked and incremented upon every insert. By any chance do you work in New York?
|
# ? Dec 9, 2008 16:27 |
|
Fenderbender posted:By any chance do you work in New York? If you trust my profile
|
# ? Dec 9, 2008 16:29 |
|
Found this gem today:php:<? function logme($what) { echo "$what\n"; exec("echo \"" . $what . "\" >> somelogfile.log "); } ?> Arntor fucked around with this message at 19:30 on Dec 9, 2008 |
# ? Dec 9, 2008 16:55 |
|
svn blame these gems and tell us more about who wrote them.
|
# ? Dec 9, 2008 16:57 |
|
Please tell me that was actually a system and not an exec. Edit: Ignore me, I got my sigil'ing languages mixed up.
|
# ? Dec 9, 2008 16:58 |
|
At first I was with you. But I can count at least three strikes against Perl. The function, the param, and the echo. And no my, how dare they.
|
# ? Dec 9, 2008 17:13 |
|
Triple Tech posted:At first I was with you. But I can count at least three strikes against Perl. The function, the param, and the echo. And no my, how dare they. I figured exec did the same thing everywhere and did not actually look that closely Yeah, perhaps I just assumed the perl guys had come up with a reasonable function definition syntax since I last played with it, but I guess that would be stupid
|
# ? Dec 9, 2008 17:21 |
|
ani47 posted:My co-worker said that having a single 'int i' in the beginning of a function instead of one per for loop saves memory. It has certainly been true in the past that GCC doesn't put a lot of effort into optimizing stack space, including (1) failing to re-use stack slots for different variables based on scope/liveness and (2) failing to "free" stack slots that were promoted to registers. Furthermore, a good compiler shouldn't be harmed by re-using the variable. That said, it's almost certainly not worth the readability hit to "optimize" this by hand.
|
# ? Dec 9, 2008 22:52 |
|
geetee posted:This is what I'm faced with during my continued attempts to stop using a table called "guid" (with 1 row and 1 bigint column) that is locked and incremented upon every insert.
|
# ? Dec 10, 2008 00:55 |
|
Lexical Unit posted:My co-worker told me today that const-correctness isn't worth the speed hit. I'm not a professional programmer or anything (nothing of the sort) but I never make functions const because I've always thought accidentally modifying an object when you didn't mean to would be a fairly uncommon thing, and I always forget to make some const that should be and then have to search through files adding const to other functions that were called by const ones. I've always gotten by fine, is this a horrible thing? I do use const when passing by reference though I guess.
|
# ? Dec 10, 2008 01:36 |
|
PrBacterio posted:Most of the things in this thread don't even bother me, and I'm very far from knowledgeable about databases, but still this one managed to get to me. That's some seriously poo poo It only got worse after I emailed him my reply. Here's more bullshit: quote:The problem is usually the slaves falling out of sync for various reasons. The issue always came down to the slave having to generate its own new increment value (because the slave works by just running the same query that was run on the master). Wow. I might not be a MySQL expert, but I'm pretty sure replication works. I remember reading about some issues with a slave crashing and trying to rerun queries from the binarylog because it wasn't able to mark off where it last left off... but that's a situation completely unrelated to using auto_increment. New form of replication? Hey what's up, my name is Matt, I read about this new internet thing. MySQL 5 came out over 3 years ago. But holy poo poo, the last paragraph is where I lost it... It works very well? Every insert requires 3 queries. (1) Get the next ID, (2) insert the record, (3) increment the "GUID" table. All the while you're locking EVERY table from doing an insert because you need to lock the GUID table which EVERY insert needs to hit. It's simple? You know what's simplier? Kill yourself. It never has an issue? See above. Besides re-inventing the wheel (poorly) and all the overhead, it's a pain in the rear end to deal with. It's never been a performance bottleneck? How could you notice it when it's surrounded by the clusterfuck of an ORM we use? Actually, the irony of this is that we're sitting at a meeting today and he says he wrote code that lets him fetch chunks of a 1000 IDs at a time to speedup the import script he's writing. Really? But it gets better... He claimed 1000 fold performance increase! Wow! I didn't realize fetching a new ID accounts for all operation time. Actually, it just might... And it'll easily handle multi-master replication (which we'll probably never need)? Oh god... How does it handle it you ask? Each web server has a setting to say how many IDs to increment by. Kind of like the auto_increment setting, but with a million more steps and hoops to jump through. So why change? I actually said we should look at something like Propel and he immediately shot back something to the effect of: "I've looked at all of those and they're all dead projects."
|
# ? Dec 10, 2008 01:49 |
|
I'm working on trying to optimize some C# stuff that keeps falling over due to a complete lack of understanding of any kind of resource management by the contractors that wrote it. Just looking at almost any function makes me want to stab someone. So I'm trying to trace through some of the program logic, and open up a source file, and see this at the top: code:
What do you know code:
Also, that explains their need to do this in their message loop after processing every message: code:
|
# ? Dec 10, 2008 01:51 |
|
seiken posted:I'm not a professional programmer or anything (nothing of the sort) but I never make functions const because I've always thought accidentally modifying an object when you didn't mean to would be a fairly uncommon thing, and I always forget to make some const that should be and then have to search through files adding const to other functions that were called by const ones. I've always gotten by fine, is this a horrible thing? That's pretty much what always happens with const: you run into some code that doesn't tag its types properly, and you either (1) strip the consts out of your new code, (2) spend hours propogating consts through the old code, or (3) add a const_cast and make weeping promises to yourself that you'll clean them all up someday.
|
# ? Dec 10, 2008 01:52 |
|
A friend who interns at some lovely gamedev company around where I live told me they had someone applying for a job, and he sent in a game together with the source code. The code (in C++) was riddled with stuff like this:code:
|
# ? Dec 10, 2008 01:59 |
|
seiken posted:I've always gotten by fine, is this a horrible thing? I mostly design libraries to be used by other people and one of the primary drives for being const-correct for me is common courtesy. If I provide a method bar() const on my object foo, then users of my library know that calling it isn't going to (conceptually) mutate the object. Going back and trying to const-correctify something that wasn't designed to be const-correct from the start is painful.
|
# ? Dec 10, 2008 03:51 |
|
beuges posted:This is what the douchebags who wrote the Amazon implementation at my shop did. They were masturbating themselves that they did it in 6 weeks, but maintainance is impossible. It literally takes almost 6 weeks just to fix bugs or update the feeds when Amazon changes the spec.
|
# ? Dec 10, 2008 03:51 |
|
geetee posted:It only got worse after I emailed him my reply. Here's more bullshit: You know, I'm not going to defend this guy or what he's doing, but I think I've seen this solution before from people who want to simulate Oracle style sequences. Usually though, it's wrapped up in a single procedure to sort of hide the unpleasantness of it. I guess maybe I'm too used to Oracle, where out of the box we regularly have to query out of a one column, one row table to get certain types of queries to work.
|
# ? Dec 10, 2008 03:54 |
|
netcat posted:A friend who interns at some lovely gamedev company around where I live told me they had someone applying for a job, and he sent in a game together with the source code. The code (in C++) was riddled with stuff like this: I like to keep my integers on the heap, too, just on the off chance that if my stack gets corrupted my data (integers) will still be correct.
|
# ? Dec 10, 2008 07:01 |
|
Ulillillia released the source code for a program he designed in C which converts the sampling rate of PCM wave files. Check it out: http://www.ulillillia.us/files/WAVFileSampleRateGeneratorV2Source.zip
|
# ? Dec 16, 2008 10:26 |
|
tripwire posted:Ulillillia released the source code for a program he designed in C which converts the sampling rate of PCM wave files. Oh my-o-my. Is that someone on the forums?
|
# ? Dec 16, 2008 14:30 |
|
TSDK posted:Is that someone on the forums? Not as far as I know. There have been some GBS threads about him over the years, though. He's internet famous for being crazy. It's been a while since I've read about what he's been up to, but notable things I remember:
Witness the insanity first-hand. His Major Fears -- Mirrors are first, complete with a map of an imaginary department store and an analysis of the logistical difficulties created by the mirrors there. Erasmus Darwin fucked around with this message at 15:04 on Dec 16, 2008 |
# ? Dec 16, 2008 15:01 |
|
TSDK posted:Oh my. Check out his website or youtubes for some flavour: http://www.youtube.com/ulillillia http://www.ulillillia.us When he says "according to my calculations" he actually means it
|
# ? Dec 16, 2008 15:09 |
|
In SQL:code:
|
# ? Dec 16, 2008 15:42 |
|
From a C# TFTP Server I'm attempting to usecode:
|
# ? Dec 16, 2008 17:53 |
|
Haha, there's more WTFage -- if the getter is called without a properly cased string, not only will the property fail to be set, but it won't complain, as it has no default: section. WTF indeed!
|
# ? Dec 16, 2008 18:25 |
|
Victor posted:Haha, there's more WTFage -- if the getter is called without a properly cased string, not only will the property fail to be set, but it won't complain, as it has no default: section. WTF indeed! code:
|
# ? Dec 16, 2008 18:38 |
|
|
# ? May 14, 2024 06:20 |
|
fankey posted:I'm pretty sure 99% of all C# projects on sourceforge are complete garbage. Cross the word C# out of that sentence and your statement remains true.
|
# ? Dec 16, 2008 18:40 |