17 August 2015, 02:14 | #241 | |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,338
|
Quote:
Personally, I find myself the most productive writing in ARexx, but I suspect it's also not a programmer snob's favourite. |
|
17 August 2015, 18:22 | #242 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
|
Have you ever tried AmigaE? It's a great OOP language with BASIC-like syntax. About the only feature I've found lacking in it is that you have to write your own wrapper code for multi-dimensional arrays.
|
17 August 2015, 23:58 | #243 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,338
|
Yes and no. I've read a lot of its documentation, but never written anything real in it. But it's certainly an interesting language that doesn't use arbitrary ascii garbage for its syntax.
|
18 August 2015, 20:17 | #244 | ||
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Quote:
IMO one will soon hit a brick wall and have either to switch language or use some extended BASIC dialect. But I repeat myself Quote:
The problem with the C syntax isn't (again IMHO) the use of symbols, it is the unstructured layout that allows programmers to output almost unreadable messes. Properly formatted C is easy to read, badly formatted it is near unreadable for humans. Not Perl unreadable though... |
||
19 August 2015, 12:18 | #245 | ||
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
But let's think about what curly braces actually do in C. They delineate code blocks. That is a necessary thing because a loop or a conditional statement (or whatever else) has to have a body. Other languages do it in different ways. Python does it just by indentation, which forces the programmer to write in a neat way, and one can immediately see the structure of the code without having to read any of the keywords. BASIC, on the other hand, has no consistent way to delineate a code block at all. There is no way to tell that a pair of statements encloses a block other than by knowing about those statements already, thus intertwining syntax and semantics. Bad enough that there are umpteen different ways to start a code block, each one has a special way to end it as well, so you have to learn symbols in pairs... IF...END IF, FOR...NEXT, WHILE...WEND &c.. the human brain might be able to cope with this, but if it requires a complex parser it is not a simple language. Megol already mentioned some of the other things i was going to say, but in addition to that, there is even more "ascii garbage" that BASIC syntax typically uses. For instance, arithmetic operators and parenthesis. For instance, one can write: Code:
Let A = (B+C)*2 Code:
Let A equal calculate B plus C first times 2 But that's not even the worst of it. I think the worst of it is that you can't really talk of "BASIC syntax" at all. Every BASIC statement has its own syntax. Let's just look at a simple print statement: Code:
Print "There are ";n;" sheep" Code:
Let A$="There are ";n;" sheep" And then there's the ascii-garbage equals sign, '=' Code:
10 Let A=5 20 If A=5 Then Print "A is 5" 30 For I=0 To 10 Step 2 ... Code:
Let A=0 To 10 Step 2 For I in A ... Code:
Let A="Hello world!" : REM Type inference! For I in A: Print I But alas, it was never meant to be, because BASIC was invented in 1964 when "real" programming was only done in assembly language and none of the staple concepts of modern programming had been invented. Quote:
The benefits you mention are common to pretty much any interpreted language, and there are a lot to choose from. |
||
19 August 2015, 12:42 | #246 |
Retro Freak
Join Date: Nov 2001
Location: Slovenia
Age: 51
Posts: 1,648
|
|
19 August 2015, 13:01 | #247 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
|
Back on topic. To make homebrew games easier to write and such, Mike Parent is starting a series of bounties for AmosPro programmers. If accepted, I'll be doing my part by making a shared library for tilemap manipulations that can be used by any 68k language that supports shared libraries. The library itself will be written in C but support will be extended to AmosPro and AmigaE as well. It will be based on the example codes by Georg Steger found in http://aminet.net/package/dev/src/ScrollingTrick.
|
19 August 2015, 15:19 | #248 | ||
Registered User
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 2,007
|
Quote:
Quote:
Code:
10 FOR EACH a$ in ["Hello world!"]: PRINT a$: NEXT a$ Code:
10 DIM a(32) 20 FOR EACH b IN a() 30 PRINT b 40 NEXT b Code:
10 INPUT a$ 20 IF a$ IN ["Yes", "yes", "YES"] THEN PRINT "Yay!" ELSE PRINT "Boo!" Code:
10 IF b IN [1 TO 10,20,30 TO 40] THEN ... 20 IF c$ IN ["0" TO "9", "A" TO "F"] THEN ... Yes, it's not part of the original Dartmouth spec (and in fact is very close to Pascal) but then the original Sinclair BASIC did things that aren't in the spec - though their string handling was genius and stands up well even today - so what's wrong with making my interpreter do things a little better? D. |
||
19 August 2015, 16:47 | #249 | |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,348
|
Quote:
String handling in more modern BASICs is much more flexible and standard than maybe you think. For your example, in Blitz the Print statement uses commas to separate arguments, just like every other statement with multiple arguments: Code:
Print "Hello ", name$, " and welcome!" Blit shape1, x, y Alternatively you can join strings and use them as one argument, again, just like with any other command: Code:
Print "Hello "+name$+" and welcome!" a$ = "Hello "+name$+" and welcome!" |
|
19 August 2015, 20:04 | #250 | ||||
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Quote:
That one can use assigns in a if statement is because C - unlike many languages - actually is designed and that case falls out naturally. Code:
a=b=c=12; Code:
if(a=input_stream_stuff()) { ... } Code:
for(;a=input_stream_stuff();) { ... } Quote:
In standard BASIC commas and semicolons are used as a statement-specific formatting indicator, so if commas are used as argument separators how are semicolons handled? Via a hack... Quote:
Like: Code:
A$="Hello" STR(A$, LEN(A$), LEN(N$))=N$ STR(A$, LEN(A$), 13)=" and welcome!" Quote:
|
||||
19 August 2015, 21:14 | #251 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,348
|
I code both in C and in BASIC, so like I said earlier in my post, I do understand the reasons and advantages of checking an assignment like that. Nevertheless, it is confusing if you're new to programming, and I've had to explain it to people in the past. == might make perfect sense to you because you're using it for so long but it is *not* intuitive to anyone who hasn't seen it before.
I know different BASICs are different, and that there isn't really a "normal" BASIC (well, there is a standard but nobody uses it), but as I said earlier in the thread, switching between dialects was never a problem for me when I was learning on the BBC / C64 / Atari 800XL. I just needed to look up in the manual what the equivalent was and work around the difference. I recently ported a small game I wrote from Blitz Basic to Visual Basic, and it took a couple of hours in total, including changing over OS-specifics like the window menus (which suck in .NET), building the interface, converting the AmigaGuide to HTML Help, converting the graphics format and so on. No big deal. I've spent similar lengths of time "porting" C code between two C compilers, so it's not like C is totally portable either. Semicolons in Blitz are for comments, nothing else. Just like AmigaDOS. So every parameter is separated by commas. Same in VB except comments are apostrophes. To be honest I can't think of a BASIC dialect that uses semicolons as an argument separator, but like you're keen to point out, that just shows how the dialects differ. Your examples of string handling seem quite odd to me, it's a long time since I've seen a BASIC that has needed to do that sort of operation to join strings. Pretty much every BASIC nowadays lets you use an operator to join strings, and lets you use strings pretty much like a numeric variable - something C is sorely lacking. Code:
a$="Hello World!" Code:
#include<string.h> char a[20]; strcpy(a, "Hello World!"); |
19 August 2015, 21:31 | #252 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,613
|
I love how 'Why is the homebrew scene...' became 'Which language is the best'...
Seriously though there's the right tool for the right job. Always. It's not that one language is perfect for everything. For example if I think about how to exchange one letter in the string of Daedalus' last example multiple times the 'which language is more easy to use' verdict totally changes |
19 August 2015, 21:55 | #253 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
Code:
unsigned char a[] = "Hello world!"; Old school BASIC belongs in the past |
|
19 August 2015, 23:24 | #254 | ||
Registered User
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 2,007
|
Quote:
In the original Dartmouth BASIC (and indeed any BASIC), the PRINT command requires one of two things as a print-item - either a print separator or an expression. If your BASIC supports such things as LET a$=b$+c$ Then PRINT will handle inline string concatenation as part of its expression evaluator. Furthermore, I'd like to see how Blitz, using its commas to separate print items, manages to output a newline or tab? I suspect (I've not investigated though!) that it must use special characters inline in the string arguments? Dartmouth used the semicolon for concatenation of items (both strings and numerics which by their nature cannot be concatenated using an operator without a conversion function on one of the terms), the comma for tabulation and the apostrophe for newline/carriage return. It's not a "hack", but I agree that it's the only command that uses these conventions - using them with a string variable assignment wouldn't work and would break delineation of the two datatypes. D. |
||
19 August 2015, 23:28 | #255 | ||||||
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
But now the standard BASIC syntax for FOR loops is redundant, you can get rid of it! "Dim" is a horrid keyword, though... but with type inference you could simply assign arrays defined with some nice syntax to a variable. Quote:
Let's go deeper... obviously we can conceive of more complex conditionals, for example: Code:
If A>5 And (A<10 Or A=20) Then ... Code:
A=(B=5) Quote:
Quote:
Quote:
Quote:
I think maybe it would have been better if some variant of Pascal had become the standard home computer ROM language. from my point of view it has only become "which language is the worst" Last edited by Mrs Beanbag; 19 August 2015 at 23:33. |
||||||
19 August 2015, 23:42 | #256 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,613
|
|
19 August 2015, 23:48 | #257 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
haha, well, as someone who DOES code for a living, i know what "TODO" means...
it means "forget about this until you have to explain it to someone else who has to work on the code 5 years later" anyway i am inventing my own language, and i'll let you know how that goes |
20 August 2015, 00:32 | #258 | ||||
Registered User
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 2,007
|
Quote:
Quote:
Quote:
Quote:
"LET a equal 5" Straight out of elementary school maths lessons. "LET a equal the result of b equals 5" Where a numeric value is assigned for truthiness that statement, with LET, makes perfect sense. AMOS, not having LET, means it looks ambiguous (and therefore confusing to the beginner) even though to the interpreter it's totally fine and rigidly defined as to its meaning. So BASIC, done well, is not a bad thing when it is used in its proper place, i.e for the beginner to get a leg up on what it means to write a list of instructions for a computer to follow. D. |
||||
20 August 2015, 03:14 | #259 |
Banned
Join Date: May 2015
Location: Australia
Posts: 67
|
He he, this thread has actually ended up answering the very question it asked.
Not via specific responses, but rather the outcome as a whole.... Too much talk, too many people trying to "out clever" each other, too much focus on semantics, etc. If this is how people with knowledge spend their Amiga related time, then it's been answered :-) p.s. I'm as guilty as anyone, but the irony amused me. |
20 August 2015, 11:29 | #260 | ||||
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
Quote:
Quote:
Quote:
|
||||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What is the technically most impressive A500 game? | mc68060 | Amiga scene | 67 | 03 June 2015 22:32 |
The Tales of Grupp - Another impressive homebrew ZX Spectrum title! | Neil79 | Retrogaming General Discussion | 3 | 24 February 2015 19:19 |
New One Of "Homebrew" 68k Amiga Magazine Idea | fishyfish | Retrogaming General Discussion | 6 | 16 April 2013 08:57 |
Impressive and Amazing PD Software! Any thoughts? | hamster | Retrogaming General Discussion | 0 | 18 July 2004 01:42 |
|
|