Live data from Hacker News

Ask HN: Is my code any good?

news.ycombinator.com

41–44 of 44 posts

Re: Ask HN: Is my code any good?

#41
post #18
post #17

How long have you been coding total? Was Design+Code your sole source for learning how to program?

No I have been coding now for close to an year now. But this is my first project with Swift. I have also watched the video lectures of the iOS development course offered by Stanford on iTunes.

The design (icons, graphics, screenshots) all look really nice. if you did all of that by yourself, then kudos!

Re: Ask HN: Is my code any good?

#42
post #12

I've not written any swift apps yet, but I have written some objective c and the (effectively) empty test directory is definitely an indicator that this code will be hard to change.

Empty test directory says absolutely nothing how hard this code will be to change. And seeing that this code is quite well organized, to change it won't be hard at all.

The code is well organized, and as there's relatively little of it, it will be relatively easy for the author to change the code. As he starts to add features and accept pull requests, he will have to manually check via static analysis and manual testing to ensure that the code will still work perfectly.

As the code base grows, doing it this way reliably will become more difficult, to the point that he will begin to fear change.

There is simply no debate that a well tested code base is easier to confidently add features to, confidently refactor and debug than code with no tests at all. This is particularly true if you bring on new contributors who have had no experience with the codebase.

Humans are not computers, they are never as good at repeatedly executing all possible execution paths of an application without growing tired or over confident that it doesn't need to check some path because it's sure it works.

I would take a well tested codebase over a well organized one with no tests any day of the week, because I know I could confidently reorganize the code without breaking anything. (well tested does imply that the tests themselves are well organized, though).

The OP was asking for criticism. He should add tests, lots of 'em.

Re: Ask HN: Is my code any good?

#44

For those advocating automated tests. Are you actually iOS developers with experience testing ios code? If so, I'm curious what frameworks/tools you've successfully used for unit and integration testing.

We use https://github.com/kif-framework/KIF for automation! But you know the deal on how comprehensively you can do automation test!
Post reply on HN