Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

May 2002 - Letters


May02: Letters

Dear DDJ,

Reading one of the posts by Verity Stob on the goofy VB gotchas, I noticed that one of my pet peeves wasn't there. When you declare a static array with the Dim statement, the array value used within the parens is the upper boundary of the array not its size. If you Dim Array(10) and the base is 0 then you have an array with 11 elements (0-10). Quite annoying if you forget this and then build a loop using UBOUND and only have values up to Array(9). Even more irritating is when you have to pass array variables around and make a call into someone else's object that uses base 1. This gets so unpredictable I won't even try to describe it, suffice to say that debugging this is another way of experiencing "special hell." I say that if we have to live with Basic as an easy way to build UIs, then maybe we should make an open-source B++. Make it use the common-sense rules of C++, but lighten up on the syntax requirements. VB is so flexible it's like using a rubber crescent wrench when a steel one is needed. Ah, now I feel a little better.

Dan Pendergrass

[email protected]

Visual Basic and VB.NET

Dear DDJ,

I was surprised to see an article on Visual Basic (Lauren Hightower's "Examining VB.NET," DDJ, March 2002) because I have always thought that most DDJ readers use low-level languages such as C and Java. On the other hand, maybe it's not so surprising if you believe the pundits who think that Microsoft wants VB programmers to switch to C#. More than a few VB programmers are not happy about this. While they realize that there's a need for a product that makes it "easy to develop web-based and client/server applications in a distributed, disconnected world," their clients still want standalone applications that are affordable. (Isn't that why PCs became so popular in the first place?) Such applications won't be affordable if developers have to master a low-level language before they can build them. So they'll probably stick with VB6 as long as they can, not realizing that Microsoft already has a tool with a forms builder and a high-level language that are very similar to VB6 (but richer), which continues to be enhanced while maintaining backward compatibility. You can check it out at http://www.VBtoFOX.com/.

Jim Williams

[email protected]

Security Inside and Out

Dear DDJ,

In his March 2002 DDJ "Letter," David Wincelberg proposes a client-server scheme to allow PCs to protect secrets against the PCs' owners: "a music or book player could be designed to...make a micropayment and receive a code" over the Internet "to allow using the player for a period of time."

But regardless of how data or keys are obtained by a PC, if some content is to be displayed by the computer, it must be represented inside the computer somehow. Then reverse-engineering the player can allow its rules to be altered (sometimes by changing a single test at an appropriate point in the player's logic) or the location of decrypted data in RAM to be obtained. (For a quick-and-dirty approach, just read each memory location sequentially and apply statistical tests to identify English text or PCM audio data stored in cleartext in temporary buffers.)

Failing that, an operating system modification will allow digital data to be recorded as it's on its way to some output. vsound for Linux and TotalRecorder for Windows can intercept audio data on its way into an operating system's sound drivers and save it to a file for later use. No software scheme can reliably detect whether an operating system is diverting data streams this way, and "tamper-proof" software is a chimera.

Seth Schoen
[email protected]

The D Language

Dear DDJ,

I would like to make some points on Walter Bright's article "The D Programming Language" (DDJ, February 2002), which I have certainly enjoyed. First of all, Walter's definition of postconditions as "contracts that verify the output of a function" is not correct. Postconditions must hold at function exit, of course, but they do not necessarily apply to the function's output; rather, they usually refer to the object's state.

Also, regarding "Putting together DBC," I don't think that implementation code and contract code are orthogonal. Usually, both of them are built from the same system requirements (and even design models), so the correctness and robustness of these requirements would affect both implementation code and contract code. There may not be causality between implementation code and contract code, but there is definitely correlation.

Finally, just a reflection and a question. The D language described by Walter includes a number of outstanding improvements over C++ and other languages. In what ways is the Microsoft .NET framework and, specifically, the C# language, convergent with D?

Cesar A. Gonzalez Perez

[email protected]

Heat Pumps

Dear DDJ,

In his March 2002 DDJ "Editorial," Jonathan Erickson says that "...heat pumps, are still around, but never made it into the mainstream..." Where I live, in Northern Virginia, heat pumps are most definitely mainstream. About half of the homes, and nearly all new apartments, are heated by heat pumps. As you go further south, they become even more popular.

A heat pump is a pretty cool invention. It works on the same principle as an air conditioner. Coils charged with refrigerant are pumped through a compressor, and possibly also through a condenser. An air conditioner pumps compressed refrigerant through outside coils and uncompresses the refrigerant inside the house — thus moving heat from inside to outside. A heat pump pumps compressed refrigerant through inside coils and uncompresses the refrigerant outside the house — moving heat from outside to inside.

Heat pumps are very efficient when the weather isn't too cold. They work great to bring the temperature up from, say, 50 degrees to 70 degrees. Under these circumstances, they cost substantially less than gas or oil. They lose a lot of efficiency, however, when the weather gets really cold — they do a lousy job of bringing the temperature up from 30, or 10, or -10 degrees. But as you go further south, such days become few and far between, making the heat pump more and more attractive.

Where I am in NoVA, we get enough cold days that I think heat pumps are a bad idea. (Typical electric bill for a single-bedroom apartment would be around $120 during cold months.) But they're popular because they're easy for builders to install, and because the local electric companies give subsidies to people who install them. To avoid insane electric bills, most heat pumps here are installed with an auxiliary heat source, like natural gas, to take over in really cold weather — which is close to the best of both worlds.

David Charlap

[email protected]

DDJ


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.