1. Куча / Говнокод #11456

    +128

    1. 1
    2. 2
    3. 3
    func fff() func() func() func() string {
    	return func() func() func() string { return func() func() string { return func() string { return "DON'T DO THAT!" } } }
    }

    http://play.golang.org/p/KN4E1RotKl

    USB, 22 Июля 2012

    Комментарии (36)
  2. C++ / Говнокод #11455

    +3

    1. 1
    x*x = new x;

    Уравнение?

    USB, 21 Июля 2012

    Комментарии (44)
  3. ActionScript / Говнокод #11454

    −114

    1. 1
    2. 2
    3. 3
    this.editable = true;
    this.itemEditor = new ClassFactory(UIDEditor);
    this.disableInEdit = true;

    Чудесное сочетание значений при котором мы не можем редактировать запись но при этом видеть в окошке редактирования...
    Это только два месяца разработки, интересно, костыли какой кудрявости я увижу через год?

    kyzi007, 20 Июля 2012

    Комментарии (12)
  4. Objective C / Говнокод #11453

    −95

    1. 1
    2. 2
    NSString *currentElementValue = ...;
    int status = [[[currentElementValue copy] autorelease] intValue];

    Кто плохо понимает как работает пямять на стеке

    notxcain, 20 Июля 2012

    Комментарии (0)
  5. JavaScript / Говнокод #11452

    +168

    1. 1
    2. 2
    3. 3
    4. 4
    var IE = '\v'=='v';
    if(IE) {
    // тут пишем обработчик для IE броузера
    }

    Самый короткий способ определения браузера IE (влючая IE.8)

    Hits, 20 Июля 2012

    Комментарии (30)
  6. Java / Говнокод #11451

    +75

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    private void executeUiOperation(final UiOperation operation, final Boolean documentReadOnly) {
            boolean readOnly = !edit;
            if (documentReadOnly != null) {
                readOnly |= documentReadOnly;
            }
    //....

    Кручу-верчу запутать хочу...

    ingenuus, 20 Июля 2012

    Комментарии (14)
  7. PHP / Говнокод #11450

    +61

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    //TODO: Ахтунг! про in_array не слышали?
    $_GET['source'] = isset($_GET['source'])
          && ($_GET['filter_source'] == "manager"
             || $_GET['filter_source'] == "admin"
             || $_GET['filter_source'] == "internet"
             || $_GET['filter_source'] == "president"
             || $_GET['filter_source'] == "builder"
             || $_GET['filter_source'] == "call-center"
             || $_GET['filter_source'] == "calls"
             || $_GET['filter_source'] == "president"
             || $_GET['filter_source'] == "petr"
             || $_GET['filter_source'] == "slava"
             || $_GET['filter_source'] == "vell"
             || $_GET['filter_source'] == "box") ? $_GET['source'] : '0';

    wds, 20 Июля 2012

    Комментарии (5)
  8. JavaScript / Говнокод #11449

    +156

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    if ($('#stoykaKS').is(':checked')) /*     29             */
    {wt.document.writeln('<div style=" position: absolute; top: 0; left: 0;"><img src="../images/stories/esd-classic/picstoykaKS.gif" /></div>');}
    if ($('#stolUS01').is(':checked')) /*      8             */
    {wt.document.writeln('<div style=" position: absolute; top: 0; left: 0;"><img src="../images/stories/esd-classic/picstolUS01.gif" /></div>');}
    if ($('#perfoPFPX').is(':checked')) /*    21              */
    {wt.document.writeln('<div style=" position: absolute; top: 0; left: 0;"><img src="../images/stories/esd-classic/picperfoPFPX.gif" /></div>');}

    И так далее, несколько сотен строк.

    Tairesh, 20 Июля 2012

    Комментарии (8)
  9. PHP / Говнокод #11448

    +62

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    $ar = array(5050,5370,6285,48100,6730,6730,4700,6500,3450,7260,2500,1370,4288,9620);
    	
    $cpr = 0;
    	
    foreach($ar as $k=>$v)
    {
    	$cpr += $v;
    }
    
    echo $cpr;

    Нестандартность мышления в действии

    domaster, 20 Июля 2012

    Комментарии (40)
  10. Java / Говнокод #11447

    +107

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    @Inject
    protected MainWindowController(
    		final SessionController session,
    		final QueueController queueController,
    		final MachineController machineController,
    		final PrintController printController,
    		final MainWindow window,
    		final UIHandler uiHandler,
    		final ImageCache imageCache,
    		final EventBus bus,
    		final ActiveOrderHolder orderHolder,
    		final ApiClientAsync apiClient,
    		final ReferenceDataCache dataCache,
    		@SvnRevision final int svnRevision) throws IOException {

    someone, 20 Июля 2012

    Комментарии (17)