[Serialize] Export updateHeaderFile in $.rib#203
Conversation
There was a problem hiding this comment.
You can use "array = $.merge([], design.getProperty(property)) to copy an array instead of using extend.
|
Updated! |
|
Apparently I didn't post my comment here before I closed the window. :( Sorry to be a stickler here, but the function updateHeaderFile() reminded me of a topic from a book, probably either "Writing Solid Code" or "Code Complete", some old Microsoft classics. The point of the topic was that functions should have a single purpose, not try to combine multiple behaviors into one. This gives more room for bugs, and makes the code less self-documenting. I believe that applies very well here: it would be much better to have addCustomFile / removeCustomFile / replaceCustomFile functions, than put all behaviors in one here. Each could then validate the inputs with its particular behavior in mind. When you are reading a call to "updateHeaderFile", you have no idea what it is doing until you look into the detail of the implementation or at least description. But with the three functions above, you can surmise what they are doing. |
|
Replaced by #206 |
No description provided.