• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Need some advice: Should I learn C?

 
Ranch Hand
Posts: 56
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been teaching my self Java for a few months now, because I want to start developing apps for android.
I understands basic things like variables and methods, in addition to Polymorphism, inheritance, exception handling, I/O...


But I also want to build robots, and from what I understood, JVM is just too large for most micro-controllers out there like the Arduino .
I heard that Arduino uses a modified sort of C, which is easier to deal with.

But I feel that this "easy C" will restrain me, and I don't want that. I want to get my hands dirty in some complicated code

Some people say that I can program a raspberry pi in Java.

A few universities in my country offer discounts for extracurricular activities, so may be I can continue with java and get a certificate from oracle to get the discount.
but I'm not sure what to do

What do you think? Should I just learn C?
 
Marshal
Posts: 71002
291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have already discussed robots in a different thread, and I seem to remember that Java┬« could be used. There is nothing wrong with learning C. It is a useful language. But it is very different from Java┬«. C is good for low‑level programming, operating systems, etc. I don't know what sort of C the Arduino uses.
 
Saloon Keeper
Posts: 22779
153
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's true. The Arduino is programmed in a C-like language. Of course, Java itself is rather C-like, although Arduino's language isn't OOP any more than straight C is.

The rumors about the Raspberry Pi are definitely true. The Pi version of Minecraft is a Java app - and a good counter to the unwashed creatures who assert that Java is slow.

C (and C++) is good to know. OS kernel and device driver code is often written in C. But there are plenty of fun things you can do in robotics with just Java.
 
Ranch Hand
Posts: 310
18
MS IE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Learning C is great alone just for the knowledge you will learn about computer programming. C will be also beneficial if you will get interested in programming iOS or OS X. Both of those use Objective-C as their primary programming language.

C is definitely a great selection for robotics. You will have a great choice of microcontrollers to program. I remember when as a kid I built self-made programmer for Atmel ATMega-8 and coded it in C. There was so much fun with it.

If you want to get seriously into robotics, I would recommend to forget about Arduino or Raspberry Pi for now. If you learn electronics and programming of little microcontrollers first, you will gain great fundamental knowledge how those things work. Using those boards like Arduino is kinda like getting into self-driving car in order to learn how to drive a car.
 
Bartender
Posts: 1464
32
Netbeans IDE C++ Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I think C would be good for you to know. I've done a bit of Arduino coding, and that does use a language that is a subset of C. It makes device-control fairly easy, in ways that Java doesn't. When you need to use C to get something done, the Java Native Interface (JNI) lets you call C routines from Java. It's a bit hard to learn, but not impossible.

If you don't want to learn both at the same time (and I suggest you shouldn't try), start with Java. It makes it (nearly?) impossible to commit some of the mistakes that baffle early C programmers, like trying to read or write outside the boundaries of an array. Those types of errors can lead to run-time behavior that beginners often find inscrutable, like crashes that occur when function returns, because an improper access corrupted the call stack and your "return" jumps you to some random location.

Good luck!
 
Andrew Polansky
Ranch Hand
Posts: 310
18
MS IE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can say no more as https://www.youtube.com/watch?v=1S1fISh-pag

Forgive me for this non-constructive post, but I had to do this
 
Stevens Miller
Bartender
Posts: 1464
32
Netbeans IDE C++ Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"T. P. Seven?"
 
Andrew Polansky
Ranch Hand
Posts: 310
18
MS IE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stevens Miller wrote:"T. P. Seven?"



Turbo Pascal 7, I guess
 
Stevens Miller
Bartender
Posts: 1464
32
Netbeans IDE C++ Java Windows
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Adam Scheller wrote:

Stevens Miller wrote:"T. P. Seven?"



Turbo Pascal 7, I guess


Ah. Thanks.

Well, I do like C, but, never forget: A dedicated programmer can write FORTRAN code in any language.
 
Greenhorn
Posts: 12
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They say a good programmer knows many languages, but knowing C and Java are a good combination as one is procedural whilst the other is object-orientated. They also make excellent preparation for learning C++.

Where Java is a "work horse" language, C is a more fundamental language for systems programming, and small programs. Instead of choosing between the two, use C as a break from your Java work and take pride in learning how to create programs using a simple text editor and assist your compiling with a make file. A quick session of 20 minutes will do wonders, so long as you don't rush it...

Good luck!
 
reply
    Bookmark Topic Watch Topic
  • New Topic