What if we could use <blank>?
-
JJ I know this isn't what you had in mind here but how about some sort of object oriented language with a drag'n drop interface. My young son (then about ten) used to program with 'Alice'. It was object oriented. If Sketchup scripts could be put together like that, then perhaps non-programmers (like me) could get into script creation.
-
Hello Ross,
Yea, Blender has something like this so i know what you mean. Although you will be limited to what you can do in a system like that.From your words it seems you would like to program but have not found a language that entices you. Have you looked at the Python Programming language? Most non-programmers find it very easy to pick up. Python takes a common sense approach to programming.
Actually Python and Ruby are equals in power, but they differ drastically in syntax and readability. Python allows for true procedural AND true OOP programming. Typically a student will find that learning basic programming principals thru a procedural approach is much easier. Then they can ease their way into OOP. OOP is not hard to understand, but taking on both at the same time is quite a daunting task.
I will even personally tutor you. I guarantee i could teach you to program in a very short period of time, and you will love it.(if you really want to)
You may wonder what it takes to be a programmer. I will tell you the secret -- Programming is perpetual problem solving -- The only skill you need is an ability to problem solve and a passion to solve problems.
If you are interested in that tutoring i am not kidding, send me a PM.
Ross's Vote: Alice
-
Are you a fan of python by any chance?
-
How about a thread with ruby programming tutorials for everyone?
-
OK, I'll bite.
C++.
For processing intensive scripts, the speed would be awesome.
Todd
-
@unknownuser said:
OK, I'll bite.
C++.
For processing intensive scripts, the speed would be awesome.
Todd
Now that'd be interesting.
-
I wouldn't be writing SU plugins if it's been C++. I've tried to get my head around it before, but with no great success. But I still think it'd be interesting with C++ plugins with the potential for increased speed.
As for my own preference of script language; I'm not picky. Script languages doesn't seem too hard to pick up once you've learnt one. I had previous experience in JS and PHP scripting. (Some Visual Basic and C# programming as well) Getting into ruby only took a weekend to get me started writing the scripts I wanted. Though I'm still learning new ways the Ruby language works as oppose to what I've used before.
I find the API and documentation of the API much more important. And I feel that the SU API documentation have lots of room for improvement.
-
C++ code - no big thang!!
#include <iostream> int main() { std;;cout << "Hello World!" << std;;endl ; return(0); }
Ruby
def cout ; STDOUT << "Hello World!" ; return ; end cout ;
I don't do Python.
-
I've done it all... I'd just be showing off.
-
@unknownuser said:
C++ code - no big thang!!
I don't do Python.With Python not only is it "no big thang"
There is no "THANG" at all!print 'Hello World'
sorry Todd, but that was a
(big one's really do fall harder!)PS: That Ruby code could have been better
PPS: Do you want to try file I/O next ?? -
I code in several languages, and Python is not one of them. Therefore, I can't be held accountable for knowing the ins and outs of it. I have nothing against Python (sans the comment ), it's just not something I want to invest my time in.
On that same list is learning how to wallpaper and ballroom dance.
-
WOW!, your comments show a deep seeded hatred for Python. Where is this coming from Todd?
-
I'm having difficulty finding any major differences between Python and Ruby. The "Hello World" example you cited can be coded exactly the same in Ruby. There are tutorials and references on Ruby, one of which is Programming Ruby. As one that has done a lot of C, to name one, I don't find that Ruby is a difficult language to learn. I don't think that a non-programming will find much difference between learning Ruby or Python. Python is open source, yada, yada, yada..., well, so is Ruby. You make it sound a lot worse than reality. Ruby is not simply derived from Perl, it has also borrowed from Eiffel, Smalltalk, Lisp, and Ada.
For the most part, I'm with Todd on this... why introduce another programming API into SU? It's not worth the effort. The quality of the SU Ruby API documentation has nothing to do with the choice of Ruby. It has everything to do with taking the time to produce. As in most software projects, documentation is generally the lowest priority on the schedule. That's certainly the case for the SU Ruby API. If Python had been chosen as the SU programming API, then I'd be in favor of keeping it. But, it wasn't. Do you think it would be a good investment of time to create another programming API for SU when one already exists? There would be double the documentation requirements and that doesn't include the added development/support requirements and code bloat. It seems very little value added for such an increased effort.
-
I am gonna have to suggest Lua on this.
The language's ability of being "a powerful, fast, light-weight, embeddable scripting language", is really what it sounds.Lua does functional programing, which is great for non programers if you combine it with the amazingly simple syntax. Also Lua has enough all the sleeves to pull all the cards you'd probably want from a scripting language. You can even do oop... and still be fast!
Many programs have been using it as their scripting language either for adding functionality or simply automating the host program. An easy example is Ecotect.
-
@jessejames said:
WOW!, your comments show a deep seeded hatred for Python. Where is this coming from Todd?
You are going down a dead end road, JJ. I don't know Python. I don't know how to wallpaper. I don't know how to ballroom dance. I don't know you. I hate none of the above. As it stands rights now, of the above, the only one I would care to learn about would be you!
-
I'm not much of a script programmer, my experience is mostly in c++ and c#. My forays into ruby are really my first experience with script languages. Not experiencing other choices, I'd have to pick ruby. I like that you can inherit classes; I don't like that it's a little to loose when it comes to that . I really like how easy it is to extend ruby with c and c++, and the tools available in c to communicate with ruby. I hate ruby's garbage collection (but that's only an issue when extending in c/c++). So good and bad, but having nothing to compare it against, I say it's good enough.
Avariant's pick: Ruby
-
@unknownuser said:
@jessejames said:
WOW!, your comments show a deep seeded hatred for Python. Where is this coming from Todd?
You are going down a dead end road, JJ. I don't know Python. I don't know how to wallpaper. I don't know how to ballroom dance. I don't know you. I hate none of the above. As it stands rights now, of the above, the only one I would care to learn about would be you!
Hello again Todd,
So you want to get to know me eh? A little chit chat? Ask away, these are free and open forums ASAIK -
JJ, some of your comparisons are clearly misleading. I haven't seen one thing that Python does that Ruby doesn't. The grammar may be slightly different, but they do the same thing (including "list comprehension"). Ruby has the identical functionality, but the syntax is different. You're wasting time as far as I'm concerned. This is a "religious" argument and your "religion" is Python. Threads like this will not end in anything but wasted time and hard feelings.
-
@david. said:
... Ruby is not simply derived from Perl, it has also borrowed from Eiffel, Smalltalk, Lisp, and Ada.
And the best things about Ruby are borrowed from Python.
@unknownuser said:
1Q.)For the most part, I'm with Todd on this... why introduce another programming API into SU? It's not worth the effort. The quality of the SU Ruby API documentation has nothing to do with the choice of Ruby. It has everything to do with taking the time to produce. As in most software projects, documentation is generally the lowest priority on the schedule. That's certainly the case for the SU Ruby API. If Python had been chosen as the SU programming API, then I'd be in favor of keeping it. But, it wasn't.
2Q.)Do you think it would be a good investment of time to create another programming API for SU when one already exists? ...These are all good questions and i will give good answers for them.
1A.) Look, an API is for users to wield the full power of an application(or maybe just automate a simple task), not so a few at the top can make money writing scripts because the language is poorly documented and overly complicated.
I have nothing against the professionals who want to write professional plug-in/scripts. But at least give the users of that application the common sense tools they need to get their scripting done, so don't handicap them with a poor language choice (Ruby)
I want to give every SU user the ability to write useful scripts for them selfs. My number one complaint about Ruby is Poor documentation. Ruby has no good free introductory tutorials. But Python has tons and tons of good free tutorials that cover vast amounts of programming tasks. At the following link, there are 300+ Python tutorials listed in more than 50 Categories, and this is just one site!!!
300+ tuts
http://www.awaretek.com/tutorials.htmlHere is a list of nonprogrammer tuts:
http://wiki.python.org/moin/BeginnersGuide/NonProgrammersHere is a list of experienced programmer tuts:
http://wiki.python.org/moin/BeginnersGuide/ProgrammersRuby cannot touch the amount of good docs available for Python.
2A.) Yes, i absoulty think bringing in Python -- even next to Ruby -- would be a great idea. This would give all SU users the power they need. Not only do i think this is a great idea, i am willing to spend my time(free of charge)to make this happen. Even if i have to do it completely alone. That is my commitment! I have no will to make capital gains on the SU users. My goal is to extend their SU experience.
I plan write an introductory tut specifically targeted at SU users with no programming experience for SU Python scripting. Not only that, i plan a much better console for SU. You may say, why do we need a better console, a console is only good for trying out short pieces of code. I say Yes, this is exactly how a n00b learns. They type a command and see the results right away. The single line console in SU is almost useless and could easily be improved. Noobie's have a problem understanding how to format code to fit on one line.
Skethchup.active_model.selection[0].offset(-3)
or this
def f;for x in model.selection; x.this;x.that;end;end
All that does is serve to frustrate and defeat the user before they have a fighting chance. A multi-line console will ease the learning curve.
PYTHON GUI
Also Python has a built-in GUI(Tkinter). Tkinter is a very easy to use GUI toolkit, which contains all the main widgets a GUI needs, built right into the language. How would you like to have that on board for ya scripting pleasure, eh?here is a Tkinter program that contains a button widget
from Tkinter import * root = Tk() def call(); print 'Hello SketchUp' Button(root, text='Press Me', command=call).pack() root.mainloop()
That short piece of code creates a main window with a button that prints 'Hello SketchUp'.
Look, i want to improve this great software for everyone. The more people we have coding, the more ideas and improvements we can bring to SU. Let's empower all SU users!!
-
@david. said:
I'm having difficulty finding any major differences between Python and Ruby. The "Hello World" example you cited can be coded exactly the same in Ruby.
Hello David,
You right, the hello world in Ruby looks exactly like Pythonprint "Hello World"
Python and Ruby share many likeness because Ruby took them from Python, which is OK, i don't mind. But Ruby and Python are very different also -- VERY different.
don't forget to scroll down on the Ruby code
RUBY WAY:
module YourNameSpace class MyClass def method1(arg) if arg == this do this elisf arg == that do that else do that end end end require "scriptname" YourNameSpace;;MyClass.new
PYTHON WAY:
class MyClass; def method1(arg) if arg == this; do this elif arg == that; do that else; do that from scriptname import MyClass instance = MyClass()
First thing you will notice is how clean Python code looks to the eyeballs. No need to declare a module, The script IS the module. Now you have a nice clean namespace and did not even have to worry about it! Also notice Python does not use an ugly and redundant "end" statement.
This is just a very simple syntax comparison, wait until you try regular expressions, or string formatting, or list comprehensions (Oh wait, Ruby can't do that one).
Ruby looks too much like Perl. If you like S&M, well i guess Ruby is your language. If you want to get things done in the easiest and most painless way, Python is your common sense approach to everyday programming! Which makes it the perfect scripting language
Advertisement