Donate to CodeFightClub

All donations are heavily appreciated.

    Latest Fights

  • @iainspad posted this fight on 13th May 2016, 8:02 AM in CSS

    CSS spacing

    This is something that particularly gets my gripe; who thinks which one is the right way to space CSS?

    .foo{ color:red; font-size:1em; }
    .foo { color: red; font-size: 1em; }

    18 Total Votes & 2 Comments

    View Fight
  • break statement emplacement

    When instanciating an object inside a case statement, we must use scope delimiters { ... } But where should we put the break statement? Inside or outside the brackets?

    switch (var) { case 0: { id somevar = ... // Do something with somevar } break; default: break; }
    switch (var) { case 0: { id somevar = ... // Do something with somevar break; } default: break; }

    7 Total Votes & 0 Comments

    View Fight
  • @ or this?

    Do you want to be short and terse or a little longer, but clearer?

    function Dog { @bark = "Bark!"; } fido = new Dog
    function Dog { this.bark = "Bark!" } fido = new Dog

    9 Total Votes & 0 Comments

    View Fight
  • Compacting tags

    I think it's more clear to write main tags on the same line, and it's an indent economy.

    <!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>My Page</title> <!-- bla bla bla --> </head><body> <!-- bla bla bla --> </body></html>
    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>My Page</title> <!-- bla bla bla --> </head> <body> <!-- bla bla bla --> </body> </html>

    12 Total Votes & 0 Comments

    View Fight
  • JS Loops

    i<x loop VS i in x loop

    times = [1,2,3,4,5]; for(i=0;i<times.length;i++){ alert(i); }
    times = [1,2,3,4,5]; for(var i in times){ alert(i); }

    9 Total Votes & 1 Comment

    View Fight
  • @Cooooding posted this fight on 30th November 2015, 2:16 PM in SQL

    SQL

    I like Competitor One, how about you?

    SELECT t.NAME AS TableName, i.name as indexName, sum(p.rows) as RowCounts, sum(a.total_pages) as TotalPages, sum(a.used_pages) as UsedPages, sum(a.data_pages) as DataPages, (sum(a.total_pages) * 8) / 1024 as TotalSpaceMB, (sum(a.used_pages) * 8) / 1024 as UsedSpaceMB, (sum(a.data_pages) * 8) / 1024 ...
    SELECT t.NAME AS TableName, i.name as indexName, sum(p.rows) as RowCounts, sum(a.total_pages) as TotalPages, sum(a.used_pages) as UsedPages, sum(a.data_pages) as DataPages, (sum(a.total_pages) * 8) / 1024 as TotalSpaceMB, (sum(a.used_pages) * 8) / 1024 as UsedSpaceMB, (sum(a.data_pages) * 8) / 1024 ...

    6 Total Votes & 1 Comment

    View Fight
  • @li_dev posted this fight on 23rd November 2015, 7:20 AM in Python

    Am I wrong ?

    Im doing codecademy Python course and everyone seems to be going with the the right solution mine is the left one... am I missing something or mine (left)solution is better?

    def average(numbers): total = sum(numbers) return float(total) / len(numbers)
    def average(numbers): total = sum(numbers) total = float(total) total = total / len(numbers) return total

    5 Total Votes & 1 Comment

    View Fight
  • Document Outlines in HTML5

    HTML5 introduces a few new semantic elements, including <article>, <section> and co. The section elements are allowed to be nested, so the author can define sub-sections to a root section. This given,...

    <!doctype html> <html> <head> <title>Ranked headings</title> </head> <body> <section> <h1>Lorem ipsum</h1> <section> <h2>Dolor sit amet</h2> <p>Consetetur sadipscing elitr, ...</p> <section> ...
    <!doctype html> <html> <head> <title>&lt;h1&gt; only</title> </head> <body> <section> <h1>Lorem ipsum</h1> <section> <h1>Dolor sit amet</h1> <p>Consetetur sadipscing elitr, ...</p> <section> ...

    6 Total Votes & 0 Comments

    View Fight
  • @VexRBLX posted this fight on 10th November 2015, 7:07 PM in C++

    printf or std::cout

    Choose which one is the best; std::cout or printf()

    #include <iostream> int main() { std::cout << "This is way better than printf()!" << std::endl; } return 0;
    #include <stdio.h> int main() { printf("This is way better than std::cout!") } return 0;

    5 Total Votes & 1 Comment

    View Fight
  • @wltashik posted this fight on 8th November 2015, 10:37 AM in HTML

    Coding Design

    How it's easy if the code design by in layout. If the coding start with competitor 1. Developer or coder get easy to config the website. if the coding start with competitor 2. Make's Problem. Now whic...

    <!DOCTYPE HTML> <html> <head> <title>Code Fight</title> </head> <body> <div="header"> <h1>This is Code Fight</h1> <p>Let's Fight for the code</p> </div> </body> </html>
    <!DOCTYPE HTML><html><head><title>Code Fight</title></head><body><div="header"><h1>This is Code Fight</h1><p>Let's Fight for the code</p></div></body></html>

    6 Total Votes & 0 Comments

    View Fight
Donate to CodeFightClub

All donations are heavily appreciated.