Click here to Skip to main content
11,484,752 members (63,795 online)

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrasing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: What was I thinking Pin
Nagy Vilmos23-Jan-13 1:33
memberNagy Vilmos23-Jan-13 1:33 
GeneralRe: What was I thinking Pin
Jonathan C Dickinson16-Jan-13 22:21
memberJonathan C Dickinson16-Jan-13 22:21 
GeneralRe: What was I thinking Pin
Sentenryu16-Jan-13 23:23
memberSentenryu16-Jan-13 23:23 
GeneralRe: What was I thinking Pin
Jonathan C Dickinson16-Jan-13 23:26
memberJonathan C Dickinson16-Jan-13 23:26 
GeneralRe: What was I thinking Pin
Ranjan.D17-Jan-13 12:32
memberRanjan.D17-Jan-13 12:32 
GeneralRe: What was I thinking Pin
Rob Grainger1-Feb-13 4:21
memberRob Grainger1-Feb-13 4:21 
GeneralRe: What was I thinking Pin
Tomz_KV17-Jan-13 3:58
memberTomz_KV17-Jan-13 3:58 
RantHappy new year... kind of... Pin
hoernchenmeister15-Jan-13 23:03
memberhoernchenmeister15-Jan-13 23:03 
After my well deserved vacation I returned to work.
Beeing happy I received a task to modify a DotNetNuke module, made by some externals from a country far far away.
Happyness didn't last long when I came along a SearchEngine class:
public const string SELECT = "SELECT";
public const string DISTINCT = "DISTINCT";
public const string FROM = "FROM";
public const string WHERE = "WHERE";
public const string HAVING = "HAVING";
public const string AND = "AND";
public const string OR = "OR";
public const string IN = "IN";
public const string ON = "ON";
public const string AS = "AS";
public const string GROUP_BY = "GROUP BY";
public const string ORDER_BY = "ORDER BY";
public const string DESC = "DESC";
public const string ASC = "ASC";
this continues for about 1500 lines of code declaring every possible table/column etc I could think of.
90% of the consts aren't even in use... and it all ends up in statements like that:
sqlString.AppendFormat("{0} {1} {2}.{3},{2}.{4},{2}.{5},{2}.{6},{2}.{7},{2}.{8},{2}.{9},{2}.{10},{2}.{11},{12} {13} {14} {15} {2} {16} {17} = @{17}",new string[]
{
SqlConsts.SELECT,
SqlConsts.DISTINCT,
SqlConsts.TBL1,
SqlConsts.OBJECT_NO,
SqlConsts.OBJECT_ID,
SqlConsts.COUNTRY, 
SqlConsts.REGION,
SqlConsts.SUBREGION,
SqlConsts.TOURAREA,
SqlConsts.LATITUDE,
SqlConsts.LONGITUDE,
SqlConsts.CITY,
SqlConsts.COUNT_ANY,
SqlConsts.AS,
SqlConsts.UNIT_COUNT,
SqlConsts.FROM,
SqlConsts.WHERE,
SqlConsts.YEAR
});
...am I missing something or is this an acceptable way of solving database related tasks?
Can you spot a reason for this? If so, please make my happiness return... somehow... please...

Happy new year
Andy
GeneralRe: Happy new year... kind of... Pin
PIEBALDconsult16-Jan-13 4:50
memberPIEBALDconsult16-Jan-13 4:50 
GeneralRe: Happy new year... kind of... Pin
hoernchenmeister16-Jan-13 6:06
memberhoernchenmeister16-Jan-13 6:06 
GeneralRe: Happy new year... kind of... Pin
Matthys Terblanche16-Jan-13 22:08
memberMatthys Terblanche16-Jan-13 22:08 
GeneralRe: Happy new year... kind of... Pin
Gary Huck17-Jan-13 4:41
memberGary Huck17-Jan-13 4:41 
GeneralRe: Happy new year... kind of... Pin
Dave Kreskowiak17-Jan-13 6:26
mvpDave Kreskowiak17-Jan-13 6:26 
GeneralRe: Happy new year... kind of... Pin
Jörgen Andersson17-Jan-13 10:04
memberJörgen Andersson17-Jan-13 10:04 
GeneralRe: Happy new year... kind of... Pin
peterchen28-Jan-13 23:05
memberpeterchen28-Jan-13 23:05 
GeneralRe: Happy new year... kind of... Pin
hoernchenmeister28-Jan-13 23:49
memberhoernchenmeister28-Jan-13 23:49 
JokeRe: Happy new year... kind of... Pin
VUnreal8-Feb-13 11:27
memberVUnreal8-Feb-13 11:27 
GeneralJust got an error from VS2012 Pin
Brisingr Aerowing15-Jan-13 9:48
memberBrisingr Aerowing15-Jan-13 9:48 
GeneralGetting it wrong badly Pin
PIEBALDconsult9-Jan-13 15:12
memberPIEBALDconsult9-Jan-13 15:12 
GeneralRe: Getting it wrong badly Pin
Sentenryu10-Jan-13 7:31
memberSentenryu10-Jan-13 7:31 
GeneralRe: Getting it wrong badly Pin
PIEBALDconsult10-Jan-13 8:42
memberPIEBALDconsult10-Jan-13 8:42 
GeneralRe: Getting it wrong badly Pin
Sentenryu10-Jan-13 23:31
memberSentenryu10-Jan-13 23:31 
GeneralRe: Getting it wrong badly Pin
AspDotNetDev10-Jan-13 8:37
protectorAspDotNetDev10-Jan-13 8:37 
GeneralRe: Getting it wrong badly Pin
PIEBALDconsult10-Jan-13 8:52
memberPIEBALDconsult10-Jan-13 8:52 
GeneralRe: Getting it wrong badly Pin
AspDotNetDev10-Jan-13 9:11
protectorAspDotNetDev10-Jan-13 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 26 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid