I came into this business from a bit of a back door (although I suspect it to be a common back door these days). I started with spaghetti code PHP, moved to OOP php with php4, then php5. I am now quite frustrated by the partial OOP implementation of php5, as I develop more complex applications. I become even more frustrated with PHP the more I learn about java.
I started with PHP too a long time ago. I've tried Perl, Python and Java. I'm a (very satisfied) Ruby programmer right now since it has a good balance of nice features taken from other languages, in my humble opinion. Learning Ruby has motivated me to know more about programming languages and now I'm looking to try SmallTalk, LISP and Haskell.
If you like Java's object orientation, you'll love Ruby's real object orientation. OOP as it was intended[1]. It's like Java done right, and without the verbosity.
The type safety at compile time makes it far easier to develop bug-free code...
The reality is not that categorical. Static versus dynamic typing benefits is debatable[2]. Incidentally, Java seems not to be type-safe [3]
Additionally, Java gives me code re-use at it's ultimate.
[...]
Not to mention that I do my development on my Mac, and deploy software across our organization to Windows and Linux desktops.
You realize that code reusability and portability is not Java's exclusive, right?
Yes, you do, of course.
Don't stop at Java. Keep trying other languages. You'll be surprised.
Don't worry about what anybody else is going to do... The best way to predict the future is to invent it. Really smart people with reasonable funding can do just about anything that doesn't violate too many of Newton's Laws!
Re:Recommended for new *nix users?
on
The Birth of vi
·
· Score: 1
I recommend vi (which in practice is vim)
Another Linux user...
You know, there are other OSes out there that may or may not link vi to vim.
The heavy use of sigils is not Ruby's fault, it's yours. I've written a lot of Ruby code and have rarely used sigils.
Sigils in Perl are mandatory and define whether a variable is a $scalar, a %hash, an @array or a &block of code. Ruby's sigils define scope: local (no sigil), @instance, @@class or $global variable, which is a good approach since it let's you know instantly whether a variable is local to the block of code or comes from another scope, which is far more important than its type.
So, unless you're using a lot of global variables, you shouldn't be heavily using sigils.
Finally, I don't see anything wrong with having regular expressions as part of the language. But if you don't like that, nothing stops you from using Regexp and Match objects.
How is 'since Jan 2005' a long time:) This must be a joke, but just in case...
There's no such thing as 'the Linux compiler' (hint: GCC is a GNU tool, Linux is a kernel and NOT a GNU project). Neither GNOME nor the X Window System are 'Linux contributions'. GNOME is a GNU project born for giving an alternative to KDE (because Qt was not free at the time) and XFree86 predates Linux.
Is it good for a "professional" to just ignore the parameters of a problem and answer with what they wish were the question?
What are you talking about?
Not all companies 'sanction' all languages. I typically don't have much of a choice on language when doing my job. What makes you think everyone else does?
What makes you think I'm thinking everyone else can choice his/her language? Anyways, the OP clearly *can* choice his language. He's just too lazy to learn another one. And that's what I'm replying to.
What the hell is wrong with you Ruby zealots?
The only Ruby-specific in my post is the suggestion to learn it. You wouldn't have thought the same if you had read it like s/Ruby/PHP/.
Fear not Atzanteol, Ruby is not a threat for you. This is your own [PHP] space and you're safe in it. Here, take your pill, and those zealots you see will go away.
Heh, well, no offense but, people that use to reply like you haven't tried Ruby, or don't understand it. Otherwise you would be in love with it already.
We cannot compare PHP and Ruby. It's like comparing BASIC and Perl, you get the idea. Remember when you discovered Perl and all its magic? Well, that's what happens when you get into Ruby. It's a true object oriented and dynamic language ready for real applications.
This might or not make sense to you. It depends on the use you are giving to your language of choice. If you write one-liners in Perl, you might not feel motivated to move to Ruby. If you are writing templates in PHP for your web applications and you're doing fine, you might not need Ruby either.
You see the light:) when you want to write OO applications/scripts. PHP used to have an awful hack (I haven't seen PHP 5), so does Perl 5. Python would be your choice, but for some reasons I cannot explain (yes, this is subjective) Ruby feels more natural.
Ok, I have fallen again in the "I love Ruby so much" that gets you so bored. So, here is some homework for you (some very nice presentations and small articles):
How about learning a "real" language like C, rather than a script piece of shit like Ruby?
how about learning a modern, multi-paradigm, very higher-level language for rapidly developing business apps like Ruby rather than an ancient portable assembly to build infrastructure like C?
I don't see the zealotry nor the cult here. He replied to a troll, with a nice summary of Ruby features not found in C.
That's the worst thing that can happen to a professional (assuming you are one): not willing to learn new things. I strongly recommend you to learn Ruby, "it puts the fun back on programming", you won't regret.
Solaris 10 is not a valid option here. They have to use a "an off the shelf [*Linux*] distribution that will be fairly easy to manage and maintain". But if *I* had a broader spectre for desktop systems then I'd say MacOS X.
This is necessary because mod_php runs scripts as the same user who started httpd, usually "nobody", so any files you want your PHP scripts to write to has to be world-writable.
That's wrong. They only need to be writable by the user running httpd.
The problem would go away if mod_php could just run PHP scripts as their owners, instead of as the user running httpd!
This is even worse. I don't want any root suid httpd process in my system, do you?.
You can already install suphp to do this, but you pay a performance penalty, since it has to start a new process for each invocation.
That means installing another vulnerable point in your system. You don't want that unless you're looking for trouble.
You can't remove the copyright notice. That's clear from the license text, for anyone who can read English:
Jiry and Nick have placed their names as copyright holders regardless they haven't made substantial changes.
I started with PHP too a long time ago. I've tried Perl, Python and Java. I'm a (very satisfied) Ruby programmer right now since it has a good balance of nice features taken from other languages, in my humble opinion. Learning Ruby has motivated me to know more about programming languages and now I'm looking to try SmallTalk, LISP and Haskell.
If you like Java's object orientation, you'll love Ruby's real object orientation. OOP as it was intended[1]. It's like Java done right, and without the verbosity.
The reality is not that categorical. Static versus dynamic typing benefits is debatable[2]. Incidentally, Java seems not to be type-safe [3]
You realize that code reusability and portability is not Java's exclusive, right?
Yes, you do, of course.
Don't stop at Java. Keep trying other languages. You'll be surprised.
My humble suggestion: Ruby.
[1] Dan Ingalls: Object-Oriented Programming - Google Video
[2] Static and dynamic type checking in practice
[3] Java is not type-safe
I'm sure there are enough OpenBSD stories to open an OpenBSD section with the respective OpenBSD logo Puffy instead of FreeBSD's Beastie
http://www.smalltalk.org/alankay.html
I recommend vi (which in practice is vim)
Another Linux user...
You know, there are other OSes out there that may or may not link vi to vim.
Then you'll be surprised too if you pick an important Ruby piece of software, let's say ActiveRecord, and see that not many sigils are used.
I wonder why you need to heavily use instance variables.
The heavy use of sigils is not Ruby's fault, it's yours. I've written a lot of Ruby code and have rarely used sigils.
Sigils in Perl are mandatory and define whether a variable is a $scalar, a %hash, an @array or a &block of code. Ruby's sigils define scope: local (no sigil), @instance, @@class or $global variable, which is a good approach since it let's you know instantly whether a variable is local to the block of code or comes from another scope, which is far more important than its type.
So, unless you're using a lot of global variables, you shouldn't be heavily using sigils.
Finally, I don't see anything wrong with having regular expressions as part of the language. But if you don't like that, nothing stops you from using Regexp and Match objects.
If you can afford another OpenBSD box for building patches you can use binpatch.
How is 'since Jan 2005' a long time :) This must be a joke, but just in case...
There's no such thing as 'the Linux compiler' (hint: GCC is a GNU tool, Linux is a kernel and NOT a GNU project). Neither GNOME nor the X Window System are 'Linux contributions'. GNOME is a GNU project born for giving an alternative to KDE (because Qt was not free at the time) and XFree86 predates Linux.
Try Ruby-Doc. Here is the core, and the standard library. Or use ri at the command line.
msg.scan(/.{8}/).each {|e| print e.to_i(2).chr}
puts msg.scan(/.{8}/).collect {|e| e.to_i(2).chr}.join
KMail requires that you install a mess of stuff for KDE.
Nope. Just kdelibs.
It's great that Ruby is 1.0.
Ruby will reach 1.8.4 this month. Rails is 1.0 since 2005-12-13
Would you mind giving an example on how Rails got in your way?
There are torrents too:
What are you talking about?
What makes you think I'm thinking everyone else can choice his/her language? Anyways, the OP clearly *can* choice his language. He's just too lazy to learn another one. And that's what I'm replying to.
The only Ruby-specific in my post is the suggestion to learn it. You wouldn't have thought the same if you had read it like s/Ruby/PHP/.
Fear not Atzanteol, Ruby is not a threat for you. This is your own [PHP] space and you're safe in it. Here, take your pill, and those zealots you see will go away.
Heh, well, no offense but, people that use to reply like you haven't tried Ruby, or don't understand it. Otherwise you would be in love with it already.
We cannot compare PHP and Ruby. It's like comparing BASIC and Perl, you get the idea. Remember when you discovered Perl and all its magic? Well, that's what happens when you get into Ruby. It's a true object oriented and dynamic language ready for real applications.
This might or not make sense to you. It depends on the use you are giving to your language of choice. If you write one-liners in Perl, you might not feel motivated to move to Ruby. If you are writing templates in PHP for your web applications and you're doing fine, you might not need Ruby either.
You see the light :) when you want to write OO applications/scripts. PHP used to have an awful hack (I haven't seen PHP 5), so does Perl 5. Python would be your choice, but for some reasons I cannot explain (yes, this is subjective) Ruby feels more natural.
Ok, I have fallen again in the "I love Ruby so much" that gets you so bored. So, here is some homework for you (some very nice presentations and small articles):
Ruby: A transparent, object-oriented programming language
10 Things Every Java Programmer Should Know About Ruby
The Ruby Programming Language (by Matz, Ruby's author)
Thirty-seven reasons I love Ruby
Blocks and closures in Ruby
I don't see the zealotry nor the cult here. He replied to a troll, with a nice summary of Ruby features not found in C.
You get a grip
but frankly, I don't want to learn a new language
That's the worst thing that can happen to a professional (assuming you are one): not willing to learn new things. I strongly recommend you to learn Ruby, "it puts the fun back on programming", you won't regret.
See?
Solaris 10 is not a valid option here. They have to use a "an off the shelf [*Linux*] distribution that will be fairly easy to manage and maintain". But if *I* had a broader spectre for desktop systems then I'd say MacOS X.
That's wrong. They only need to be writable by the user running httpd.
The problem would go away if mod_php could just run PHP scripts as their owners, instead of as the user running httpd!This is even worse. I don't want any root suid httpd process in my system, do you?.
You can already install suphp to do this, but you pay a performance penalty, since it has to start a new process for each invocation.
That means installing another vulnerable point in your system. You don't want that unless you're looking for trouble.
*co-founded