DEV Community

Cover image for Why is your preferred programming language your go-to?
Ali Spittel
Ali Spittel

Posted on

Why is your preferred programming language your go-to?

I got asked on Twitter why I love Python so much, and I thought I would do a quick writeup, then open this up to a discussion on why your preferred language is your go-to.

Python was my first programming language, and it made me fall in love with writing code in the first place. I was able to write games and helpful scripts with very little programming experience. I also started my software engineering career with writing Python code for data science scripting. I'm not sure that my career would exist without the Python programming language, to be totally honest.

Python's syntax is so similar to written English. Its guiding principles are outlined in The Zen of Python, which is a poem that all programmers should take into account (I even named my blog after it and have it hanging on the wall in my apartment. Four lines in particular really speak to me:

Explicit is better than implicit.
Simple is better than complex.
Readability counts.
If the implementation is hard to explain, it's a bad idea.

I think those guidelines make the language easy to understand and write code with.

I also really appreciate how diverse the use cases are for it. Django makes creating web apps straightforward and extendible. Pandas makes data manipulation a breeze, and the data science libraries are unparalleled. It's also great for solving code challenges because of the utilities in the standard library. IPython notebooks are awesome for teaching and creating shareable and accessible code.

Some other notable features include:

  • list comprehensions, which are a really elegant way of transforming data
  • you can extend Python relatively easily with C or C++ which you can use to write faster-running utilities if needed
  • meaningful whitespace: I'm going to indent my code anyways, I should get something in return for that!
  • a great and supportive community behind the language

So, what is your go-to programming language and why?

Note: There are a lot of programming languages I have written code in, and I like a lot of them as well. Python is just the language that I do code challenges with. Also, totally understand that different languages are good for different things. This isn't meant to be a debate, just a display of love for languages that have been helpful for us!

Top comments (117)

Collapse
 
ben profile image
Ben Halpern

As might be clear from my entries to your challenges, Iโ€™m a Rubyist. I play around with other things, and explore different things, but Ruby captured my heart and I havenโ€™t looked back.

Iโ€™m super excited for Ruby 3.

Collapse
 
pavonz profile image
Andrea Pavoni

I've been a Rubyist for over a decade but, like you, I always explored new things, and now I settled mostly on Elixir as my go-to language for server-side web/apps.

I still use Ruby and Python for other quick/focused scripts or tasks.

I also appreciate Go, even if it's my last go-to, just when I need speed or portability (eg: deploy a binary in production)

Collapse
 
ondrejs profile image
Ondrej

Ruby is my second go-to language right after Kotlin (I do primarily mobile apps) :) Great choice, you can't go wrong with Ruby.

Collapse
 
ben profile image
Ben Halpern

Kotlin definitely seems to get a lot of things right

Collapse
 
pbnj profile image
Peter Benjamin (they/them)

Last time I worked with Ruby (3-4 years ago), I heard about the Ruby 3x3 initiative.
Any resource you can point me to for latest progress/news on Ruby v3?

Collapse
 
srowles profile image
Stephen Rowles

Go as it's a great all-rounder. Complied to native binary makes it simple to use for processing io and building tools.

Fast enough and safe enough to build microsevices in. Memory managed to I don't worry about malloc and free any more :)

Collapse
 
ondrejs profile image
Ondrej

I have also experimented with it and enjoyed it quite a lot, seems to be like pretty good replacement for C/C++.

Collapse
 
valorm profile image
Valorm

Am a go programmer too, at first I love C/C++.
Go is awesome and itโ€™s really fast ๐Ÿ’จ

Collapse
 
buphmin profile image
buphmin

I mostly use PHP and JS as those were the two languages I learned first. I can see how PHP and JS can be abused to write bad code, but so can any language. I recently used Go for a project where I needed plenty of threads and that was awesome, I love how simple Go is. PHP and JS are easy to use and as far as I know the two fastest scripting language (though JS cheats as it is all JIT now). JS has the benefit of being useful everywhere now and a must know for frontend web dev.

I have considered learning python, but I keep thinking there is nothing I can do in python that I can't do in PHP/JS and PHP/JS both run significantly faster in most cases than vanilla python (excluding pypy and cython). JS because it is JIT compiled, and PHP because of heavy caching plus a ton of built in C extensions which are of course very fast.

Collapse
 
filips profile image
Filip ล 

Main problem with PHP is that it was not so good in the past (before PHP 7 and PHP 5). It was slow and it had some weird functionalities. But with release of PHP 7 (and PHP 8), PSR standards and frameworks like Laravel and Symphony, it has improved a lot. It's very fast and with JIT coming in PHP 8 will be even faster.

Other big problem is that is is very easy for beginners. And beginners obviously don't write so good code. This is also reason why many people think that (all) code in PHP is bad.

Collapse
 
david_j_eddy profile image
David J Eddy

Additionally: PHP is a beast of a web language. With the upcoming 7.3 release being 200% faster than the 5.6 release performance is only getting better.

Collapse
 
nicolus profile image
Nicolus • Edited

It is one of the fastest scripting languages, and it will become even faster when JIT is implemented (like an order of magnitude faster). That won't make a difference in web apps because computing is never the bottleneck (it's usually I/O bound : loading 1000s of classes from your favorite framework and querying an API or SQL server that's not even on the same machine comes at a cost), but it could make PHP usable for domains in which nobody would consider using PHP/Python/Ruby today, like heavy scientific computations, image processing, 3d rendering or IA.

Preloading (coming in 7.4) on the other hand could help quite a bit on the I/O side.

Collapse
 
simoroshka profile image
Anna Simoroshka • Edited

I started learning programming with C++ (go-to language for the first 3-4 years in uni), then there was Java, PHP, a bit of Python, a bit of Ruby on Rails...
Somewhere in between I had to do a project with animations, and I used canvas and Javascript. Javascript was SO weird! I remember banging my head on the table because of "functions are objects and you can pass them around" while things like closures simply made me want to run away. Nothing made much sense.
But then it became familiar. Like in romance movies, hate transformed into love.
I like the flexibility. I like how it looks. Everything seems a bit easier when I code it in JS.

Collapse
 
ld00d profile image
Brian Lampe

I'm going to be the weirdo here: I don't have a go-to programming language.

I like python. It's nice for simplicity, and I'm ok with the whitespace thing. I never get to apply this skill professionally though.

I like javascript. It's everywhere. It's got some warts, but it's pretty simple to hammer stuff out.

I like java. Tools like Spring Boot where almost anything you want to do is there already, and you can build pretty big things with a couple of config classes, a few interfaces, and some annotations.

Collapse
 
latetide profile image
LateTide

Same here, mostly any of these three or c#, when it comes to programming.
The only reason I use JS more than the others is that it's really simple to just open the console in Chrome and start typing...

Collapse
 
leoat12 profile image
Leonardo Teteo • Edited

I have two preferable languages depending on the situation: Java and TypeScript.
Java is the language I use professionally, I am a web developer who loves Spring Boot and what it has to offer. The combination of Java maturity and Spring Boot ease of use made me love the Java language, before I used to see C# as the go-to language, but after I knew Java well, I fell in love. It is great to see that decades of well organized community driven development is at your back. You can find any solution for anything in Java and most of the time the solution is very elegant as well. People may say that it is verbose, but I think it has the vocabulary necessary to transmit what needs to be transmitted to the developer. It has the best libraries and the best exception handling as well, it is easy to find where is the problem, something that I didn't find in any language, unless, maybe, C#.

TypeScript is Javascript for the statically typed language fans. You are almost forced to know Javascript nowadays, but Javascript really bothered me with its, in my opinion, unsafe way of dealing with types, I have come from Java, it is something I don't tolerate. Therefore, TypeScript has been incredible for me, it reminds me a lot Java (and Kotlin), which makes me feel more comfortable and I can use the fast development and prototype of JavaScript and NodeJS.

So, I tend to use Java for work related things, web development and serious projects and TypeScript for quick projects, prototyping, etc.

Honorable mentions: the growing desire to come back to C# and learn it well, I think it is important and it is probably not that far from Java. I think it is good to have both Java and C# under your belt, but I didn't find the time to do so until now. Python is a language that I never liked and probably never will, it is just not for me, I need curly braces in my life... hahaha

Collapse
 
kaelscion profile image
kaelscion

the growing desire to come back to C# and learn it well, I think it is important and it is probably not that far from Java

I've felt this urge at times as well as I started with C#, but am a Python/Julia guy now. I will say as well that Java and C# are, in my opinion, sister languages in a lot of ways. If you know one, you are likely able to read the other and know what is going on for the most part. They were also designed with similar problems in mind, for similar use cases, and inspired by similar languages. They were just developed at different companies. I ultimately believe that Java is more widely used due to its portability, whereas C# is used by pretty much any business that runs the Microsoft stack. Sorry, let me rephrase that: pretty much any business :P.

However, in the days where the JVM runs more than just Java and C# is now cross-platform (weird), they may be actually becoming more similar than they've ever been. I'm actually hugely interested to see the future of these two languages.

Collapse
 
leoat12 profile image
Leonardo Teteo • Edited

Yes, that's true, C# and Java are very similar in many ways, except for a few different ways with doing things and writing things. It is somewhat the difference between dialects of a same language, I think. The different is mostly how things are done, for example dependency injection, database interaction, etc. In these areas they are very different, but it is a matter of framework, not language itself.
Here where I live I see that there are a 50/50 ratio between Java and C# and it would be great for my career to know both. This weekend I decided to have a "C# Weekend", I'm rewriting a application I did for fun and practice in Java and Spring to C# and APS.NET Core. Probably, I will write an article about my impressions regarding this rewriting. :)

Thread Thread
 
kaelscion profile image
kaelscion

I would read the crap out of that article. I left the C# world behind when .NET 4.5 was new and C# 5 was the latest version of the language so, suffice to say, I'm well removed from the C family nowadays. But I would love to see something that was written in Java, not only re-written into modern C#, but in the .NET Core repackaging of The .NET Framework. I've read a bit about .NET Core, but am not really sure if it is Microsoft doing its usual thing of acquiring a company (in this case Xamarin) then giving their founders a big middle finger by ripping their product apart, taking what they like, and throwing the rest away, telling Mono to go shove it, or an actual attempt to encourage a cross-platform, open sourced world. I like Microsoft's new direction. I really like how Satya Nadella, when first given his position, was expected to do a bunch of stuff, and in many cases had it demanded of him by the board, and instead kind of just said "That's nice. But Azure is my baby, I'm a cloud guy at heart. So guess what? We're going after AWS's cloud service. Oh, and we're going to do it by showing Google their not the only open playground of the big 5. Cheers fellas, I've got a company to run." But, I'm also relatively sure that at least part of that was, more or less, a PR stunt to help all of us skeptics believe that a "maverick" had taken MS by the ears and is leading a bright new revolution in tech and don't really trust it as far as I can grow a grand piano full of molten lead. It would be interesting to see the comparison either way though :D

Collapse
 
swizzard profile image
sam

i write python for my job, but if i had my druthers i'd be writing haskell all the time. it's concise and elegant, and things like type classes, algebraic data types, and higher-kinded types (not to mention the concept of kinds in general) are things i miss when writing other languages

Collapse
 
kspeakman profile image
Kasey Speakman

Props for the colloquialism โ€œdruthersโ€. ๐Ÿ‘

Collapse
 
ondrejs profile image
Ondrej

I would recommend you Elm language if you like Haskell. Pure functional language suitable for beginners.

Collapse
 
swizzard profile image
sam

I actually looked into Elm--it's got a lot to recommend it, but I'm not super keen on the way the language and community is managed. If you like Elm, you should give PureScript a try--it's heavily Haskell-influenced and compiles to JavaScript, plus it has (imo) a better way of dealing with interoperation, not to mention fun stuff like row polymorphism.

Thread Thread
 
ondrejs profile image
Ondrej

I know PureScript, I have seen a lot of talks about it, but it's a bit mathematical voodoo to me. Note, that I do not work as a frontend developer, but I do mobile apps in Kotlin, so everything else is just more or less hobby to me.

Collapse
 
lincolnsand profile image
LincolnSand

I love haskell too. It's not my go to though. I would choose java or python (the languages I know best) or maybe C (I don't know very much C, but I sometimes have to use it. I like C more than java).

Collapse
 
caseycole589 profile image
Casey Cole

Perl because it gives me power to do anything simply

Collapse
 
kaelscion profile image
kaelscion

I'm a Python guy through and through. I started my career with C#, which was a bit of a difficult first language to be honest. Back then, I didn't think about what was going on under the hood as I could barely even remember what to type. But I truly hated how much code it took for everything


public static void main(string, args[]{
  string wth = "why?!? Why so many dang characters to define a simple method?!?!?";

)}

Now, I've not written a single line of C# code in 5 years so there are probably a ton of mistakes above. But if you've come from a C language to a high level scripting language like Python, Julia, Go, or Ruby and you can look me in the eye and tell me that the above C# example didn't make your sphincter tighten a little bit, then you are a dirty dirty liar ๐Ÿ˜‹๐Ÿ˜‹๐Ÿ˜‹.

What I love most about Python is that it teaches you to think in code. The syntax and ease of use allowed you to translate ideas in your head into code so easily its insane. A lot of folks feel that this kind of easy syntax makes programmers weak and squishy, but I disagree. I would consider a strong programmer somebody who can think through a problem while doing something else, figure out a solution, then simply sit down and type it out and watch it build and work correctly rather than trying to remember what that curly brace is supposed to go.

Our job is to build solutions and solve problems efficiently, effectively and quickly. Does expertise in using a sword give you bragging rights? Yes, of course. Will a beginner with a gun kill you in open space from 30 feet away? Absolutely and bragging rights be damned. But different languages have different strengths and use cases. One size never fits all and I have a lot of trouble not trying to solve a problem with python that would be better suited to Go or Rust or Haskell.

Either way, I love using Python because I can code thoughts like writing notes in a notebook. If I want some functionality, I like that Python makes it easy to translate that thought into code and test it quickly rather than fighting the compiler.

Collapse
 
lincolnsand profile image
LincolnSand

I think dynamically/weakly typed languages are a bomb waiting to explode. I think statically typed is the way to go. But I do use python a lot and it was my first language.

Collapse
 
kaelscion profile image
kaelscion

A lot of folks feel that way and I can't say that defining the type of data that goes into a variable or data set is not a huge advantage in a lot of ways. But I also think that dynamic typing has its place as well. In my opinion, having used both, I think the typing system of a language is less important than knowing how to use the typing system of your language of choice. Good code is good code and bad code is bad code. Although, I will totally admit that static typing does make it easer to write certain types of code well, it has its own set of issues. But I will also be the first to admit that Python, and languages like it, are far from perfect despite their popularity. Still my favorite language though! (Although, I have been looking at Rust's performance and memory/thread safety lately, and am thinking of starting to move some of my more speed-centric projects over to it. Don't tell Python yet thought cuz she doesn't know and I want her to be ready to move on with her life before I bring in a step-mom for her in the shape of Rust. It can be so tough for kids to see their dad get re-married just before they leave for college...)

Collapse
 
chenge profile image
chenge

My languages team:


              Ruby

     Go                  Nodejs



        Rust    Elixir  Clojure

Ruby, everything is a object and care programmers happy.
Go favor simple.
Nodejs is popular.
Rust has some new idea.
Elixir' author often say beautiful code.
Clojure, everything in ().

Some comments may only be visible to logged-in visitors. Sign in to view all comments.