Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The /prog/matic programmer

Name: Anonymous 2012-09-27 15:16

ANyways, so... I was reading The Pragmatic Programmer [1] and it occurred to me that we should probably boil these principles down for the novices amongst us. ITT things you want to carve into your colleagues' faces.

* KEEP IT FUCKING SIMPLE, MOTHERFUCKER!
* You're code is not ``clever'', it is autistic.
* Code is /not/ poetry or art. Go away! Fuck your OCD.
* This shit has been solved a thousand times over.
* You do not need to design with the latest and greatest in gang-of-four approved OOP design patterns, using infinitely scalable NoSQL solutions in hip new languages that compile down to JavaScript (srsly WTF?!), just to create a CRUD application.
* Not everyone gets off on code, some of us just want to make a living doing the least amount of effort that is required to deliver a consistent quality for an extended period of time.

I swear by god if I see one more AbstractControllerFactoryInterface

[1] http://pragprog.com/the-pragmatic-programmer, easily found online.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-05-14 7:55

I think you'll all just make me facepalm more if I let you continue, so I'll explain it all now.

>>67 was the closest "why".
and it looks like your real problem is files with individual lines stretching beyond 4GiB, or 16EiB, or whatever, which would mean that your catch is `you better not store each line in an array as you read it in.'
Not quite. It'll die as soon as you have a line bigger than available memory. which may be several MB. Everything else you say isn't the main issue here. The main issue with the first few solutions is YOU ARE USING O(N) MEMORY WHEN YOU SHOULD ONLY BE USING O(1). That's why I said it doesn't matter whether you buffer or not. You can read in 64K at atime to buffer, no problem. But the moment you think of reading an "entire line" into memory at a time, you've FAILED.

>>70
>>34 is not correct because of getchar's return type. And it uses recursion and reinvents printf%u unnecessarily. Nothing else.

>>80
This is a pass, maybe overly complicated but if this was written on the first try it's a pass.

>>73
being meguca is suffering

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List