Opinions requested on my blog post about primitive obsession.

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
Daniel
10/28/2007 7:23:37 PM
comp.lang.java.programmer 52316 articles. 0 followers. Post Follow

8 Replies
344 Views

Similar Articles

[PageSpeed] 1
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
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
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
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
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
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
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
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
Roedy
10/29/2007 12:24:39 PM
Reply:
Similar Artilces:

Writing a Java application to send/receive HTTP Requests
Hi, I would like to write a program that can send and receive HTTP requests. Basically the first page received from the server will contain a form and I want the user to be able to enter form data via my app and then send the request off to the server. I know about developing java applications, but have had very little experience with dealing with HTTP requests in Java. Can anyone point me to a good tutorial, example or resource that could give me the basics? Cheers, David Here's Sun's tutorial on working with URLs: http://java.sun.com/docs/books/tutorial/networking/urls/index....

Nantucket Tools 1 (request)
Hi there, Some years ago I've got a harddisk crash and now I have to change a little piece of software in an very very old application (but still working). Compiling is ok but now whe noticed that we are missing one of our libraries: Nantucket Tools 1 (last time succesfull used in 1991). Yes very old stuff, I know! (Clipper Summer '87). Because of the missing lib we are not able to link this application to an executable - and we are not in the mood to bringing this to Clipper 5 of Visual Objects because of the several 3th party libs used (getit, netlib, silverware comm, barcode, funke...

I know I only post when I want an opinion...
But I have found /Aura/ for �15 and, as I am trying to fill the void before the release of /The Sims 2/, is it worth it? JA gave it a B+, but I know their reviewers can be overly critical. I have the demo from a magazine cover DVD and, whilst it's very pretty to look at, the sound (especially the music) could do with being a little beefier, but the puzzles are what concerns me - they appear to be on a par with /Obisidian/ in terms of difficulty and I really couldn't get on with that at all. For example, there is a puzzle in the second room in the 'laboratory' ...

Opinion needed
Someone posted the following. I am thinking of buying a notebook and this seems interesting but slightly beyond what I can pay now. How much will you pay for it? ----------------------------------------------------------------------- Dell Latitude D600, 1.30GHz, Pentium M, 14.1 XGA 128MB 1 Dimm DDR 2100 RAM, 30G HD, Windows XP Home, 24X CDRW, 56K Modem, NIC, Wireless Network (Intel PRO/Wireless 2100 WLAN), Battery Life: 4 hours Dimision: 12.4x10.1x1.2 inch , Weight: 4.6lb (thin and light) Three Year Warranty (End Sep-2004) It's brand new and in sealed box yet. However I got another la...

Site Critique request
HI, I'd appreciate if anyone who has a spare minute or two could have a look at http://www.scottish-logcabin.co.uk and let me have any comments about the layout. Thanks, Simon Simon Hanmer <bf6460$bhcjj$1@ID-74001.news.uni-berlin.de> wrote in comp.infosystems.www.authoring.site-design: > HI, I'd appreciate if anyone who has a spare minute or two could > have a look at http://www.scottish-logcabin.co.uk and let me have > any comments about the layout. Div layout instead of tables, which is good. Good use of the h* elements to denote headers. ...

iOS7 "muddled" design? One critic's opinion.
http://www.washingtonpost.com/blogs/the-switch/wp/2013/09/19/apples-muddled-design-philosophy/ or http://tinyurl.com/kb44whx -- "Political correctness is a doctrine, fostered by a delusional, illogical minority, and rapidly promoted by mainstream media, which holds forth the proposition that it is entirely possible to pick up a piece of shit by the clean end." -Unknown On 2013-09-20 15:53:45 +0000, Alan Browne said: > http://www.washingtonpost.com/blogs/the-switch/wp/2013/09/19/apples-muddled-design-philosophy/ &...

Cola tactic #142
A favorite COLA tactic is to simply move the goal posts and change the subject when proven to be wrong. A recent example of this are the various Novell SuSE layoff threads. Idiot trolls like Linocrap and Billy 'the idiot' Poaster first claimed that Novell was NOT going to layoff any SuSE employees. For example, in the "Other companies in Microsoft's crosshairs" thread the troll known as Poaster wrote - "So just WTF *was* the troll implying, if it wasn't that Novell were laying off *linux* staff? " And now that Novell and several other sources have confir...

Opinions on Sony Clie UX50
Hello there, I know Sony is going out of the PDA business, but I like very much the unique feature set of Clie UX50 (Keyboard, WiFi, Bluetooth) so I am considering changing from my SJ30 (where I have to use an external keyboard) to the UX50 (prices dropped a bit since Sony's announcement). ....Any opinion of any UX50 owner on features, battery life, hardware aging (screen, keyboard)?? Thanks, El_Layo. In article <Xns95312800BC32FIDToken@212.27.42.69>, name <public-email@server.com> wrote: > Hello there, > > I know Sony is going out of the PDA business, > but...

Help Resources -- Forum/Fast Help/Tips N' Tricks/Tutorials/Blogs
Hello, I have a fairly new site that may be of use to you: http://www.wizardsolutionsusa.com There we have all kinds of help resources including a forum. It only takes 90 seconds to sign up at the forum and post your questions or help someone out. We are always looking for new moderators, so if you're interested, then just let me know at the forum. csheppard91@gmail.com said: > Hello, I have a fairly new site that may be of use to you: > http://www.<lamejunk>.com Not again! Fixed that "C++" code yet? -- Richard Heathfield "Usenet is a strange place" ...

About Steve Yegge's 'Opinions considered harmful' post
Excuse me, but where in this post does anything about Ruby arise? Maybe you misjudged the 'opinion' topic. Or maybe we're not on the same page. I thought it to mean opinions about Ruby, the way it works, even the community, and things directly related to it. Your last two posts, though I disagreed with them, were well within this definition. You were even syndicated in a few places with people singing your praises. Deleting them seemed a bit rash to me, but I didn't mind seeing them go seeing as they were a bit accusatory towards the Python community, as you had mentioned...

Re: "sh" command posted without formattin errors.
On Mon, 09 Feb 2004 22:59:05 +0100, Peter Köhlmann wrote: > andy wrote: > >> On Mon, 09 Feb 2004 21:00:13 +0000, The Ghost In The Machine wrote: >> >>> >>> Your entire program is futzed from the get-go because chdir() >>> can only change the current program's directory. While >>> you've tried to work around this by using execl(), it's clear that >>> after some usages of your program one will get a tree of shells >>> that looks like this: >>> >>> sh >>> +sh >>> ++sh...

OT: Keyboard opinions?
Well my old keyboard from 2003 is starting to fail on me with sticky and sometimes unresponsive keys, so I guess I'm in the market for something new. But before I open my wallet (watch out for moths when I do!), I was curious what the general opinion here was of the Saitek Eclipse II and the Logitech G15? In terms of price, I can get the G15 for $10 more than the Eclipse II, but just wanted to know from owners of both what your day-to-day experience has been like. Thanks. Personally I am leaning towards the Eclipse II. I had considered a Microsoft keyboard, but I heard something ...

good sites to post completed shell scripts?
hi, is there any good sites that have alot of traffic out there to post pup a shell!!! its a pretty good address book shell 1, add records 2. edit 3. delete 4. view 5. view selected rows all with a nice gui that works on the most basic linux enrionment. ;-) ronancarty@gmail.com wrote: > hi, is there any good sites that have alot of traffic out there to post > pup a shell!!! > its a pretty good address book shell > > 1, add records > 2. edit > 3. delete > 4. view > 5. view selected rows > > > > all with a nice gui that works on the most basic lin...

GNU Fortran 95: Opinions?
Hi, gfortran (http://gcc.gnu.org/fortran) is the Fortran 95 compiler that will replace g77 in the forthcoming 4.0.0 version of the GNU Compiler Collection, GCC (http://gcc.gnu.org). Since gfortran is still in development, I know many people have not had a chance to use it. Snapshots are available from the GCC web site. While an official release is still several months away, I'm interested in knowing what Fortraners want from gfortran. Note that I have *no* official capacity in terms of gfortran, though I submit patches and do testing. For what it's worth, I'm a Fortran 95 progr...

Re: OT: Presidential views website- Compare your opinions #2
whoop!!! why doesn't that surprise me.... ol' GW came in at 19%. What did surprise me a bit was that Kucinich came in at 100%.... Think I need to follow him a bit more closely (not that his views, or evidently mine either, have a snowball's chance in hell of getting anywhere). * To join/leave the list, search archives, change list settings, * * etc., please visit http://raven.utc.edu/archives/hp3000-l.html * ...

SolidWorks Job Postings and Job Board
Hi, its Neil from www.SolidWorkstips.com to announce a couple of new additions to our site. First of all there is a new tip in the API section for One Button PDF Publishing (http://www.solidworkstips.com/ api_pages/06_one_button_pdf.htm). We are also happy to announce the newest section to http://www.SolidWorksTips.com with a job board and job posting. To bring this new section in we are making posting free with no catch for 30 days. Please check out the newly designed site and if you have an opening in your company please give us a chance to find your next employee. 65,000+ hits come thr...

Re: Opinion Telegrams and Mailgrams
TELECOM Digest Editor wrote in response: > [TELECOM Digest Editor's Note: Does anyone remember when we used to > have _two_ mail deliveries each day as a routine thing, and when > postage cost only a few pennies at that? PAT] Pat, I wouldn't complain too much about the US Postal Service. Take a look at what the mail service is like in your neighbor to the north. Canada Post doesn't deliver on Saturdays. If you buy a home in a new subdivision, you will NEVER get mail delivery to your door. If you build a house on a vacant lot, in between 2 houses that ha...

why does my client(s) request freeze
Hi all Tao users TAO VERSION: 1.2 ACE VERSION: 5.2 HOST MACHINE and OPERATING SYSTEM: Pentium IIII 1.8 Win XP professional sp2 COMPILER NAME AND VERSION VC++ 6 sp5 (server) CBuilder 4 sp2 (client) DOES THE PROBLEM AFFECT: COMPILATION? no LINKING? no EXECUTION? yes [Please indicate whether ACE/TAO, your application, or both are = affected.] application SYNOPSIS: Client frozen when a request by client is suspended by semaphore on server. Subsequent requests are not answered. DESCRIPTION: My client is multi threaded I have one thread(main to requests that are answered ...

in your opinion
Wondering, as a broad comment, do you guys thing c is the best programming language I'm trying to have a vote so I can find out, so if I want to learn it and move towards using it a lot more I will have more consensus / census type info... Thanks, -Robin On Thu, 05 Aug 2010 16:57:46 -0700, Robin wrote: > Wondering, as a broad comment, do you guys thing c is the best > programming language The best for what? On Thu, 5 Aug 2010 16:57:46 -0700 (PDT), Robin <robin1@cnsp.com> wrote: >Wondering, as a broad comment, do you guys thing c is the best >progra...

CGI C++ POST
Hello, I would like to code some easy cgi stuff using c++ POST-method (I know ...) How is it done? How is the html-tag like? How do I have to compile? My HTML try: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>title</title></head> <body> <form method="post" action="open("google.de") "> <pre> name: <input name="name" value="nix"></pre></form> </body> </htm...

Webserver request invalid query
Hi~ Recently I found very weird queries while reviewing error queries. After successful SP(stored procedure), error query follow like this... select * from SP -or- selet * from exec SP SP name is same. I can't resolve this problem. Do you have any good methods? -- Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-general/200602/1 ...

my opinion
The people in this group who post messages simply to say something bad about Commodores, why don't you just get the hell out of this group? Some of us actually own the equipment and know what we're talking about. We like to be able to read the real posts without searching for them. Go away unless you have something useful to say. Gordon Pettey "Gordon Pettey" <petteyg359@swbell.net> wrote in message news:Y7BSb.1810$Ph7.267299044@newssvr11.news.prodigy.com... > The people in this group who post messages simply to say something bad about > Commodores, why don&#...

Great programming blog #2
I found a great discussion forum for programming. It's a place to discuss code and developer tools. It's called Programming Central http://programmingcentral.blogspot.com/ ...

Blog "about python 3"
http://alexgaynor.net/2013/dec/30/about-python-3/ may be of interest to some of you. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence On Mon, 30 Dec 2013 19:41:44 +0000, Mark Lawrence wrote: > http://alexgaynor.net/2013/dec/30/about-python-3/ may be of interest to > some of you. I don't know whether to thank you for the link, or shout at you for sending eyeballs to look at such a pile of steaming bullshit. I'd like to know where Alex gets the idea that the transition of Python 2 t...

REQUEST: REALbasic Professional 5.5 Serial...............................................................TIA
x In article <Xns94C5E6C7EF595CaryGrantParamountco@207.69.154.204>, Cary Grant <Cary_Grant@Paramount.com> wrote: > x Surely a big, rich, dead movie star like Cary Grant can afford to buy the software like everybody else. If $99 is going to break your ass you need to be doing something other than programming. Doing your homework would be a good start. In article <Xns94C5E6C7EF595CaryGrantParamountco@207.69.154.204>, Cary Grant <Cary_Grant@Paramount.com> wrote: > x Loser.... -- -Thomas <http://www.bitjuggler.com/> You can...