r/computerscience • • Mar 25 '20

What's your favoured programming language?

I know most of you would use different languages for different purposes, but say there was a quick problem you wanted to solve or something you wanted to test; which one would you use?

I thought it would be interesting to see the spread on this subreddit!

Mar 30 '20
994 Java
2080 Python
378 C
767 C++
385 JavaScript
55 Ruby
212 Upvotes

161 comments sorted by

143

u/[deleted] Mar 25 '20

Dude, no C#?

27

u/arcadianheathen Mar 25 '20

I would definitely have included C# but reddit polls only allow 6 options at most.

153

u/may_be_indecisive Mar 25 '20

So you chose Ruby? Lol

21

u/slappyredcheeks Mar 25 '20

My thoughts exactly. I wonder what OP's choice is.

23

u/arcadianheathen Mar 25 '20

I use Lua mostly. Didn't include it as I haven't met too many other people that work with it much. Looks like ruby was a bad choice to include haha.

3

u/yugerthoan Mar 25 '20

As language ruby is cool. The implementation I know isn't as fast as I would like it to be.

7

u/slappyredcheeks Mar 25 '20

Maybe not. It looks like Ruby sees more use than C#.

https://madnight.github.io/githut/#/pull_requests/2019/4

10

u/molybedenum Mar 25 '20

A quick google search indicates that employment statistics trend the opposite way, with C# having more relevance than Ruby.

4

u/slappyredcheeks Mar 25 '20

True but it doesn't justify being incredulous over OP's choice to include Ruby over C#.

1

u/xPURE_AcIDx Mar 25 '20

Doesnt include private repos or non github repos. Useless statistic.

0

u/slappyredcheeks Mar 25 '20

claiming statistic is useless because it doesn't include everything in its sample

I think you should freshen up your understanding of how statistics work.

2

u/xPURE_AcIDx Mar 25 '20

You made the claim that said Ruby has more use then C#.

Your source doesn't provide enough evidence to make that claim.

You made the assumption that rates of use of Ruby and C# would be similar between public github repositories and everything else. An assumption which I'm not on board with. You're comparing open source github development to private (or non github) development. The languages used by corporations (using private repos) is different then what a open source developer might use.

2

u/legato_gelato Mar 26 '20

True, whoever is downvoting you is a moron. C# is HUGE for enterprise and a lot of that is closed source. Ruby was hip in open source a few years ago before it died a fiery death. I think there's just a lot of clueless people in this thread.

2

u/SanJJ_1 Mar 25 '20

what's wrong with Ruby

1

u/legato_gelato Mar 26 '20

Dead ecosystem for one

-1

u/[deleted] Mar 25 '20

My thoughts exactly lol

5

u/AshIsRightHere Mar 25 '20

C# is where it's at. You can do so much in so little time with it.

4

u/may_be_indecisive Mar 25 '20

I think you meant to say Python. But yes C# is a close second. But it's still much more verbose than Python.

7

u/AshIsRightHere Mar 25 '20

Python is good too, my first language actually. I just like how easy you can make desktop programs with winforms.

2

u/molybedenum Mar 26 '20

Honestly, this is true for any language with a great set of foundational libraries, as long as it’s a language that someone is familiar with.

Proficiency is a huge factor.

1

u/Peter_See Mar 25 '20

Im more impressed reddit has polls now

1

u/JalapenoxD Mar 26 '20

And HTML

/s

-3

u/[deleted] Mar 25 '20

If C# is your favorite language you should try something new

2

u/legato_gelato Mar 26 '20

Why don't you name a language that targets the same problems and is better? Your comment is basically saying hammers are stupid

1

u/[deleted] Mar 26 '20

Yeah I mean I use hammers all day and I have splinters and the head flies off and hits me in the face all the time so I just prefer to use Python.

2

u/legato_gelato Mar 26 '20

If you think Python and C# targets the same problems and that one is a clear winner without specifying the problem then you need to go outside your regular domain for sure :)

If it's a 15 lines script that you will never need to refactor or expand then sure, but if we're talking something larger then the problem needs more clarification in order to choose.

0

u/[deleted] Mar 26 '20

Sure, I've made a large distributed API server with a worker queue running on kubernetes in Python. If you don't want to take my word for it, Dropbox and Spotify both have engineering blogs and both use Python for all of their critical systems.

Anything C# can do Python can do it in half the lines or less. The best .Net systems I can think of besides Microsoft's own services belong to stack overflow. Good engineering blog as well.

1

u/Dx2x Mar 28 '20

You must be really bad at using hammers.

0

u/[deleted] Mar 26 '20

[deleted]

2

u/legato_gelato Mar 26 '20

How so, it's often praised for the exact opposite? You clearly have no idea what you're talking about, I'm actually curious how you could ever justify that comment?

It was was significantly better than Java early on (lambdas, no type erasure, LINQ, "Fluent API") and now Java has barely cached up to the basic features many years later, while C# has moved on to proper null safety, recursive pattern matching, proper tuple support etc.

There's plenty of good languages on the JVM though, but Java itself is basically legacy. Even Android development which kept it alive for green field projects quickly moved on to Kotlin which shares many features with C#.

0

u/[deleted] Mar 26 '20

[deleted]

1

u/legato_gelato Mar 26 '20

Pretty sure you edited that in after my comment

0

u/YoMommaJokeBot Mar 26 '20

Not as wrong as joe mom


I am a bot. Downvote to remove. PM me if there's anything for me to know!

1

u/[deleted] Mar 26 '20

It’s actually exactly the opposite in most aspects. C# LINQ makes API development a breeze

32

u/xSp00n3r Mar 25 '20

Where is Go?

28

u/Gunslinging_Gamer Mar 25 '20

Gone !

4

u/[deleted] Mar 25 '20

Gone is my favorite language bruh

3

u/arcadianheathen Mar 25 '20

I should've added it in place of Ruby I think.

3

u/legato_gelato Mar 26 '20 edited Mar 26 '20

You should have added C# instead of Ruby.

If you want to expand the list then Go and Rust could be added as those are wildly popular on reddit but those have niche use cases.

Go targets huge onboarding or churn of junior devs by keeping it simple, as explicitly stated as a design goal by Rob Pike. This is in many people's opinion, including mine, at the cost of expressiveness and verbosity.

Rust targets low level systems programming with better memory safety, and is generally a better alternative to c++.

The thing is those are not really the same use case, so it doesn't make sense to ask which is better. A more useful poll would explain the problem at hand and ask which language people would choose. Even so, it should also be clear if you are choosing a language for a personal project or for a company. I would never pick Go for a personal project (until they finish some of their current drafts), but would choose it for a certain kind of company profile.

Edit: Didn't vote given the choices, but didn't see you already stated that it should be a quick problem. It doesn't really change most of the comment, but then I think Rust is not a great fit unless it needs to be very performant and low level.

2

u/[deleted] Mar 25 '20

Go is a fantastic language, I really enjoyed the chance I got to use it on a professional level. Sadly that job didn't last and now I'm just looking for some open source projects to maintain my knowledge.

6

u/m4xxp0wer Mar 25 '20

Lua

4

u/arcadianheathen Mar 25 '20

I use Lua as well actually. Didn't include in poll though.

75

u/KaranasToll Mar 25 '20

Reddit polls are showing their short commings. Needs to allow more options and any user should be able to add options. LISP.

12

u/ivandagiant Mar 25 '20

I'm surprised it came out so limited. Other platforms have already made this type of post before, why couldn't they just copy their ideas

2

u/Sylicas Mar 26 '20

Allowing more options is great, but the second option sounds really abusable loo

1

u/futlapperl Apr 01 '20

I know this is late, but maybe only show the ten most-popular options but still let users type in custom responses. So if enough people type the same thing, it'll start showing up. Something like that; I haven't thought this through much more.

3

u/WarmodelMonger Mar 26 '20

Do want you want... but LISP???? wtf!

1

u/KaranasToll Mar 26 '20

I want paradigm agnostic, expressive, creativity enabling, interactive, meta programming.

1

u/WarmodelMonger Mar 26 '20

So no work done, got it!

1

u/KaranasToll Mar 26 '20

Ah, huh... I don't see the correlation. No reason work can't be fun.

1

u/WarmodelMonger Mar 26 '20

that may be part of the problem

3

u/xxhomiekidcringe Mar 25 '20

Maybe you can code it so that it does.

9

u/KaranasToll Mar 25 '20

I don't think reddit is open source.

3

u/[deleted] Mar 25 '20

petition time? /s

2

u/[deleted] Mar 25 '20

Just make a vote bot

86

u/Gunslinging_Gamer Mar 25 '20

Assembly

40

u/crownu Mar 25 '20

Madlad

8

u/[deleted] Mar 25 '20

Brainfuck ftw

2

u/Hallsville3 Mar 25 '20

1

u/[deleted] Mar 26 '20

Writing an interpreter and this sort of thing is quite easy for bf. I have a repo in cpp set up but still haven't started because procrastination i guess Anyways, well done! It's actually nice to have "designed an interpreter" in your resume!

3

u/Hallsville3 Mar 26 '20

Haha thanks, I just am excited whenever someone mentions bf and thought I’d drop it here.

0

u/[deleted] Mar 25 '20

[deleted]

3

u/gbbofh Mar 26 '20

C is also my go-to language. Python is a close second if I'm prototyping something big, and C++ if I need to prototype something of similar scale but I also need it to run quicker than Python can allow.

2

u/Peter_See Mar 25 '20

Ah yes i have this quick problem to solve now I ju... Ok now i just gotta find the segmentation fault and then I can go back to solv... Alrighty char* types cant be used in that... String? No.... 4 hrs later finally, i can start solving that quick problem!

2

u/gbbofh Mar 26 '20

If it takes you four hours to do something in C that is "small", you're doing something very wrong. C is not that hard of a language to use, and debuggers exist for a reason.

3

u/mymar101 Mar 25 '20

My favorite isn't on there. C#

3

u/arcadianheathen Mar 26 '20

Yup that seems to be a recurring theme in this comment section.

0

u/mymar101 Mar 26 '20

I think it’s a silent majority who think it’s a good language.

28

u/ropa1998 Mar 25 '20

What about Scala, Haskell or Rust?

4

u/SV-97 Mar 25 '20

They're orders of magnitude behind the other languages in the poll. I too love Haskell and Rust but given that stuff like C# and Go isn't in the poll really means that the more uncommon language have no business being there either

1

u/sk0gg1es Sr. Software Engineer Mar 26 '20

Scala

Can't believe you're the only person here to mention Scala. By far my preferred language.

13

u/[deleted] Mar 25 '20

writing this before opening the poll. top option is gonna be python

edit: lol

45

u/acroporaguardian Mar 25 '20

Everyones bored I see so I'll toss a hand grenade: C is the only one that can make all the others. C++ can make the others, except C wins that because C can mimic OOP with its own structures whereas C++ would have to simply... not use portions of it to mimic C.

Discuss and flame away.

Also, for added discussion, I would have picked HTML had it been a choice. We all know that one is top notch!

25

u/Nixin72 Mar 25 '20

Makes C compiler in JavaScript just to prove a point

But almost any language can accomplish almost any task, it's not about what features you can mimic in a given language - otherwise Lisp would reign supreme!

10

u/Peter_See Mar 25 '20

laughs in Prolog

-3

u/acroporaguardian Mar 25 '20

But the JavaScript itself needs to go through several translations to get to machine code. C basically is assembler, thats my point. C goes directly to ASM on your machine.

Only thing that can trounce C is ASM in terms of "I can do everything!"

11

u/Nixin72 Mar 25 '20

C maps better to assembly than JS, sure, but C needs to go through a huge number of translations to get to machine code as well, it's very far from just C -> ASM. GCC has up to over 200 passes in its compiler depending on your level of optimization. And if you're using clang that's even more of a false statement since C needs to go through the LLVM IR, which another formally specified language completely independent from clang (although clang is part of the LLVM project, LLVM compiler tools are meant to be harnessed by any language that has bindings to its API. Rust and Swift for example have the same compiler backend as C-clang)

And saying no other language can do as much as C is simply false. There's many languages designed to work at the level C can. Even high level languages such as Scheme have low level implementations to make embedded software with small additions to remove garbage collection and add pointers. But other notable languages like Rust and Ada can do the same stuff as C, they'll just help you not shoot yourself in the foot like C allows you to do - things you'd very rarely want to do in practice. And even at that, Rust lets you go wild with unsafe blocks.

-5

u/acroporaguardian Mar 25 '20

Rust wasnt in the poll.

5

u/Nixin72 Mar 25 '20

Neither was ASM. Didn't realize we were only talking about languages in the poll.

-7

u/acroporaguardian Mar 25 '20

C is most ASM like, that was my point. Had ASM ben on there, itd win. C++ is close but you can do OOP in C.

JavaScipt and Python are interpreted for all intents and so is lesser than C++ and C. Java is slower.

5

u/Nixin72 Mar 25 '20

Had ASM been on there, it'd win

Statistics disagrees with you

JavaScript and Python are interpreted for all intents

Again, you're wrong. I don't know about Python as much, but JS is JIT interpreted, same as Java, just using its own VM not JVM:

https://blog.sessionstack.com/how-javascript-works-inside-the-v8-engine-5-tips-on-how-to-write-optimized-code-ac089e62b12e

Edit: formatting

-10

u/acroporaguardian Mar 25 '20

lol whatever. Its getting nitpicky. JS is not on same level as C.

The joke of the original comment is I knew CS nerds would come out. I prob got more programming accomplishments than 99% on here (look at my post history for my upcoming game).

The joke is, languages are what students argue about.

8

u/Nixin72 Mar 25 '20

Its getting nitpicky

No, it's not. Both things you said were way off their mark - one of them statistically by 60%. I'm not being nitpicky.

JS is not on the same level as C

I never said JS was at the same level as C, I made a joke about making a C compiler in JS - very different. Which you then turned into an argument about languages, which "only students do"...

I prob got more programming accomplishments than 99% on here

Really? That's what you're going to resort to? Accomplishments you have don't make you any more right. I don't care about your accomplishments - you're saying things that are false. And for what it's worth, everyone on here has different accomplishments that are huge in their own way. For some, getting accepted to uni is as big an accomplishment as getting your PhD in Applied Econ. Accomplishments mean nothing when you're saying things that are wrong.

Good luck on your game and I hope you're out of your shitty sounding job now, that's rough. I know what micromanagers are like, it's the worst.

→ More replies (0)

5

u/[deleted] Mar 25 '20

I prob got more programming accomplishments than 99% on here

You have a few posts showing off an unimpressive side project that the vast majority of people here are capable of. Get over yourself.

→ More replies (0)

4

u/ljdelight Mar 25 '20

You ignored 95% of that reply. No comment on C compilers now being written in C, much like JavaScript can compile C?

1

u/SV-97 Mar 25 '20

C goes through various intermediate forms in the same way that Haskell goes through various intermediate forms and there's nothing that would prevent you from writing a javascript ahead of time compiler. Also: https://queue.acm.org/detail.cfm?id=3212479

4

u/frankist Mar 26 '20

C cannot mimic C++ template metaprogramming even with macros

2

u/whoisdravenlol Mar 25 '20

C stands for Cancer though

13

u/Lazyspartan101 Mar 25 '20

No Rust or Go 😢

6

u/[deleted] Mar 25 '20

no rust :angry:

1

u/w8cycle Mar 25 '20

Same. I had to pick Java as a second placer.

27

u/[deleted] Mar 25 '20

I think this vote is rigged from the start. You shouldn't put Python here ;)

4

u/xxhomiekidcringe Mar 25 '20

Pretty much all the C’s.

4

u/[deleted] Mar 25 '20

No haskell/purescript/rust/ocaml/scheme any one of them would have been great.

4

u/xPURE_AcIDx Mar 25 '20

C/C++ should be on the same line.

You can write a C++ program using mostly C syntax if you wanted. Obviously there are some differences, but they're more the same then they are different.

Like you'll be using the same IDEs, the same builders (like CMake, Ninja, etc), the same targets (you're not writing Java for an STM32 or a system driver are you?) , etc.

13

u/doppleres Mar 25 '20

Unpopular opinion, but where are my PHP people at?

0

u/[deleted] Mar 25 '20

[deleted]

4

u/Keroths Mar 25 '20

/unjerk

2001

/jerk

7

u/Yak-4-President Mar 25 '20

I would say Java is my favourite for getting it to do what I want. But Python is close second because it feels like cheating at programming :)

13

u/Peter_See Mar 25 '20

I resisted python for so long. "No datatypes? Ridiculous. Pre-allocating lists? No?? What a silly language"

But now call me snake charmer jim cause i love me some python in my bum

8

u/Nixin72 Mar 25 '20

Voted JS, but favourite is Lisp.

2

u/seanprefect Mar 25 '20

Groovy, but i'll settle for kotlin.

2

u/[deleted] Mar 25 '20

Lisp

2

u/CFan62 Mar 25 '20

What about Scratch? The OG programming language

4

u/-I-D-G-A-F- Mar 25 '20

No php no vote

1

u/_abscessedwound Mar 26 '20

You absolute savage

3

u/[deleted] Mar 25 '20

No C#? Really?

2

u/Jakeonehalf Mar 25 '20

What, no HTML?!

1

u/GPhykos Mar 25 '20

It has been 4 years since I started using Ruby and man, I love it so fucking much

1

u/caykroyd Mar 25 '20

Most of these aren't very good choices for "a quick problem you want to solve", but for other uses. I think your question is biased

2

u/Peter_See Mar 25 '20

I'd say python fits that bill pretty well. Avoid most memory and allocation issues, datatypes, syntax is easy pz.

1

u/caykroyd Mar 26 '20

Yep, that's exactly what I meant. I think the answers to "which is the best programming language?" and "which programming language is the most useful when you want to code short, quick solutions?" are NOT necessarily the same.

The phrasing in OP's question made it more likely that people will answer "python" instead of "C++", for example, even though they might prefer the latter overall.

1

u/skipper1931 Mar 25 '20

It depends really

If I need to test something quickly I’ll probably go with whatever I have the tools for, which on my current Linux instead would be C/C++

If I’m making a desktop app or some kind of server backend I’d do C# with dotnet core

If Im really bored I’ll do assembly

2

u/Peter_See Mar 25 '20

If your really really bored try prolog.

1

u/throwawaydyingalone Mar 25 '20

Matlab > Ruby

1

u/sunhye_ Mar 26 '20

Hold up. Matlab is a programming language??

/s

((( Please don’t kill me. I actually like Matlab )))

1

u/[deleted] Mar 25 '20

No Kotlin... had to choose Java.

1

u/o4ub Computer Scientist Mar 25 '20

If I have to test something that need a bit of structure, I'll go C. If I need a quick tool to do anything else, probably would go for bash.

1

u/Zewcuh Mar 25 '20

Clojure

1

u/c3534l Mar 25 '20

Ah yes, the 6 programming languages.

Of course I like Rust, Haskell, and Elixir, for my low-level, high-level, and dynamic interpreted (respectively) coding. If I have to go C-like, I'm going Go, but the fact that generics/parametric polymorphism has been relegated to an afterthought is a kind of shockingly stupid design decision. I'm best at Python, but I like it less and less as time goes on. It's just too mushy and wishy-washy. But it's fine for, say, math and data science.

1

u/[deleted] Mar 25 '20

My favorite would be Erlang. The second favorite would be C#. Lately looking at Rust. None of those are in the list. I work with Java and C++ a lot, but I wouldn't pick em as favorites.

1

u/Stevecaboose Staff Engineer Mar 25 '20

C# hands down

1

u/[deleted] Mar 25 '20

Uhh.... C#

1

u/Z1ndabad Mar 26 '20

Where’s Visual Basic? /s

1

u/[deleted] Mar 26 '20

Did not expect c++ to fall so far behind. also, to make room for more options, c and c++ could be combined, java and c# could be combined etc.

1

u/[deleted] Mar 26 '20

java

1

u/b1uetruth Mar 26 '20

Python is top, really? Damn, I mean I’m only a freshmen in college and have only done JS, Python and Java, but Python is such a bitch to work with so far. Primarily the problem of conversion errors and list indices just make me so annoyed.

Then again I’m just a noob so

1

u/2Tori Mar 26 '20

I enjoy more C++ code because I spent a good amount of time on it. For a quick test Python is the way to go.

1

u/WarmodelMonger Mar 26 '20

Java but no .Net?

1

u/Nkg19 Mar 26 '20

For a quick program, python is always my choice, as It has a library for everything. So for small task, the python code is hardly over 50 lines.

1

u/Disaster_Expert Mar 25 '20

Perhaps turn JavaScript into JavaScript / TypeScript.

1

u/[deleted] Mar 25 '20

cries in swift

1

u/[deleted] Mar 25 '20

Python, for sure. It "just works". It's easy to write something. I am a researcher so easy to use languages are a must.

1

u/[deleted] Mar 25 '20

( _/ ) C#

1

u/_________KB_________ Mar 25 '20

C# is my favorite, but since its not on there I had to go with C++ as my second choice.

1

u/325Gerbils Mar 25 '20

Other - Go

-1

u/entwie_dumayla Mar 25 '20

Everybody knows c++ is the best or you are wrong...

3

u/Peter_See Mar 25 '20

I guess im wrong because c++ makes me wanna commit straight sudoku

0

u/scherado Mar 25 '20

Well, of course it does depend on the task. APL2. (interpretive)

0

u/RippledBarbecue Mar 25 '20

C# but in the absence of C# I go Python,C++ and finally JS for languages I've used.

0

u/bovine_scatology Mar 25 '20

If I Haskell was an option, I would've chosen it.

0

u/_Jokily_ Mar 25 '20

Where is Assambler?! 😂

0

u/[deleted] Mar 25 '20

Rust! If I was just throwing something down real quick just to see, I'd probably use javascript. From this list, if I care about it, C. If I want classes, Java. Python can go suck a big fat one, it's the dumbest language to exist and I wish it a painful death.

-1

u/acroporaguardian Mar 25 '20

God I hate people who reddit like you do

0

u/[deleted] Mar 25 '20

[deleted]

3

u/[deleted] Mar 26 '20

LOGO anybody? the one in which we move the turtle.

-2

u/Peter_See Mar 25 '20

You obviously havnt used prolog. The most usefullest of the languages

0

u/[deleted] Mar 25 '20

[deleted]

1

u/Peter_See Mar 25 '20

Why not just use python script interface instead of shell? So much faster to implement ideas

2

u/o4ub Computer Scientist Mar 25 '20

Because I know much better bash than python, and I love piping my commands !

2

u/Peter_See Mar 26 '20

Far be it from me to get between a man/woman and their pipes

0

u/[deleted] Mar 25 '20

[deleted]

8

u/arcadianheathen Mar 25 '20

Reddit polls only take 6 options =)

3

u/juhotuho10 Mar 25 '20

Didn't know that you can poll on reddit, would be nice if they implemented a way to format a polling options into your post or a comment

4

u/arcadianheathen Mar 25 '20

I think it's a new feature. It was released yesterday I think.