You are viewing a single comment's thread from:

RE: ConstraintMaker for Autolayout

in #utopian-io6 years ago

I was asked by @amosbastian to review the code as I have some knowledge about iOS development.

I've found the following problems with your code:

  • As mentioned by @opus: similar functionality already exists in the SDK.
  • You've kept the default Xcode project name: DemoProject.
  • There are nearly no useful comments in the code itself. Couldn't find any to be exact. I'm not really the person that should judge people for that (I rarely comment my own code), but still this is an issue.
  • You've failed to adhere to a bracing convention. Some function declarations have the opening brace on the same line as the "func", sometimes the opening brace is on the line following the declaration itself. You should create rules for yourself and then follow them. I'd suggest to reformat the code.
  • The code has lots of duplicate logic. While I don't suggest any solutions to this I'd recommend to try and find a way to deduplicate code on your own. Repeating code like this may lead to issues later on when you'll have to change that exact bit of code in multiple lines (due to API changes, for example).

In spite of the issues I've mentioned the library itself seems to work correctly. I don't believe this project will be deemed useful by fellow Swift programmers. I hope to be proven wrong, though :)

Every contribution to free open source software is welcome though, and I myself would love to see more projects from you. Keep coding!

PS. Keep that in mind this is not an official review of your code. It's just my opinion of your code. It may influence the utopian review, but you will still, probably, be rewarded. Thank you for contributing to FOSS.

Sort:  

Hey @nepeta
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.

Contributing on Utopian
Learn how to contribute on our website.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Thanks for the appreciation, though there are some issues which I have to focus on. From my next contribution I will try my best to include all things in a proper way as mentioned above and will try to include comments in the code to make the developers know the exact meaning of each bit of code.