Ask HN: If you could only code with one language which would it be?
My friends and I are discussing which language we would choose if we only could code in one language for the rest of our lives. Some arguments have been made for c++, SQL, Java, python and JS
51 comments
[ 1.7 ms ] story [ 48.7 ms ] threadIt has all you mentioned:
- C++ (Strong OOP + Static typing)
- SQL (LINQ)
- Java (Well, no comment here)
- JS (dynamic, async/await)
By having the widest array of hardware devices to build on, I’d have the opportunity to solve the widest scope of problems.
Or Stackly, a language I've been writing for nearly two years now. Like C, it's performant, compiles to tiny binaries (it maps fairly close to assembly under the hood), but unlike C it has a ref-counting GC, compile-time and runtime type safety.
I did used to care a lot more about community adoption or libraries, but less so today. If you're not dealing with protocols or encryption, and there is no library, and you can spare a month or two, then writing the library isn't a hard task. First fortnight to implement, six weeks to fuzz n fix.But then, I've been forced to work with all sorts of estoric languages in my work, from PL1 to FORTH to Brainfuck, so my experience is unlikely to be the norm.
Stackly isn't public yet, and probably won't be until I finish the type-checkers.
[0]: http://p-cos.blogspot.in/2014/09/why-i-like-common-lisp.html
Common Lisp / Scheme are great to learn about programming languages themselves. think learning about closures in CL vs in ObjC and you will realize how simple concepts become awkward and secondarily builds your taste so you know engineer who prides in knowing C++ complexity is a fucking idiot.
Personally, CL has helped me quickly learn hard subjects (3D graphics), prototype software for open ended problems, etc etc.
And any given day, give me a language with live editing and updates, I hate the edit/compile/test cycle.
Other languages have gotten nice repl environments in the last year, but the integration with the language is never as good as lisp repls.
I'm curious what kinds of projects would cause you to reach for common lisp over scheme and vice versa. Also would be interested in any other thoughts comparing the two.
If I had actual time limits, python.
A (non-scientific) look at Wikipedia puts Python's first public release in 1991, and PHP in 1995. But Python's roots actually go back to the late 80s, while PHP was started and released in 1995. PHP was really originally created as a collection of helper functions, not a full programming language.
If you know Java, it takes a week or so before you're comfortable, and after that it's magical. All of the boilerplate, all of the tiny little frustrations and bad ergonomics, are just gone.
IntelliJ is a fantastic IDE, too, and I didn't bother picking it up until I started playing with Kotlin.
Kotlin compiles to JVM bytecode, and it runs everywhere I'm currently deploying applications. It can be mixed in with existing Java baselines, and interoperability is almost perfect.
Kotlin also cross-compiles to Javascript, and there's a new Native target, which I haven't played around with yet, but seems like a decent answer to Go's statically compiled, platform native, single binary output.
Lastly, there's an experimental feature that allows you to write one source base and target native, the JVM, and browsers. That finally gives me a single language that I can run anywhere that isn't Javascript.
It can do (most) everything that C can, but is (usually) a lot easier to work with.
I usually wanted to code in one language to save learning many languages to an expert level. Also it felt good to have a uniform code on various levels of the system - something which today in JavaScript world is called "isomorphism". Then I realized I'm really doing different things in different layers, and in a big language I'll perhaps use different parts of the language - effectively several languages. For a small language I'll probably be creating necessary constructs first - again, different for needs of different layers - and then would use those.
Now I think it's better to have the ability to adjust language after the task, and here Lisps look rather good. Even more, with security in mind I want to use not only "language suited for the task", but "language minimally suited for the task", so it's hard to use it incorrectly and easy to reason about abilities of the particular software layer. Here, again, Lisp-like languages are a good platform. Some others languages suitable for DSL creation (Haskell? Tcl?) can also be good.
But please don’t let it come to this. I’m happiest as a polyglot.
My reasoning is that this is one language that you can use to write apps for MacOS and iOS possibly sharing some codebase. It doesn't run on VM, so should be faster. Swift Playgrounds got me interested in this especially the fact that it seems to work with a lot of toys like Mindstorms. It might even evolve to support server side dev. So I see it as decent investment.
Also people in Apple's ecosystem seems to spend more money on apps even with smaller market share of Apple. And really want to write apps that do something interesting as I am really bored with another CRUD webapp with pretty UI.