News for hackers. Stuff that matters.
Re:How many lines of code is Candy Japan? by wheels on Friday September 30, 2016 @12:14PM (#12613345)
Above 10k lines is where statically typed languages really begin to justify their overhead. I work primarily in Ruby, C++ and Java, and while for smaller projects, Ruby is far more of a joy to use, for large projects (I've worked on C++ projects well over a million lines of code) static typing is a blessing.

Refactoring Ruby is painful in a large project, even with decent test coverage (and a large portion of the tests basically enforce what you'd get automatically with static typing). C++ is doable in that you'll get (increasingly humane with clang and recent GCCs) compiler errors when you've forgotten some detail. But refactoring Java is positively germane with all of the tools that are enabled by such a consistent VM-model. (It really is neat to be able to rename a method in an object on 100k LOC project simply by renaming it in one place or to change a signature with helpers along the way.)

Some of that makes those languages less fun (and quick) to work with initially, but for projects that are likely to eventually grow quite large, there can be an eventual pay-off.

Re:How many lines of code is Candy Japan? by adamnemecek on Friday September 30, 2016 @07:09PM (#12615779)
What kills me about it refactoring c++ is dealing with headers. A lot of times, something should really be a separate file (or should me merged into another file) but it would be a pain in the ass to fix the headers.
Re:How many lines of code is Candy Japan? by webkike on Friday September 30, 2016 @09:44PM (#12616208)
This is a core problem with C++. Until we have packages, you might want to consider another language. Rust is usually a good choice.
Re:How many lines of code is Candy Japan? by sytse on Friday September 30, 2016 @06:40PM (#12615677)
GitLab is 30k+ lines of Ruby code http://gitlab-org.gitlab.io/gitlab-ce/coverage-ruby/#_AllFil...

We're not missing static typing as far as I know. We still are able to ship a lot of changes every month. I'm not sure if it is our structure (idiomatic Rails), test coverage (over 85%), something else, or maybe we should miss it but don't realize it.

One disadvantage is that static typing causes more lines of code than dynamic code. And code size is the best predictor of code quality http://blog.vivekhaldar.com/post/10669678292/size-is-the-bes...

Re:How many lines of code is Candy Japan? by adamnemecek on Friday September 30, 2016 @07:10PM (#12615784)
> One disadvantage is that static typing causes more lines of code than dynamic code.

Not if the statically typed language uses inference.

Re:How many lines of code is Candy Japan? by sytse on Friday September 30, 2016 @07:18PM (#12615798)
That would be the best of both worlds indeed. Hope we get this for Ruby https://codon.com/consider-static-typing
Re:How many lines of code is Candy Japan? by saurik on Saturday October 01, 2016 @02:12PM (#12619124)
The seminal languages with static typing had this feature, so I feel it does the field a disservice to say "the best of both worlds": there are a few annoyingly popular statically typed languages which don't have this property, and they should be considered deficient to the extent to which it is not for theoretical type depenence reasons.