Home > Tools > Less is more

Less is more

Quflow example: Working inside a subsystem as if it was the complete system:
[python]
>>> from quflow import Attributes
>>> obj = Attributes(x = 1)
>>> with obj:
… y = x + 1
… del x

>>> obj
Attributes(y = 2)
[/python]
Same example without quflow requires cluttering with symbols that hides the intention and does not provide any focus area to the logic:
[python]
>>> obj = dict(x=1)
>>> obj[‘y’] = obj[‘x’] + 1
>>> del obj[‘x’]
>>> obj
{‘y’: 2}
[/python]

Advertisements
Categories: Tools
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: