5 ms·
What sucks about these languages is complex sentences that look like loose English but are actually formal syntax. “.length” is so much easier to understand and
by shrimpx 6y ago
What sucks about these languages is complex sentences that look like loose English but are actually formal syntax. “.length” is so much easier to understand and remember as a formal sentence than “the number of chars in”.
- msla 6y agoIt would be a good language for a very active IDE which constantly showed you how the sentence-so-far had been parsed, so you wouldn't need to guess as much about the grammar. SQL could definitely use something like that, too.
- Wowfunhappy 6y ago> It would be a good language for a very active IDE which constantly showed you how the sentence-so-far had been parsed. I love this idea. Combined with a language like Hypertalk, a new user could foreseeable just figure out the syntax without looking it up.
- bantunes 6y agoMaybe for you. The goal of Hypercard was to empower people that don't really think '.length' is easier.
- cocktailpeanuts 6y agoThis is a common misunderstanding coming from people whose first language is English. There is a wider world where they prefer ".length" over some english sentence. Even the ".length" is difficult for them but it's still less grammar to learn.
- Wowfunhappy 6y agopre-OS X versions of Applescript (which was largely based on Hypertalk) actually allowed you to use Spanish/French etc in addition to English. Was taken out in OS X apparently.
- Guthur 6y agoAnd it has been demonstrably shown that languages that have a pseudo English syntax do nothing to open programming to the masses; case in point being Cobol, there is a proverbial tonne of it being maintained only by software engineers.
- cturner 6y ago"pseudo English syntax do nothing to open programming to the masses" But they did with hypercard, right? I remember my sister showing me a hypercard presentation she did while she was in primary school.
- Wowfunhappy 6y agoWait—that's really cool! Did she just go ahead and learn it on her own?
- KineticLensman 6y ago> case in point being Cobol, there is a proverbial tonne of it being maintained only by software engineers I don't think COBOL is a good comparator. Although COBOL uses 'English' words, it has massively idiosyncratic programme structure (data division! [0]) and weird data structures (PICTURE clause! [1]), and it was these that made it hard to understand and maintain without a very steep learning curve. Source: I had a language trajectory that went Pascal -> COBOL -> C -> Hypercard. I was stunned by how rapidly I could create impressive Hypercard applications, with quite sophisticated (for the time) UI and graphics. This was invaluable in the group I worked in, a research group in a large UK engineering company in the early '90s. [0] https://en.wikipedia.org/wiki/COBOL#Data_division https://en.wikipedia.org/wiki/COBOL#Data_division [1] https://en.wikipedia.org/wiki/COBOL#PICTURE_clause https://en.wikipedia.org/wiki/COBOL#PICTURE_clause
- pmoriarty 6y ago"I don't think COBOL is a good comparator." Another similar language is Inform 7, the text adventure authoring language, which came out in 2006, about 20 years after Hypercard.[1] Below is a simple example program in the language. A more involved example can be found here: [2] "Hello Deductible" by "I.F. Author" The story headline is "An Interactive Example". The Living Room is a room. "A comfortably furnished living room." The Kitchen is north of the Living Room. The Front Door is south of the Living Room. The Front Door is a door. The Front Door is closed and locked. The insurance salesman is a man in the Living Room. The description is "An insurance salesman in a tacky polyester suit. He seems eager to speak to you." Understand "man" as the insurance salesman. A briefcase is carried by the insurance salesman. The description is "A slightly worn, black briefcase." Understand "case" as the briefcase. The insurance paperwork is in the briefcase. The description is "Page after page of small legalese." Understand "papers" or "documents" or "forms" as the paperwork. Instead of listening to the insurance salesman: say "The salesman bores you with a discussion of life insurance policies. From his briefcase he pulls some paperwork which he hands to you."; move the insurance paperwork to the player. [1] - https://en.wikipedia.org/wiki/Inform_7 https://en.wikipedia.org/wiki/Inform_7 [2] - http://inform7.com/book/RB_1_3.html#e74 http://inform7.com/book/RB_1_3.html#e74
- athenot 6y agoHyperTalk existed before unicode, however it's conceivable that a modern implementation would return... the number of actual characters in a string. For contrast, JaveScript's .length definitely does not count the number of characters, it returns the count of UTF-16 units, which for Emojis yields an incorrect result. My point being that the conveniences we all enjoy with `.length` come with subtle gotchas that we overcome as devs but are perhaps not necessarily as user-friendly as a more long-winded approach.
- cturner 6y agoFor what it's worth, Rust's string length tells you the number of conventional characters, whilst following typical programming notation rules.
- FreeFull 6y agoRust's .len() on string does not give you the length in characters, it gives you the length in bytes. If you want the length in unicode codepoints, you need to do .chars().count(), but given things like combining characters, that might not be quite what you want either.
- sildur 6y agoNo, it’s not much easier. You simply got used to it and forgot the time it took you to learn it.
- iainmerrick 6y agoNo, it’s just a question of what you’re used to. HyperTalk was the second programming language I learned (after BASIC) and I had no trouble remembering the grammar. It probably helped that I didn’t have too many preconceptions to unlearn. One big thing in HyperTalk’s favor that rarely gets mentioned is that it pretty-printed your code automatically. That was a massive help, and well ahead of its time.
- Wowfunhappy 6y ago> What sucks about these languages is complex sentences that look like loose English but are actually formal syntax. I really like this though! It's true, you can't just write English sentences and expect the computer to understand you—you have to learn the "formal syntax". But, once you've written that code, it comes out as English sentences, so you can read what your code is doing in English! I love this. I've never used Hypercard (too young), but I do use Applescript, which was based on Hypertalk's syntax and which—sometimes, when Applescript isn't being crappy—has the same property. If there are other modern languages that do this effectively and can be used for more than just macOS automation, I'd love to know about them...
- cxr 6y agoApple's SK8 was intended to be the original successor to HyperCard and led to AppleScript. It's available under some quasi-open source license. https://en.wikipedia.org/wiki/SK8 https://en.wikipedia.org/wiki/SK8 https://github.com/waywardmonkeys/apple_sk8 https://github.com/waywardmonkeys/apple_sk8
- hobs 6y agoHaving run non-trivial programs in Applescript I want to say that its an absolutely nightmare to debug - reading english sentences describing program operations is not understanding intent at all, its just sooooo verbose.
- Wowfunhappy 6y agoApplescript is annoying for reasons that I don't think have to do with being English-like. The type system is obtuse and exceedingly difficult to follow, and a lot of the more advanced syntax doesn't actually read much like English. (Personally, I do still happen to like Applescript, but it has a lot of problems.)
- maxwelljoslyn 6y ago'Wowfunhappy, I strongly suggest you take a look at the Inform 7 programming language: http://inform7.com/ http://inform7.com/ It is powerful, stable, and addresses many of the issues of using an English-like syntax. It comes with an IDE and two hyperlinked manuals, which contain hundreds of working code samples implementing everything from basic conversations to systems of weights and measures. Finally, as one of the pillars of the modern interactive fiction<1> development community, it is under active development by its creator, in the saddle for twenty-plus years now. Here's a sample (syntax may be slightly wrong): A person can be nervous or relaxed. A person is usually relaxed. The Train Station is a room. Joe is a man in the Train Station. Joe is nervous. "Joe shifts from foot to foot, looking uncomfortable." The description of Joe is "[if Joe is nervous]He's shifting uncomfortably[else]He's standing tall and proud[end if]." Understand "cheer" as something new. Cheering is an action related to one person. Carry out cheering (x - a person): if x is nervous: now x is relaxed; otherwise, say "[X] doesn't need to be cheered up." instead. Report cheering (x - a person): say "You clap [X] on the back. It works: [regarding X: his] mood lightens."<2> That's all you need for rudimentary gameplay: TRAIN STATION Your buddy, Joe, shifts from foot to foot, looking uncomfortable. > look at joe He's shifting uncomfortably. > cheer joe You clap Joe on the back. It works: his mood lightens. > examine joe He's standing tall and proud. <1>: the medium started by, but not limited to, text adventure games like ADVENT and Zork <2>: [regarding X: his] is roughly the syntax used to change "his", "her", etc. into the appropriate gender for the variable X. Because games and experiences built with Inform have all-text contents and interfaces, Inform provides a large number of constructs to tame printed strings.
- spanhandler 6y ago.length is easier. .length, .size, .len, .count, then all those again but as functions taking an array argument, then again but as method calls, are not. And that’s not all the possibilities! Seriously I bounce between languages enough that I have to look this shit up every time if autocomplete doesn’t help me out, and even that might take a couple tries.
- jmnicolas 6y agoNo need to bounce between languages, you can get everything from C# : you call .Length on arrays but .Count on Lists but .Count() on IEnumerables ... It's a good thing that Intellisense is top notch !
- asveikau 6y agoI guess there's no reason for a difference between .Length and .Count that I can think of. I guess you could make IEnumerable's Count() into a property and enjoy the same syntax but I am not sure it's a good idea, because Count() needs to enumerate and is therefore O(n), and property syntax may coax you into writing with the expectation that it is O(1). Then suddenly (it's been years since I did c#) I recall that Count() is added to the interface as an extension method with the "this" keyword. Is it possible to have an extension property? I do not think so but again it's been a while.
- thewebcount 6y agoAnd on top of all that, it doesn't tell you the units of the result. Is it size in characters? Size in bytes? Size in code points? (Obviously in 1989, it was both characters and bytes, but these days, who knows?)
- analog31 6y agoAn amusing anecdote: Someone told me that HyperScript simply ignores the word "the" when interpreting scripts. I wonder if that's true for the other little words like "of" and "in." Too bad I no longer have a Mac, to try it out. I wrote some industrial control apps using HyperCard. Unfortunately, it was at a time when the Mac OS was going through a dark period, and just wasn't stable enough to use in a factory. We ended up with Visual Basic instead, but I continued to use HyperCard at home.
- betamaxthetape 6y agoI've just checked "of" on my Mac with HyperCard, and the answer is no - it's not optional. (I tried with "answer the number of cards" and "answer number of cards", which both worked fine, but "answer the number cards" and "answer number cards" both didn't). If you still have copies of those industrial control HyperCard stacks, I'd love if you were to upload them[1] for the online collection[2] (provided, of course, that doing so doesn't violate any NDAs / etc...). [1] http://hypercardonline.tk/ http://hypercardonline.tk/ [2] https://archive.org/details/hypercardstacks https://archive.org/details/hypercardstacks
- analog31 6y agoI've been searching in vain, but will keep my eye out. I'm glad you're keeping this archive.