Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Should DOTS code be handled functionality instead of OOP?

Discussion in 'Entity Component System' started by Manablight, Mar 31, 2020.

  1. Manablight


    Aug 11, 2014
    I learned to program using OOP. Code for DOTS projects looks like functional programming(what little I know about it) with the heavy use of lambdas functions and style of building. Am I correct? Or is it a mix of both? If so would do you have any book or site recommendations to help wrap my head around functional programming.
  2. Grimreaper358


    Apr 8, 2013
    It's not functional programming it's Data-Oriented Programming. If you want to learn more about it you can check out these tutorials which go over all the basics of ECS, Jobs, and burst. All of these together make up (DOTS) Data-Oriented Technology Stack.

    The first videos in each of these playlists explain things well.

    And if you want something more advanced then you can check out the Data-Oriented Design Book
  3. RichardWepner


    May 29, 2013
    @Manablight: functional programming usually uses immutable data. Rather than removing an entry of an array, a new array without this entry (or another datatype with a reference to the original array and the information "without element at index X") would be used. If you want to learn more about this, you could look for mutable vs. immutable, and the somewhat related topic of shared and non-shared data. (Related, since you can either have mutability or a shared state for easy/easier multi-threading.)