[CHP] Programming question...

I’m a little embarrassed to ask this question.

I haven’t programmed in years and years. Off the top of my head, 14 years.

I’ve got a problem that I can’t solve with excel. (I am so embarrassed right now.)

So—What is the easiest way to get started programming on a PC?

C-something (C#?) would be ideal. The last language I used was C++, although I would be comfortable with any reasonable language. (I need basic stuff: arrays, text string manipulation. Bitwise manipulations would be nice. Some way to talk to a USB port would be good, but not a dealbreaker. I don’t need object oriented or anything fancy. Straight C will do.)

I’ve got the Arduino “processing” tool installed. Does that have simulation features where it will run on the computer?

Bonus for free and legal, but I would definitely consider paying.

Thanks!

Matthew
Sharonville

Most languages have arrays, text manipulation and bit operators. If you can provide some more detail on your goals we can probably recommend a good language for your task. Like, what do you want to do with USB?

Craig

First I just need to do some manipulations to generate a lookup table for the Arduino. I won’t have enough memory to generate the table onboard.

Next is the USB where I want to read NMEA ( or proprietary) sentences from a Pharos GPS.

Matthew

Processing is a good fit for communicating with an arduino. The processing IDE was used as the inspiration for the arduino IDE, and there are processing libraries to make talking to an arduino easier.

Beware, despite the similarities, the languages are very different. The arduino sketches based on C, the processing sketches are based on java.

http://glaikit.org/2010/12/20/interfacing-the-pharos-gps-500-to-mac-os-x/

This blog post mentions it’s actually serial coming out to a usb converter. Someone posted a comment about the Perl module GPS::NMEA. The blog author seems to have a bunch of posts about arduino and gps topics so this might be of interest.

http://search.cpan.org/~srezic/perl-GPS-0.17/NMEA.pm

I’m going to rephrase the question and see if it makes more sense:

Say I’m interested in a C#, C, or C++ compiler that is:

Free (but I’ll consider paying for a good one)
Decent
Works on Windows
optional: Has an integrated development environment.

From this list: http://en.wikipedia.org/wiki/List_of_compilers#C.23_compilers , does anyone have a recommendation based on experience?

(Also, I’d consider something other than C (or a derivative) if it offers superior—something.)

Again, thanks! (I’m going on a trip where I might not have a reliable internet connection, so I’m hoping to get it installed and working in the next day or so.)

Matthew

Hi Matthew, I don’t think I’ve met you at the Hive before, but I was wondering about your project. Is it for a product? Personal use?

Just curious!
tif

I don’t program on windows much but when I did I typically used visual studio because that’s often what my employer was using. Or I would use cygwin to compile C with gcc but I’m very comfortable with a unix shell and gcc so that may not be an ideal solution for you.

.Net is easy (imo) and you could probably use Mono for free http://www.mono-project.com/Main_Page

Tiffany,

I’m about 99% sure we have met at the Hive. You were making a laser cutter book with the interesting hinge. I’m not a member yet, but I expect to join probably in September. I’ve got too many around-the-house projects right now. Plus I need a new roof.

It’s a ham radio project. There is a tiny chance (literally 5% or less) that the hardware will become a club-level kit, sold to many people. But I’ll be giving the software away under a copyleft or other open source general public license.

Matthew

Bloodshed-dev

GCC & binutils with MinGW32 target works really well for C/C++.

For C# there isn’t really much in common with C or C++. It is actually a Java derivative named C# (rather than J++) to satisfy some Microsoft branding concerns (and patent/trademark issues).

In all cases, the second, but likely more pertinent issue is library compatibility. You need a runtime that is cross-platform compatible. The GLIB and GLIBMM projects are good examples.

Have you considered Python? It's a powerful language with a great
community, and it should be fairly easy for you if you've done C++.
Plus it's a very useful scripting language to know.

Jim

I second Python. It’s a very concise, expressive language, while one that’s rather easy to get started with; it has a huge collection of built-in libraries for all sorts of things, and it runs on pretty much every platform. It’s also quite easy to extend with C code via ctypes if you need to write some lower-level code - though most widely-used C/C++ libraries already have Python bindings.

However, if you start from a C++ background, you do benefit from un-learning tendencies to accomplish anything large with overly-complex type hierarchies, templating, and tricking the hopeless type system into doing what you need (no, it’s not because C++ is statically-typed, and no, not all object-oriented programming is required to look this way) If you don’t have these tendencies, now is a good time to pick a language that does not encourage them.

If you are just looking for a free C/C++ compiler that’s well-supported and readily available, just go with GCC. Basically all Unix/Linux systems (including Cygwin on Windows) have a version that is either already installed or can be installed in a matter of minutes. There are plenty of IDEs that can target it; I’m partial to Qt Creator, but plenty of folks have had good luck with Code::Blocks.

Ah Code::Blocks…forgot about that. I used that when working with some apps for the Kinect and it is a fully featured interface (although not small but what huge IDE is)

As far as scripting languages go, I like python but prefer Ruby and I know a lot of people at the Hive use perl. All of them can tie into C libraries and have a ton of pre-built libraries to pick from.

I also vouch for python. Sounds like it would be a better fit since the stuff you’re doing may not need the speed that C gives over ease of programming.

Jon