Jump to content

At Magicduel, We are professional and proud of our Code


Chewett

Recommended Posts

and then there's the people that do this sort of thing for commenting

 

//************************************************

//* paragraph about the funtion below this block *

//* the paragraph is even brokren up into lines  *

//* to make it easier to read                    *

//************************************************

 

for(int i=0;i<array.length;i++) //go through each elemtn of the array

 

You can never have too many comments!

 

edit: i like the semicolon at the end of the comment chew­ :­P

Edited by Rophs
Link to comment
Share on other sites

  • Root Admin

yeah you can have too many comments.

 

No the paragraph style you comment isnt bad, its very useful when used properly

 

If you are explaining the basics of the language in a comment, you are giving the code to too new people, unless you are teaching them

Link to comment
Share on other sites

  • Root Admin

To me the worst is that javascript lets you return different argument types.  -________-   Sure you can treat strings as booleans but still...


I see no issues with a non strictly typed language :D I like it. Just some of PHP's quirks catches people unaware if they dont know what they are doing :D
Link to comment
Share on other sites

See the problem is it makes building large applications just that much more time consuming.  You have to go and look at the function they defined, see what they return, see if they throw errors, make sure you handle all the edge cases... etc.

 

Whereas in a strictly typed language, you know what it returns, what it throws without ever having to read the code.

 

And sure comments help, but it still adds at least an extra few minutes to development.

 

They should make it optional in javascript to add a return type to functions.  But I doubt that'll ever happen.

Link to comment
Share on other sites

  • Root Admin

chew..it would be nice to make a top of worst code ever in md, on sections, like for example #1:user class #2:navigation process ..etc. Can't include combat here because it was so terrible that Randril had to rewrite it...that would have won the worst code top for sure

i am actually serious about this, will be fun to know your opinion. Too bad I didn't ask r for the same, to compare

ps, i think items will win :p
ps2: could be a contest if you present the main sections and ask people to bet

Link to comment
Share on other sites

  • Root Admin

See the problem is it makes building large applications just that much more time consuming.  You have to go and look at the function they defined, see what they return, see if they throw errors, make sure you handle all the edge cases... etc.

 

Whereas in a strictly typed language, you know what it returns, what it throws without ever having to read the code.

 

And sure comments help, but it still adds at least an extra few minutes to development.

 

They should make it optional in javascript to add a return type to functions.  But I doubt that'll ever happen.

 

PHPDoc :)



chew..it would be nice to make a top of worst code ever in md, on sections, like for example #1:user class #2:navigation process ..etc. Can't include combat here because it was so terrible that Randril had to rewrite it...that would have won the worst code top for sure

i am actually serious about this, will be fun to know your opinion. Too bad I didn't ask r for the same, to compare

ps, i think items will win :P
ps2: could be a contest if you present the main sections and ask people to bet

 

items are very hacky, most of them are good examples of copy and paste coding :P

 

Although i did find a nice if/elseif/else statement in confirm strategy, that had the same comment, in romanian saying along the lines of they in an immunity zone, no attacks. For every single if statement, because you copied it and never removed/made the comment correct :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Forum Statistics

    17.5k
    Total Topics
    182.5k
    Total Posts
  • Recently Browsing

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
  • Recent Event Reviews

×
×
  • Create New...