Live data from Hacker News

Walkmod: Open-source tool to automatically apply code conventions

walkmod.com

21–28 of 28 posts

Re: Walkmod: Open-source tool to automatically apply code conventions

#21
post #13
post #7

Earlier quoted context omitted.

From their GitHub README [1] (I'm not affiliated): "Walkmod can support with any programing language if a set of interfaces are implemented as a third party plugin. The first (and current) supported language is Java." [1] https://github.com/rpau/walkmod-core

Exactly, Walkmod acts as a framework for language transformations, but we have started with Java

It would be nice to write another plugin for something else like Python or C++. For example in the UML diagram I saw something called "JavadocComment" which immediately puts me off writing a plugin because it looks like I would have to follow this even for a non-Java language.

Re: Walkmod: Open-source tool to automatically apply code conventions

#24
I'm a bit skittish about tools like this.

We started using one for C# a while back, and discovered a couple key problems with it. First and foremost, sometimes its edits were not safe to do in the context - either that commented code really was important to keep around for some specific reason (e.g., it serves an explanatory purpose), or sometimes the changes were not truly behavior-neutral and would therefore introduce subtle bugs.

In light of that, I'm moving away from thinking that using tools like this as a sort of spray-on tan for cleaning up code is wise. I've started leaning toward the following approach: First, let sleeping dogs lie. Old messy code is like asbestos; it's most dangerous when you disturb it. Second, if you're going to have to work on the code anyway then that's an appropriate time to clean it up. Even so, proceed with caution: Make sure you understand the code and it's got good test coverage so you can visually and empirically verify that the cleanup isn't doing any damage.

Re: Walkmod: Open-source tool to automatically apply code conventions

#25

I'm a bit skittish about tools like this. We started using one for C# a while back, and discovered a couple key problems with it. First and foremost, sometimes its edits were not safe to do in the context - either that commented code really was important to keep around for some specific reason (e.g., it serves an explanatory purpose), or sometimes the changes were not truly behavior-neutral and would therefore introd…

>> In light of that, I'm moving away from thinking that using tools like this as a sort of spray-on tan for cleaning up code is unwise.

Great metaphor, and I agree.

Re: Walkmod: Open-source tool to automatically apply code conventions

#26

I'm a bit skittish about tools like this. We started using one for C# a while back, and discovered a couple key problems with it. First and foremost, sometimes its edits were not safe to do in the context - either that commented code really was important to keep around for some specific reason (e.g., it serves an explanatory purpose), or sometimes the changes were not truly behavior-neutral and would therefore introd…

It is a respectable point of view, but I think that automatize some boring tasks to correct inside the code is a good idea because let you work on other more interesting tasks.

In fact, most of us use some automatic ways to correct and enrich code with IDEs. Is it also incorrect? In fact, what we are trying to solve are the following situations:

a) In a context where there are a lot of developers and you have worked hard into improve the code style and someone else pushed code that again violates your "implicit" code style. Do you need to correct these bad practices over and over again?

b) There are some boring tasks that punctually appear like "refactoring" when deprecated methods appear or developers need to upgrade one external library version (eg. one critical bug appears).

Anyway, thank you for your opinion :-)

Re: Walkmod: Open-source tool to automatically apply code conventions

#27
post #18

I think we're long overdue a tool like this (maybe it already exists?) that will reformat code. I have been so bored beyond tedium about endless debates over tabs or spaces, 2 spaces or 4 spaces, semi-colons or no semi-colons, etc. etc. ad nauseum. Let users check out a repo formatted using whatever indentation they like, then commit back in a standardised format. Then we can all stop talking about this utter nonsens…

Thoughtbot offer a tool called HoundCI that does this for JS, ruby, coffeescript and SASS (SCSS). They charge $12/month for private repos and it's free for open source.

It's designed to check your github pull requests. Haven't used it but looks pretty nice. They provide style guides for each language that your free to customize.

https://houndci.com

Re: Walkmod: Open-source tool to automatically apply code conventions

#28
I prefer to use a tool that gives you feedback on your code, rather than to correct your code. When you get feedback, you learn and (hopefully), you'll improve your style while you write your code. When it is automatically corrected for you, you don't necessarily learn anything from it.
Post reply on HN