Search Unity

[IDEA] - Post a script and get input for optomization.

Discussion in 'Android' started by Dblfstr, Feb 27, 2014.

  1. Dblfstr

    Dblfstr

    Joined:
    Jan 17, 2014
    Posts:
    15
    Do you guys think it would be a good idea to have a thread where one could post a script from their game and have others chime in on better ways to accomplish the same task, or suggest optimizations for said script. I ask this because, in the Unity answers, I see many uses of code that I am sure came from some tutorial. These snippets are not nearly optimized and usually do things the hard way. Ive noticed most tutorials are about how to get something done, and fast, but nowhere mentions the proper way to achieve that goal. Many cases there is an abundant use of FindObjectWithTag in an Update() function, etc.

    This is also a problem for me. Being relatively new. I find my best source of learning is online tutorials and examples. I use a little of this and a little of that, until I have a working script that does what I want. But surely it is not efficient. Furthermore, when other scripts rely on this code, I end up having to change everything (not very modular) to get things working again.

    So, it would be nice, if there was a dedicated place for users to post their code (THEIR CURRENT WORKING CODE) for optimization advice and expert input.

    This 'dedicated place', however, should not be used as a Q&A forum. Nor should it be for "My code almost works... but..".

    Proper use, for example.

    I have my code. It does exactly what I want. I have comments throughout that specify to the readers what does what and why. I would not really have to add anything to post besides my script. Maybe a brief explanation that this codes does such and such, and interacts with other codes for this and that. Then the readers, experts, could say, this algorithm in your such and such funtion would be more efficient by doing it this way :code:.


    I don't know. Would this be a good idea? Would it get spammed with Q&A, and people just wanting someone to fix their nonworking code. I mean, there already is a place for that.
     
  2. zombience

    zombience

    Joined:
    Mar 29, 2012
    Posts:
    57
    heya, just saw your post over at answers. i've also put up a post here:
    http://forum.unity3d.com/threads/23...-in-code-review-growing?p=1546532#post1546532
    I'm interested in exactly what you're talking about I'd love to see something along the lines of code review. I've asked this question in the past as well :)

    I am definitely interested in something like that, something beyond the scope of answers.unity3d, exactly as you've mentioned, that deals with already working code. A place where people can share optimization tips and best-practices