Basicprogramming(.org) > Tutorials and articles

Notes on Script BASIC

<< < (8/10) > >>

Tomaaz:
OK. Here is another task. Recursively walk directory, find all .jpg files which names are integers, sort the names by numbers and print the result.

Ruby (one line):

--- Code: ---puts Dir.glob("**/*").select{|a| File.extname(a) == ".jpg" and File.basename(a, ".jpg").to_i.to_s == File.basename(a, ".jpg")}.map {|a| File.basename(a, ".jpg").to_i}.sort

--- End code ---

If you want to know what part of the code is responsible for what part of the task, I can explain it to you. It only looks cryptic. If you know basics of Ruby it's clear as

--- Code: ---for x = 1 to 10 : print x : next x
--- End code ---
in BASIC.  ;)

Mike Lobanovsky:
Look guys,

What are those Python/Ruby/QB64/younameit "tasks" doing in the Notes on Script BASIC thread in the absence of the language project lead?

Is the forum Administration really after the ever increasing message counter readings by way of blatant trolling and flooding in every other thread on a BASIC forum?!

(Tomaaz, should BASICs be able to swallow LISP-ish lists and maps, they would've been called LISPs. Or Pythons at the worst. This is definitely not what the BASIC community is particularly after -- here or elsewhere.)

Tomaaz:
Mike, you were away writing next "Smoke on The Water" or next "Child in Time", so let me explain what's happened here. John kept spamming every possible topic and asking me and B+ what was that we didn't like about ScriptBasic. In response to that, B+ has started this topic and we have both given John our answers. B+ doesn't like the fact that ScriptBasic is not beginner friendly, I don't like the fact that it's unfinished and, despite what John's saying, it can't compete with serious scripting languages (my examples are here to prove it). John, instead of agreeing/disagreeing with us, has closed his account. I agree that there was "trolling and flooding in every other thread", but, sorry, it wasn't me or B+.

As for "lists and maps", they are part of any serious scripting language. You can find them in Python, Perl, Ruby, Tcl, PHP, JavaScript. Does it make Perl Python? Should we call Ruby "PHP"? Or maybe we should call PHP "Ruby"? How come NewLisp looks completely different than Tcl? They both have "lists and maps". For me, BASIC doesn't have to have these features. It would be nice if it had, but it's not necessary. After all, BASIC is meant to be a simple language for beginners. You just need to understand that it's not as powerful and flexible language as Python, Ruby or Perl. It doesn't have to be a bad thing, either. But you need to see that difference. And this is something John finds difficult to accept. He keeps describing ScriptBasic as this great, professional BASIC that is a real programming language (as oppose to the toy languages developed by other members here) and expects every single BASIC user and developer to share his enthusiasm and quit any other languages they happen to be using/developing. Well, it will never happen. I wish John didn't quit (I really struggle to find reason for it), but he's gone, so does it really matter what we're posting in this topic?

Mike Lobanovsky:
Smoke on the Water and Child in Time are unique phenomena in the hard rock culture and as such cannot be replicated or rivaled. ;D

Thanks for bringing me up to date with the cause of events in this thread. I must confess it was a little difficult for me to reconstruct it with some of John's responses evidently missing. Yet if I were in your shoes I'd most likely stop posting here and would rather open a couple of new threads to present the Python/Ruby examples as challenges for the BASIC-ers to compete. It's obvious there won't be a Script BASIC solution to them anyway though...

Tomaaz:

--- Quote from: Mike Lobanovsky on September 22, 2018, 10:27:36 PM ---Smoke on the Water and Child in Time are unique phenomena in the hard rock culture and as such cannot be replicated or rivaled. ;D

--- End quote ---

Ritchie Blackmore in Child in Time - one of the greatest guitar solos in history (especially in the original version from In Rock). You see - it was still possible to achieve a higher level of off-topic.  ;D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version