Stupidest code of the day

E

emmaps

Now I have come to expect that my colleagues are still stupid enough
Whats wrong with using ""+ ?
 
D

Darryl L. Pierce

emmaps said:
Whats wrong with using ""+ ?

It's forcing an unnecessary conversion of an int into a String, the
creation of a second String, and then the parsing of that String into a
double in order to create an instance of Double.
 
J

Jon Caldwell

emmaps said:
Whats wrong with using ""+ ?


I would like to submit a nomination for today's stupidest code. I hope C
entries are eligible.

put_bufint(&ptr, 1, atoi("92")); /* record type */
put_bufint(&ptr, 1, atoi("1")); /* language code */
put_bufint(&ptr, 1, atoi("0")); /* cmd accessible */

Any ideas how to optimize this? ;-)
 
A

Andrea Desole

Jon said:
I would like to submit a nomination for today's stupidest code. I hope C
entries are eligible.

put_bufint(&ptr, 1, atoi("92")); /* record type */
put_bufint(&ptr, 1, atoi("1")); /* language code */
put_bufint(&ptr, 1, atoi("0")); /* cmd accessible */

Any ideas how to optimize this? ;-)

put_bufint(&ptr, atoi("1"), atoi("92"));
put_bufint(&ptr, atoi("1"), atoi("1"));
put_bufint(&ptr, atoi("1"), atoi("0"));
 
P

Paul Tomblin

In a previous article said:
I would like to submit a nomination for today's stupidest code. I hope C
entries are eligible.

put_bufint(&ptr, 1, atoi("92")); /* record type */
put_bufint(&ptr, 1, atoi("1")); /* language code */
put_bufint(&ptr, 1, atoi("0")); /* cmd accessible */

Any ideas how to optimize this? ;-)

Submit it to "The Daily WTF" http://thedailywtf.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top