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!

Oldest comments (117)

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
 
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
 
kspeakman profile image
Kasey Speakman

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

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
 
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
 
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
 
hananezlitni profile image
Hanane

My first programming language was Java, which was my go-to language throughout my undergrad studies. I then learned JavaScript as I started getting deep into web development.
Getting into JavaScript was easy for me since I already knew the fundamentals and syntax of Java, and it slowly became my new go-to language. I really love its flexibility, how dynamic it is and the big variety of frameworks it has. If I'm trying to think of an implementation for a problem, I always find myself thinking in JavaScript.

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
 
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
 
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
 
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
 
netmailgopi profile image
Gopi Ravi

Python is an all-rounder. You can do anything from basic scripting to big
data to running websites. I've used Vbs, Shell, PowerShell for different things over time and python can do everything they can do and may be more. The libraries are so vast and diverse, letting lot of possibilities a reality. I've used Django and it's simple and fantastic.

Collapse
 
ondrejs profile image
Ondrej

Kotlin because it's general purpose and is so elegant. Python is also ok, but i like it only for scripting (I do not like OOP in Python because IMO it's not primarily designed for it). Ruby is IMHO much more elegant, flexible and naturally object-oriented. In terms of usability nothing beats JS though.

Collapse
 
andrewchou profile image
Andrew Chou

As my first language, Python used to be my go-to mostly because it let me build things out quickly without many barriers.

Nowadays, I spend my days (and nights) focusing on web development so I'm writing a lot more JavaScript. It's not necessarily my favorite language but I've gotten comfortable with it because I use it so often now. I think the added context of working with a browser and DOM gives it a really fascinating ecosystem, so it's always going to keep me attached to some extent.

I will say that I've been learning Go on my own time and it's slowly becoming my go-to if we're talking about language design. I generally prefer simplicity and readability in a language and I think Go is great at that compared to other languages, despite its known shortcomings. I'm hoping it won't be long before I actually start using it for personal projects and other endeavors.

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
 
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
 
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
 
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...)

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