If you know neither Python nor Perl, learn Python. The learning curve is shorter, especially if you know OO concepts. Perl's data structures stink, except for simple lists or hashes. If you want a list of hashes or a hash of lists or whatever, it gets ugly fast (think C pointers). Perl does have better variable scoping ("use strict" is a lifesaver) and regular expressions are easier to use as they're part of the language syntax.
If you do use the COM ports via Python (and probably Perl) on Windows, make sure you always close them when your program terminates. Rebooting the PC to get the COM port back gets old really fast.
If you want a list of hashes or a hash of lists or whatever, it gets ugly fast (think C pointers).
Oh, please! Comparing Perl's references to C's pointers is a total red herring. Perl handles references transparently, and you can't get into trouble using them. Moreover, Perl has automatic memory management and built-in garbage collection, whereas C ... well, if you enjoy tracking down memory leaks ...
I don't mean to turn this into a religious war, but let's be fair. Anyway, Python has a large fan-base, for sure. Many Perl advocates would bad-mouth it. I'm not one of them. And, yes, with Perl alwaysuse strict; ! ('Learned this the hard way.)
Phil, I get paid to write in Perl, among other languages. It gets the job done. References work when you get them right. When you don't, they're often difficult to debug. Python also has it's problems, but the amount of arcane stuff you have to remember is much smaller. It's a good thing there's a good interactive debugger.
I need basic graphics, no high end 3D, speed is nice, access to ports, etc.
What is your opinion and why?
I know BASIC, assembly, and C. Should I use Visual Basic? Python? or?
If you know C and have a Windows box... I'd write a console app in C. If you do it right then moving to VS C++ is no brainer you just have to add the graphics. In the end, it's up to you to goof around with different languages and decide what you like. Asking "What's the best programming language and why" in an open forum is a little dangerous and can cause a religious war.
I think Perl is brilliant. One striking thing about that language, and the "more than one way to do stuff", is that even if one knows only a small sub-set of Perl, amazing things can be done. For me, at times, I write a little to do sysadmin type tasks, and occasionally fetch data from one ugly repository, mangle it, then stuff it back into another ugly repository. Perl is kind of awesome for this kind of thing. Nothing else like it.
Re: Religious war.
Well? Maybe. IMHO, it's good to hash this stuff out, because good things come from that, if people can keep the bitings to a minimum. It's interesting to me to watch, and sometimes participate in "war" type threads. Really, really great things often come from one. There is a cost though.
I say do it, but always zip up the flame suit, and see what comes.
Well, I didn't mean just starting one. But, if one happens, sometimes it's a good thing. Zipping up the flame suit really means not worrying over it. If it goes south, just move on, that's all.
I'm sure that is what most of us would do, and I have to admit that a little conflict sometimes makes things fun, however...
What if moving on means moving to an Arduino or some other platform.
I sometimes wish we had one section for the newer people (sometimes "newbies" seems to come across negatively), and another for the battle scarred old fogey's...
Well? Maybe. IMHO, it's good to hash this stuff out, because good things come from that, if people can keep the bitings to a minimum. It's interesting to me to watch, and sometimes participate in "war" type threads. Really, really great things often come from one. There is a cost though.
I feel everyone has a right to my opinion but I've been around long enough to not care too much. There's always some whizzbang thing that comes along. Currently, I'm working with Microsoft's answer to Ruby, ASP MVC and Entity Framework. It's cool, it does a lot... which is good if you understand what it is doing.
this thread I enjoy a lot. I am trying to decide on a path to go on. All I want to do is store values from the propeller and its attached devices/sensors and display in a bar graph. Perhaps this graph will be on a web page. I need a database and a language. With Visual Studio I am pretty sure I can make the DB visually(I think its some Sql Server Express but I dont know).
I think Java has only received cursory mention here and that was to say its getting old ! Python has been said to be easy to pick up. Perl good for data(well I dont have to do much except display it) One reply stated installing Visual Studio drastically increased boot time, this sounds bad, I love how I can shut down and boot up in 30 seconds right now.
So I hope this thread keeps going for awhile yet. Thanks.
BTW, the Scribbler and S2 GUIs are written in Perl/Tk. 'Just thought I'd throw that out, lest Perl get typecast in peoples' minds as a data/text-processing language only.
One reply stated installing Visual Studio drastically increased boot time, this sounds bad, I love how I can shut down and boot up in 30 seconds right now.
Mickal,
I have both Visual Studio 2008 and 2010 on my laptop and did not notice any significant difference in boot time when I installed them. Running on a Dell M6300 with Windows 7 64 bit with 8GB RAM, maybe that matters, maybe not.
I downloaded GCC (GNU) with the Netbeans editor and I couldn't get it (GCC) installed properly. Actually, unless I'm missing something, there IS NO installer I have to set it all up myself. I got frustrated and put it aside for a couple days.
I downloaded MS C Express and installed it. It absolutely blew my mind. I had no idea where it start or what anything meant. Wow it's different from the C I know........ This was 1hr after the botched GCC install and I was still fuming, it was late so I'll give that another shot in a couple days too.
I've been coding a little in Just/Pure Basic..... I like Pure better I think, but they are kinda' cute I guess. It almost replaces the old QBasic I used to use to work out my ideas. So far I have made programs that pass data to OR from the BS2px (It doesn't work for both yet, which is kind of bizarre) and one that made a polar plot of data sent from the BS2px that simulated distance data from the PING. The PING wasn't running, it just simulated what the PING might see.
I made a game in Python, HA! A stupid little game from the Color Computer days called "Catalyst". It's not 100% functional yet, but it works and looks nice. python is a bit strange for me, I dunno why..... it's just not sinking into my brain yet. It was fun though. I made the graphics for the different game pieces in SolidWorks, edited in a image processor and saved as a PNG file. It looks cool
I've not downloaded Perl just yet.
I too seem to have increased boot times since the MS C Express install. I'm not ready to blame Microsoft just yet, but something is surely amiss......
Attached is a demo for a Basic Atom and a SRF04 that I'm planning to use as the target device for some examples as I mentioned earlier in this thread. Hopefully Spiral_72 or someone else with a BS2 and a Ping))) can create a modified version. I'll followup later with a Demo GUI using VB.Net.
@ ctwardell - You might want to consider breaking your example project off into a separate thread. It's the type of subject that gets enough attention here to warrant its' own home.
Thank you Kevin. I'll get that. I see it includes the debugger and editor too which is very nice. I can use notepad I guess, but the color indicated objects are so much easier to read.
I can use notepad I guess, but the color indicated objects are so much easier to read.
If you're looking for freeware text editors that support syntax highlighting, as well as external compilers, look at Notepad++, Programmer's Notepad, ConTEXT, PSPad, SciTE, and Komodo Edit. There's also JEdit if you don't mind using Java.
There are others out there on various platforms, free & $$$, but the above are very good for what they do.
I use UltraEdit for coding Perl, HTML, and other plain text documents; and I love it. It's not free, but it's not terribly expensive, either. Whatever editor you use, if it gives you a choice of screen fonts, I highly recommend Proggy Clean. Also, for programming, I've discovered that modern keyboards are pure Smile. Apple keyboards are the worst -- like typing on a pillow. So I invested in an ancient (ca. 1992), but unused IBM Model M keyboard with the "clicky keys". OMG, what a difference! I'd forgotten how satisfying typing could be. This is as close as you will get to the feel of an IBM Selectric typewriter. 'Highly recommended!
I..........So I invested in an ancient (ca. 1992), but unused IBM Model M keyboard with the "clicky keys". OMG, what a difference! I'd forgotten how satisfying typing could be. This is as close as you will get to the feel of an IBM Selectric typewriter. 'Highly recommended!
-Phil
Man, that's the keyboard I use on my old machine listed above. I love that keyboard. I wish mine had a Windows key though.
Jazzed: Oh man, Basic doesn't have near the speed I'm looking for. Basic to me is a test bed. Eventually I'd like to play with machine vision and navigation..... Basic just doesn't seem to have the resources.
Man, that's the keyboard I use on my old machine listed above. I love that keyboard. I wish mine had a Windows key though.
Yeah, if it had a Windows key, I'd get one for my Mac, too. (It's needed to sub for the Apple key.) I never used the Windows key with Windows, so I don't miss it there. There's a company that's making newer versions of the buckling spring (Model M-style) keyboard under license from Lexmark, who took it over from IBM. Here's a link to their website:
Jazzed: Oh man, Basic doesn't have near the speed I'm looking for. Basic to me is a test bed. Eventually I'd like to play with machine vision and navigation..... Basic just doesn't seem to have the resources.
Didn't realize your need for speed. GNU or other C/C++ is about as close to the iron (ASM) as you can get.
Of course C/C++ comes at the cost of time (and probably money) in learning the language. Once you learn C/C++, you can figure out most languages in the universe (except Forth). Even PERL is C-like though it gives you a much more forgiving rope for the gallows, it of course comes with a cost in having to carry around a 2MB virtual machine (and have execution slowed by it) as well as needing to learn all that string parsing stuff and strange variable notation.
Thing is by the time you've learned all that, your BASIC program (presumably the language you already know) could have been doing lots of great work. Visual Basic is not really so bad and it is a wonderful GUI language for those who don't mind using Windows, but I agree it is slower than C/C++ with all else being equal.
Those IBM Model M keyboards are not cheap, but then if you are going to spend significant time on it, it makes sense. I once had a heavy duty WANG keyboard. Sold it to a Pc SHOP, he was really keen to get it !
I 'heard' swordfish basic was fast as or faster than C. But I think thats only for PIC programming.
Also 'head' VB and C# .net (clr) were very very close to speed of c
Comments
If you do use the COM ports via Python (and probably Perl) on Windows, make sure you always close them when your program terminates. Rebooting the PC to get the COM port back gets old really fast.
Mike
I don't mean to turn this into a religious war, but let's be fair. Anyway, Python has a large fan-base, for sure. Many Perl advocates would bad-mouth it. I'm not one of them. And, yes, with Perl always use strict; ! ('Learned this the hard way.)
-Phil
As if. Pah!
So I took the challenge on post #44 and typed in my preferences rated from 0 to 100 and ....
it tells me that "C is your preferred langauge"
The gods are conspiring against me! Aaargh.
Ah well, back to coding the BCX Basic to C converter...
See <<http://sites.google.com/site/steveyegge2/ancient-languages-perl>>.
Perl is not for everyone. It's not a tidy language, by any means. If you saw my shop, you might infer that to be the reason I like it
-Phil
If you know C and have a Windows box... I'd write a console app in C. If you do it right then moving to VS C++ is no brainer you just have to add the graphics. In the end, it's up to you to goof around with different languages and decide what you like. Asking "What's the best programming language and why" in an open forum is a little dangerous and can cause a religious war.
Re: Religious war.
Well? Maybe. IMHO, it's good to hash this stuff out, because good things come from that, if people can keep the bitings to a minimum. It's interesting to me to watch, and sometimes participate in "war" type threads. Really, really great things often come from one. There is a cost though.
I say do it, but always zip up the flame suit, and see what comes.
-Phil
-Phil
I'm sure that is what most of us would do, and I have to admit that a little conflict sometimes makes things fun, however...
What if moving on means moving to an Arduino or some other platform.
I sometimes wish we had one section for the newer people (sometimes "newbies" seems to come across negatively), and another for the battle scarred old fogey's...
C.W.
Oh, geez, you just said the A-word and started the mother of all flame-wars here...
OH NO!
But...At least I did not mention the chip that shall not be named. :-)
Borrowing from Spiral_72's tagline...
"" puff ".... Smile, there went another one!"
C.W.
@Phil: Hear you on that. Probably a very good call longer term.
I think Java has only received cursory mention here and that was to say its getting old ! Python has been said to be easy to pick up. Perl good for data(well I dont have to do much except display it) One reply stated installing Visual Studio drastically increased boot time, this sounds bad, I love how I can shut down and boot up in 30 seconds right now.
So I hope this thread keeps going for awhile yet. Thanks.
-Phil
Mickal,
I have both Visual Studio 2008 and 2010 on my laptop and did not notice any significant difference in boot time when I installed them. Running on a Dell M6300 with Windows 7 64 bit with 8GB RAM, maybe that matters, maybe not.
C.W.
Higher Order Perl
I downloaded GCC (GNU) with the Netbeans editor and I couldn't get it (GCC) installed properly. Actually, unless I'm missing something, there IS NO installer I have to set it all up myself. I got frustrated and put it aside for a couple days.
I downloaded MS C Express and installed it. It absolutely blew my mind. I had no idea where it start or what anything meant. Wow it's different from the C I know........ This was 1hr after the botched GCC install and I was still fuming, it was late so I'll give that another shot in a couple days too.
I've been coding a little in Just/Pure Basic..... I like Pure better I think, but they are kinda' cute I guess. It almost replaces the old QBasic I used to use to work out my ideas. So far I have made programs that pass data to OR from the BS2px (It doesn't work for both yet, which is kind of bizarre) and one that made a polar plot of data sent from the BS2px that simulated distance data from the PING. The PING wasn't running, it just simulated what the PING might see.
I made a game in Python, HA! A stupid little game from the Color Computer days called "Catalyst". It's not 100% functional yet, but it works and looks nice. python is a bit strange for me, I dunno why..... it's just not sinking into my brain yet. It was fun though. I made the graphics for the different game pieces in SolidWorks, edited in a image processor and saved as a PNG file. It looks cool
I've not downloaded Perl just yet.
I too seem to have increased boot times since the MS C Express install. I'm not ready to blame Microsoft just yet, but something is surely amiss......
The file contains usage info.
SonarDemoV0_1.bas
UPDATE: Upon getting my BS2 OEM I found that my previous code does not convert as easily as assumed, here is a BS2 version:
SonarDemoV0_2.bs2
C.W.
@ ctwardell - You might want to consider breaking your example project off into a separate thread. It's the type of subject that gets enough attention here to warrant its' own home.
Looks like you've had some success with basic.
Maybe you should stick with that?
If you're looking for freeware text editors that support syntax highlighting, as well as external compilers, look at Notepad++, Programmer's Notepad, ConTEXT, PSPad, SciTE, and Komodo Edit. There's also JEdit if you don't mind using Java.
There are others out there on various platforms, free & $$$, but the above are very good for what they do.
-Phil
Man, that's the keyboard I use on my old machine listed above. I love that keyboard. I wish mine had a Windows key though.
Jazzed: Oh man, Basic doesn't have near the speed I'm looking for. Basic to me is a test bed. Eventually I'd like to play with machine vision and navigation..... Basic just doesn't seem to have the resources.
I've never used one, so I can't attest to their quality. It'd be hard to match the original IBM battleship, though. I mean, the thing is heavy!
-Phil
Of course C/C++ comes at the cost of time (and probably money) in learning the language. Once you learn C/C++, you can figure out most languages in the universe (except Forth). Even PERL is C-like though it gives you a much more forgiving rope for the gallows, it of course comes with a cost in having to carry around a 2MB virtual machine (and have execution slowed by it) as well as needing to learn all that string parsing stuff and strange variable notation.
Thing is by the time you've learned all that, your BASIC program (presumably the language you already know) could have been doing lots of great work. Visual Basic is not really so bad and it is a wonderful GUI language for those who don't mind using Windows, but I agree it is slower than C/C++ with all else being equal.
I wish you luck on this quest.
I 'heard' swordfish basic was fast as or faster than C. But I think thats only for PIC programming.
Also 'head' VB and C# .net (clr) were very very close to speed of c
DAMN THESE VOICES