Ruby's global nightmare!
-
Hello Fredo,
Thanks for your level headed response also, but i am going to argue some points you made because they are flawed.
@unknownuser said:
Your point on Python is mostly for occasional programmers.
Wait a minute, are you suggesting that Python is some sort of lego language to only be used by debutantes and adolescents? No Python is much much more, ask You Tube devs, ask NASA, ask Industrial Light and Magic(remember a little trilogy called Star Wars?), oh and don't forget Google, who uses Python extensively!!! Heck don't take my word check this out..
http://www.python.org/about/quotes/@unknownuser said:
For guys who engage in programming beyond a few hundreds lines or more and share them to a community of users, they have to understand the language they use and make sure that their script can live with others'.
Yes and that script living with others is why Python is the better choice! Name clashing is a big deal in this community just ask around
@unknownuser said:
In Ruby, the encapsulation is done via Modules.
In Python the encapsulation is done via modules, except the redundant syntax is removed!
@unknownuser said:
In C or Python (which is actually a derivation of C / C++), the file defines a module implictely. It's a matter of language convention. There is nothing complex there if you invest in understanding the programming language. I personally prefer Modules because you can freely split the code in many files.
You can freely split the python code in many modules it's called a package!
@unknownuser said:
Now, I will fully agree with Jim and TBD. Arguing on the right language for SU is little bit of wasted time. SU comes with a Ruby API, so let's use Ruby.
Sure lets use Ruby but if a better alternative exists lets explore the possibilities or lets crusade for changes in the Ruby language.
-
My dear jessejames, I don't really understand your attitude about RUBY... I'm not a programmer and all my last attempts to learn a programming language failed ... Until I became interested in making my work easier. I started learning SketchUp and then RUBY to make SketchUp a more usefull tool for me. And surprise: I've been able to write my own "Hello world" and short time after I wrote some simple plugs for my work (I'm a furniture designer).
What I want to say with this? Well... just that RUBY is not so bad as you say if a non-talent in programming as me was able to fully understand it and enjoy ruby-ing. It fits for me and it fits for others... -
@jessejames said:
Ah my fellow Python "brother in arms" Martin, who agrees with me, but only half way... I'm royally screwed!
But there may be someone at Google that might agree with you.
http://www.python.org/~guido/ -
Jesse, its not ok to be a brat.
Chris
-
@chris fullmer said:
Jesse, its not ok to be a brat.
Ah my old friend and sometimes nemesis Chris Fullmer, the only fellow SketchUpper i love to hate
-
@jessejames said:
Are you hinting that you would like to use another language besides Ruby but have no other choices at this time?
I will use any language that does a job better and quicker (including learning it).
@jessejames said:
Or maybe you just took my comments as personal attacks?
nah.
@jessejames said:
I would like for you TBD (or anyone) to argue my points and defend the Ruby language if anything i said is untrue.
I have better things to do that arguing on Ruby vs Python. yes, you said true things. now get over it and do something productive, like :
- tutorial on how to install SuPy with
- examples of Python scripts for Sketchup (more than creating a box),
- expand Ruby with Python features,
- or anything else that the community will benefit. not empty talks.
@jessejames said:
Discussion is a good thing, even the occasional argument.After all this is a discussion group is it not?
flame war is also a discussion, but is not a good thing
-
jj, you're the one that's brainwashed...
-
you're also truly an obsessive personality...
-
and, getting to be a real troll.
-
Get Over It...
-
Nah. These boys are doing fine on their own. Besides, argueing over Ruby!?
Nerds!
-
To all,
I don't know why I looked at this thread, but the basic premise that began it is the idea that an OS object (a file) should have an effect on namespaces in a coding environment. That, at a minimum, is a matter of personal preference.
I could argue that the idea is very foolish, as I want my code to define the namespace, not it's placement in a file, or the file's name.
If we're going to argue about X language vs Y language, might as well address serious topics, not fluff, and somewhere other than a forum about using Ruby in SketchUp.
Greg
-
@msp_greg said:
To all,
I don't know why I looked at this thread, but the basic premise that began it is the idea that an OS object (a file) should have an effect on namespaces in a coding environment. That, at a minimum, is a matter of personal preference.
I could argue that the idea is very foolish, as I want my code to define the namespace, not it's placement in a file, or the file's name.
If we're going to argue about X language vs Y language, might as well address serious topics, not fluff, and somewhere other than a forum about using Ruby in SketchUp.
Greg
Agree 100%! Not sure why JJ keeps pushing this other than OCD.
-
@msp_greg said:
I could argue that the idea is very foolish, as I want my code to define the namespace, not it's placement in a file, or the file's name.
What is a file? What is a script? They are both simply containers for data, right? (Am i moving to quickly for ya? i'll try to use layman's terms). So when you write a script in Ruby or Python you put some text into a file. This is the same for Ruby and Python and Perl and C and whatever language floats your boat.
HOWEVER, the beauty of Python's module and import mechanisms are the fact that you don't need to contain the code that is already contained in the script with more syntax! Ruby forces you to put one container into another container --this is the very definition of redundancy and defines the lunacy of the Ruby language.
Same goes for the end statement which is completely useless. With indention there is no need to mark the end of a block anymore. It's what we Python coders refer to as elegance. You will fund much elegance in the Python language, but only a very little in Ruby.
So in Ruby you will first need to create a file (or OS object as MSP_Greg has informed us) THEN you must encapsulate the code therein within a module between the tags "Module<name>" and "end" Python removes this completely unnecessary step(and many other redundancies i might add).
-
You could argue that python forces you to create an excessive number of files to contain your creations, though.
And who says i want to indent my code? i like to be able to lay out my code as i like.
More broadly, you can argue a lot about whats best, but as has been said we've got ruby and it isn't a bad language for SU scripting.
-
If we complain about Ruby, what AutoCAD users say about Lisp?
-
jessejames,
@jessejames said:
Am i moving to quickly for ya?
Having written code in Python, Ruby, C#, Java, JavaScript, various dialects of Basic, and C++, probably not. Also, having a CompSci prof in the late '70's always wax on about the elegance of Pascal conditioned me to the large distinction between 'elegant' when finished, vs easy to reach 'finished.'
The Python features youβre referring to would be considered simple syntax conventions by most programmers, and, hence, trivial. I'll respond anyway.
-
Namespaces β Lets say I'm working on a real project, and production code will be a minimal set of files. As the code is being created, it's often helpful to have the code being worked on by itself, in a separate IDE container. Once complete, it's moved into another container that has finished code. Often, that IDE container is a file. I don't want the namespace changing if I move code between them.
-
End vs indent β I've written code where there may be a lot of end statements, one after the other. Also, indenting is commonplace today. Hence, it would seem that Python's removal of statements like 'end' would be helpful, even though almost all other languages use them. Conversely, when writing code, I often leave test/debug statements on the left margin as a marker that I can delete them when the code works. I can't do that in Python.
I might suggest that you read a few books like 'Design Patterns' by the 'Gang of Four' to get an idea of what the real distinctions are in programming languages. Real distinctions affect whether a framework can be moved/ported to another language, as opposed to simple syntax conventions.
I might also suggest that there's plenty of others forums for your concerns. This one is for Ruby used in SketchUp.
BTW, I'm ignoring the flame, otherwise we might get into that layman concept...
Greg
-
Advertisement