|
Ryouga Inverse posted:So today I gave him a story for "parsing" log files retrieved from a machine. The first iteration of this is simply "look for {FAIL!} in the log, if it's there, the test failed." A "story"?
|
# ¿ Nov 21, 2008 16:43 |
|
|
# ¿ Apr 23, 2024 22:09 |
|
We give applicants a coding test and we've gotten back some interesting responses. One guy asked, "Could you send me some test files?" We answered no. Then he invented his own input file format. The instructions are very clear what the input will be. Another made a project (in twice the typical time) that contained only a test class, with one method that said: code:
|
# ¿ Dec 17, 2008 06:17 |
|
tripwire posted: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? floWenoL is just wrong.
|
# ¿ Dec 23, 2008 01:26 |
|
That Turkey Story posted:This. Take whatever floWenoL says with a grain of salt, he's not very smart and he loves to mislead people by giving purposely false information. If all of your functions aren't less than 10 lines you probably made a huge mistake/are a terrible programmer. He's also really freakin gay. Well regarding 3000 line functions, they're only sensible when the level of complexity is very low, like when 2975 lines are used to fill a static array.
|
# ¿ Dec 23, 2008 02:16 |
|
Ugg boots posted:No they aren't. They only become useless if you're only doing bitwise operations on integers expecting the bitwise operations to have a result on the numerical representation. In all worlds doing 0xFF & 0x01 would equal 0x01, but not in all numerical representations does the 0x01 bit represent the same thing. What if, for example, a system only had a floating point math processor, so all integers are floating point numbers. Ignoring the precision problems, & 0x01 would not tell you if the number is even or odd, but in all representations it would give you the least significant bit. If I were floWenoL, I would be posting "Look how stupid you are." Bitwise anding a floating point representation with the floating point representation of 1 won't give you the least significant bit; it will give you some power of 2 or NaN. Arguing a point by bringing up these fantasmical scenarios is worthless jerkery.
|
# ¿ Jan 6, 2009 07:17 |
|
Everything on this page: http://www.xsharp.org/samples/
|
# ¿ Jan 21, 2009 23:05 |
|
Codepadded into #cobol:code:
|
# ¿ Jan 28, 2009 02:11 |
|
mr_jim posted:
Why, so you can encrypt passwords with xor encryption!
|
# ¿ Feb 5, 2009 02:24 |
|
Flobbster posted:I should start up a joke programming blog where I write posts like "Functions with multiple arguments are bad!" Well, this statement alone is actually 100% correct.
|
# ¿ Mar 17, 2009 06:43 |
|
Ugg boots posted:How would you conditionally branch with goto? Put function pointers in a two-element array and index the array with a boolean. Of course, that has nothing to do with goto. But I think there's some gcc feature that would let you do that with goto. Don't bytecode interpreters use that nowadays?
|
# ¿ Apr 12, 2009 19:46 |
|
ShoulderDaemon posted:Short-circuiting boolean operators. Does that really work? http://codepad.org/iKriru3l Edit: Oh, but obviously not really with goto... Durr
|
# ¿ Apr 12, 2009 19:58 |
|
Unless somebody points to a piece of standard that says otherwise, there's no reason a char can't be bounded between -128 and 127 while sizeof(int) == 4 where there is no bound on the possible value an int may contain. Edit: The reason was that you'd be limited to having 2^n distinct int values at any given time without being limited to having 2^n distinct ints. But if you're limited to having at most 2^n distinct ints, then that might violate some other rule of the language. shrughes fucked around with this message at 05:20 on Apr 13, 2009 |
# ¿ Apr 13, 2009 05:18 |
|
Vinterstum posted:Lambda calculus is a horror in itself. If you think lambda calculus is bad, try adding continuations. code:
|
# ¿ Apr 27, 2009 21:28 |
|
rhag posted:And no, don't give me the 80 columns crap. Nobody nowadays has an 80 col limitation, upgrade your drat monitor if you do, so no, there is no need to wrap on multiple lines most of the statements. You're one of those retarded people who maximizes all their windows, aren't you.
|
# ¿ May 14, 2009 01:44 |
|
Rottbott posted:Who doesn't make use of all the available screen space? Unless you're working on a single monitor, which is daft. If you have an 80 character column limit you'll have less screen area devoted to large swaths of empty space. Because you can have more files open side by side.
|
# ¿ May 15, 2009 00:02 |
|
necrobobsledder posted:If you're doing an Agile development model, you'll be checking in code so often you'll probably hit a point where you'll just check it in and fix it up in another commit happening in only a matter of hours while you work on it. It's always weird to read things like these, go "WTF?", and then remember how most people still use revision control systems.
|
# ¿ Sep 12, 2009 00:42 |
|
geetee posted:Maybe setting myself up for embarrassment, but can you explain how people should use revision control systems? Well, reading things about "checking in code for the night" makes it sound like people are all working on the same branch or something... And having the timescale between "commits" being hours rather than minutes... :/ necrobobsledder posted:I was mostly saying that it's alright to check-in code that's commented out if you basically put a "under construction, here's what's shaky and don't step on these parts" sign up and if it's temporary. See, if it's under construction, it should just go in some private branch. Why don't you use a separate branch for every unit of change you're working on?
|
# ¿ Sep 12, 2009 15:53 |
|
Athas posted:Do you really think it's useful to commit every few minutes? For some number of minutes less than sixty. And define "commit."
|
# ¿ Sep 12, 2009 15:58 |
|
Zombywuf posted:It is demonstably false, as can be seen from making the set S the union of the set of integers and pointers. Given that in classical logic (which I assume we are operating in) if you can prove a false statement you can prove anything, the latter paragraph clearly does prove, and thereby explain, the former. Huh? If S is the union of Z and P, then for + to be a binary operator, you'd have to be able to add two pointers together. However, we could say that + : (Z x P) U (P x Z) -> P And thus the pointer arithmetic +
|
# ¿ Sep 20, 2009 20:28 |
|
Zombywuf posted:Is the false statement. a and i are trivially members of the set S = {a, i}. Still no good; if + were a binary operator on {a, i} then (a + a) would have to make sense.
|
# ¿ Sep 20, 2009 20:41 |
|
Zombywuf posted:That's fine, just make it a. Even so, a+i would have to be in the set. This only works if i = 0.
|
# ¿ Sep 20, 2009 20:48 |
|
weaaddar posted:I just figure you guys might get a laugh out of this. It's just a Y combinator, a useful utility function found in any real programming language. Where's the horror in that?
|
# ¿ Nov 10, 2009 01:59 |
|
PT6A posted:I suppose; however, it does affect me, since using unapproved languages mean the TAs have to use a different environment to mark the assignments, and may have to read code in language with which they aren't familiar, which holds up the grading in a very serious way (and may result in the TAs being in a bad mood when they mark my assignment). I'm pretty sure the reason I didn't fail my final computer graphics project was that the TA didn't feel like installing GHC and GTK on Windows, so I just got an A instead.
|
# ¿ Nov 29, 2009 16:29 |
|
So I've been reading the PostgreSQL manual and discovered this gem.code:
|
# ¿ Nov 30, 2009 00:03 |
|
ColdPie posted:Should've known the 65 new posts weren't 65 new funny posts but instead 65 new posts arguing about functional programming. You mean 66. Edit: 68.
|
# ¿ Nov 30, 2009 16:57 |
|
Zombywuf posted:I wonder what the equivalent would look like for Haskell... Probably like some graphical, better-organized version of this list. Control.Category (.) composition (<<<) left-to-right composition (>>>) right-to-left composition Control.Arrow (***) splitter (&&&) fanout (^>>) function precomposition (>>^) function postcomposition (<<^) right-to-left function precomposition (^<<) right-to-left function postcomposition (<+>) ArrowPlus (+++) conditional split (|||) fanin Control.Applicative (<*>) sequential application (<|>) alternative (<$>) fmap (<$) replace (*>) discard first (<*) discard second (<**>) reverse application Control.Monad (>>=) sequential composition (>>) discard first (=<<) reversed sequential composition (>=>) left-to-right Kleisli composition (<=<) right-to-left Kleisli composition Control.Parallel.Strategies (>|) evaluate before (>||) evaluate in parallel ($|) sequential function applictaion ($||) parallel function application (.|) sequential function composition (.||) parallel function composition (-|) sequential right-to-left function composition (-||) parallel right-to-left function composition Data.Array.IArray (!) indexing (//) update Data.Array.Parallel and children (+:+) concatenation ($:) closure application ($:^) lifted lifted closure application ($!) indexing (+++) stream concatenation (^+++^) undocumented stream something (>:) who the gently caress cares for unlifted arrays (^+:+^) some crazy poo poo for unlifted arrays (!:^) unlifted sequential array indexing (+:+^) unlifted sequential array concatenation (^+:+^) some other concatenation Data.Bits (.&.) bitwise and (.|.) bitwise or Data.Bool (&&) logical and (||) logical or Data.Complex (:+) build complex number Data.Eq (==) equals (/=) not equals Data.Function (.) function composition ($) function application Data.IntMap (!) lookup (\\) set difference Data.IntSet (\\) set difference Data.List (:) list cons (++) list concatenation (!!) list indexing (\\) list difference Data.Map (!) lookup (\\) set difference Data.Ord (<) less than (>=) greater than or equal to (>) greater than (<=) less than or equal to Data.Ratio (%) make ratio Data.Sequence (<|) sequence cons (|>) sequence snoc (><) sequence concatenation Data.Set (\\) set difference Prelude (+) add (*) multiply (-) subtract (/) divide (**) floating exponent (^) non-negative exponent (^^) integral exponent ($!) strict function application System.Filepath (</>) combine filepaths (<.>) add file extension Test.HUnit (@?) assert (@=?) assert equal (@?=) assert equal with expected on right side (~?) make test case (~=?) make test case on equality assertion (~?=) make test case on equality assertion with expected on right side (~:) label test Test.QuickCheck (==>) implies Text.Html and Text.Xhtml (<<) convert to html and apply (+++) concatenate html (<->) connect html table beside (</>) connect html table above Text.ParserCombinators.Parsec (<?>) label (<|>) alternative Text.ParserCombinators.Parsec.Perm (<||>) builds permutation parser (<$$>) builds permutation parser differently (<|?>) builds permutation parser differently (<$?>) builds permutation parser differently Text.ParserCombinators.ReadP and .ReadPrec (+++) symmetric choice (<++) exclusive left-biased choice Text.PrettyPrint.HughesPJ (<>) beside (<+>) beside with space ($$) above with overlapping ($+$) above with no overlapping Text.Regex.Posix (=~) match regex (=~~) match regex in monad
|
# ¿ Dec 1, 2009 17:20 |
|
The integers are dense modulo 2pi so you can achieve arbitrary trigonometric precision.
|
# ¿ Dec 8, 2009 08:25 |
|
Ok, listen up, folks. var doesn't make C# weakly typed. Do you write your code like this: code:
code:
P.S. Anybody who doesn't know their functions' return types is really a crabby dumb babby who sucks the teet of autocomplete.
|
# ¿ Jan 27, 2010 16:10 |
|
evensevenone posted:Linked list is like answering "Drive my Hummer!" when someone asks you what you would do if you didn't have a car. No, your analogy is inapt. Using a linked list is like answering, "I never drive my car" when someone asks me what I would do if I didn't have a car.
|
# ¿ Mar 18, 2010 10:30 |
|
Speaking of coding horrors, I created one today:code:
|
# ¿ Apr 14, 2010 23:35 |
|
jonjonaug posted:I get all of this except the last part. What's wrong with <string>? It deep-copies, it's mutable, it's a sequence of bytes with no encoding, it's made out of some kind of basic_string miasma, it's expensive to concatenate, it's inconvenient in the standard library to convert stuff to or from them, with nothing like String.Format or other good things, and it's written in C++, and it's pretty much like the rest of the STL, which is unbragable.
|
# ¿ Apr 15, 2010 01:23 |
|
king_kilr posted: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. That's pretty funny. Is it because he thinks that function calls are expensive?
|
# ¿ Apr 16, 2010 07:18 |
|
qntm posted:Today I discovered that FTP has no capability to "get" a complete directory and all of its subdirectories. Have an RPC protocol where the client sends code to be run sandboxed on the server. It's the only option unless you want zillions of useful features.
|
# ¿ Apr 16, 2010 19:58 |
|
Both are pretty easy, you're talking about easily transformable code that doesn't really create some kind of framework trap that will ruin your life for the rest of the project.
|
# ¿ Apr 16, 2010 23:42 |
|
qntm posted:Yeah, it's the ftp command that I'm complaining about, not the protocol itself. If it's so easy to implement clever recursive transfers on top of ftp, why hasn't it been done and incorporated into ftp? Features are bad. Consider the ASCII transfer mode, or EBCDIC mode. Consider how many different modes of operation one would need for the different ways of doing directory hierarchies, symbolic links, and such. Hey, back in the day, some computers didn't even have directory hierarchies. Also, bandwidth was lower and disks were slower, so lag wasn't as important. They probably just implemented the features they needed first, and then implemented other stuff in the client. And then they wrote that in the RFC. Which is from 1971. And that was the end of it. shrughes fucked around with this message at 21:31 on Apr 17, 2010 |
# ¿ Apr 17, 2010 05:35 |
|
I saw this today:code:
Edit: added hardwrapping to be less annoying shrughes fucked around with this message at 05:42 on Apr 20, 2010 |
# ¿ Apr 20, 2010 04:53 |
|
When I had a group project, I got stuck with the three other kids who were not turned on by all the other groups' stupid ideas. We ended up being the awesomest group. The end.
|
# ¿ Apr 28, 2010 06:42 |
|
A A 2 3 5 8 K posted:It doesn't make sense to say that one has an excellent reason to prefer Pink Floyd to Led Zeppelin, it's personal and subjective. No, you are wrong [1]. We are talking about style guides here, not music. People do not come with a built-in preference for what they consider good style. The preference is mostly "what they are used to." And thus it makes sense to have and to follow style guidelines, so that everybody is used to the same style. [1] Also, I am right.
|
# ¿ May 19, 2010 09:58 |
|
npe posted:Found this bit of java code to left pad a number with zeros... That's not a horror.
|
# ¿ May 31, 2010 06:06 |
|
|
# ¿ Apr 23, 2024 22:09 |
|
HFX posted:No, C# is what you get when you try to add features to attract every developer to your platform without designing for the features originally in mind. C# has turned into a mess of a language with What features are these? I was going to assume that you're a moron, but first, I'd like to know how you are a moron.
|
# ¿ Jun 1, 2010 21:14 |