I have never been a big language geek. My CV lists a raft of them; C#, JavaScript, Ruby, VBScript and even COBOL. But I know many coders (like Kenny, Brian or David) who have a much deeper understanding than I do. On a daily basis Brian shows me twists and turns of C# that I had no idea about. I am not ashamed about this though. Programmers aren’t one type. We have generalists and specialists, high-level chaps and on-the-metal sorts.
Occasionally though along comes a language or system that works the way I think. I then go to another level of understanding with it. HTML and CSS may not be strict programming languages but I do know them to a far greater degree than I do other languages. I am dead confident with them which is a nice feeling.
I reckon Ruby is fast revealing itself to be a language I will grow to be confident in, one I’ll understand beyond my usual level. It feels right.
Just an hour ago I needed some Ruby code that would generate a random string of characters (for a password system in this case.) One Google later and I came across this post. A comment by Scott Becker blew me away with its usesfulness and simplicity. Here is the code:
schars = "0124356789abcdefghijk"
password = ""
1.upto(8) { password += schars[rand(schars.length),1] }
In other languages a line like that would leave me scratching my head and turning to Brian but in Ruby it made elegant, simple sense.
Add New Comment
Viewing 4 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)
June 1, 2006 at 4:27 pm
[...] Brian read my previous post and quickly replied with this functionally identical C# code: string schars = "0124356789abcdefghijk"; string ...