|
Except you're always trying at least once, but the saying says to try only if you don't succeed first.
|
# ¿ Feb 3, 2016 18:58 |
|
|
# ¿ May 9, 2024 22:37 |
|
code:
|
# ¿ Feb 3, 2016 19:15 |
|
Are you familiar with the meaning of the phrase "if at first"?
|
# ¿ Feb 3, 2016 20:04 |
|
I was reading a job posting and got to the part that said, "Our code is highly structured PHP." and closed it.
|
# ¿ Feb 3, 2016 20:52 |
|
Because succeed() and try() are two different functions, obviously!
|
# ¿ Feb 3, 2016 22:45 |
|
code:
|
# ¿ Feb 5, 2016 17:48 |
|
My favorite was when my bank or T-Mobile or something started rejecting my password because it didn't support the special characters I was using. It rejected them as I was logging in with the password I already had. I still don't get that. If I want wacky Unicode in my passwords, I should be allowed to!
|
# ¿ Feb 18, 2016 21:09 |
|
"Please paste your security image in the box below."
|
# ¿ Feb 18, 2016 21:24 |
|
Suspicious Dish posted:half rant / half question: does anybody hate the "programmers are introverted, we must be alone, in our own offices, to prevent ~*~ breaking the flow ~*~" meme thing I'm not a big fan of pair programming, because I don't like the time it takes to watch the other person type, but part of the reason I turned down a job offer a year ago was because it would have put me alone in an office. I felt like one of my strengths was the ability to turn around in my chair and help the people who sit next to and behind me. I also knew that, if I were cooped up in an office all day, I would quickly start to fit the stereotype and it took me a while to break out of that stereotype when I started my current job.
|
# ¿ Feb 24, 2016 06:51 |
|
I discovered today that Java allows ဪ in identifier names, but not 💩. I guess the first one counts as a letter, but the pile of poo is just a pile of poo.
|
# ¿ Feb 26, 2016 00:01 |
|
canis minor posted:Are there any resources on this I can read explaining "why"? I'd have thought that even if a character set had Ⅻ as one singular character, translating it to Unicode should have become XII. If translating XII from Unicode to that character set, it would go back to Ⅻ, but I guess it's naive of me to think so (or I guess there's a roman sentence where IV should stay IV instead of Ⅳ) I wouldn't want character conversions to be responsible for my friend 6 having to go to the hospital to get an 4 drip.
|
# ¿ Mar 4, 2016 20:37 |
|
That was one of Andy's better stories on The Office. He was originally named Walter, Jr., until his little brother came along and his parents liked him better.
|
# ¿ Mar 4, 2016 22:19 |
|
On top of that, Eclipse can generate "bridge" code that make it so stuff outside of nested classes can use private members inside them. It usually doesn't affect anything, though, so you can tell Eclipse to shut up about it.
|
# ¿ Mar 15, 2016 18:12 |
|
I like the slide with the gears that can't possibly turn: http://tpm2016.zoffix.com/#/43
|
# ¿ Apr 1, 2016 19:48 |
|
Probably in a way the original developer didn't expect!
|
# ¿ Apr 12, 2016 15:54 |
|
I'm trying to picture what that maybe used to do and I'm drawing a blank.
|
# ¿ Apr 13, 2016 15:42 |
|
I wonder if that person had any idea why that was suddenly necessary.
|
# ¿ Apr 20, 2016 15:43 |
|
Me today: "Hmm. What's this unit test here that doesn't seem to run ever? Oh, it fails! Whew, fixing it was a simple change. Now what other code was calling what this test was testing? Oh, nothing. This test tests code that only the test itself calls. Great."
|
# ¿ Apr 21, 2016 18:36 |
|
Thermopyle posted:When I use else after return it's because it seems to communicate intent better. It's good to be pragmatic about stuff like this. (But not all the time! Get it?)
|
# ¿ May 11, 2016 15:41 |
|
rjmccall posted:I personally would not consider any of those to be "magic numbers"; a comment on the line above like "Interpret the first four bytes as a big-endian int." Yeah, I agree with that. For a computation where none of the pieces really has any meaning on its own, I think it's fine to skip defining constants, as long as some documentation says where the values come from. We have code all over the place at work that looks like this: Java code:
|
# ¿ May 12, 2016 15:34 |
|
That's not the "horror" part.
|
# ¿ Jun 2, 2016 15:46 |
|
MALE SHOEGAZE posted:It's got to be one of those intentional 'simplicity' designs because I cannot imagine designing a language with multiple return values and not go hog wild with destructuring syntax. Case in point: Ceylon.
|
# ¿ Jun 19, 2016 18:45 |
|
Java's class and instance initialization logic only extremely rarely affect anything, but, boy, when they do, it's amazing. (In this case, I bet the old compilers were figuring the values had already been initialized because some implicit constructor had already run or something.)
|
# ¿ Jul 11, 2016 16:49 |
|
NihilCredo posted:Speaking of Java boilerplate, am I the only one who sees this as a coding horror? No.
|
# ¿ Aug 17, 2016 15:28 |
|
fa+rt
|
# ¿ Nov 3, 2016 15:44 |
|
I saw, during a code review, a bit of code that relied on another bit of code outputting an exact sequence of characters. I asked my coworker to write a unit test that verified the functionality, in case we ever rewrite the code to output a slightly different sequence of characters. What I really wanted to ask was, "How come you didn't write that unit test already?" Then the coworker asked where to put it, how to run unit tests, etc.
|
# ¿ Dec 1, 2016 17:51 |
|
taqueso posted:Really, that's awesome and you should be happy to help someone learn. It was well after I was out of college when I had finally been burned enough by not having testing that I 'got' unit tests and why it was worth spending the energy. I wish I someone had mentored me on it earlier. It clearly didn't stick the last handful of times I recommended during team meetings that we should all be writing more unit tests (and said coworker was nodding along).
|
# ¿ Dec 1, 2016 19:13 |
|
xtal posted:Can anyone come up with a Java reflection joke? More like a C# reflection joke.
|
# ¿ Dec 6, 2016 20:46 |
|
Volte posted:By making Go code ugly by nature and mandating an arbitrary style, it lets you turn off that part of your brain that gives a poo poo about that, and you end up writing code twice as fast. Bognar posted:Go is great as a honeypot for bad opinions. Hmm. Yes, I see.
|
# ¿ Jan 12, 2017 17:09 |
|
Testicle-Driven Douchebaggery At my old job, we had a pile of API documentation that was out-of-date because it was separate from the code and in an annoying-to-update Google doc. When I added some functionality to the API, I covered the new stuff with some unit tests and said, "If anybody needs API documentation, send them the unit test." I don't think the sole consumer of the API ever even asked for documentation, so whatever.
|
# ¿ Feb 2, 2017 18:29 |
|
At my last job, we had something like fifty unit tests for years and years because nobody was being directed to write them and it was impossible to test a huge chunk of the code because it assumed there was an active HTTP request going on. I finally got sick of simple stuff failing immediately after we pushed it and, being on the Infrastructure team, decided that it was up to us to add unit testing to the list of what every developer is expected to know about. A week later, we had sixty unit tests, including a few rear end in a top hat tests I wrote that were designed to fail when developers added new values to a certain enum and didn't add tests for them. Couple months later, we had two hundred unit tests, mostly written by me. Now I'm unemployed because management didn't see the value of our team. vv I bet I could ask my old coworkers in a year how many unit tests they have and it'll still be two hundred.
|
# ¿ Feb 6, 2017 19:54 |
|
Ha, maybe that's what management was worried about; I was about to start updating the coding standards to include starting to expect more and more unit tests to be written. This, of course, would have inflated point estimates and slowed down development. And for what? Peace of mind? Bah!
|
# ¿ Feb 6, 2017 23:15 |
|
lol if you don't have a keyboard shortcut for typing ☭. (Or Ctrl-Space, Ctrl-C, and Ctrl-V.) I think I used theta once, in some geometric calculation.
|
# ¿ Feb 7, 2017 01:10 |
|
NihilCredo posted:The most grokkable explanation seems to be that it mimics the behaviour of calling "cd" on each argument in sequence. Yeah, it's not "path1 + path2," it's more like "path1 and-then path2," looks like. I can see how one could assume normal concatenation logic would apply, though.
|
# ¿ Mar 26, 2017 16:08 |
|
ExcessBLarg! posted:the double-checked locking anti-pattern. It's been a normal pattern since like Java 6, as long as you use volatile. An unfortunate consequence of the "write once, show up in Google forever" nature of blog posts.
|
# ¿ Apr 1, 2017 23:28 |
|
And the classic "set a variable to a value and then immediately set it to something else" move. I'm surprised he doesn't set it back to null in the finally block with a "// GC" comment.
|
# ¿ Apr 20, 2017 17:46 |
|
Ha, the missing null check made me think the assignment was unnecessary!
|
# ¿ Apr 20, 2017 18:16 |
|
When I started at Experts Exchange in 2007, they were moving pretty rapidly with a site-wide redesign and somebody found it useful to be able to edit the email templates via an employee-only page on the Production website. Every now and then, we would have to instruct new employees that they needed to copy changes to the other environments, lest they be wiped out. Once, I replaced the $username variable in a heavily used template with "CPColin". Another time, somebody in Customer Service accidentally blanked one of the more important templates. Took way too long before somebody deleted that page. The "execute arbitrary SELECT queries on the Production database" page stayed up for a while longer, though.
|
# ¿ Jun 5, 2017 17:04 |
|
I can't believe you're saying code review is bad.
|
# ¿ Jun 18, 2017 06:00 |
|
|
# ¿ May 9, 2024 22:37 |
|
boo_radley posted:Quick, what's the emoji for legacy code? � Or "NO-BREAK SPACE"
|
# ¿ Jul 5, 2017 16:31 |