|
Zakalwe posted:3000 lines is , but there's nothing wrong with using the occasional goto. "Never ever use goto" is generally promulgated by people who've heard of Dijkstra's article but never read the drat thing. Gotos have no place in OO (or really any kind of structured) programming. Maybe you'd feel more at home with fortran?
|
# ¿ Jun 15, 2008 01:38 |
|
|
# ¿ Apr 25, 2024 06:10 |
|
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 |
|
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 |
|
mr_jim posted:It's weird because his diction and tone seem to indicate some level of understanding and comprehension, probably enough to grasp why mountains of global variables are bad if he was taught. Part of me wants to just email him and help him out, but another part of me knows it would be an effort in futility because of how set in his ways he seems to be. Either way, very amusing code
|
# ¿ Dec 22, 2008 05:56 |
|
floWenoL posted:Some things are just complex and wouldn't benefit from trying to artificially split it up. That and C is pretty low-level so it can get verbose. I guess I should qualify this by saying I'm a complete programming noob, but I've never seen a huge function that couldn't benefit in terms of legibility and ease of maintenance by being split up in an appropriate way. Whats an example of something for which this doesn't apply?
|
# ¿ Dec 22, 2008 21:26 |
|
Rottbott posted:It was poorly desgined to begin with, then maintained and added to over many years by bad programmers. There are also hundreds of global variables, many of which have incorrect hungarian prefixes where the type has been changed but not the variable name. God I hate hungarian notation. How in the hell did anyone ever think it was a smart idea
|
# ¿ Dec 28, 2008 23:43 |
|
Steampunk Mario posted:Its original intent - to document the purpose and usage of the variable - was a great idea. Somehow it got perverted into being only the type, which is obviously useless. At the risk of opening a can of worms, its retarded in either form. You are only adding more headaches for yourself later on.
|
# ¿ Dec 29, 2008 06:25 |
|
hexadecimal posted:I honestly don't know. I had a brain fart. I wanted to do x==y but forgot you could do == on boolean values. Why? No idea. So I used ! xor. You are crazy. How can you forget the standard idiomatic way to do something so fundamental as comparing for equality and end up with the rubegoldberg-esque xor contraption?
|
# ¿ Jan 8, 2009 22:46 |
|
royallthefourth posted:Dude, you just pre-incremented in order to increment the post! It seems like a post-increment would have been better suited! I've got a solution for that
|
# ¿ Jan 9, 2009 02:23 |
|
ryanmfw posted:What would be the correct email regex? Its tricker than it seems. The regex suggested in RFC 2822 (printed below) matches some addresses that will cause most email clients to choke, like name@host.com.fake for example. (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
|
# ¿ Feb 12, 2009 00:15 |
|
ryanmfw posted:I was thinking more along these lines: There is no god
|
# ¿ Feb 12, 2009 01:18 |
|
Contero posted:My girlfriend wrote this: The horror The horror
|
# ¿ Feb 14, 2009 06:05 |
|
Contero posted:The real horror Ah yes. The Thing class.
|
# ¿ Feb 14, 2009 23:32 |
|
implicit posted:
Wow, very descriptive variable names! It's like you don't even need comments, it just explains itself
|
# ¿ Jun 13, 2009 20:09 |
|
tef posted:This would explain the response I got to this childish job advert. What the hell kind of job advertisement is that!?
|
# ¿ Jul 9, 2009 11:29 |
|
Ryouga Inverse posted:Haha, I love their "fail" page. Someone submitted a GA program that evolves hello world. Clearly not 1337 enough for these badass renegades of code
|
# ¿ Jul 9, 2009 18:58 |
|
I was looking through some of those "fail"s and couldn't figure out how one of them was getting this text it operates on:code:
Anyway at least I learned a neat trick: in python, "import this" prints the Zen of Python
|
# ¿ Jul 9, 2009 20:18 |
|
Otto Skorzeny posted:Oh, I think I do.
|
# ¿ Jul 10, 2009 00:06 |
|
Otto Skorzeny posted:Oh, I think I do.
|
# ¿ Jul 10, 2009 14:41 |
|
Otto Skorzeny posted:There's a cpan module for everything, and several for most things; the one I used was Acme::EyeDrops
|
# ¿ Jul 10, 2009 15:06 |
|
Avenging Dentist posted:And just think, you can actually do practical stuff that looks more-or-less like that. Please don't tell me that at this point in time
|
# ¿ Aug 12, 2009 05:33 |
|
Nippashish posted:This is from a math rendering module for mediawiki. It's a important to get rid of all those dangerous capital >'s. edit: Ah its php. I guess /i is to ignore case. What the hell?
|
# ¿ Aug 29, 2009 13:05 |
|
tef posted:I wonder how you know this
|
# ¿ Jan 2, 2010 06:03 |
|
Whats so complicated
|
# ¿ Jan 2, 2010 06:45 |
|
mr_jim posted:
|
# ¿ Jan 14, 2010 04:56 |
|
How did i not know that? Are there any other neat tricks in a similar vein to that?
tripwire fucked around with this message at 05:00 on Jan 14, 2010 |
# ¿ Jan 14, 2010 04:56 |
|
mr_jim posted:Cut out the middle man: Wow, thats insane! It's almost like having an interactive c REPL console for loving around with. I could see that coming in handy for just testing snippets of code without bothering to build and make a big project.
|
# ¿ Jan 14, 2010 05:59 |
|
Avenging Dentist posted:I've just devised a new mathematical relation. Ruby on Rails = PHP.
|
# ¿ Mar 24, 2010 20:27 |
|
rt4 posted:I'm probably going to get poo poo on for asking this, but... When it crashes silly!
|
# ¿ Mar 24, 2010 21:56 |
|
jandrese posted:I must be crazy because even though those lines look complicated at first, they're quite straightforward when you get down to reading them. It just checks every space around the player that they could possibly see without going outside of the bounds of the map. Pretty much everything is well named and everything. You are crazy.
|
# ¿ Mar 25, 2010 23:30 |
|
manero posted:I just reverted a developer's ASCII art figlet comments from an 800+ line HTML/JS mishmash. I assume he put them in because it was too hard for him to find the code he needed to modify. Spoilsport
|
# ¿ May 14, 2010 05:22 |
|
No Safe Word posted:It's the value for the LSRequiresIPhoneOS key Shouldn't it be an attribute of the LSRequiresIPhoneOS tag and not its own tag then?
|
# ¿ Jul 29, 2010 22:45 |
|
Crazy RRRussian posted:Although there is something to be said about long names that are still loving confusing and too long.
|
# ¿ Aug 6, 2010 02:26 |
|
Those aren't even good or descriptive. And one of the variables has the word Audio in it, twice. Sorry, three times.
|
# ¿ Aug 6, 2010 03:55 |
|
Maybe he was into constructivism
|
# ¿ Oct 6, 2010 01:51 |
|
Hammerite posted:Hahaha Ahahahahaha
|
# ¿ Nov 8, 2010 17:16 |
|
Only in code tags though. I don't know if thats funny or not.pre:def ¡(n) return !!n end puts ¡"farts".reverse! Array.class_eval do alias :∀ :each def Σ return self.reduce(0) {|k, i| k + i} end def ∋(obj) return !!self.find {|n| n == obj } end end π = Math::PI def √(n) return Math.sqrt(n) end def ∀(obj) obj.each {|e| yield e} end arr = [1, 2, 3] ∀(arr) {|n| puts n } #=> 1 2 3 arr.∋ 2 #=> true arr.push π arr.∋ π #=> true arr.Σ #=>9.141592653589793 √ π #=>1.7724538509055159
|
# ¿ Nov 12, 2010 06:25 |
|
I'd like to see you program the game of life more tersely!
|
# ¿ Nov 12, 2010 06:37 |
|
Janin posted:http://bugs.php.net/bug.php?id=32100 Ahahaha people still use this language willingly
|
# ¿ Dec 11, 2010 00:06 |
|
|
# ¿ Apr 25, 2024 06:10 |
|
tef posted:For what it is worth (not much), the talk that started this derail is online: http://vimeo.com/17675268 I really liked your talk! It was funny how many people in the audience were irked by your slagging on drupal
|
# ¿ Dec 15, 2010 00:20 |