Ruby is a beatifull language, but with a key word “end” which I hates to write many many times.
Is there any method by which I can write concise code without writing “end” every time?
Ruby is a beatifull language, but with a key word end which I hates
Share
Ok, this is partially non-responsive, but originally,
begin ... endwas the paradigm. And by originally, I mean languages you or I have never seen; things called funny names like Algol. Some languages (FORTRAN, Basic) staggered along for years with only single-statement conditionals.Then C, and later, Java, came along and took over the world. They had { .. }. and that was not bad.
Python and a few others (including a microcode assembler I wrote years before Python was invented) have experimented with using indent for block structure. Nice solution but apparently it wasn’t all that popular.
All of those worked but there were various issues.
Believe it or not, Ruby’s syntax design no-doubt involved consideration of all these other less-than-perfect dead ends.
My suggestion is: give it another chance just the way it is.
Ruby merges the groundbreaking and technically worshipped
SmalltalkandLispwith the practical and actually usefulPerl.For whatever reason, Smalltalk and (((Lisp))) haven’t succeeded in 30 and 55 years, roughly, and Perl is fading. Ruby is by far the most advanced language ever to become popular.The future is Ruby (and Python and JavaScript) and people like Ruby for a reason. One of those reasons is the really user-friendly syntax.
Believe me, the alternatives are worse.
Keep trying!