Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
shrughes
Oct 11, 2008

(call/cc call/cc)

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"?

Adbot
ADBOT LOVES YOU

shrughes
Oct 11, 2008

(call/cc call/cc)
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:
public void TestMaze()
{
    // all tests pass!
}
Another wrote his in C++, and half his code consisted of helper functions to handle memory management. (The problem required a single dynamically sized two dimensional array of chars.)

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)
Everything on this page: http://www.xsharp.org/samples/

shrughes
Oct 11, 2008

(call/cc call/cc)
Codepadded into #cobol:

code:
  for (int b=a; a>0; a--)
  {
    cout << a << "\n";
    myfile << a << "\n";

  } while (a > 0);

shrughes
Oct 11, 2008

(call/cc call/cc)

mr_jim posted:

:wtc:

How is that supposed to be useful?

Why, so you can encrypt passwords with xor encryption!

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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?

shrughes
Oct 11, 2008

(call/cc call/cc)

ShoulderDaemon posted:

Short-circuiting boolean operators.

Does that really work?

http://codepad.org/iKriru3l

Edit: Oh, but obviously not really with goto... Durr

shrughes
Oct 11, 2008

(call/cc call/cc)
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

shrughes
Oct 11, 2008

(call/cc call/cc)

Vinterstum posted:

Lambda calculus is a horror in itself.

If you think lambda calculus is bad, try adding continuations.

code:
((call/cc call/cc) (lambda (f) (display "butt!") (newline) (f f)))

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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?

shrughes
Oct 11, 2008

(call/cc call/cc)

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."

shrughes
Oct 11, 2008

(call/cc call/cc)

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 + operator is a commutative operator function is commutative.

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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?

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)
So I've been reading the PostgreSQL manual and discovered this gem.

code:
$ psql
psql (8.4.1)
Type "help" for help.

postgres=# SELECT (7 !);
 ?column? 
----------
     5040
(1 row)

postgres=# SELECT (!! 7);
 ?column? 
----------
     5040
(1 row)
That's right, PostgreSQL has two factorial operators!

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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

shrughes
Oct 11, 2008

(call/cc call/cc)
The integers are dense modulo 2pi so you can achieve arbitrary trigonometric precision.

shrughes
Oct 11, 2008

(call/cc call/cc)
Ok, listen up, folks.

var doesn't make C# weakly typed. Do you write your code like this:

code:
double distance = sqrt(square(x1 - x2) + square(y1-y2));
Or do you write it like this:

code:
double xDiff = x1 - x2;
double yDiff = y1 - y2;
double xSq = square(xDiff);
double ySq = square(yDiff);
double s = square(xSq + ySq);
double distance = sqrt(s);
Oh, let me guess: you'd write the latter.

P.S. Anybody who doesn't know their functions' return types is really a crabby dumb babby who sucks the teet of autocomplete.

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)
Speaking of coding horrors, I created one today:

code:
char *replaceEntities(char *to, const char *from, size_t n) {
	const char *end = from + n;
	const char *r = from;
	char *w = to;
		
	while (r < end) {
		char x = *r++;
		if (x == '&') {
			if (r < end) {
				const char *tmp = r;
				char y = *tmp;
				if (y == '#') {
					// decimal code or hex code?  Meh, we're assuming decimal code.
					
					tmp++;
					const char *tmptmp = tmp;
					int num = readNonNegativeNumber(&tmptmp, end);
					if (tmp < tmptmp && tmptmp < end && *tmptmp == ';' && num < 256) {
						r = tmptmp + 1;
						*w++ = num;
					} else {
						*w++ = x;
					}					
				} else {
					// Only do the common entities...
					if (eatThroughString(&tmp, end, "lt;")) {
						r = tmp;
						*w++ = '<';
					} else if (eatThroughString(&tmp, end, "gt;")) {
						r = tmp;
						*w++ = '>';
					} else if (eatThroughString(&tmp, end, "quot;")) {
						r = tmp;
						*w++ = '"';
					} else if (eatThroughString(&tmp, end, "apos;")) {
						r = tmp;
						*w++ = '\'';
					} else if (eatThroughString(&tmp, end, "amp;")) {
						r = tmp;
						*w++ = '&';
					} else {
						*w++ = x;
					}
				}
			} else {
				*w++ = x;	
			}
		} else {
			*w++ = x;
		}
	}
	return w;
}


// hilarious
NSString *initEntityString(NSString *allocedString, const char *beg, const char *end) {
	size_t n = end - beg;
	char *buf = malloc(n);
	char *bufEnd = replaceEntities(buf, beg, n);
	return [allocedString initWithBytesNoCopy:buf length:bufEnd-buf encoding:NSUTF8StringEncoding freeWhenDone:YES];
}
It works as specified :colbert:

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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?

shrughes
Oct 11, 2008

(call/cc call/cc)

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.

shrughes
Oct 11, 2008

(call/cc call/cc)
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.

shrughes
Oct 11, 2008

(call/cc call/cc)

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

shrughes
Oct 11, 2008

(call/cc call/cc)
I saw this today:

code:
static enum ParseState consume(NSMutableData *output, const char **posRef, const char *end, enum
 ParseState state, NSString **lastSeenThreadId) {
	const char *pos = *posRef;
	const char *r = pos;
more:
	switch (state) {
		case ParseStateTop: {
			const char *linkBeg = skipThroughSegment(&r, end,
 "<link rel=\"stylesheet\"" "type=\"text/css\" href=\"http://ycombinator.com/news.css\">");
			if (!linkBeg) {
				break;
			}
			state = ParseStateBeforeScript;
			[output appendBytes:pos length:linkBeg - pos];
			static const char alternateLink[] = "<link rel=\"stylesheet\" type=\"text/"
"css\" href=\"hn://ycombinator.com/news.css\">";
			[output appendBytes:alternateLink length:strlen(alternateLink)];
			pos = r;
			NSLog(@"Modified stylesheet!");
		}
			// fallthru
		case ParseStateBeforeScript: {
			if (!skipThroughString(&r, end, "var item = v[1];")) {
				break;
			}
			state = ParseStateBeforeMainTable;
			[output appendBytes:pos length:r - pos];
			pos = r;
			static const char confirmation[] = "if (!confirm('Sure you want to vote '"
" + v[0] + '?')) { return false; }";
			[output appendBytes:confirmation length:strlen(confirmation)];
		}
			// fallthru
		case ParseStateBeforeMainTable: {
			const char *attrBeg = NULL;
			const char *attrEnd = NULL;
			const char *segBeg = skipThroughTagWithAttr(&r, end, "table",
 "width=\"85%\"", &attrBeg, &attrEnd);
			if (!segBeg) {
				break;
			}
			state = ParseStateBeforePageTop;
			[output appendBytes:pos length:attrBeg - pos];
			static const char fullWidth[] = kFullTableWidth;
			[output appendBytes:fullWidth length:strlen(fullWidth)];
			[output appendBytes:attrEnd length:r-attrEnd];
			pos = r;
			NSLog(@"Full width!");
		}
			// fallthru
		case ParseStateBeforePageTop: {
			BOOL through = NULL != skipThroughSegment(&r, end,
 "<span class=\"pagetop\">");
			if (!through) {
				break;
			}
			state = ParseStateAfterPageTop;
			NSLog(@"Pierced through pagetop!");
		}
			// fallthru
		case ParseStateAfterPageTop: {
			BOOL through = NULL != skipThroughCloser(&r, end, "table");
			if (!through) {
				break;
			}
			state = ParseStateAfterTopRow;
			NSLog(@"Pierced through top row!");
		}
			// fallthru
		case ParseStateAfterTopRow: {
			BOOL through = NULL != skipThroughOpeningTag(&r, end, "table");
			if (!through) {
				break;
			}
			state = ParseStateInContentTable;
			NSLog(@"In content table!");
		}
			// fallthru
		case ParseStateInContentTable: {
			const char *attrBeg;
			const char *attrEnd;
			BOOL isDefault;
			const char *opener = choiceTagWithAttr(&r, end, "td", "class=\"default\"",
 "class=\"title\"", &attrBeg, &attrEnd, &isDefault);
			if (!opener) {
				break;
			}
			if (isDefault) {
				const char *tdDefault = opener;
				const char *commentWalker = r;
				r = tdDefault;
				const char *tdDefaultClassInsertionPoint = attrEnd - 1;
				const char *spanComhead = skipThroughTagWithAttr(&commentWalker,
 end, "span", "class=\"comhead\"", &attrBeg, &attrEnd);
				if (!spanComhead) {
					break;
				}
				if (!skipThroughTagWithAttr(&commentWalker, end, "span",
 "id=score_", &attrBeg, &attrEnd)) {
					break;
				}
				const char *beginningOfCommentId = attrEnd;
				const char *endOfCommentId = eatToChar(beginningOfCommentId,
 end, '>');
				if (!skipThroughTagWithAttr(&commentWalker, end, "span",
 "class=\"comment\"", &attrBeg, &attrEnd)) {
					break;
				}
	//			const char *beginningOfComment = commentWalker;
				const char *endOfComment = skipThroughCloser(&commentWalker,
 end, "span");
				// If we haven't read the whole comment, move r before 
// the recognizable td class="default".
				if (endOfComment == NULL) {
					break;
				}
				NSString *itemId = [NSString stringWithCString:beginningOfCommentId
 length:endOfCommentId - beginningOfCommentId];
				NSString *threadId = *lastSeenThreadId;
				enum PostTrackerPostNovelty novelty = threadId ? [[PostTracker
 thePostTracker] noticePost:itemId inThread:threadId] : PostTrackerPostNoveltyNotNew;

				// alright.  let's write.
				// Write data up to td class="default":
				[output appendBytes:pos length:tdDefaultClassInsertionPoint - pos];
				// Adjust td class:
				const char *extraClass = novelty == PostTrackerPostNoveltyNew ?
 " noveltyNew" : "";
				[output appendBytes:extraClass length:strlen(extraClass)];
				// write everything else consumed:
				[output appendBytes:tdDefaultClassInsertionPoint length:
commentWalker - tdDefaultClassInsertionPoint];
				pos = commentWalker;
				r = pos;
			} else {
				const char *tdTitle = opener;
				const char *titleWalker = r;
				r = tdTitle;
				if (!skipThroughTagWithAttr(&titleWalker, end, "span",
 "id=score_", &attrBeg, &attrEnd)) {
					break;
				}
				const char *beginningOfThreadId = attrEnd;
				const char *endOfThreadId = eatToChar(beginningOfThreadId,
 end, '>');
				if (!skipThroughTagWithAttr(&titleWalker, end, "a",
 "href=\"item?id=", &attrBeg, &attrEnd)) {
					break;
				}
				const char *beginningOfCommentCount = titleWalker;
				const char *endOfCommentCount = eatToOneOf(beginningOfCommentCount,
 end, " <");
				titleWalker = eatToChar(titleWalker, end, '<');
				if (!titleWalker) {
					break;
				}
				// Now, how many comments do we have, and what's our thread id?
				NSString *commentCountString = [NSString 
stringWithCString:beginningOfCommentCount length:endOfCommentCount - beginningOfCommentCount];
				NSInteger commentCount = [commentCountString integerValue];
				NSString *threadId = [NSString stringWithCString:
beginningOfThreadId length:endOfThreadId - beginningOfThreadId];
				NSLog(@"Comment count string: %@ thread id string: %@", 
commentCountString, threadId);
				NSInteger knownComments = [[PostTracker thePostTracker] 
knownCommentsForThread:threadId];
				// now for some output...
				[output appendBytes:pos length:titleWalker - pos];
				if (commentCount > knownComments) {
					NSString *s = [NSString stringWithFormat:@" <b>(%d)</b>", 
(commentCount - knownComments)];
					[output appendData:
[s dataUsingEncoding:NSASCIIStringEncoding]];
				}
				pos = titleWalker;
				r = pos;
				*lastSeenThreadId = [threadId retain];
			}
		}
			goto more;
		default:
			r = end;
			break;
	}
	[output appendBytes:pos length:r - pos];
	*posRef = r;
	return state;
}
A gigantic switch statement? Check. Switches with fallthrough? Check. Goto statements? Check. Intermingling patterns for altering external state? Check. The use of retain in the middle of nowhere? Check. Haphazard mechanisms for holding up a stream? Check. Extreme parsing fragility? Check. A haphazard mix of hardcoded strings and references to preprocessor defines? Check. Useless variable names? Check. I wrote it myself.

Edit: added hardwrapping to be less annoying

shrughes fucked around with this message at 05:42 on Apr 20, 2010

shrughes
Oct 11, 2008

(call/cc call/cc)
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.

shrughes
Oct 11, 2008

(call/cc call/cc)

A A 2 3 5 8 K posted:

:words: 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.

shrughes
Oct 11, 2008

(call/cc call/cc)

npe posted:

Found this bit of java code to left pad a number with zeros...

code:
String ss = "0000000000000000" + Integer.toString(suffix); 
sb.append(ss.substring(ss.length() - pad_size));

That's not a horror.

Adbot
ADBOT LOVES YOU

shrughes
Oct 11, 2008

(call/cc call/cc)

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 some many features I am not even sure why they exist.

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply