Howdy search team,
Would anyone be interested in collaborating on style guides for Java, PHP, and any other languages we tend to use amongst ourselves?
It would be super handy to have a reference to reach for when considering alternative design patterns, plus it would be a lot of fun to think about how (and why) we might prefer one style over another.
It would also make a convenient way when onboarding new folks (of whom there will be many) to get them quickly ramped up on how to sling code, WMF Search Team style.
Also also it would make a convenient way for code reviewers to say "Yo James, this is totally not Haskell, stop trying to make everything a monad!".
Thoughts?
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
Cheers! James
1. http://www.amazon.com/Effective-Java-Edition-Joshua-Bloch/dp/0321356683 2. http://shop.oreilly.com/product/0636920021667.do 3. http://www.functionalphp.com/
I'm a HUGE fan of coding standards and guidelines. I would think a starting point might be: https://www.mediawiki.org/wiki/Manual:Coding_conventions
Kevin Smith Agile Coach Wikimedia Foundation
*Imagine a world in which every single human being can freely share in the sum of all knowledge. That's our commitment. Help us make it a reality.*
On Tue, May 12, 2015 at 9:03 AM, James Douglas jdouglas@wikimedia.org wrote:
Howdy search team,
Would anyone be interested in collaborating on style guides for Java, PHP, and any other languages we tend to use amongst ourselves?
It would be super handy to have a reference to reach for when considering alternative design patterns, plus it would be a lot of fun to think about how (and why) we might prefer one style over another.
It would also make a convenient way when onboarding new folks (of whom there will be many) to get them quickly ramped up on how to sling code, WMF Search Team style.
Also also it would make a convenient way for code reviewers to say "Yo James, this is totally not Haskell, stop trying to make everything a monad!".
Thoughts?
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
Cheers! James
- http://www.amazon.com/Effective-Java-Edition-Joshua-Bloch/dp/0321356683
- http://shop.oreilly.com/product/0636920021667.do
- http://www.functionalphp.com/
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
Oh, cool - I didn't know about that page! Looks like it's all ready for a section about Java.
On Tue, May 12, 2015 at 9:20 AM, Kevin Smith ksmith@wikimedia.org wrote:
I'm a HUGE fan of coding standards and guidelines. I would think a starting point might be: https://www.mediawiki.org/wiki/Manual:Coding_conventions
Kevin Smith Agile Coach Wikimedia Foundation
*Imagine a world in which every single human being can freely share in the sum of all knowledge. That's our commitment. Help us make it a reality.*
On Tue, May 12, 2015 at 9:03 AM, James Douglas jdouglas@wikimedia.org wrote:
Howdy search team,
Would anyone be interested in collaborating on style guides for Java, PHP, and any other languages we tend to use amongst ourselves?
It would be super handy to have a reference to reach for when considering alternative design patterns, plus it would be a lot of fun to think about how (and why) we might prefer one style over another.
It would also make a convenient way when onboarding new folks (of whom there will be many) to get them quickly ramped up on how to sling code, WMF Search Team style.
Also also it would make a convenient way for code reviewers to say "Yo James, this is totally not Haskell, stop trying to make everything a monad!".
Thoughts?
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
Cheers! James
http://www.amazon.com/Effective-Java-Edition-Joshua-Bloch/dp/0321356683 2. http://shop.oreilly.com/product/0636920021667.do 3. http://www.functionalphp.com/
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
On Tue, May 12, 2015 at 12:03 PM, James Douglas jdouglas@wikimedia.org wrote:
Howdy search team,
Would anyone be interested in collaborating on style guides for Java, PHP, and any other languages we tend to use amongst ourselves?
It would be super handy to have a reference to reach for when considering alternative design patterns, plus it would be a lot of fun to think about how (and why) we might prefer one style over another.
It would also make a convenient way when onboarding new folks (of whom there will be many) to get them quickly ramped up on how to sling code, WMF Search Team style.
Also also it would make a convenient way for code reviewers to say "Yo James, this is totally not Haskell, stop trying to make everything a monad!".
Thoughts?
Yes sure.
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
I'd go with Google's style guide https://google-styleguide.googlecode.com/svn/trunk/javaguide.html as a starting point. Its been a while since I read it but I remember it being pretty good. For the most part the actual code layout stuff is handled by checkstyle. Stuff like indent 4 spaces, no spaces around parrens and crap.
Until we upgrade to Java 8 I'm inclined to keep functional programming to a minimum like they talk about on the guava guide https://code.google.com/p/guava-libraries/wiki/FunctionalExplained. Its really useful for lazy structures but its super verbose.
In the Elasticsearch plugins I try to follow the Elasticsearch and Lucene style which is pretty loose. They almost never use the functional idioms in Guava and aren't big on setters and getters.
I certainly appreciate Haskell but I think it works because it has: * Bind syntax * Strong type inference * Easy lambdas (maybe too easy) * Laziness
None of which Java 7 has. Java 8's going to have better lambdas but that's it. So I think you have to be weary what you pull from Haskell into Java. I think its easier with Scala because its closer. I just think we should use these tools where they are obviously good but not for cases where imperative work is more idiomatic in Java.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
For the most part I want us to stay close to MediaWiki's style. Right or wrong, it'd be crazy to go against it. Kevin mentioned in a reply that I just got that there is a style guide. I honestly haven't read it - I just tried to make my code look like the other code. Ooops.
Nik
Hi!
Thoughts?
I think having code style is good, though I don't particularly care which one it is, provided it's reasonable. I have my personal preferences, but I can do any style within reason.
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
I'd be interested to look at [3] and [2] (and maybe [1] too if you have it). But I agree with Nik that real use of FP would probably be better on Java 8, it looks too clunky on Java 7.
As for code standard, looks like MediaWiki already has one, so we probably should use that one. There are tools like checkstyle btw to enforce it, but looks like WMF is not using them right now.
Doesn't MW itself have a styleguide for PHP? (if that's the same as "code standard" ignore me ;p)
On 12 May 2015 at 20:02, Stas Malyshev smalyshev@wikimedia.org wrote:
Hi!
Thoughts?
I think having code style is good, though I don't particularly care which one it is, provided it's reasonable. I have my personal preferences, but I can do any style within reason.
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
I'd be interested to look at [3] and [2] (and maybe [1] too if you have it). But I agree with Nik that real use of FP would probably be better on Java 8, it looks too clunky on Java 7.
As for code standard, looks like MediaWiki already has one, so we probably should use that one. There are tools like checkstyle btw to enforce it, but looks like WMF is not using them right now.
-- Stas Malyshev smalyshev@wikimedia.org
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
Yep, detective Kevin found it: https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP
On Tue, May 12, 2015 at 5:36 PM, Oliver Keyes okeyes@wikimedia.org wrote:
Doesn't MW itself have a styleguide for PHP? (if that's the same as "code standard" ignore me ;p)
On 12 May 2015 at 20:02, Stas Malyshev smalyshev@wikimedia.org wrote:
Hi!
Thoughts?
I think having code style is good, though I don't particularly care which one it is, provided it's reasonable. I have my personal preferences, but I can do any style within reason.
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
I'd be interested to look at [3] and [2] (and maybe [1] too if you have it). But I agree with Nik that real use of FP would probably be better on Java 8, it looks too clunky on Java 7.
As for code standard, looks like MediaWiki already has one, so we probably should use that one. There are tools like checkstyle btw to enforce it, but looks like WMF is not using them right now.
-- Stas Malyshev smalyshev@wikimedia.org
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
-- Oliver Keyes Research Analyst Wikimedia Foundation
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
For a Java style guide for the WMF, I'd recommend also looping in the Android app engineers, since they're developing in Java too. Your point of contact for them would be their tech lead, Bernd (bsitzmann@wikimedia.org, BearND on IRC).
Given Android apps are a very different domain from Java services, you may end up diverging and wanting separate Java style guides, which I think would be fine. But I thought I'd throw that out there anyway. :-)
Dan
On Tuesday, May 12, 2015, James Douglas jdouglas@wikimedia.org wrote:
Howdy search team,
Would anyone be interested in collaborating on style guides for Java, PHP, and any other languages we tend to use amongst ourselves?
It would be super handy to have a reference to reach for when considering alternative design patterns, plus it would be a lot of fun to think about how (and why) we might prefer one style over another.
It would also make a convenient way when onboarding new folks (of whom there will be many) to get them quickly ramped up on how to sling code, WMF Search Team style.
Also also it would make a convenient way for code reviewers to say "Yo James, this is totally not Haskell, stop trying to make everything a monad!".
Thoughts?
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
Cheers! James
+bearND
Good call on talking to the Android folks on their Java style. bearND's reviewed quite a few of my Java patches and has been super helpful.
On Wed, May 13, 2015 at 1:22 PM, Dan Garry dgarry@wikimedia.org wrote:
For a Java style guide for the WMF, I'd recommend also looping in the Android app engineers, since they're developing in Java too. Your point of contact for them would be their tech lead, Bernd (bsitzmann@wikimedia.org, BearND on IRC).
Given Android apps are a very different domain from Java services, you may end up diverging and wanting separate Java style guides, which I think would be fine. But I thought I'd throw that out there anyway. :-)
Dan
On Tuesday, May 12, 2015, James Douglas jdouglas@wikimedia.org wrote:
Howdy search team,
Would anyone be interested in collaborating on style guides for Java, PHP, and any other languages we tend to use amongst ourselves?
It would be super handy to have a reference to reach for when considering alternative design patterns, plus it would be a lot of fun to think about how (and why) we might prefer one style over another.
It would also make a convenient way when onboarding new folks (of whom there will be many) to get them quickly ramped up on how to sling code, WMF Search Team style.
Also also it would make a convenient way for code reviewers to say "Yo James, this is totally not Haskell, stop trying to make everything a monad!".
Thoughts?
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
Cheers! James
http://www.amazon.com/Effective-Java-Edition-Joshua-Bloch/dp/0321356683 2. http://shop.oreilly.com/product/0636920021667.do 3. http://www.functionalphp.com/
-- Dan Garry Product Manager, Search and Discovery Wikimedia Foundation
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
I began https://www.mediawiki.org/wiki/Manual:Coding_conventions/Java based on the suggestions so far.
On Wed, May 13, 2015 at 10:40 AM, Nikolas Everett neverett@wikimedia.org wrote:
+bearND
Good call on talking to the Android folks on their Java style. bearND's reviewed quite a few of my Java patches and has been super helpful.
On Wed, May 13, 2015 at 1:22 PM, Dan Garry dgarry@wikimedia.org wrote:
For a Java style guide for the WMF, I'd recommend also looping in the Android app engineers, since they're developing in Java too. Your point of contact for them would be their tech lead, Bernd (bsitzmann@wikimedia.org, BearND on IRC).
Given Android apps are a very different domain from Java services, you may end up diverging and wanting separate Java style guides, which I think would be fine. But I thought I'd throw that out there anyway. :-)
Dan
On Tuesday, May 12, 2015, James Douglas jdouglas@wikimedia.org wrote:
Howdy search team,
Would anyone be interested in collaborating on style guides for Java, PHP, and any other languages we tend to use amongst ourselves?
It would be super handy to have a reference to reach for when considering alternative design patterns, plus it would be a lot of fun to think about how (and why) we might prefer one style over another.
It would also make a convenient way when onboarding new folks (of whom there will be many) to get them quickly ramped up on how to sling code, WMF Search Team style.
Also also it would make a convenient way for code reviewers to say "Yo James, this is totally not Haskell, stop trying to make everything a monad!".
Thoughts?
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
Cheers! James
http://www.amazon.com/Effective-Java-Edition-Joshua-Bloch/dp/0321356683 2. http://shop.oreilly.com/product/0636920021667.do 3. http://www.functionalphp.com/
-- Dan Garry Product Manager, Search and Discovery Wikimedia Foundation
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
Hi,
We don't have a very formulated code style yet. But we do have a checkstyle.xml file in our repo we run our builds against, which covers a good amount. (Up until recently this was enforced through maven checkstyle, now that's done through Gradle checkstyle). We mainly use the Android Studio (similar to IntelliJ) defaults for automatic code formatting. I'm going to try to come up with some customizations that we in the team can agree on and that can be configured in Android Studio. First I'd like to figure out a way to share the Android Studio/(or IntelliJ) Code formatting configuration.
Bernd
On Wed, May 13, 2015 at 10:41 PM, James Douglas jdouglas@wikimedia.org wrote:
I began https://www.mediawiki.org/wiki/Manual:Coding_conventions/Java based on the suggestions so far.
On Wed, May 13, 2015 at 10:40 AM, Nikolas Everett neverett@wikimedia.org wrote:
+bearND
Good call on talking to the Android folks on their Java style. bearND's reviewed quite a few of my Java patches and has been super helpful.
On Wed, May 13, 2015 at 1:22 PM, Dan Garry dgarry@wikimedia.org wrote:
For a Java style guide for the WMF, I'd recommend also looping in the Android app engineers, since they're developing in Java too. Your point of contact for them would be their tech lead, Bernd ( bsitzmann@wikimedia.org, BearND on IRC).
Given Android apps are a very different domain from Java services, you may end up diverging and wanting separate Java style guides, which I think would be fine. But I thought I'd throw that out there anyway. :-)
Dan
On Tuesday, May 12, 2015, James Douglas jdouglas@wikimedia.org wrote:
Howdy search team,
Would anyone be interested in collaborating on style guides for Java, PHP, and any other languages we tend to use amongst ourselves?
It would be super handy to have a reference to reach for when considering alternative design patterns, plus it would be a lot of fun to think about how (and why) we might prefer one style over another.
It would also make a convenient way when onboarding new folks (of whom there will be many) to get them quickly ramped up on how to sling code, WMF Search Team style.
Also also it would make a convenient way for code reviewers to say "Yo James, this is totally not Haskell, stop trying to make everything a monad!".
Thoughts?
For a starting point in Java, perhaps we could use Effective Java[1] as a template, and (bias alert) sprinkle in some Functional Programming in Java[2] for good measure.
For PHP, I have no idea what I'm doing, but I have an interesting Functional Programming in PHP[3] book on my desk that y'all can borrow.
Cheers! James
http://www.amazon.com/Effective-Java-Edition-Joshua-Bloch/dp/0321356683 2. http://shop.oreilly.com/product/0636920021667.do 3. http://www.functionalphp.com/
-- Dan Garry Product Manager, Search and Discovery Wikimedia Foundation
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search
Wikimedia-search mailing list Wikimedia-search@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikimedia-search