Code is not hard to read IMO



  • I don't really agree that code is hard to read.

    Well, of course it depends on the language, Assembler is really hard to read, but I mostly code in Python and unless some special magic happens I find that it isn't really hard.

    Of course you can't read it like written text, you'll have to think a bit. But comments like:

    ### If actor is attacking, handle the attack.
    if actor.state == "Attacking":
    
    ### Make the actor rotate
    actor.rotate(fTime)
    

    Make the actor move

    actor.move(fTime)

    ### First we check if the actor has just been created
    ### Because that means we want to scale it to its default size
    ### from really small.. to create a cooler effect. :)
    if actor.state == "Being Spawned":
    	<SNIP>
    

    Then we check if the actor is dying

    elif actor.state == "Dying":
    <SNIP>

    Then we check if the actor is landing

    elif actor.state == "Landing":
    ### Make the actor move
    actor.move(fTime)
    <SNIP>

    really doesn't help that much to me. I want comments that tell what the code does not, otherwisw I'll just have to read each commend twice, once in comment form and once in code form to make sure that the comment was accurate and that nothing more happen than mentioned.

    Personally I have a tendancy to comment way to little though, well, actuall on my last project I realised that I hadn't commented at all, that probably was a bit too little, even though I work hard on making sensible code that doesn't need comments.



  • This foum is insane! But please delete this thread since it was meant as a reply in another thread.



  • This forum is wack.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.