Canonical has used both SQLAlchemy and SQLObject on large projects. Storm was written because neither of those did what we needed. There's a little bit of discussion here: http://programming.reddit.com/info/24oo3/comments.
I searched, but no-one else seems to have suggested this. Use a wiki. I recommend MoinMoin.
It is usable by non-technical users (a *lot* simpler than MS Word, certainly), and keeps a complete revision history, and can show diffs. Can be installed on NT with IIS5 with full functionality.
The down side is converting existing documentation to use it, although most solutions to your problem will involve that to some degree.
If a firewall doesn't understand a packet, and wants to protect a server behind it, it should drop the packet.
Or the firewall manufacturer could be forward-thinking, realise that someday someone might have a useful reason to set that bit, and reject the packet, probably by sending a RSET with ECN unset. That way the experimental host can be notified of the problem, and can try again without ECN if it chooses.
I have no disagreement with firewalls being paranoid. I do disagree with firewalls dropping these packets silently. Especially seeing as upgrades fixing the problem have been available since mid-2000, according to here.
In fact, there's a very strong argument to be made that linux is being non-standards compliant
Actually, ECN is designed to be backwards compatible - if a host doesn't understand ECN, it should respond with a packet with the ECN bit turned off, and the ECN-aware originating host will behave accordingly.
The problem is routers that drop these packets silently. They should either let them through, or if paranoid, reject them, sending a RST back to the original host, which can then retry without ECN. Dropping silently just makes the connection attempt "hang", until it times out.
Further, it is *not* enabled by default, can be toggled at runtime via/proc/sys/net/ipv4/tcp_ecn and comes with warnings in the appropriate build option. I'd say that's perfectly responsible way to introduce a new feature.
I knew it was something like that, but I kept thinking along the lines of a function like IsEmpty(), IsNull() and IsMissing(), but of course, Nothing being an object (or lack of, anyway) is treated slightly differently. And of course searching the MSDN for "IsNothing" didn't help...
As has been mentioned somewhere else in this discussion, there are just too many kinds of null (or whatever you want to call it) in VB. Especially as it treating an "empty" variant as an integer makes it magically seem to be 0, but treating it like a string makes it magically seem to be "".
Don't you know the fastest way to concat big strings in VB* is to write to a file and then slurp it back in?
No, the fastest way is to use a COM component written in C that does it for you:)... we found that a speedup of 200 times was trivial to achieve (talking approx. 1.5Mb files here).
And I shudder to think of a webserver serving 100s of users at once having VB component spew files everywhere and read them back in... ugh!
I happen to like the indentation of Python. I find it's only rarely inconvenient. Much less than people tend to think.
Any decent editor can cope with indenting and outdenting large blocks of code easily, which pretty much makes the "correct number of tabs" thing a non-issue. Or by "tty mode" did you mean pasting directly into the interpreter? What an odd thing to be doing with large sections of code.
-Spiv.
Re:This is what gives VB a bad name...
on
KBasic
·
· Score: 2
No problem. Have you thought of checking to see if the array is empty? Or raising an error in the function (seems like 0 elements would be an error condition in most cases). Or maybe using error handling...
I don't think 0 items is always necessarily an error condition - there are times when it's perfectly valid to have nothing in a list or whatever
And just how do you intend to check if the array is empty, hmm? Seriously. Show me the code you have in mind. Here is the function prototype:
Function Foo() As Variant()
Show me both how to return an empty array, and also how to test for it.
After doing that, tell me how long it took you to figure out. I'd be interested to know.
[Regarding string concatenation] The solution is to create a fixed length string of desired size and then replace the contents of the string with your data.
Yes, but that's tricky to do cleanly when you don't know the size of your string until you've created it... and the point is it shouldn't be difficult in the first place in such a high-level language!
And as for your opinion me as a coder, without having seen any of my code... I much don't care. It is certainly possible to write poor code in any language, but I'd like to think that I write reasonably good code, and my friends and co-workers (who have seen my code) generally agree (at least do to my face...:-).
I have put a reasonable effort into learning VB, and how to use it most effectively. And if the flaws I've cited above were the only flaws, then it'd probably be okay, but I find the whole language has problems. Those are just a sample of the things which bug me.
But, I was pretty sure Basic was Microsoft's property
Visual Basic is Microsoft's - I'm sure they have a Trade Mark on that name. BASIC, though, is older than Microsoft (Microsoft's very first product was a version of BASIC). They didn't invent it.
-Spiv.
Re:A source code converter would be better.
on
KBasic
·
· Score: 2
Possibly what is really needed here is converter to take source code from a VB program and turn it into source code in a sensible language.
A difficult task, at least if you wish to make it platform independent at the same time. A lot of VB's "power" comes from it's ability to use COM stuff, which makes stuff like
Set xl = CreateObject("Excel.Application")
xl.visible = 1
possible (This pops up an Excel window, in case you couldn't guess).
But if you were prepared to shift languages but keep with win32 for simplicity's sake... I don't see any real barriers to mechanically converting VB to, say, Python. In fact, it should be dead easy - Python has all the features of VB, including COM support, plus ALOT more.
The trick would be converting it to efficient code, i.e. noticing certain idioms and converting them to Python equivalents - it'd make no sense to use the Scripting.Dictionary object in Python, for instance. The only feature of VB that I can't immediately think of a Python equivalent for is it's "With" statement... which would hardly be hard to cope with.
In fact, I'm half tempted... hmm... I just need to get some free time... [grumble grumble] Maybe someday. Or has someone already started doing this?
-Spiv.
Re:Geeks who cut their teeth on it malign it?
on
KBasic
·
· Score: 2
I learned programming by hacking apart games and utilities that were written in BASIC. [...] Now I'd argue that PERL would be the better choice.
Bletch!
Perl has it's uses, but to learn programming with? If you want to teach bad habits, maybe...
Don't get me wrong, Perl is really handy sometimes, but I would strongly advise against teaching people to program with it. It encourages shortcuts that make things "easy" - which is fine if you know what you're doing. A Perl hacker knows what sort of magic is going on behind the scenes. A newbie programmer doesn't.
-Spiv.
Re:What is wrong with this?
on
KBasic
·
· Score: 2
If KBasic has anything close to as easy to use and powerful of an IDE as VB does
I would think the code for a simple calculator would look very similar in BASIC and Python. And after writing it, you could save it in a module so you could go "import mycalc" later:)
And I so miss the feature that allowed you to collapse an entire function into a single line in the editor...
Allow me to introduce you to... fte! (the Folding Text Editor). It has some other nice features too...
-Spiv.
Re:Not really true these days...
on
KBasic
·
· Score: 2
Well, it's an order of magnitude better than VB...
I've got a few specific things I don't like about Java. It borrows heavily from C syntax, yet somehow loses alot of the terseness - which seems like the worst of both worlds. It's doesn't have templates, which severely limits it as well, IMHO.
But mainly, I just don't like the *feel* of the language. I don't enjoy programming in it, so I don't use it. It's certainly a personal thing. I do like that it has a large standard library (although some parts aren't particularly pretty). And it has other things going for it (like JPython:-), but overall, it's not my thing.
Yes, it had a Palette command that was incredibly slow... you were much better off using:
outp &h3c8, r
outp &h3c8, g
outp &h3c8, b
outp &h3c9, index
(I think... it's been a while)
Incidentally, QBasic did have a logical and, but I didn't use it in that program... you're probably confusing the notation for hex with that. The and operator was simply "And", IIRC.
Thanks for the comments on Python! I'm sitting here, Python book by my side, currently trying to learn it. Was getting disheartened but reading posts like yours fill me with confidence again.
Glad to hear it!
I personally learnt Python from Programming Python, from ORA, which is a fairly good book, but I soon learnt that the Online Documentation was invaluable. Especially the Library Reference.
For those who are interested, I have a small python cgi here . Just to pretend this is on-topic... "I'd hate to write even that in VB".:)
don't mean to start any wars, but WHY in the name of all that's holy was this story posted on Slashdot?
Isn't it obvious?
Language wars, of course! Just look at all the flamin^Wdiscussion it's generating!
-Spiv.
Re:Not really true these days...
on
KBasic
·
· Score: 2
Visual BASIC today competes successfully against Java and has 2-3 times as many developers using it in complex projects well over 20 lines of code.
Yes, and I don't much like Java either.:-P
Certainly, having user-defined functions and ditching line-numbers have improved the language immensely. It's still crap though. I've personally written thousands of lines of VB. And for most it, it felt like I was wrestling against the limitations of it to try make it do something useful. It certainly has taken on aspects of other languages. The result is an ugly, cumbersome language with very big limitations.
Doesn't Tahoe already do this?
Canonical has used both SQLAlchemy and SQLObject on large projects. Storm was written because neither of those did what we needed. There's a little bit of discussion here: http://programming.reddit.com/info/24oo3/comments.
How about an RSS feed?
I think you want CVSToys.
I searched, but no-one else seems to have suggested this. Use a wiki. I recommend MoinMoin.
It is usable by non-technical users (a *lot* simpler than MS Word, certainly), and keeps a complete revision history, and can show diffs. Can be installed on NT with IIS5 with full functionality.
The down side is converting existing documentation to use it, although most solutions to your problem will involve that to some degree.
-Spiv.
Or the firewall manufacturer could be forward-thinking, realise that someday someone might have a useful reason to set that bit, and reject the packet, probably by sending a RSET with ECN unset. That way the experimental host can be notified of the problem, and can try again without ECN if it chooses.
I have no disagreement with firewalls being paranoid. I do disagree with firewalls dropping these packets silently. Especially seeing as upgrades fixing the problem have been available since mid-2000, according to here.
-Spiv.
Actually, ECN is designed to be backwards compatible - if a host doesn't understand ECN, it should respond with a packet with the ECN bit turned off, and the ECN-aware originating host will behave accordingly.
The problem is routers that drop these packets silently. They should either let them through, or if paranoid, reject them, sending a RST back to the original host, which can then retry without ECN. Dropping silently just makes the connection attempt "hang", until it times out.
Further, it is *not* enabled by default, can be toggled at runtime via /proc/sys/net/ipv4/tcp_ecn and comes with warnings in the appropriate build option. I'd say that's perfectly responsible way to introduce a new feature.
-Spiv.
Ah, yes, of course, thank you!
I knew it was something like that, but I kept thinking along the lines of a function like IsEmpty(), IsNull() and IsMissing(), but of course, Nothing being an object (or lack of, anyway) is treated slightly differently. And of course searching the MSDN for "IsNothing" didn't help...
As has been mentioned somewhere else in this discussion, there are just too many kinds of null (or whatever you want to call it) in VB. Especially as it treating an "empty" variant as an integer makes it magically seem to be 0, but treating it like a string makes it magically seem to be "".
Thanks again.
-Spiv.
No, the fastest way is to use a COM component written in C that does it for you :)... we found that a speedup of 200 times was trivial to achieve (talking approx. 1.5Mb files here).
And I shudder to think of a webserver serving 100s of users at once having VB component spew files everywhere and read them back in... ugh!
-Spiv.
Are you sure?
I could've *sworn* I saw the copyright to another company in QuickBasic. I'll admit I didn't check, just relying upon memory, so I could be wrong.
Oh well. It happens. Apologies for the mis-information.
-Spiv.
I happen to like the indentation of Python. I find it's only rarely inconvenient. Much less than people tend to think.
Any decent editor can cope with indenting and outdenting large blocks of code easily, which pretty much makes the "correct number of tabs" thing a non-issue. Or by "tty mode" did you mean pasting directly into the interpreter? What an odd thing to be doing with large sections of code.
-Spiv.
I don't think 0 items is always necessarily an error condition - there are times when it's perfectly valid to have nothing in a list or whatever
And just how do you intend to check if the array is empty, hmm? Seriously. Show me the code you have in mind. Here is the function prototype:
Function Foo() As Variant()
Show me both how to return an empty array, and also how to test for it.
After doing that, tell me how long it took you to figure out. I'd be interested to know.
Yes, but that's tricky to do cleanly when you don't know the size of your string until you've created it... and the point is it shouldn't be difficult in the first place in such a high-level language!
And as for your opinion me as a coder, without having seen any of my code... I much don't care. It is certainly possible to write poor code in any language, but I'd like to think that I write reasonably good code, and my friends and co-workers (who have seen my code) generally agree (at least do to my face... :-).
I have put a reasonable effort into learning VB, and how to use it most effectively. And if the flaws I've cited above were the only flaws, then it'd probably be okay, but I find the whole language has problems. Those are just a sample of the things which bug me.
-Spiv.
Not quite. Microsoft didn't create QuickBasic (or it's trimmed down cousin, QBasic). They bought it from another company.
-Spiv.
Visual Basic is Microsoft's - I'm sure they have a Trade Mark on that name. BASIC, though, is older than Microsoft (Microsoft's very first product was a version of BASIC). They didn't invent it.
-Spiv.
A difficult task, at least if you wish to make it platform independent at the same time. A lot of VB's "power" comes from it's ability to use COM stuff, which makes stuff like
Set xl = CreateObject("Excel.Application")
xl.visible = 1
possible (This pops up an Excel window, in case you couldn't guess).
But if you were prepared to shift languages but keep with win32 for simplicity's sake... I don't see any real barriers to mechanically converting VB to, say, Python. In fact, it should be dead easy - Python has all the features of VB, including COM support, plus ALOT more.
The trick would be converting it to efficient code, i.e. noticing certain idioms and converting them to Python equivalents - it'd make no sense to use the Scripting.Dictionary object in Python, for instance. The only feature of VB that I can't immediately think of a Python equivalent for is it's "With" statement... which would hardly be hard to cope with.
In fact, I'm half tempted... hmm... I just need to get some free time... [grumble grumble] Maybe someday. Or has someone already started doing this?
-Spiv.
Bletch!
Perl has it's uses, but to learn programming with? If you want to teach bad habits, maybe...
Don't get me wrong, Perl is really handy sometimes, but I would strongly advise against teaching people to program with it. It encourages shortcuts that make things "easy" - which is fine if you know what you're doing. A Perl hacker knows what sort of magic is going on behind the scenes. A newbie programmer doesn't.
-Spiv.
Are you using the same VB that I'm using?
-Spiv.
Python is almost as bad as C?
I'd say Python is much more like BASIC than C - it has a very friendly syntax - and even an interactive mode!
>>> print "Hello World!"
Hello World!
>>> 6 * 9
54
I would think the code for a simple calculator would look very similar in BASIC and Python. And after writing it, you could save it in a module so you could go "import mycalc" later :)
-Spiv.
Allow me to introduce you to... fte! (the Folding Text Editor). It has some other nice features too...
-Spiv.
Well, it's an order of magnitude better than VB...
I've got a few specific things I don't like about Java. It borrows heavily from C syntax, yet somehow loses alot of the terseness - which seems like the worst of both worlds. It's doesn't have templates, which severely limits it as well, IMHO.
But mainly, I just don't like the *feel* of the language. I don't enjoy programming in it, so I don't use it. It's certainly a personal thing. I do like that it has a large standard library (although some parts aren't particularly pretty). And it has other things going for it (like JPython :-), but overall, it's not my thing.
Flame away :)
-Spiv.
Just to clarify, by parent I mean the message with cid=21. Apologies for the ambiguity.
-Spiv.
Yes, it had a Palette command that was incredibly slow... you were much better off using:
outp &h3c8, r
outp &h3c8, g
outp &h3c8, b
outp &h3c9, index
(I think... it's been a while)
Incidentally, QBasic did have a logical and, but I didn't use it in that program... you're probably confusing the notation for hex with that. The and operator was simply "And", IIRC.
-Spiv.
3 types of NULL? Hmm..
I can think of four: "Nothing", "Null", "Empty" and "Missing". Oh, and if you declare a variant array like this:
Dim fred() as Variant
but never ReDim it, then IsArray(fred) will be True, but both UBound and LBound choke on it. That sorta counts in a bizarre sort of way.
Btw, does anyone know a better way to detect if something is set to "Nothing" other than if typename(foo) = "Nothing" then ..., or catching errors?
-Spiv.
Glad to hear it!
I personally learnt Python from Programming Python, from ORA, which is a fairly good book, but I soon learnt that the Online Documentation was invaluable. Especially the Library Reference.
For those who are interested, I have a small python cgi here . Just to pretend this is on-topic... "I'd hate to write even that in VB". :)
-Spiv.
Isn't it obvious?
Language wars, of course! Just look at all the flamin^Wdiscussion it's generating!
-Spiv.
Yes, and I don't much like Java either. :-P
Certainly, having user-defined functions and ditching line-numbers have improved the language immensely. It's still crap though. I've personally written thousands of lines of VB. And for most it, it felt like I was wrestling against the limitations of it to try make it do something useful. It certainly has taken on aspects of other languages. The result is an ugly, cumbersome language with very big limitations.
-Spiv.