Mistři v programování na #hovnokod

WebClient klyjent = new WebClient();
klyjent.Encoding = System.Text.Encoding.UTF8;
bool wrtd;
StreamWriter writer = File.AppendText(DateTime.Now.ToString("yyyyMMddHHmm") + ".txt");
for (;;)
{
    wrtd = false;
    try
    {
        hledany = klyjent.DownloadString("http://......php");
        ...
    }
    catch (System.Net.WebException)
    {
        Console.WriteLine("Network error");
        writer.WriteLine("Network error");
        wrtd = true;
    }
    catch (ArgumentOutOfRangeException)
    {
        Console.WriteLine("Vyjebaný O2 ADSL modem");
    }
    if (wrtd)
    {
        Console.WriteLine("at " + DateTime.Now + Environment.NewLine);
        writer.WriteLine("at " + DateTime.Now + Environment.NewLine);
        writer.Flush();
    }
    System.Threading.Thread.Sleep(10000);
}

Anonymous,

        Private Sub SetFleetControls()
            Dim isEnabled = FleetScreen.AircraftsGrid.RowCount > 0
            If isEnabled Then
                SingleCopyAircraftButton.Enabled = True
                MultiCopyAircraftButton.Enabled = True
                FleetToExcelButton.Enabled = True
                FleetFromExcelButton.Enabled = True
                OpenAircraftDetailsButton.Enabled = True
                FleetCostingDetailsToExcelButton.Enabled = True
                FleetCostingDetailsFromExcelButton.Enabled = True
                DetailsToExcelButton.Enabled = True
                AllocateTotalPremiumButton.Enabled = True
                FleetApplySuggestedButton.Enabled = True
            Else
                SingleCopyAircraftButton.Enabled = False
                MultiCopyAircraftButton.Enabled = False
                FleetToExcelButton.Enabled = False
                FleetFromExcelButton.Enabled = False
                OpenAircraftDetailsButton.Enabled = False
                FleetCostingDetailsToExcelButton.Enabled = False
                FleetCostingDetailsFromExcelButton.Enabled = False
                DetailsToExcelButton.Enabled = False
                AllocateTotalPremiumButton.Enabled = False
                FleetApplySuggestedButton.Enabled = False
            End If
        End Sub

Anonymous,


Anonymous,

čím více negací, tím více programátor?

bool jePovolenoObdobi = !CiselnikyBOServices.Instance.BlokovaneObdobi(row.Datum);

if (!jePovolenoObdobi)
  return true;

Anonymous,

Jak správně zakomentovat obsah.

<?php if (0) { //schovani obsahu ----------------------------------------------------------------- ?>
	<div>Obsah</div>
<?php } //schovani obsahu ----------------------------------------------------------------- ?>

Anonymous,