News for hackers. Stuff that matters.
Re:What’s New in Swift 5.2 by favorited on Thursday February 06, 2020 @02:02PM (#22259104)
The concept of progressive disclosure means that you shouldn't teach this kind of stuff to beginners. Stuff like callAsFunction, dynamic member lookup, etc. are for people who are writing DSLs, providing rich libraries, etc.
Re:What’s New in Swift 5.2 by zionic on Thursday February 06, 2020 @02:12PM (#22259226)
Progressive disclosure does absolutely nothing for your students looking up example code only to be greeted by alien syntax that does the same thing.

Pretend you know nothing about a language, why would you assume .map { $0.thing } and .map(\.thing) are even remotely similar?

Re:What’s New in Swift 5.2 by Razengan on Thursday February 06, 2020 @03:57PM (#22260206)
You would look it up, as you would for anything else you see for the first time.
Re:What’s New in Swift 5.2 by keenmaster on Thursday February 06, 2020 @05:49PM (#22261296)
I wonder if there's a coding interface for beginners that works as follows:

The beginner types a declaration of "I want to _____" and the interface uses ML to auto-suggest code. The auto-suggest would be context-sensitive and fit in with previously written code. Auto-correct would work similarly. If the declaration isn't specific enough, then the auto-suggest tool would ask a series of questions that illustrate the different choices a programmer can make in achieving their goal. Finally, the tool would output code that reflects the beginner's choices.

This would increase the speed of the think-do feedback loop. Beginners would be able to jump into coding with very minimal education and "make" the application they want straight away. Of course, it would usually behoove them to eventually read some programming books and take classes, but this tool would pique their interest. The power of the auto-complete would scale back as the beginner progresses unless they get stuck. Maybe this would only work on a finite set of projects that the ML was trained on, which is fine because you can just give a lot of projects to choose from. That is until the ML becomes more powerful and generalizable.

Re:What’s New in Swift 5.2 by hndc on Thursday February 06, 2020 @06:15PM (#22261485)
Among the drawbacks of excessive syntactic sugar is that it is often difficult or impossible to look up
Re:What’s New in Swift 5.2 by Razengan on Monday February 10, 2020 @04:22AM (#22287579)
Do you have examples of that?