|
That does look to be a unique name, but certainly not the best choice of a method name; sadly not the worst method name I have ever seen either
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Hmm, Should be considered as a best practice in JavaScript kind of language.
Life is a computer program and everyone is the programmer of his own life.
|
|
|
|
|
That's crazy! I am glad I don't use Erlang!
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???
|
|
|
|
|
Just reading the title of the reference book[^] confirms that I would want nothing to do with that!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm sure Yoda will understand that.
I may not last forever but the mess I leave behind certainly will.
|
|
|
|
|
There's a similar book for learning Haskell, I believe. "Learn You a Haskell for Great Good"[^]
|
|
|
|
|
Someone using that as a function name is certainly no fault of Erlang, but that of a coder who should by up on disciplinary proceedings.
Do what thou wilt shall be the whole of the Law. - Liber AL vel Legis 1:40, Aleister Crowley
|
|
|
|
|
Brady Kelly wrote: Someone using that as a function name is certainly no fault of Erlang, but that of a coder who should be up on disciplinary proceedingshanged by the neck until dead, then hung from the lamppost outside work as a warning to others.
FTFY
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
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.
|
|
|
|