r/computerscience • u/arcadianheathen • 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!
32
u/xSp00n3r Mar 25 '20
Where is Go?
28
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
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
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
3
u/xxhomiekidcringe Mar 25 '20
Maybe you can code it so that it does.
9
86
u/Gunslinging_Gamer Mar 25 '20
Assembly
40
8
Mar 25 '20
Brainfuck ftw
2
u/Hallsville3 Mar 25 '20
1
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
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
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
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
-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:
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
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
2
13
6
27
4
4
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
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
2
2
2
4
3
2
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
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
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
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
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
1
1
1
1
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
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
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
1
1
1
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
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
-1
0
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
0
0
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
0
0
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
0
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
143
u/[deleted] Mar 25 '20
Dude, no C#?