Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Questions about general programming (python/ruby)
#1
Hi people, I have a few questions about general programing here since I'm starting (just as a hobby, I'm not working in this) to learn to code in python/ruby.

First of all... I know you're supposed to learn a language based on what you want to do. So, I want to make programs for mobile platforms (Maemo/Meego and maybe Android). But first I want to learn to program. Many coders talked me into gettin' started with python/ruby since learning in these languages is fun (meaning I won't get too frustrated as in starting with, say, C right away) and (in case of python) it creates good habbits.

I heard a lot of fuss about Ruby on Rails, but the more I read, the more I feel it's main purpose is web developing. And I don't want that. I know Ruby is one thing and Rails is another though.

So basically my questions are:

1) what can I do with ruby/python? are they good enough just for web developing or can I do basically anything with these languages (specially mobile platforms developing)?

2) What is a framework and/or a toolkit? I know TCL is a language too but I always see TCL coupled with Tk (as in Tcl/Tk).. what's the deal? If TCL is the language, what is Tk then?? Is there an example with Python/Ruby like this?

3) Say I'm making a program in Ruby. Where do I code the GUI? In Ruby itself or do I need something else? This particular questions bugs me a lot in every language... if I code in C, how do I get a GUI for what I am coding? For example PCSX2. You code it in C++ I think but how do you code the GUI and, if there are two different programs, how do you merge them? how do you make them interact?

Basically that... I hope you can help me cause I don't seem to get those things straight. I am NOT trying to code an emulator or low-level stuff like that, I don't have the time to get that knowledge as I work on a totally different area. I just want to make small programs for mobile plattforms =)
SAGER NP8690 | i7-620M 2.66Ghz | 6GB RAM | ATI 5870M 1GB GDDR5 | FullHD 1080p 15.6'' | 500GB HDD 7200RPM | WINDOWS 7
Reply

Sponsored links

#2
I am a ruby fan and professional developer, just want to state that first. I am VERY pro ruby. AND Ruby On Rails.

(12-11-2010, 12:18 AM)dotHack Wrote: Hi people, I have a few questions about general programing here since I'm starting (just as a hobby, I'm not working in this) to learn to code in python/ruby.

First of all... I know you're supposed to learn a language based on what you want to do. So, I want to make programs for mobile platforms (Maemo/Meego and maybe Android). But first I want to learn to program. Many coders talked me into gettin' started with python/ruby since learning in these languages is fun (meaning I won't get too frustrated as in starting with, say, C right away) and (in case of python) it creates good habbits.

I heard a lot of fuss about Ruby on Rails, but the more I read, the more I feel it's main purpose is web developing. And I don't want that. I know Ruby is one thing and Rails is another though.

So basically my questions are:

1) what can I do with ruby/python? are they good enough just for web developing or can I do basically anything with these languages (specially mobile platforms developing)?
I speak for ruby here and yes you can do almost anything with ruby and since the language is young it is still expanding. Ruby is a very agile script language. Personally I have not tried it for mobile platforms. However there is something called jruby, which is a ruby interpreter run by java. Which basically means you can create java programs in ruby and run java classes from ruby code. And java is a language used much.

Quote:2) What is a framework and/or a toolkit? I know TCL is a language too but I always see TCL coupled with Tk (as in Tcl/Tk).. what's the deal? If TCL is the language, what is Tk then?? Is there an example with Python/Ruby like this?

Quote:3) Say I'm making a program in Ruby. Where do I code the GUI? In Ruby itself or do I need something else? This particular questions bugs me a lot in every language... if I code in C, how do I get a GUI for what I am coding? For example PCSX2. You code it in C++ I think but how do you code the GUI and, if there are two different programs, how do you merge them? how do you make them interact?
You use gems to install code with which you can create GUI:s. Depending on what kind of GUI or application you do you might have a separate thread (process) that reads the data your code produces and displays it on the screen. Your GUI could also be more integrated in your code so that the screen is only updated when you reach certain places in your code.
I highly suggest you try one of the Ruby On Rails tutorials to get the hang of the Model-View-Controller design pattern. Learning that as a base for your coding will help you create better applications.
If a web GUI isn't the way to go for you, then you can switch it out later after learning the basics.
Personally I see that more and more of the apps we use daily are being put on the web and in "clouds". If you want to learn something that will only get more and more important start with the full rails experience. It will make you learn ruby and also structure your code aswell.
Quote:Basically that... I hope you can help me cause I don't seem to get those things straight. I am NOT trying to code an emulator or low-level stuff like that, I don't have the time to get that knowledge as I work on a totally different area. I just want to make small programs for mobile plattforms =)
You can create web applications for mobiles. Rails can generate simple html that can be read by even older mobiles. But that also depends what type of mobile app you want to do ofcourse.
Reply
#3
Thanks a lot nikethebike!

Now everything's clearer and I'm more confident knowing Ruby can actually tackle almost anything. Whenever I hear about Ruby, I hear about greatness =) and I must say, there's a lot of documentation and a great community which helps a lot!

Since you are a professional developer and very pro ruby too, can you please explain me.. say i write a program in Ruby, does Ruby by itself generates all the GUI too? Or do I need another program or extension or whatever that "reads" my Ruby code and generates a GUI for the end user to interact with?

Say.. on Linux. You interact with the kernel (C code) through your desktop environment or window manager (which can be metacity, Kwin, Enlightment and so on) but if you don't have a window manager, or better said, a window system (like X) you only have a text-based OS. You have the code, you have the program, but you have no GUI. I can make a program in Ruby, but where do I make the GUI?

Please bear in mind that though I use Linux on a daily basis I know nothing about programming and as such I make these noobish questions =P

Again thanks A LOT for your help!
SAGER NP8690 | i7-620M 2.66Ghz | 6GB RAM | ATI 5870M 1GB GDDR5 | FullHD 1080p 15.6'' | 500GB HDD 7200RPM | WINDOWS 7
Reply




Users browsing this thread: 1 Guest(s)