On Tue, Jan 22, 2013 at 03:02:54PM +0100, Tomek CEDRO wrote:
> I propose to introduce and use superfluous variable names:
> 
> 1. Prefix all variables and function names with "oocd_". This will
> help to identify which code comes from OpenOCD in case we also use it
> in conjuction with other programs and/or libraries.
> 
> 2. Use layer name as second argument in function/variable names - i.e.
> "oocd_interface_" for everything related to Interface layer,
> "oocd_transport_" for everything related to transport layer,
> "oocd_target_" for everything related to target layer, etc.
> 
> I know this will create long variable names and sound like Yoda, but
> this will dramatically increase code readability and debug, prevent
> one layer stuff usage in other layers (i.e. current "jtag_interface"
> name for something that is not only jtag related, or "reset" that is
> tied to JTAG, etc etc).

Absolutely no.

This is tedious to write, clutters namespace and provides a sense of
organization that is in reality not there. When fully implemented, these
long names will *decrease* code readability.

Use sensible names on all levels, but do not include the layer in every
symbol, and definitely drop the leading oocd_ - that one provides zero
information.

A clean, layered API can be implemented without such a ridiculous naming
scheme - layering violations are not prevented by such a scheme.

cu
Michael

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to