Article 5M7MJ CodeSOD: Just a Few Questions

CodeSOD: Just a Few Questions

by
Remy Porter
from The Daily WTF on (#5M7MJ)

Pete has had some terrible luck with the lead programmers he's worked with. He's had a few which are... well, they don't take feedback well. Like his current team lead, who absolutely doesn't let any of the other developers review or comment on his code. "Don't ask me questions, you should know this already," is a common refrain. Speaking of questions:

String q1 = form.getQ1()!=null?request.getParameter("question_" + form.getQ1().getId()):null;String q2 = form.getQ2()!=null?request.getParameter("question_" + form.getQ2().getId()):null;String q3 = form.getQ3()!=null?request.getParameter("question_" + form.getQ3().getId()):null;String q4 = form.getQ4()!=null?request.getParameter("question_" + form.getQ4().getId()):null;String q5 = form.getQ5()!=null?request.getParameter("question_" + form.getQ5().getId()):null;String q6 = form.getQ6()!=null?request.getParameter("question_" + form.getQ6().getId()):null;String q7 = form.getQ7()!=null?request.getParameter("question_" + form.getQ7().getId()):null;String q8 = form.getQ8()!=null?request.getParameter("question_" + form.getQ8().getId()):null;String q9 = form.getQ9()!=null?request.getParameter("question_" + form.getQ9().getId()):null;String q10 = form.getQ10()!=null?request.getParameter("question_" + form.getQ10().getId()):null;String q11 = form.getQ11()!=null?request.getParameter("question_" + form.getQ11().getId()):null;String q12 = form.getQ12()!=null?request.getParameter("question_" + form.getQ12().getId()):null; String q13 = form.getQ13()!=null?request.getParameter("question_" + form.getQ13().getId()):null;String q14 = form.getQ14()!=null?request.getParameter("question_" + form.getQ14().getId()):null;String q15 = form.getQ15()!=null?request.getParameter("question_" + form.getQ15().getId()):null;

Pete adds: "Note, this is only 15 lines of a file of his 2000 line file. This pattern is repeated for about 1900 lines. I guess he never learned about loops or arrays."

proget-icon.png [Advertisement] ProGet's got you covered with security and access controls on your NuGet feeds. Learn more. TheDailyWtf?d=yIl2AUoC8zA_5sLSfhtO90
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments