|
Well, it's me who did it. It was approved by all coworkes though. In Erlang we have many single-use one-liner overloads to take advantage of pattern matching. Such code is repeated in so many places that this kind of joke doesn't really hurt anyone. More code:
compute_price('POST', [], User) ->
'4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, User:role_atom()).
'4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, some_atom) ->
{JsonProps, Product} = process_request(Req, User),
RangesFromJson = calendar_lib:json_ranges_to_month_records(proplists:get_value(<<"ranges">>, JsonProps)),
UserClickCounts = [ Range:click_count() || Range <- RangesFromJson],
...
This is a very good language to implent any buisness logic or algorithms, but terrible if you try to interact with a front-end in web development
|
|
|
|
|
Well crap, I've used that exact function name just yesterday...
|
|
|
|
|
I oddly like this. This function is presumably generated and used by some automated code generator and not something a human programmer would have to reference.
|
|
|
|
|
Yes, but some poor schmuck may have to deal with it. There should be a way to generate a friendly unique name based on the original source construct that caused the name to be generated. If nothing else, it could be based on the source file path and line number, just as an example.
Software Zen: delete this;
|
|
|
|
|
Ed Korsberg wrote: This function is presumably generated and used by some automated code generator
It's not.
|
|
|
|
|
Not only that; there are three other functions, within the same file, with names:
4d568c9e-cb32-4db1-a276-26cb06cc3f6g(User, SomeVar),
4d568c9e-cb32-4db1-a276-26cb06cc3f6h(User, SomeVar),
4d568c9e-cb32-4db1-a276-26cb06cc3f6j(User, SomeVar),
Maybe they should add this functionality to Intellisense: string matching from the trailing end 
|
|
|
|
|
Three months ago, we launched a new Azure web application for a client. The application generates around 500 records (or one for every employee) in a particular table every workday. In the main processing page, if a daily record already exists for an employee, the record id was passed in with this code:
intRecID = CShort(Request("current_daily_rec_id").ToString)
The application ran just fine until this morning when all hell broke loose!
I had it fixed and posted within an hour of the first incident, but only after recording over 240 errors!
"Go forth into the source" - Neal Morse
|
|
|
|
|
What happened? An overflow?
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Yep! Average 20 working days a month and a little over 3 months times the 500 records a day comes out to about 32,767 or so...now, I should be good for another 18,000 years or so.
"Go forth into the source" - Neal Morse
|
|
|
|
|
Oops!
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
A similar thing happened quite a few years ago on a system on of our clients had from a different supplier, which was an Access database - they started getting numeric overflow errors and the original supplier wanted lots of time and money to investigate and fix the problem as it was out of paid support. I asked the user if there were 32,767 records in the main table and he was astonished at my correct guess.
I changed the autonumber column in the main table from a short integer to a long integer and said that he could buy me a pint on my next site visit. Lots of brownie points were also awarded by the client.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I had to fix a similar issue back in the 90s, when the table of accounts in our database exceeded the number we could import to an Excel sheet (16384?). 
|
|
|
|
|
Here's[^] one of my favourite Halls of Shame.
|
|
|
|
|
Private Function getMonthByCode(ByVal code As String) As Integer
Select Case code
Case "JUL"
Return 7
Case "SEP"
Return 9
Case Else
Return -1
End Select
End Function
|
|
|
|
|
Duncan Edwards Jones wrote:
Private Function gGetMonthByCode(ByVal code As String) As Integer
Select Case code
Case "JUL"
Return 7
Case "SEP"
Return 9
Case Else
Return -1
End Select
End Function Fixed
I'll ignore the fact that it's VB as I like VB (not this particular piece though)
|
|
|
|
|
Duncan Edwards Jones wrote: I'm guessing there are two unit tests for this No, three: don't forget to test for FILE_NOT_FOUND.
|
|
|
|
|
Maybe the code is only in "alpha state" for now.
I miss a comment like:
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Wow. Just two? I can think of at least three more.
|
|
|
|
|
Did you intend to reply to KarstenK or the OP?
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Should have been the OP. Oops.
|
|
|
|
|
It happens.
One site I was on had a developer add a "feature" that caused forum replies to be attached to a random post. He said that it was supposed to "liven up the forums". I don't think he works for that site anymore.
I'd post a link, but this was several years ago, and I can't remember what site it was.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Brisingr Aerowing wrote: One site I was on had a developer add a "feature" that caused forum replies to be attached to a random post. He said that it was supposed to "liven up the forums". I don't think he works for that site anymore.
Uhhhh.... yeah. How was that supposed to "liven up the forms"? The only way we're ever going to know that is to find out what drugs he was on and get some.
|
|
|
|
|
Makes sense if the only valid input is JUL or SEP
|
|
|
|
|
Porting some C code to one microcontroller to another I found this:
if((error == 0)
#ifdef SENSAR
|| (V_OK == 0))
#else
)
#endif
This work is unhealthy
|
|
|
|