r/javascript • • Mar 01 '16

Udemy offering javascript course with JAVA logo

Post image
413 Upvotes

121 comments sorted by

View all comments

55

u/METALz Mar 01 '16 edited Mar 01 '16

There are so many things wrong with this picture that it could be easily posted to /r/programmerhumor

42

u/[deleted] Mar 01 '16

Here's some problems I can see:

  • Java logo

  • Non-monospaced font

  • HTML comment inside <script>

  • Deprecated attributes on <table>

44

u/thebezet Mar 01 '16

HTML comment inside <script>

That's not necessarily "wrong", it's just not needed anymore. We used to have to include such comment tags so that browsers that don't understand script tags wouldn't output the code in the browser. Since virtually all browsers support the script tag, this is not needed anymore (same goes with CDATA for XHTML), but can still be visible in legacy code.

3

u/[deleted] Mar 02 '16

Some days I would love to teleport back to right at the onset of AJAX and be a fly on the wall of IRC channels about it and whatnot.

2

u/ahref Mar 02 '16

Peperidge farms remembers.

→ More replies (1)

2

u/[deleted] Mar 02 '16

[removed] — view removed comment

2

u/thebezet Mar 02 '16

Is this a reply to my post? I'm not sure how does building your html programmatically relate to having HTML comments inside <script>. Could you explain what you mean?

11

u/maffoobristol Mar 01 '16

Three sync function calls inside an onclick is the bit that really hurt me. Also where the hell is photos defined?

4

u/azium Mar 01 '16

Where is page defined?

3

u/maffoobristol Mar 01 '16

Yep! Especially seeing as it's inside a closure. Basically, it's shit code.

2

u/sakabako Mar 01 '16

page is defined inside the onclick handler string, right before updatePage is called.

→ More replies (3)

3

u/n9e9o9 Mar 01 '16

why is that bad? is it because we can't guarantee those particular calls will synchronously execute, in relation to other possible calls going on in that page?

2

u/thebezet Mar 01 '16

You want to avoid inline code as it is less maintainable – you want to have your code in one place, where it is expected to be, not attached to DOM elements in your markup, dotted all over the place.

2

u/maffoobristol Mar 01 '16

Just hideously unstructured.

2

u/theywouldnotstand Mar 01 '16

depending on what they are, they could take forever and block the UI on click.

2

u/Zhouzi Mar 01 '16

After giving it some thought, that's actually pretty close to <button ng-click="doSomething()">click me!</button>

→ More replies (3)

14

u/thebezet Mar 01 '16

Also, has anyone noticed the <script> tag after the </body> tag?

→ More replies (3)

2

u/Mysticum_ Mar 01 '16

Also: The description is capitalized, which is just utterly completely wrong. Even if it were to be considered as a title, it is still wrong.

2

u/keystorm Mar 01 '16 edited Mar 01 '16
  • Usage of <table> for layout

  • Iterating elements by id forgery instead of class

2

u/the_foo_maker Mar 01 '16

TABLE for layout with inline STYLE.

2

u/caseynshan Mar 01 '16

!= instead of !==

2

u/calsosta Mar 02 '16

Regarding monospaced fonts. I recently switched (back) to Anonymous Pro but I am not loving it. In Sublime like 1 pixels worth is cut off of the left side of some characters.

I need something better. What is everyone else using?

→ More replies (3)
→ More replies (5)

9

u/tontoto Mar 01 '16

seriously that code is totally fucked

4

u/humpier Mar 01 '16

I guess their target market wouldn't know if it's wrong or not.

→ More replies (2)