Ask coding questions

← Back to all posts
What language?
mkhoi (213)

If you have to stick with 1 programming language forever for everything that you write... What would it be?

Ps: also remember about what language your career needs, your personal favorites... too

And apparently Python and JS are the most popular choices

Commentshotnewtop
RoylatGnail (77)

Assembly. Because I like wasting my time.

eankeen (926)

Clear choice of JavaScript for me! Use it all the time and I absolutely love it!

ItsEmpCs (38)

True. It's easy and lets you make website and also no problems making [email protected]

Ntechh (9)

C++. It's the fastest and most portable language. Ever.

liltaco (64)

@Ntechh some things like sockets and libraries are difficult in C++, and they are big compromises because of the language's age. Also the syntax, even in C++17, is mostly dated. There are alternatives popping right now like Rust that have similar performance and all that fixed. I'd recommend you to just check it out, just to know it is there. I don't use it but its ideas are interesting.

Ntechh (9)

@liltaco I've never heard of Rust, but it looks promising. However, I've been trained in C++ and it'll be a while before its unmatched compiler optimization, low-level access, and raw memory management are rivaled by a competitor.

As to libraries, they're just a question of how well each was built, and compatibility. There are great socket libraries such as Dermesser's Libsocket on Github. With that library, implementing a http client, for example is as simple as:

# include <iostream>
# include <string>
# include "../headers/inetclientstream.hpp"
# include "../headers/exception.hpp"

// HTTP client demonstrating the use of snd and rcv on STREAM sockets

int main(void)
{
    using std::string;

    string host = "spheniscida.de";
    string port = "80";
    ssize_t len;
    string test;

    char* buf = new char[10000];

    try {
	libsocket::inet_stream sock(host.c_str(),port.c_str(),LIBSOCKET_IPv4);

	sock.snd("GET / HTTP/1.0\n\n",16);

	sock.shutdown(LIBSOCKET_WRITE);

	while ( 0 != (len=sock.rcv(buf,10000)) )
	    std::cout << string(buf,len); // write only as many characters as we read
    } catch (const libsocket::socket_exception& exc)
    {
	std::cerr << exc.mesg;
    }

    return 0;
}
liltaco (64)

@Ntechh Rust has a very different fundamental idea to C++. It erased the idea of pointers and memory management and race conditions with its "ownership" model, so it negates the largest problem in C++, memory leakage. Low level access is similar, and I am not saying that Rust is the future, but there's no reason C++ will stay for many years because of its flaws. The problem with C++ libraries is that many of them are dated and while not all are, it's a problem. Also, C++ tooling is subpar, with no well known package manager and single way to use it.

jpayne (5)

C, so I can recreate any language I want

mkhoi (213)

@jpayne That is an AWESOME IDEA! But kinda fell like cheating tho

KevinLacker (4)

JavaScript. With Node and React Native, you can build mobile apps and server-side stuff along with typical web frontend things. So even though I'd be stuck with one language I could still build all sorts of things

Zavexeon (739)

Well, that's a tough choice

I'd probably go with Ruby.

a5rocks (576)

Python has all the features I need (thus far).

And this might be cheating, but Cython allows you to use C in Python too (if i remember correctly).

mkhoi (213)

@Game_Collabs Are there any more python-something hybrid because Cython and Jython seems cool 😎

a5rocks (576)

@Game_Collabs Oh yeah, and how could I forget Rust + Python interoperability.

Game_Collabs (14)

@mkhoi I don't know. Will keep an eye out for more!

Pythonier (307)

Nice question, although python is really good, I'd probably go with javascript.

ebest (596)

@Pythonier Your username is an oxymoron with this reply.

Pythonier (307)

@ebest True, python is my favorite language but I am pretty sure you can do more with javascript in the long run.

ebest (596)

@Pythonier Wellllllllll, what does your post say?

YOUR POST

Pythonier (307)

@ebest First of all, that is not my post, and the one I did post was based of the comments not me.

AquaMarine0421 (27)

NOBODY VOTE FOR C?? I LOVE C

OathOfCode (20)

PYTHON is litteraly the greatest language ever!
You can create a website, login system, and games too!
Its very easy to learn as well!

PYer (2668)

Depends, can you use flask with python? It kind of uses html

skull_is_dull (36)

python, because you can make a lot of useful things

GillesDevillers (2)

C, because it’s simple (a lot more than those weird C++ syntaxes), powerful and fast!

Game_Collabs (14)

I'd stick with python.

Hacker22 (16)

JavaScript for SURE. With Node.js and an ejs (pretty sure thats still JS) template you can basically have JavaScript and HTML with a full server. And if you ever need more functionality that JS can't provide, just call an API, super easy!

SPQR (478)

C++ because of its sheer speed

Murzikal (22)

i only know python lol, so python i guess

mkhoi (213)

@Murzikal You cant write <insert language here> if you dont know <that language> 😁😁😁

Crissier (1)

C++ just because

Squrril (1)

Python 3, because it is simple, understandable, and beautiful. Unlike Java and C. No-wait! My favorite programming language is HTML. Definitely.

gladimdim (1)

Dart. because it compiles to native code on iOS and Android

Dopest_Pleb (15)

JavaScript, it's been a long 9 years.

kaldisberzins (282)

I love javascript and it is the language that I primarily code in but it would be severely limited by not being able to code in HTML or CSS. While it would be not impossible to code websites and would still be mostly possible to do some back end work, Javascript is still dependent on the other two for many things. Other languages, like the hybrid ejs or jsx for React would not be allowed as they are really blends of HTML and jasvascript. This limits it immensely. This is why I would probably switch to something like C or C++ because they are much more standalone than javascript.

JSer (1192)

@kaldisberzins but HTML and CSS are not programming languages

eankeen (926)

@kaldisberzins Using jsx is completely valid from my point of view! :P Have you thought about manually using those render functions minus the jsx? :wink:

Nanowrimoijk (39)

id go with JavaScript

minion3665 (13)

Javascript... and not lolcode (sorry lolcode)

liltaco (64)

JavaScript, unlike almost all other languages, is the building block of the web, so it will stay useful for a long time. It has a really modern and intuitive syntax if you use ES6+, can be used for servers, and unless you're programming high-performance code, it's my favorite language.

theangryepicbanana (1236)

I'd go with Perl 6 because it can do literally anything I need it to