Boards.ie: Danny wrote: » Without PHP you wouldn't have anywhere to write that post, lets leave the language wars for another thread?
if(var == true) { return true; } else { return false; }
public string MyFunc() { try { DoWork(); return "success"; } catch(Exception e) { return e.Message; } } and then with a nice: if MyFunc == "success"
bool GodClass::MakeTheMagicHappen() { /* loads of stuff with no error checking or exception handling */ return true; }
awec wrote: » People who write:if(var == true) { return true; } else { return false; } should have their nipples wired to an electric fence.
COYW wrote: » Apparently, that is classic Agile!
COYW wrote: » I was told not to comment my code, as it was a "waste of time". Apparently, that is classic Agile!
COYW wrote: » They were Agile too, meaning that they documented nothing.
... // Using if/then here instead of switch as it's more efficient if () { ... } else if () { ... } else if () ...[b][i]repeats for approximately 14,000 lines of code[/b][/i]...
Sparks wrote: » Not a typo. Fourteen Thousand Lines in an if/then/else structure, done because an earlier programmer thought that that was more efficient than switch(). There wasn't a brick in a sock large enough to beat them with...
Capt'n Midnight wrote: » I had to change a switch to nested if But that was in Power Basic back in 1990 and needed to run on an 8MHz 8086.
Sparks wrote: » BASIC? #define ALLBETS 0 /* */
zynaps wrote: » Most (structured) Basics I encountered were awesome...
/* * Constant for one hundred */ public static final int ONE_HUNDRED = 100; /* * Constant for one hundred twelve */ public static final int ONE_HUNDRED_TWELVE = 112;
COYW wrote: » [..] I was told not to comment my code, as it was a "waste of time". Apparently, that is classic Agile!
PrzemoF wrote: » A good code doesn't need comments; a bad code doesn't need comments either - it needs to be fixed!
int i; // Declare variable i i = 0; //Define variable i i++; //Increment variable i
Sparks wrote: » It's a matter of degree; if I saw, say: If, on the other hand, I see ten lines of dense code without a single comment giving an overview, I'm going to refuse to pass it through code review. It might be obvious to the coder today what they meant; in a month's time, they may not remember; when some other poor schmuck has to debug it in two years time, the original coder may not even be with the company anymore. One line of comment saying "here we do X" is not onerous, and it's the easiest line to write. ... Not commenting appropriately is just downright obnoxious...
Cork24 wrote: » Do you work as a Developer ? Maybe you worked with Mircosoft for the Vista OS !!! yeah that could be it, All Code needs to be Commented on, What if i Wrote about 500 lines of Code in C, and 4 years later some one comes in to update some of the code, how is he meant to know what section of Code does what ? Thats where Commments come into play, every program i do, i have about 3 lines of Comment over every Method/Function telling what its doing and where its pointing to if i was using Pointers or Abstract Coding in Java.
Try m_bIndexing = configReader.GetValue("Indexing", GetType(Boolean)) Catch ex As Exception m_bIndexing = True End Try If Not m_bIndexing Then mnuSeparator.Visible = False mnuSearch.Visible = False End If
dazberry wrote: » Try m_bIndexing = configReader.GetValue("Indexing", GetType(Boolean)) Catch ex As Exception m_bIndexing = True End Try If Not m_bIndexing Then mnuSeparator.Visible = False mnuSearch.Visible = False End If I don't know which annoys me more: the fact that it's in vb.net the fact that m_bIndexing is declared as a field in the form class and used only in one place (as shown) the fact that the configReader.GetValue() pattern is repeated f**king everywhere in the project, including for the "Index" value again... the fact that m_bIndexing is assigned true when declared, so the assignment in the exception handler is pointless the If Not m_bIndexing .... = False the fact that all the code is like this... muck the fact that when this was being written, I was writing enterprise level code in a language that no one uses anymore so this is what I'm resigned to the fact that my career has ended up scraping the seedy underbelly of the irish software industry D.
Try m_bIndexing = configReader.GetValue("Indexing", GetType(Boolean)) Catch ex As Exception m_bIndexing = True End Try If Not m_bIndexing Then mnuSeparator.Visible = False mnuSearch.Visible = False End If
Duggys Housemate wrote: » Surely he's correct to not assume that m_bindexing = true all the time.
Capt'n Midnight wrote: » Interesting.http://www.theregister.co.uk/2012/11/23/why_os2_failed_part_one/