|
Something I found in our codebase today, slightly paraphrased:code:
|
# ¿ Apr 15, 2014 17:31 |
|
|
# ¿ Apr 27, 2024 17:45 |
|
Plorkyeran posted:When possible, just find other stuff to work. I wasted the entire day yesterday because ClearCase decided to stop working on my machine. It got gradually worse, to the point that I could not even open a new terminal window or log in remotely. Only good thing is that I got a workstation upgrade out of it. We're planning to transition to Git Real Soon Now. I can't decide whether to wish for it or be terrified about it. I'm sure I'll have plenty of horrors for this thread when it happens.
|
# ¿ Apr 23, 2014 17:55 |
|
JawnV6 posted:Typing is typically on y'all's critical path? No, but spending five minutes watching somebody do a task I could do in as many seconds, is. My own nemeses are people who don't know what a path name is. You can type emacs butt/fart/dick.txt, you don't have to loving cd there first.
|
# ¿ Jun 3, 2014 17:52 |
|
Just today I was notified about a crash by the people porting our elder-gods-created codebase to GCC 4.8 [1]. The mechanism for running constructors for static objects has changed, and it conflicts with a nasty hack we are using in a few hundred shared libraries [2]. Time to update the comment documenting this hack, again. [3] [1] Currently on 4.1 since we're still using RHEL 5. Our customers are very, very conservative and need serious arm-twisting to agree to OS updates. [2] Luckily the affected code is mostly auto-generated. [3] That comment starts with a quote from Canto III of Dante's Inferno, and goes downhill from there.
|
# ¿ Jun 27, 2014 16:55 |
|
Hammerite posted:Are there misspellings in your code base? It is statisitically likely. Most people working on our code are not native English speakers (me neither). So we get grammatical errors as a bonus.
|
# ¿ Jul 1, 2014 05:27 |
|
Suspicious Dish posted:The second problem is that traditional regular expression languages don't have any inherent composability. There's no way to say delimiter = '-' | ' ' | ''; and then use (\d{3})? $delimiter (\d{3}) $delimiter (\d{4}). Because of this, you also see a lot of clever trickery in common regex syntax to group some parts together, and a lot of "code golf" that makes it dense and unreadable. Trying to understand a regular expression is like reverse engineering assembly code, almost. Lex is 39 years old. How much more traditional can you get?
|
# ¿ Jul 17, 2014 18:21 |
|
eithedog posted:City: Munster, Country: Germany (unless there's Munster in Germany as well)? http://de.wikipedia.org/wiki/Munster http://de.wikipedia.org/wiki/Münster
|
# ¿ Jul 21, 2014 16:17 |
|
Subjunctive posted:When it starts to be a tree-with-exceptions ("let's share this one case to save space...") is when you start taking nips out of your bourbon flask during compiles and randomly keying cars in the parking lot. It's called a DAG.
|
# ¿ Aug 4, 2014 17:02 |
|
Volmarias posted:Outside of Unix style file permissions, when would you realistically use octal? I recently had a use for octal constants, when defining the settings for a device register with two 3-bit fields. But that's perhaps the second time in a 20+ year career that I've found them useful.
|
# ¿ Aug 8, 2014 17:11 |
|
Internet Janitor posted:
Yeah, but in forth you can also do things like code:
|
# ¿ Aug 9, 2014 10:55 |
|
Athas posted:APL. ⌈ is the maximum function, ⌊ is the minimum. Similarly, ⌽ is reversal along the last axis, while ⊖ is along the first axis, and, of course, ⍉ reverses all axes. Richard Stallman posted:Rho, rho, rho of X
|
# ¿ Aug 19, 2014 16:29 |
|
down with slavery posted:Looks like an inverted chart of "what programming language should I choose first" answers Lisp
|
# ¿ Aug 20, 2014 17:45 |
|
Something I noticed today (typed in from memory so probably not 100% accurate):code:
|
# ¿ Sep 25, 2014 16:50 |
|
Jewel posted:Isn't that whole thing just It's supposed to be a sign extension from 31 to 32 bits, yes. But obviously the author didn't trust that the simple way to do it (shift left, then right) would work. As for the thought process (if any) that led to doing it twice, and to the utterly insane last expression - I have no idea. The fun bit? There are probably some chips in your smartphone, and your car, that were tested using the software containing this beauty.
|
# ¿ Sep 25, 2014 17:17 |
|
Spatial posted:Our compile times are in excess of 4 minutes right now. Try a couple of hours. For an incremental build. Want to run regression tests? Start the build when you leave, and hope the server that schedules the hardware for online tests doesn't die overnight, as it did yesterday.
|
# ¿ Oct 10, 2014 16:31 |
|
Suspicious Dish posted:The best documentation is: You'd love working on our codebase. You wouldn't.
|
# ¿ Oct 12, 2014 08:44 |
|
Hughlander posted:The last time I was paid to write C the compiler wouldn't complain about, but would ignore any part of an identifier after 8 letters. ratbert90 posted:Wow, that compiler must have been horribly lovely. In 1985 or so, all C compilers were that lovely.
|
# ¿ Oct 15, 2014 18:16 |
|
Flobbster posted:OS X 10.10 is only theoretical and if anyone ever actually figures out a way to install it, they would
|
# ¿ Oct 25, 2014 11:27 |
|
Steve French posted:Ugh it's foo, bar, baz, *then* quux I am surrounded by amateurs HEATHENS! foo, bar, baz, zip, qux, quux, quuux, ...
|
# ¿ Nov 7, 2014 06:56 |
|
Since this is the coding horrors thread, I'm sure most of you know about Duff's device already. But have you seen Stroustrup's device (PDF)? C++ code:
|
# ¿ Nov 14, 2014 10:19 |
|
baka kaba posted:Don't be silly, it clearly gets tomorrow's date today, when today is tomorrow and tomorrow is today Is your name Arnie?
|
# ¿ Nov 22, 2014 15:33 |
|
Voted Worst Mom posted:Let me personally assure you that gcc has never and will never accept that nonconformant code without error. Let me quote from the original, pre-standard, Annotated C++ Reference Manual (Ellis & Stroustrup): quote:6.5.3 The for Statement It goes on to comment: quote:[...] the same name cannot be used to control two for loops in the same scope. Every C++ compiler behaved this way before the standard came out.
|
# ¿ Dec 7, 2014 10:40 |
|
Joda posted:In what way is this a "a magic pseudo-variable?" Assignment to this used to be the way to do dynamic object allocation, before Stroustrup came up with new. This is the main reason why this is a pointer (it should have been a reference all along).
|
# ¿ Dec 8, 2014 06:39 |
|
HappyHippo posted:Seriously. I mean it's great in many ways, and it's very powerful, but man there are some dumb choices. Another good one: even though LaTeX has a standard convention for commands with arguments (the arguments are in { } braces following the command, eg "\frac{a}{b}") if you want to get an integral (or summation) sign with limits you need to use subscript and superscript. "\int" is the integral sign, "\int_a^b" is an integral from a to b. Why would you do that? It's not like it's taking the integral symbol and putting those superscripts/subscripts, the engine treats this as a special case. I always define my own sensible command so I can type "\intlimits{equation}{lower limit}{upper limit}" like it should have been in the first place. The "\int_a^b" notation is inherited from base TeX, while "\frac" is LaTeX specific. Also, "\int_a^b" is not actually a special case; in an inline formula, the limits will be typeset as sub/superscripts, it's only displayed formulas that are treated specially.
|
# ¿ Jan 6, 2015 20:26 |
|
Plorkyeran posted:LaTeX is pretty much nothing but a giant mass of historical warts. Also TeX itself is not really a programming language; it's almost all macro expansion and text substitution, with a few special horrors like \expandafter thrown in.
|
# ¿ Jan 7, 2015 07:20 |
|
Spatial posted:Someone's got a vfork() up their rear end in a top hat http://i.imgur.com/JV5cpXs.jpg (from the Schadenfreude thread.)
|
# ¿ Feb 8, 2015 14:37 |
|
Xenoveritas posted:The amusing thing about this "do the right thing" discussion is that Unix is the classic example of the Worse is Better design philosophy, and fork() sounds like a great example. It's a simple API and a simple concept. Rather than doing the right thing, it goes for "simple" and simply doesn't worry about the problems it causes. The caller can deal with those on their own. fork() actually is older than Unix (it came from a system called GENIE).
|
# ¿ Feb 8, 2015 19:41 |
|
Subjunctive posted:Get off the main thread. Then tell me where to send my 5-figure consulting invoice. gently caress every OS with a single-threaded event loop. yes I'm still bitter that BeOS didn't go anywhere
|
# ¿ Mar 25, 2015 21:23 |
|
ExcessBLarg! posted:However, "function-like" macros can generate all sorts of expressions that wouldn't be valid [...] I had reason to curse function macros just yesterday. Defined a class something like this: code:
|
# ¿ Mar 27, 2015 20:29 |
|
IT BEGINS posted:list] No; yes. Only idiots put spaces between a function name and parenthesis in C/C++, and only idiots put no space between a keyword (if/for/while/switch/...) and a parenthesis. But the real morons are those who put blanks behind an open paren, or before an closing one. When I see something like this, I know it's not going to be a good day: code:
|
# ¿ Apr 24, 2015 18:29 |
|
Firstkind posted:
You don't know four programming languages. You know four dialects of one. OK, you could argue that object orientation is a fairly major feature, so C could be considered to be more of an ancestor to the others, but it's still all imperative. But don't worry too much about that. You'll probably never encounter a job that requires something fundamentally different, like a functional (Lisp, Haskell etc.) or—God forbid—logical programming language. As for all those toy scripting languages like Ruby, Python or whatever the current fashion is, as you become more experienced you should be able to pick those up as you go.
|
# ¿ May 3, 2015 10:11 |
|
Wardende posted:You can write procedural or functional code in all of those languages. Yes. You can also do logical programming using C++ template metaprograms, but that doesn't mean it's a good language for doing that.
|
# ¿ May 4, 2015 18:25 |
|
Hughlander posted:
Amateurs. IEEE 1164 posted:The primary data type std_ulogic (standard unresolved logic) consists of nine character literals in the following order:
|
# ¿ May 6, 2015 18:49 |
|
xzzy posted:Python. Anybody remember the transputer?
|
# ¿ May 6, 2015 19:54 |
|
fritz posted:Those that belong to the emperor That looks like Cyc PS: your tags are leaking.
|
# ¿ May 7, 2015 17:31 |
|
fritz posted:How does this hypothesis explain having 8 bit bytes but 7 bit characters? 7 bit plus parity.
|
# ¿ May 9, 2015 13:13 |
|
Suspicious Dish posted:I don't think you understand quote:In summary, ICCCM is a technological disaster: a toxic waste dump of broken protocols, backward compatibility nightmares, complex nonsolutions to obsolete nonproblems, a twisted mass of scabs and scar tissue intended to cover up the moral and intellectual depravity of the industry's standard naked emperor.
|
# ¿ May 20, 2015 19:55 |
|
TheresaJayne posted:I think i have seen a lot of this, Its where they get an error once, and find the solution there and apply that solution as boilerplate everywhere. Or more likely, paste some codes they got from the internet. Otherwise known as Cargo Cult programming.
|
# ¿ Jun 4, 2015 10:20 |
|
QuarkJets posted:i write all of my code to check the current date and if the current date is before the code's last revision date then i start formatting the nearest disk Bernard S. Greenberg came up with an interesting strategy to prevent that happening in Multics.
|
# ¿ Jun 12, 2015 22:11 |
|
|
# ¿ Apr 27, 2024 17:45 |
|
ChickenWing posted:variable goes on the left aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Something like this is legal in C code:
|
# ¿ Jun 18, 2015 21:47 |