Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

At Magicduel, We are professional and proud of our Code

Featured Replies

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

  • Author
  • 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

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

  • Author
  • 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

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.

  • 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

  • Author
  • 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

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...

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.