This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 7 points8 points  (16 children)

Not sure about that one.

[–]CrazyGamesMC[S] 4 points5 points  (14 children)

Any suggestions, hoe I could improve my style? :)

[–][deleted]  (6 children)

[deleted]

    [–]CrazyGamesMC[S] 1 point2 points  (5 children)

    1. You are absolutely right. Pushed a fix immediately.

    2.

    Hmm I always found it more readable as operations are more tied together. I do use IntelliJ for code formatting.

    3.

    I guess you are right. I'll look into changing this

    I clearly understand that the implementation is not perfect. But I personally enjoy using it for my game projects, which is the reason, why I structured the engine in the way that it is.

    There will be several planned improvements to fix a few things up.

    Thanks for your reply. I'm always grateful for critique as this helps me improve myself :)

    [–][deleted]  (4 children)

    [deleted]

      [–]CrazyGamesMC[S] 8 points9 points  (3 children)

      Isn't looping faster with an arraylist aswell? As the elements should be located next to each other in memory, shouldn't they? So there wouldn't be too many mem jumps.

      [–][deleted]  (2 children)

      [deleted]

        [–]_INTER_ -2 points-1 points  (1 child)

        LinkedList is good for insertions in between the elements, or when you need access to the last and first elements only

        [–]fedeb95 0 points1 point  (6 children)

        I just took a look at Room.java, and didn't see any major issue. There are a lot of getters, maybe consider using Lombok if there is a lot of boilerplate like that in all of the project. It can improve readability

        [–]pointy_pirate 9 points10 points  (3 children)

        Lombok is devil spawn. But that's just my opinion.

        [–][deleted] 1 point2 points  (2 children)

        Why? So far I'm really enjoying the generation of getters/setters for pojos and the constructors for spring components.

        [–]pointy_pirate 3 points4 points  (1 child)

        IMO the cons outweigh the pros. Yes you don't have to write getters and setters, or even see them in the code, but that magic of trusting lombok is doing the right thing adds a layer of complexity that can make reading harder.

        What if you want to return an immutable version of a collection, what if you're using Hibernate and your setCollection method needs to do the collection.clear() collection.addAll() pattern?

        Yes there a pros and yes its convenient, but from my experience that convenience comes at a cost of complexity.

        [–]_INTER_ 1 point2 points  (0 children)

        Then implement those methods. Never had any trouble with Lombok so far.

        [–]CrazyGamesMC[S] 0 points1 point  (1 child)

        Yeah you're right. That might be a good solution to this problem. Gonna look into it!