On Saturday, June 16, 2012 12:26:34 PM UTC-6, Sean Corfield wrote: > > On Sat, Jun 16, 2012 at 10:58 AM, Kurt Harriger <kurtharri...@gmail.com> > wrote: > > How does one turn off pre/post conditions in production? > > (binding [*assert* false] (call-my-code)) > > > I agree with Sean > > however and generally think that assertions in production a bad thing. > > I didn't say that. I said the question was a philosophical one. >
> I actually think assertions should stay _on_ in production (so I would > care about computationally intensive assertions - and I would prefer > those to be in a test suite). > Sorry, I mistyped that. I too agree that assertions should remain on in production. Sometimes my fingers don't keep up and I miss a word or two when that word is "not" the results can be disastrous. > > (and I don't agree with you on using accessor functions vs data-as-API > either) > I think there is a difference between data as an api and using data as a programming model. I am fond of declarative programming, say what not how. But, it is my opinion that good declarative data models require extremely good understanding of the problem domain which develops from reflecting of the commonality and differences in many different implementations. Declarative data models done right can simplify things... however, the wrong data model can also introduce complexity. Ant is a data driven api but the data model is poorly designed, maven is a much better example of a declarative data api, yet a lot of people still find maven to be more complex and inflexible than ant for various projects that require a lot of plugins. A really good clojure specific example of data vs api is the discussion regarding if the clojurescript analyzer should contain children or if children should be a multimethod https://groups.google.com/forum/m/?fromgroups#!topic/clojure-dev/vZLVKmKX0oc HTML is another great example of a "declarative" data model that has shown the stress of increasing complexity from poor representation for common use cases (its a navbar not a table) and a multiplicity of vendor specific additions that do the same thing in a different way. I don't think it is a stretch to say that rich client side web development was significantly more difficult to do correctly before apis such as jquery were written to abstract over the differences in vendor implementations. HTML is data as an api that tells the browser how to render a page it cannot be anything else... but I wouldn't consume or construct the data structure directly instead I would use an api such as jquery so that when the data representation changes such as new css attributes that enable the same effect to be accomplished more efficiently I can quickly take advantage of them without needing to make massive breaking code changes. APIs allow you to be DRY. I'm not suggesting that the api for a program should not be a declarative data structure, what I am saying is that we should not consume the data structure directly without abstractions. Publish your api as a data structure...consume that the data structure through an api. Kurt > -- > Sean A Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ > World Singles, LLC. -- http://worldsingles.com/ > > "Perfection is the enemy of the good." > -- Gustave Flaubert, French realist novelist (1821-1880) > On Saturday, June 16, 2012 12:26:34 PM UTC-6, Sean Corfield wrote: > > On Sat, Jun 16, 2012 at 10:58 AM, Kurt Harriger <kurtharri...@gmail.com> > wrote: > > How does one turn off pre/post conditions in production? > > (binding [*assert* false] (call-my-code)) > > > I agree with Sean > > however and generally think that assertions in production a bad thing. > > I didn't say that. I said the question was a philosophical one. > > I actually think assertions should stay _on_ in production (so I would > care about computationally intensive assertions - and I would prefer > those to be in a test suite). > > (and I don't agree with you on using accessor functions vs data-as-API > either) > -- > Sean A Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ > World Singles, LLC. -- http://worldsingles.com/ > > "Perfection is the enemy of the good." > -- Gustave Flaubert, French realist novelist (1821-1880) > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en