Opinions requested on my blog post about primitive obsession.

  • Permalink
  • submit to reddit
  • Email
  • Follow


So, I just finished the first draft of an article on the benefits of avoiding primitive obsession.  I'd like some feedback on the article. <shameless>Also, posting this message is a good way to promote my blog.</shameless>Any feedback is very welcome. Either using the comment system, or by following up on this thread.  Comment system is preferred (think of it as a followup-to header).<http://virtualinfinity.net/wordpress/program-design/2007/10/28/primitive-obsession/>Thanks,Daniel.P.S.  If anyone has an opinion, positive or negative, about my "advertising" my blog-posts in this manor, feel free to let me know here.  I don't want to be classified as a spammer, and I feel that I contribute enough to this community that the occasional unsolicited message is appropriate.  Let me know if you feel otherwise.-- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
0
Reply Daniel 10/28/2007 7:23:37 PM

See related articles to this posting


On Sun, 28 Oct 2007 12:23:37 -0700, Daniel Pitts<newsgroup.spamfilter@virtualinfinity.net> wrote, quoted or indirectlyquoted someone who said :>P.S.  If anyone has an opinion, positive or negative, about my >"advertising" my blog-posts in this manor, feel free to let me know >here.  I don't want to be classified as a spammer, and I feel that I >contribute enough to this community that the occasional unsolicited >message is appropriate.  Let me know if you feel otherwise.the big advantage to your way, is you can modify your essay based onthe feedback.  If you do it via posts, your errors sit there foreverto mislead others.So I figure anything more that a couple of paragraphs should be postedas html.-- Roedy Green Canadian Mind ProductsThe Java Glossaryhttp://mindprod.com
0
Reply Roedy 10/28/2007 11:00:48 PM

On Sun, 28 Oct 2007 12:23:37 -0700, Daniel Pitts
<newsgroup.spamfilter@virtualinfinity.net> wrote, quoted or indirectly
quoted someone who said :

><http://virtualinfinity.net/wordpress/program-design/2007/10/28/primitive-obsession/>

I have been lobbying since the 1970s  for units of measure as a built
in feature to create a friendly language for engineers.  

If you have both British and ISO measure in the same program, SO many
errors happen because of invalid assumptions about measure.  Even with
pure ISO, powers of 10 errors are easy to make.  

With declared units of measure you can have:
1. dimensionality consistency checks.
2. automatic unit conversion.

Units of measure are NOT classes. They are compile time modifiers to
primitives.  You could think of them as generics for primitives.

see http://mindprod.com/jgloss/unitsofmeasure.html
-- 
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
0
Reply Roedy 10/28/2007 11:05:58 PM

Roedy Green <see_website@mindprod.com.invalid> writes:>Units of measure are NOT classes. They are compile time modifiers to>primitives.  You could think of them as generics for primitives.  They can be used in Fortresshttp://research.sun.com/projects/plrg/Fortress/overview.html  Language Specificationhttp://research.sun.com/projects/plrg/fortress.pdf  JVM-based interpreter for a subset of the languagehttp://fortress.sunsource.net/
0
Reply ram 10/28/2007 11:22:28 PM

On Oct 29, 10:05 am, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> On Sun, 28 Oct 2007 12:23:37 -0700, Daniel Pitts
> <newsgroup.spamfil...@virtualinfinity.net> wrote, quoted or indirectly
> quoted someone who said :
>
> ><http://virtualinfinity.net/wordpress/program-design/2007/10/28/primit...>
>
> I have been lobbying since the 1970s  for units of measure as a built
> in feature to create a friendly language for engineers.  

I understand completely :-)

Before I moved into the IT world, I spent many years in the
metal and engineering trades, converting between Metric and
Imperial units on a daily basis.

> If you have both British and ISO measure in the same program, SO many
> errors happen because of invalid assumptions about measure.  Even with
> pure ISO, powers of 10 errors are easy to make.  

Indeed.

> With declared units of measure you can have:
> 1. dimensionality consistency checks.
> 2. automatic unit conversion.
>
> Units of measure are NOT classes. They are compile time modifiers to
> primitives.  You could think of them as generics for primitives.

I don't see why the couldn't be represented as classes.
Units can be viewed as an abstraction to measurement types.

I haven't used AutoCAD in a while, but I'm reasonably sure that they
worked with units in such a way - You just specify the unit type and
begin drawing.

--
Chris

0
Reply Chris 10/29/2007 4:37:51 AM

On Oct 29, 12:05 am, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> On Sun, 28 Oct 2007 12:23:37 -0700, Daniel Pitts
> <newsgroup.spamfil...@virtualinfinity.net> wrote, quoted or indirectly
> quoted someone who said :
>
> ><http://virtualinfinity.net/wordpress/program-design/2007/10/28/primit...>
>
> I have been lobbying since the 1970s  for units of measure as a built
> in feature to create a friendly language for engineers.

And that's why people have developed frink. http://futureboy.homeip.net/frinkdocs/

It didn't take them 30 years of lobbying. Just some Java coding.

> If you have both British and ISO measure in the same program,

ISO? Do you mean SI? ISO doesn't do units.

> If you have SO many
> errors happen because of invalid assumptions about measure.  Even with
> pure ISO, powers of 10 errors are easy to make.
>
> With declared units of measure you can have:
> 1. dimensionality consistency checks.
> 2. automatic unit conversion.

>From an interactive  Frink session (first line after an empty line is
the input, followed by Frink's response):

Frink
Copyright 2000-2007 Alan Eliasen, eliasen@mindspring.com
http://futureboy.us/frinkdocs/
Enter calculations in the text field at bottom.
Use up/down arrows to repeat/modify previous calculations.

var m is mass = 10 pounds
45359237/10000000 (exactly 4.5359237) kg (mass)

m = 11 pounds
498951607/100000000 (exactly 4.98951607) kg (mass)

m = 11 meters
BasicContext:  Cannot set symbol m, ContextFrame threw exception:
  Constraint not met--value must have dimensions of mass

m = 1 kg
1 kg (mass)

m -> pound
100000000/45359237 (approx. 2.2046226218487757)

10 volt
10 m^2 s^-3 kg A^-1 (electric_potential)

20 amp
20 A (current)

10 volt * 20 amp
200 m^2 s^-3 kg (power)

10 volt * 20 amp -> watt
200

10 volt * 20 amp -> meter
 Conformance error
   Left side is: 200 m^2 s^-3 kg (power)
  Right side is: 1 m (length)

var p is power = 10 volt * 20 amp
200 m^2 s^-3 kg (power)

p = 10 watt
10 m^2 s^-3 kg (power)

0
Reply Hunter 10/29/2007 6:58:17 AM

Roedy Green wrote:> I have been lobbying since the 1970s  for units of measure as a built> in feature to create a friendly language for engineers.  The Measures and Units API (JSR-275) seems to be the answer to your efforts.See introductory article:<http://www.javaworld.com/javaworld/jw-10-2007/jw-10-jsr275.html>As the article states, there is still no decision on inclusion of the JSR-275 API in Java 7.  Up to now, there is also no mention of 'javax.measure' package in official list of Java 7 packages (http://download.java.net/jdk7/docs/api/).  So, my guess is that we should wait a bit longer for that...  Hopefully, intermediately we may use mentioned in the article the reference "draft" implementation from the JScience project (http://jscience.org/).piotr
0
Reply Piotr 10/29/2007 10:48:37 AM

On Sun, 28 Oct 2007 23:05:58 GMT, Roedy Green<see_website@mindprod.com.invalid> wrote, quoted or indirectly quotedsomeone who said :>If you have both British and ISO measureoops British and SI measure.-- Roedy Green Canadian Mind ProductsThe Java Glossaryhttp://mindprod.com
0
Reply Roedy 10/29/2007 12:23:04 PM

On Sun, 28 Oct 2007 21:37:51 -0700, "Chris ( Val )"<chrisval@gmail.com> wrote, quoted or indirectly quoted someone whosaid :>I don't see why the couldn't be represented as classes.>Units can be viewed as an abstraction to measurement types.If you make them a something like generics for primitives, they havezero run time extra overhead.  This is important forcomputation-intensive engineering programs.-- Roedy Green Canadian Mind ProductsThe Java Glossaryhttp://mindprod.com
0
Reply Roedy 10/29/2007 12:24:39 PM
comp.lang.java.programmer 51820 articles. 38 followers. Post

8 Replies
206 Views

Similar Articles

[PageSpeed] 10


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Request for comments on forthcoming blog posting about Unicode in Windows consoles
http://alfps.wordpress.com/?p=356&shareadraft=4ece5380818f3 You may have a chance to affect the final posting... :-) The link is just to an unfinished draft (maybe I'll complete this this evening), but much read-worthy there, I think. Cheers, - Alf On 24/11/2011 14:40, Alf P. Steinbach wrote: > http://alfps.wordpress.com/?p=356&shareadraft=4ece5380818f3 > > You may have a chance to affect the final posting... :-) > > The link is just to an unfinished draft (maybe I'll complete this this > evening), but much read-worthy there, I think. Off-topic. HTH. ...

Difference between TCAP Request Primitive and Indication Primitive
Hi, Can anyone please explain to me the difference between TCAP Request Primitive and Indication Primitive. I mean when is Request primitive used and when is Indication primitive used? ----------------------------------------------------- Parameter | Primitive: TC-INVOKE | ----------------------------------------------------- | Request | Indication | ----------------------------------------------------- thanks Rohit On Oct 12, 5:37=A0am, "rrs.mat...@gmail.com" <rrs.mat...@gmail.com> wrote: > Hi, Rohit, An indication is receiv...

Attaching binary data to a POST GET (or POST) request
Hello Everyone, I need to send a file to a RESTful API by attaching the binary data to the REST call. The API tells me this is the format I should attach it it: http://api.service.com?subject=The_Subject_Of_The_Message&media=The_binary_data_of_the_file This looks like a GET request but, either way, I'm not sure how to attach binary data to either a GET or POST request. I've Googled for hours and can't find what I need. Can someone help? Thanks! Anthony Just looked and saw it's expecting a POST request. So how do I do this via POST? El 07/07/2010 8:37,...

Difference between TCAP Request Primitive and Indication Primitive [Telecom]
Hi, Can anyone please explain to me the difference between [the] TCAP Request Primitive and [the] Indication Primitive? I mean, when is [the] Request primitive used and when is [the] Indication primitive used? ----------------------------------------------------- Parameter | Primitive: TC-INVOKE | ----------------------------------------------------- | Request | Indication | ----------------------------------------------------- thanks, Rohit ...

Posted under request
Hi Richard, Sorry for dropping in like this but it seemed that I cant pose to both INFO-VAX@MVB.SAIC.COM, INFO-VAX@LISTSERV.UGA.EDU though I can see the postings coming into my mailbox. Appreciate if you can send my email below to the list on my behalf. In the past my subscription just got cut off after a month or so & I have to resubscribe. Thanks Goh ======================================== Hi, Currently we have a Windows application which generates pdf/Word/Excel reports & we'll be using our corporate standard tool ConnectDirect to 'b...

how to post a request
hi, i want to knoe how to give input to Perl Program through the POST method from a HTTP client. this POST method is not from teh a form but it is from a C program (HTTP Client program). i have to use the POST method to give input to a web page as specified by the HTTP RFC. it would be of great help if anyone can help me out with this. -Nachiketh Nachiketh wrote: > i want to knoe how to give input to Perl Program through the POST > method from a HTTP client. this POST method is not from teh a form > but it is from a C program (HTTP Client program). i have to use the > POST method...

Opinions Requested
What's the best set of authoring tools (if there is one...) for building a simple Web site? Specifically, I want to produce a "newsletter" site that contains a menu (for key dates and subjects), has variable-sized text narratives, and contains some pictures. Not much in the way of graphics, but some different fonts and colors might be nice...) I don't want a blog, nor do I intend to do any e-commerce with this site - just have a lot of "news" content for the few people I'll point to it. The reason for this query is that I know of many ...

I posted this a while back but I am posting it again because the question on a pure mathematical level deserved further examination in my opinion
The idea of when I leave my house I have to lock my door to make sure what is in my house is secure when I leave my house seems to be a basic function as to be so easy to understand its parallels must echo through the halls of eternity. Alas, have we, as a voice of reason fell on (tripped) to overhear (by deaf ears) a misplaced concept? When I go to the ATM I enter a key but when I leave the ATM I just leave. I do not lock my account back up. Alas, it seems to be a very basic observation that unless an encrypted action takes or piece of knowledge is transcended upon receipt by the very forces...

Jordan mechner's blog post on finding and posting the Prince of Persia source
Prince of Persia Source Code -- Posted! http://jordanmechner.com/blog/2012/04/source/ "Let me begin to count the ways I've been lucky with this: The box was found. The disks were intact. Prince of Persia and I happened to have a high enough public profile that people of Jason and Tony's caliber (and dozens of others who contributed their expertise via IRC, skype and twitter from around the world) cared. "In the bigger picture, our timing was lucky. The 1980s and the Apple II are long enough ago to be of historical interest, yet recent enough that ...

ajax cross domain request by POST method with content type application/json skipping preflight OPTIONS request
I there a way to do this? The problem is server doesn't respond header Access-Control-Allow-Headers: content-type But i need to specify content-type: application/json As a consequence, when browser send preflight options request, i have messa= ge error in console like this Request header field Content-Type is not allowed by Access-Control-Allow-He= aders When i use Postman(chrome extension) and send the same post request to the = same server, then all fine: in network tab i don't see preflight options re= quest, but only one post request with status OK. I copied my ...

HTTP Post Request
Hi to all, i want to ask you a question, concerning the best way to do the following as a POST request: There is server-servlet that accepts xml commands It had the following HTTP request headers: Host: somehost.com User-Agent: Jakarta Commons-HttpClient Content-Type: text/xml Content-Length: 415 and the following request body (reformatted here for clarity): <?xml version='1.0'?> <methodCall> <methodName>search</methodName> </methodCall> How...

xmlhttp-request and POST ?
http://kb.mozillazine.org/XMLHttpRequest As read in many places i found and tested xmlhttp request... the problem is that it works with GET, but I want to use it with POST... i.e it has to be attached on onSUbmit or some such and send the form-data in some way, get the result and display it.. Does anyone done something like this (i.e.with POST), if yes can you post the solution or example code.. It has to be posible, 'cause it seems google uses it in gmail. tia raptor wrote: > Does anyone done something like this (i.e.with POST), if yes can you > post the solution or example co...

How to post the request object
Hi all, My requirement is like this,we have 2 text fields called name and number and one button named submit.when ever we click the submit button then we need to store the page information(form values) into our database and need to post this form values to some other site (eg:action="google.com/signup.aspx"). How to do this in asp.net please send me the code. Thanks, Srinivas.M This is a serverside question really, let your page postback like usual on the submit and then to a Server.Redirect with the form variables appended to the URL as GET params - eg google.com/sign...

Interesting blog post
http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html Honest assessment of somebody getting into forth.. and failing. Well worth the read. -Mux Mux <spam_catcher123@hotmail.com> writes: > http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html > > Honest assessment of somebody getting into forth.. and failing. Well > worth the read. I didn't manage to thank you earlier for posting that. I read it a couple weeks ago and it was interesting. I just re-read it in the midst of all these GA-related discussions and it was even more interesting. ...

Interesting blog post
Just read the http://blogs.ittoolbox.com/oracle/guide/archives/recent-open-source-oracle-projects-19233 and thought - maybe it is interesting to share. I personally found the mentioned http://ora-safe-search.sourceforge.net/ very useful. Best regards Maxim -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maxim Demenko wrote: > Just read the > http://blogs.ittoolbox.com/oracle/guide/archives/recent-open-source-oracle-projects-19233 > > and thought - maybe it is interesting to share. I personally found the > mentioned http://ora-safe-search.sourceforge.net/ very useful. > ...

Request for giving an opinion.
Hello. I programme in C++ using g++ v 3.4.4 in Cygwin. Do you know about good websites where I could have an opninion about created programs. I am asking for this because as a being beginner and programming by myself, it is difficult to find problems. Thanks. -- ZikO gg: 557876 ZikO wrote: > Hello. > > I programme in C++ using g++ v 3.4.4 in Cygwin. > Do you know about good websites where I could have an opninion about > created programs. If you want your program criticized to bits and pieces, you could post it here provided: (a) It is not incredibly long (to ensure ...

Request opinions for a website
Hello, I have created a mortgage/realestate website for a company (actually it's two companies in one domain with a same owner) located in Illinois. I would greatly appreciate any comments, suggestions or constructive criticisms that might help in improving its' usability and resourcefulness. Thank you very much. http://www.groupcontinental.net acs2006 admin@groupcontinental.net Doesn't work right in Firefox 1.5.1 R "acs2006" <akiosatoh@gmail.com> wrote in message news:1139006570.827066.58580@g43g2000cwa.googlegroups.com... > Hello, I have created a mor...

design opinions requested
I have a design opinion. I have 3 models in mind, and I don't particularly like them, so maybe someone can suggest or help justify. I have a set of essentially unrelated classes (about 6). class Foo; class Bar; class Bat; I have a container-ish class that holds many of those other classes and other meta-data: class Stuff { public: vector<pair<string, Foo *> > foos; vector<pair<string, Bar *> > bars; vector<pair<string Bat *> > bats; } So here's the p...

How to send a POST request?
Hi. Sorry for this very clueless question, but how does one write in Python an HTTP client that can send a POST request? The modules I've found (e.g. urllib, urllib2), as far as I can tell, seem to be limited to GET requests. (I could be wrong though; please correct me if this is so.) TIA! kynn -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded. In <g2cc24$638$1@reader2.panix.com> kj <socyl@987jk.com.invalid> writes: >Hi. Sorry for this very clueless question, but how does one...

Testing the Post request
Hi, Below is a bit of code that I intend to use to perform a http "Post" request to an another application - which is still under development. I would like to verify the implemention of this method ie it will perform a http POST request with the xml content to the specified URL. I want to avoid mocking the HttpClient class. I would like to effectively see this method perform the a actions and and some stub application receive the request ( get I presume). Any help, with example code pls, would be very much appreciated. Thank You. Pete code => public void sendResponse() { St...

Testing the Post request
Hi, Below is a bit of code that I intend to use to perform a http "Post" request to an another application - which is still under development. I would like to verify the implemention of this method ie it will perform a http POST request with the xml content to the specified URL. I want to avoid mocking the HttpClient class. I would like to effectively see this method perform the a actions and and some stub application receive the request ( get I presume). Any help, with example code pls, would be very much appreciated. Thank You. Pete code => public void sendResponse() { St...

AJAX Post requests
Hi, I have a simple web server using BaseHTTPServer, and the def do_POST (self) function works fine for regular forms that are submitted to it, but when I send an AJAX POST to it it does nothing (I've tried to just get it to print to check it's nothing else but it doesn't even do that, although it does for a regular POST request. The post function is def do_POST(self): global rootnode try: ctype, pdict = cgi.parse_header(self.headers.getheader ('content-type')) if ctype == 'multipart/form-data': query=cgi....

flatfish: what is your obsession as to where I post from ?
From: Patricia <patty_fitz_del_henry@yahoo.com> Subject: Re: for those of you new to COLA X-No-Archive: Yes NNTP-Posting-Host: 24.190.99.62 flatfish (Gary Stewart) wrote in message msg: <ovaPc.20890$cL2.9690800@news4.srv.hcvlny.cv.net> > Maybe you are not aware Daeron, but it appears your server > is not secured properly. Since when did 'pattie' become an expert on IP protocols ? On Sun, 01 Aug 2004 23:09:34 +0000, Patricia wrote: > On Sun, 01 Aug 2004 17:04:10 -0600, Hamilcar Barca wrote: > >> In article <da46811d.0408011128.5f61480b@posting.goo...

How do I POST a multipart request?
Hello I am writing a script to send a POST request to a webserver. The request consists of the following: POST /someurl/servlets/SomeServlet Host: myname User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3b) Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1 Accept-Encoding: none Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: close Referer: http://someserver/servlets/servlet1 Cookie: USERID=test Content-Type: multipart/form-data; boundary=----...