Sergey Bugaev is a user on mastodon.technology. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

What would you recommend as a first programming language for students, and why?

I’ll go first. TypeScript: it teaches you the best parts of JS and about types

If you’re into backend: Go. Safe, types, good community and fast enough for most things

@andrioid I'm not sure. Python has remained my preferred language but I'm not sure how to justify it as a first language.

Definitely not Java though, (without an IDE) it's a pain to type all the type signatures and those would detract from learning programming.

Haskell would be an interesting choice though, just to throw a curveball here with a different paradigm that might or might not be simpler to teach.

Sergey Bugaev @bugaevc

@alcinnz @andrioid sorry for pushing Apple stuff here, but . It's just a very nice language that feels very lightweight and scripting-like, yet uses static typing and compiles to native code (LLVM; but it's not as efficient as or C due to pervasive boxing). It has a REPL and some very nice interactive IDE support (Swift Playgrounds), which also lets you do basic UI stuff in the sidebar, right alongside the playground.

· Web · 1 · 1

@alcinnz @andrioid So you can code the game of 2048 or something and play it right there. It is "completely native" to Cocoa, Apple's framework stack, and it's a serious language parts of macOS and iOS are written in (e.g. the Dock).

Swift Playgrounds is also available as an iPad app, and it has some additional niceties for beginners, like a playful and friendly introduction to basic syntax and to programming in general.

@alcinnz @andrioid last note, Swift has nice support for FFI, and it does some magic to make it automatic. I bet there are *tons* of corner cases, but basically you can just "import Darwin"/"import Glibc" and call C functions directly, as if they were Swift functions, and you can even pass Swift's native strings where `char `* is expected and so on.

@bugaevc @alcinnz I think Swift looks really interesting. However, I need languages with such strong commercial backing to become community projects before I can allow myself to use them.

For example, when Google's Go was only a language for the App Engine it had absolutely no appeal to me. But now 👍

@andrioid @alcinnz mind, I'm not saying you should write your personal projects in Swift, I'm saying it's good for teaching beginners to code. After you get familiar with a language (and programming in general), it's much easier to learn a different language you'd need for an actual serious project, whether that's JavaScript, Java, Python, etc.

@bugaevc @alcinnz so much easier to motivate students if they think they can build something awesome with it afterwards

@andrioid @alcinnz they *can* build something awesome with Swift, like an iOS or macOS app. It may not be what *you* want to do, and not what *they* end up doing in their career as developers, but it's a great way of learning. Swift being so high-level, native to Cocoa, and integrated with the rest of the system (e.g. installed with Xcode) makes it very well positioned for learning programming by building real things, because it's so easy to go from print("Hello World") to a simple app.

@bugaevc @alcinnz Sorry if that came over as critical of Swift.

Of course you can build awesome stuff with Swift. What got me, personally excited in programming was the web. I never figured out how to use Turbo Pascal for anything useful. 😀

@bugaevc @andrioid I wonder how much you'd miss from it if you're not on a Mac...

It definitely looks like a very nice language though.

@alcinnz @andrioid Swift itself is open source & Apple even provides packages for some old Ubuntu releases. I've heard of Swift flatpaks that you can just install on your distro of choice. So you get the REPL + your favorite text editor, but lose all things Playgrounds & Cocoa. And that voids most of Swift appeal, so you'd have to use macOS/iOS to teach beginners Swift, yeah, that's a huge downside.