Ankündigung

Einklappen
Keine Ankündigung bisher.

Schlimme Code Ausschnitte

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Schlimme Code Ausschnitte

    Ich habe mal eine Witzige Seite gefunden(Leider nur in Russisch) dort posten PHP Entwickler schlimmen Code den Sie finden http://govnokod.ru/php sicherlich das Eine oder Andere zum Schmunzeln für euch dabei

    Gibt es vielleicht auch Deutsche/Internationale alternativen?
    apt-get install npm -> npm install -g bower -> bower install <package> YOLO [URL]https://www.paypal.me/BlackScorp[/URL] | Mein Youtube PHP Kanal: [url]https://www.youtube.com/c/VitalijMik[/url]

  • #2
    Änderst Du bitte dn Threadtitel?
    [COLOR="#F5F5FF"]--[/COLOR]
    [COLOR="Gray"][SIZE="6"][FONT="Georgia"][B]^^ O.O[/B][/FONT] [/SIZE]
    „Emoticons machen einen Beitrag etwas freundlicher. Deine wirken zwar fachlich richtig sein, aber meist ziemlich uninteressant.
    [URL="http://www.php.de/javascript-ajax-und-mehr/107400-draggable-sorttable-setattribute.html#post788799"][B]Wenn man nur Text sieht, haben viele junge Entwickler keine interesse, diese stumpfen Texte zu lesen.“[/B][/URL][/COLOR]
    [COLOR="#F5F5FF"]
    --[/COLOR]

    Kommentar


    • #3
      Zitat von nikosch Beitrag anzeigen
      Änderst Du bitte dn Threadtitel?
      geht leider nicht, wenn ich auf bearbeiten klicke kann ich nur den inhalt bearbeiten

      EDIT: ach da ist ein Erweitert button
      apt-get install npm -> npm install -g bower -> bower install <package> YOLO [URL]https://www.paypal.me/BlackScorp[/URL] | Mein Youtube PHP Kanal: [url]https://www.youtube.com/c/VitalijMik[/url]

      Kommentar


      • #4
        Naja da ich kein Russisch verstehe kann ich die Kommentare nicht lesen und das muss man wohl zum Teil.

        Kommentar


        • #5
          Ach komm. Einiges erkennt man auch so (aber nicht alles ist lustig):
          Bsp: http://govnokod.ru/16844
          if ($str > 0 AND $str <= 12) wäre wohl zu einfach gewesen.

          Oder er hier: http://govnokod.ru/16858
          Erzeugt das aktuelle Datum, zerlegt es, macht ein Array daraus und gibt das zurück.

          Nette Fehlermeldungen: http://govnokod.ru/16752
          Da hat eindeutig jemand verstanden wie man Cronjobs benutzt: http://govnokod.ru/16681

          Edit: Geniales if: http://govnokod.ru/18
          Windows Server gehören NICHT ins Internet!

          Dildo? Dildo!

          Kommentar


          • #6
            Hmm, schade, dass ich kein russisch kann...

            Oder er hier: http://govnokod.ru/16858
            Erzeugt das aktuelle Datum, zerlegt es, macht ein Array daraus und gibt das zurück.
            Was auch lustig daran ist, ist dass die Methode getCurrentRawDate hat und nen Parameter $yesterday hat^^

            LG
            https://github.com/Ma27
            Javascript Logic is funny:
            [] + [] => "", [] + {} => object, {} + [] => 0, {} + {} => NaN

            Kommentar


            • #7
              @BlackScorp: ich kenne nur diese Seite hier:

              http://www.codecandies.com/

              finde ich jetzt mäßig witzig, da es hierbei meist nur um Kommentare o.ä. geht.

              ...aber sowas hier, ist schwer zu toppen:

              PHP-Code:
              class {
                  function 
              bar() { echo __METHOD__'()'PHP_EOL; }
                  function 
              __toString() { return 'v'; }
              }
              class 
              { function __toString() { return 'c'; } }
              class 
              { function __toString() { return 'bar'; } }
               
              $c 'f';
               
              $${
              'v'} = new ${(string) new ${$v 'v'}()}();
              $$$$$
              $v->{(string) new m()}(); 
              der (arme) nachfolgende Programmierer, der sich mit dem code mal auseinandersetzen muss (wenn man das so konsequent durchzieht)...
              while (!asleep()) sheep++;

              Unterschätze nie jemanden der einen Schritt zurück geht! Er könnte Anlauf nehmen.

              Kommentar


              • #8
                Der Klassiker: http://thedailywtf.com/
                [URL="http://goo.gl/6Biyf"]Lerne Grundlagen[/URL] | [URL="http://sscce.org/"]Schreibe gute Beispiele[/URL] | [URL="http://goo.gl/f2jR7"]PDO > mysqli > mysql[/URL] | [URL="http://goo.gl/jvfSZ"]Versuch nicht, das Rad neu zu erfinden[/URL] | [URL="http://goo.gl/T2PU5"]Warum $foo[bar] böse ist[/URL] | [URL="http://goo.gl/rrfzO"]SQL Injections[/URL] | [URL="http://goo.gl/Q81WJ"]Hashes sind keine Verschlüsselungen![/URL] | [URL="http://goo.gl/2x0e2"]Dein E-Mail Regex ist falsch[/URL]

                Kommentar


                • #9
                  =>
                  /**
                  * Once you are done trying to ‘optimize’ this routine,
                  * and have realized what a terrible mistake that was,
                  * please increment the following counter as a warning
                  * to the next guy:
                  *
                  * total_hours_wasted_here = 11
                  */
                  gefällt mir. Und das war sogar in einem PHP-Projekt.

                  Kommentar


                  • #10
                    https://www.destroyallsoftware.com/talks/wat
                    [COLOR="#F5F5FF"]--[/COLOR]
                    [COLOR="Gray"][SIZE="6"][FONT="Georgia"][B]^^ O.O[/B][/FONT] [/SIZE]
                    „Emoticons machen einen Beitrag etwas freundlicher. Deine wirken zwar fachlich richtig sein, aber meist ziemlich uninteressant.
                    [URL="http://www.php.de/javascript-ajax-und-mehr/107400-draggable-sorttable-setattribute.html#post788799"][B]Wenn man nur Text sieht, haben viele junge Entwickler keine interesse, diese stumpfen Texte zu lesen.“[/B][/URL][/COLOR]
                    [COLOR="#F5F5FF"]
                    --[/COLOR]

                    Kommentar


                    • #11
                      Zitat von trollface Beitrag anzeigen
                      Ach komm. Einiges erkennt man auch so (aber nicht alles ist lustig):
                      Bsp: http://govnokod.ru/16844
                      if ($str > 0 AND $str <= 12) wäre wohl zu einfach gewesen.
                      Jede Wette, im Originalcode stand was anderes und es wurde nur so geändert damit es "lustig" ist.

                      Kommentar


                      • #12
                        Zitat von wolf29 Beitrag anzeigen
                        @BlackScorp: ich kenne nur diese Seite hier:

                        http://www.codecandies.com/

                        finde ich jetzt mäßig witzig, da es hierbei meist nur um Kommentare o.ä. geht.

                        ...aber sowas hier, ist schwer zu toppen:

                        PHP-Code:
                        class {
                            function 
                        bar() { echo __METHOD__'()'PHP_EOL; }
                            function 
                        __toString() { return 'v'; }
                        }
                        class 
                        { function __toString() { return 'c'; } }
                        class 
                        { function __toString() { return 'bar'; } }
                         
                        $c 'f';
                         
                        $${
                        'v'} = new ${(string) new ${$v 'v'}()}();
                        $$$$$
                        $v->{(string) new m()}(); 
                        der (arme) nachfolgende Programmierer, der sich mit dem code mal auseinandersetzen muss (wenn man das so konsequent durchzieht)...
                        oh ja

                        ich finds auch lustig dass einige code ausschnitte aus bekannten systemen kommen zb

                        OpenCart
                        PHP-Code:
                        class ModelCheckoutOrder extends Model 
                         public function 
                        addOrder($data) {
                            
                        $data['login']=md5(rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100));
                          
                        $this->db->query("INSERT INTO `" DB_PREFIX "order` SET login='".$data['login']."',invoice_prefix = '" $this->db->escape($data['invoice_prefix']) . "', store_id = '" . (int)$data['store_id'] . "', store_name = '" $this->db->escape($data['store_name']) . "', store_url = '" $this->db->escape($data['store_url']) . "', customer_id = '" . (int)$data['customer_id'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', firstname = '" $this->db->escape($data['firstname']) . "', lastname = '" $this->db->escape($data['lastname']) . "', email = '" $this->db->escape($data['email']) . "', telephone = '" $this->db->escape($data['telephone']) . "', fax = '" $this->db->escape($data['fax']) . "', payment_firstname = '" $this->db->escape($data['payment_firstname']) . "', payment_lastname = '" $this->db->escape($data['payment_lastname']) . "', payment_company = '" $this->db->escape($data['payment_company']) . "', payment_company_id = '" $this->db->escape($data['payment_company_id']) . "', payment_tax_id = '" $this->db->escape($data['payment_tax_id']) . "', payment_address_1 = '" $this->db->escape($data['payment_address_1']) . "', payment_address_2 = '" $this->db->escape($data['payment_address_2']) . "', payment_city = '" $this->db->escape($data['payment_city']) . "', payment_postcode = '" $this->db->escape($data['payment_postcode']) . "', payment_country = '" $this->db->escape($data['payment_country']) . "', payment_country_id = '" . (int)$data['payment_country_id'] . "', payment_zone = '" $this->db->escape($data['payment_zone']) . "', payment_zone_id = '" . (int)$data['payment_zone_id'] . "', payment_address_format = '" $this->db->escape($data['payment_address_format']) . "', payment_method = '" $this->db->escape($data['payment_method']) . "', payment_code = '" $this->db->escape($data['payment_code']) . "', shipping_firstname = '" $this->db->escape($data['shipping_firstname']) . "', shipping_lastname = '" $this->db->escape($data['shipping_lastname']) . "', shipping_company = '" $this->db->escape($data['shipping_company']) . "', shipping_address_1 = '" $this->db->escape($data['shipping_address_1']) . "', shipping_address_2 = '" $this->db->escape($data['shipping_address_2']) . "', shipping_city = '" $this->db->escape($data['shipping_city']) . "', shipping_postcode = '" $this->db->escape($data['shipping_postcode']) . "', shipping_country = '" $this->db->escape($data['shipping_country']) . "', shipping_country_id = '" . (int)$data['shipping_country_id'] . "', shipping_zone = '" $this->db->escape($data['shipping_zone']) . "', shipping_zone_id = '" . (int)$data['shipping_zone_id'] . "', shipping_address_format = '" $this->db->escape($data['shipping_address_format']) . "', shipping_method = '" $this->db->escape($data['shipping_method']) . "', shipping_code = '" $this->db->escape($data['shipping_code']) . "', comment = '" $this->db->escape($data['comment']) . "', total = '" . (float)$data['total'] . "', affiliate_id = '" . (int)$data['affiliate_id'] . "', commission = '" . (float)$data['commission'] . "', language_id = '" . (int)$data['language_id'] . "', currency_id = '" . (int)$data['currency_id'] . "', currency_code = '" $this->db->escape($data['currency_code']) . "', currency_value = '" . (float)$data['currency_value'] . "', ip = '" $this->db->escape($data['ip']) . "', forwarded_ip = '" .  $this->db->escape($data['forwarded_ip']) . "', user_agent = '" $this->db->escape($data['user_agent']) . "', accept_language = '" $this->db->escape($data['accept_language']) . "', date_added = NOW(), date_modified = NOW()");

                          
                        $order_id $this->db->getLastId();

                          foreach (
                        $data['products'] as $product) { 
                           
                        $this->db->query("INSERT INTO " DB_PREFIX "order_product SET order_id = '" . (int)$order_id "', product_id = '" . (int)$product['product_id'] . "', name = '" $this->db->escape($product['name']) . "', model = '" $this->db->escape($product['model']) . "', quantity = '" . (int)$product['quantity'] . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', reward = '" . (int)$product['reward'] . "'");
                         
                           
                        $order_product_id $this->db->getLastId();

                           foreach (
                        $product['option'] as $option) {
                            
                        $this->db->query("INSERT INTO " DB_PREFIX "order_option SET order_id = '" . (int)$order_id "', order_product_id = '" . (int)$order_product_id "', product_option_id = '" . (int)$option['product_option_id'] . "', product_option_value_id = '" . (int)$option['product_option_value_id'] . "', name = '" $this->db->escape($option['name']) . "', `value` = '" $this->db->escape($option['value']) . "', `type` = '" $this->db->escape($option['type']) . "'");
                           }
                            
                           foreach (
                        $product['download'] as $download) {
                            
                        $this->db->query("INSERT INTO " DB_PREFIX "order_download SET order_id = '" . (int)$order_id "', order_product_id = '" . (int)$order_product_id "', name = '" $this->db->escape($download['name']) . "', filename = '" $this->db->escape($download['filename']) . "', mask = '" $this->db->escape($download['mask']) . "', remaining = '" . (int)($download['remaining'] * $product['quantity']) . "'");
                           } 
                          } 
                        http://govnokod.ru/16837 Yii Framework 2.0 keine ahnung wozu die $_memoryReserve da gut ist

                        usw ich wette im Symfony gibts auch was nettes drin
                        apt-get install npm -> npm install -g bower -> bower install <package> YOLO [URL]https://www.paypal.me/BlackScorp[/URL] | Mein Youtube PHP Kanal: [url]https://www.youtube.com/c/VitalijMik[/url]

                        Kommentar


                        • #13
                          Zitat von monolith Beitrag anzeigen
                          Jede Wette, im Originalcode stand was anderes und es wurde nur so geändert damit es "lustig" ist.
                          Ach wenn man so manche Quelltexte hier im Forum sieht, wäre ich mir da nicht so sicher.
                          Windows Server gehören NICHT ins Internet!

                          Dildo? Dildo!

                          Kommentar


                          • #14
                            Ich habe letztens in nem Magazin auch solche Auskommentierungen gelesen.

                            Mein Highlight war in einem Kommentar
                            Code:
                             #define TRUE FALSE // happy debugging motherfucker

                            Kommentar


                            • #15
                              lol

                              Kommentar

                              Lädt...
                              X