Showing results for 
Search instead for 
Did you mean: 

Code Reviews?

Is there any interest from the community for a group for doing peer code reviews? I am lucky in my current position to work in a team of developers, but in my previous role I was the only one with any LabVIEW knowledge and when you're stuck in isolation like that it can nuture bad coding habits ("oh, I didn't know you could do it like that"). Of course, networking/user groups are great to combat this but you might not have a local one.


It can also help to avoid the 'cliff of confusion' (man, I wish I could find the LV version of this...):


The idea was mentioned here so credit to James.Morris & _Bryan


I envisage it working something similar to the certifications forum where people can request help/a code review and then if someone else is willing to look it over - they can agree any terms, share the code privately, and then get feedback on it. I see it as being more a quid pro quo type affair ("you scratch my back, I'll scratch yours").


- I appreciate that many alliance partners offer consulting/code reviews as a paid for service - perhaps they can be allowed advertise their services in the group

- IP/Confidentiality might be an issue, in this case, the pair can transfer code privately/outside of the group or agree/sign an NDA (perhaps with a simple template available?)

- We could also offer some resources on effective code reviews (e.g. some basic checklists? rubber ducks?)


If there's enough interest, I'll create a group on the NI forums (it doesn't look like there is one at the moment?).


Edit: Nevermind - I figured out how to create groups so I've created it anyway. Feel free to discuss it here, though.


I present: The LabVIEW Code Review Community.

LabVIEW Champion, CLA, CLED, CTD
Message 1 of 4

In my previous job we had a decent code review process.  It was relatively simple and was made up of two parts.  A reviewer would go through a check list of things the front panel should be and should not be doing, and then a set of checks for things the block diagram should and should not be doing.  If there was a missing mark (or was there and shouldn't be) then during the review the reviewer would describe why that check was there, and what good practices it was trying to promote and why.  The check list was pretty basic, and you could have good code not get 100%, it was just to open up some dialog about what is good and why.


The second half was running the VI Analyzer with a set of rules and specific settings that we used.  Then the reviewer would go over some of the these failures, in a similar way as the check list, showing what things should be improved and why.  Here again we tried to focus on the dialog more, than the procedure.  We also didn't go over every failure, but usually ones that were the most conserning, or had high importance.


Through this lots of beginner developers learned quickly why to do something, and what types of things to avoid.  Many times there would be lots of those "hey I didn't know you could do it that way" moments, which often translated into more excitement about the language, and the right way of doing things.


That being said I'm not certain this type of format will translate well into an online forum for a few reasons.  You already mentioned the IP issue and I think that will be a big one.  Sharing my companies code with someone might be grounds for firing, or law suites depending on where you work.  But maybe you are a student, or just wanting to learn and posting your whole project is possible.


The other major issue is time.  I'd be concerned if 1,000s of people upload their projects all asking for them to be reviewed, and having 3 members try to review all code.  Especially if reviewing code takes about an hour each, which is what I typically saw.  I think this is a good thing, I'm just not sure it will catch on, but if it does, it could be a very good thing for the community.  Our little code reviews were very successful with new developers, and often times that's what the forum sees a lot of.

Message 2 of 4

Yeah, I think there's lots of benefits of having code reviews and it generally doesn't have to be a laborious (or even the case of VI Analyser) process. I think I've seen a few sample checklists floating around on the community - for example, Steve Watts posted his.


The forums are pretty good for posting if you have a specific problem, and often other issues get picked up - but often not the sort of things that you'd be looking for in a code review. The forums are great for solving particular issues (i.e. things not working), and the certifications board is a prime example of people posting their 'completed' solutions for review and that's the kind of spirit that I think we could tap into? Also - let's not rule out things like APIs / instrument drivers / VI Packages etc.


As for the IP issue - of course no-one should post their entire projects to the LV forums/community - hence why I'd suggest that was done privately/outside of the community. I think most tech/software/engineering companies will have a similar clause to yours, but there's often the possibility for NDAs (non-disclosure agreements) or situations where it is possible - particularly if you were to use the group to 'buddy up' with someone for reviews.


I also don't think it has to be a laborious process - even just spending 10 minutes looking through a project you'd be able to spot a bunch of obvious stuff.


Anyway - this was the reason for starting the thread - to discuss and see if there's enough interest. It's amazing how when you break out of that isolation of the only LabVIEW developer in a team/company how much you can learn (and how quickly).



LabVIEW Champion, CLA, CLED, CTD
0 Kudos
Message 3 of 4

We already have code reviews here. It's the Rube Goldberg Code thread. Smiley Tongue


LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
Message 4 of 4