|
So much for protecting the guilty.
|
|
|
|
|
The exact quote from the site made it very easy to find.
|
|
|
|
|
|
I took a look, briefly, some years ago at that database, and never really got into it, even though they have those odd ads in Dr. Dobb's Journal all the time...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
It says its the fastest database though? I wonder how it compares to say sqlite
|
|
|
|
|
StevenWalsh wrote: I wonder how it compares to say sqlite
I am not sure. I haven't really worked with sqlite and I hear alot of good things about it. I am tempted to put together a Northwind style of a database, build it on a number of different database platforms, test out performance and write up an article here about the results. Hmmmm...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
That would be a very interesting article.
|
|
|
|
|
There are many different approaches to this, and I have to figure which are the most meaningful and what assumptions should be made...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
One of the first assumptions would be that proper order of operations is followed. Be sure to test it though.
|
|
|
|
|
Thanks for the tip. I was thinking along the lines of building a test suite app where the user can choose which database platforms he/she has, run tests on the throughput of SELECT statements fetching various numbers of rows ( i.e., first pass would get first 100, then second pass, first 200, then third pass, the first 400 - doubling each time until a certain point, say 1,600.), do the same for INSERTS, UPDATES, and DELETES. One item of caution would be that more databases they choose from, the longer the test has the potential to take. There could be network considerations to take into place. As you can see, this could end up being a pretty big deal.
Maybe just start of simple, then advance it. I could just go on and on
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Found this gem while trying to remember how to instantiate an array in VB6
2 ways to create an array
Dim theArray() As Variant
theArray() = Array("Spring", "Summer", "Fall", "Winter")
or
dim strArray as string
strArray = split("summer;winter;spring;fall", ";")
I went w/ the first one...
|
|
|
|
|
I can't figure out which one is most atrocious.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
I vote the latter
|
|
|
|
|
Well, given that they are both VB6...
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Andy Brummer wrote: VB6
|
|
|
|
|
I agree that they are both pretty bad. It's the curse of having to dive into some vb6 code on occasion...
|
|
|
|
|
The second lends itself to replacing the values with a file string and thus more flexible
strFileValue = "summer;winter;spring;fall;late fall;early spring;late birthday" 'comes from a configuration file or user settings, or whatever.
dim strArray as string
strArray = split(strFileValues, ";")
|
|
|
|
|
There's a third... Which I just dealt with today in an old Excel VBA macro (Essentially VB6)...
(Hastily-written, VB-style pseudo-code, as it's faster than removing the proprietary stuff)
For x = 1 to 13
Dim line As String
line = GetLine(x, username, code, thing, item, anotherstring, andanother, blah, blah, blah, blah, blah)
(Do something with line...)
Next x
...
Public Function GetLine(x As Long, username As String, etc etc etc etc etc)
Select Case x
Case 0
GetLine = "SomeString="&username
Case 1
GetLine = "Something Else=" & code
Case 2
GetLine = "Another Thing=" & thing
...
Case 13
GetLine = "Some literal string"
End Select
End Function
Yes, it passes all those parameters to the function 13 times. Yes, it only uses one of those parameters each time. Yes, every member of that select statement is a simple concatenation of a literal with a string parameter (If even that). Yes, I replaced the whole system with a C# utility as fast as I could.
|
|
|
|
|
VB6 is dead – I hope.
Too may surprise VB.Net is pretty good.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I'm sure you have all come across something like this. At least I see it way too often. So here it is in C# style:
<br />
bool someBoolValue;<br />
<br />
if (someBoolValue == true)<br />
{<br />
}<br />
else<br />
{<br />
}<br />
modified 19-Nov-18 21:01pm.
|
|
|
|
|
I occasionally find that slipping into my code. Looking back over it a few minutes later reveals my brain fart.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
That, and the classic ternary
(sMethod == "read"? true : false)
What I never understood is why these people stop so soon. The concept is readily extended...
if (doIt) => if (doIt == true) => if ((doIt == true) == true) ...
and combined
bool flag = ((doIt == true) == true? true : false);
if (flag != false) doIt = true;
We could go on all night...
|
|
|
|
|
Personally I don't find that to be horrible. It's completely correct and only slightly more redundant. It really makes no difference in practice.
And no I'm not trying to defend my usage of it I don't lie
|
|
|
|
|
I agree it's not horrible and that it can add to readability but it is still one comparison too many.
It might get more obvious in different situation.
Like (some stupid example):
<br />
<br />
bool IsNumberEven(int number)<br />
{<br />
return ((number % 2 == 0) ? true : false);<br />
}<br />
<br />
int Main()<br />
{<br />
int someNumber = 2^100;<br />
<br />
for (int i = 0; i < 100; i++)<br />
{<br />
while (IsNumberEven(someNumber) == true)<br />
{<br />
someNumber /= 2;<br />
}<br />
}<br />
}<br />
I think it is similar as using String object when one should use StringBuilder. It's OK for small number of iterations or single comparison, but can be time-consuming for large number of iterations.
modified 19-Nov-18 21:01pm.
|
|
|
|
|
I've always assumed that if(aBool) is simply a short-hand for if(aBool == true), and they should be completely equivalent to the compiler. If they are not for some reason, it would be a trivially easy optimization for the compiler to make.
|
|
|
|