Thread Rating:
  • 413 Vote(s) - 2.81 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sonntag MVC without strings or name
08-09-2011, 01:12 AM,
#4
RE: Sonntag MVC without strings or name
Hi

The intention is to always keep plain text "logic" strings out of exposed logic in code. The example shows multiple exposure of the same string in different pieces of source logic. This is one case where it is not "less" that is more, but "fewer is better."

The macro requires the addition of another syntax-switch to accommodate an expression or a token for the identifier and for that reason I have requested to join that sourceforge.net group for Sonntag.

In fact, the current macro reconstructs an Identifier from that which is passed in by using only its name - so better to pass an object in the first place. The changes required are really that simple.

Real-world code is too complex for us to needlessly leave strings lying about - even disquiesed as identifier names for macros - and the example is excellent for it uses such common strings as "clear" and "content".

If you then add the complication that strings must have some "command" format, you needlessly add complexity and expose that complexity - when all that was required was
1) encapsulate (as an option)
2) a more flexible macro that also accepts an expression to support 1)

That way no one is forced to fully separate in the way I advocate, but neither is such separation precluded by the macro alone.

Yes, message is Any type. But the macro is expecting only an Identifier. It is then up to the macro to ensure that the expression is acceptable.
Robert Shiplett, Curlr
Fredericton NB

Canada


Messages In This Thread
RE: Sonntag MVC without strings or name - by RobertShiplett - 08-09-2011, 01:12 AM

Possibly Related Threads...
Thread Author Replies Views Last Post
  Sonntag で別画面(Screen)のイベントを呼ぶ umemura 2 4,048 08-04-2011, 02:47 AM
Last Post: RobertShiplett
  Sonntag でCommand を呼び出す umemura 4 4,128 08-02-2011, 09:24 AM
Last Post: fukuta
Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('187')