# "Python is undoubtedly faster in helping programmers express their concept in fewer lines of code"

**URL:** <https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872>\
**Category:** Offtopic\
**Created:** [September 1, 2020, 1:21am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872 "2020-09-01T01:21:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaymondLing](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daymondling/32/8474_2.png) [@DaymondLing](https://discourse.julialang.org/u/DaymondLing)\
**Post date:** [September 1, 2020, 1:21am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/1 "2020-09-01T01:21:02Z")

</div>

[Julia vs Python: Which is best for Data Science? | TechGig](https://content.techgig.com/julia-vs-python-which-is-best-for-data-science/articleshow/77832810.cms) says “Python is undoubtedly faster in helping programmers express their concept in fewer lines of code”.

Really? I find Julia can express mathematical ideas very succinctly, it’s almost literal translation of algorithm straight into code. I find it quite the opposite actually - Python code tend to be a bit more verbose due to numpy syntax.

What do you think? What’s your experience been?

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [September 1, 2020, 1:34am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/2 "2020-09-01T01:34:44Z")

</div>

I think you will find most people on this website consider Julia to be better. Julia is one of the most (if not the most) expressive programming languages.

Python is a bit ugly in my opinion, but I don’t mind that some people still prefer it, that’s up to them.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [September 1, 2020, 2:30am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/3 "2020-09-01T02:30:33Z")

</div>

> [@DaymondLing](#):
>
> Python is undoubtedly faster in helping programmers express their concept in fewer lines of code

These kind of sentences makes me wince. If a program is faster (in terms of human coding), then they may not have as few lines of code as python, and if a language can express the same thing in fewer lines then they can argue that it takes longer to come up with these shorter lines.

It’s too good a cover. I think more precise language is called for.

---

<div class="post-metadata">

**Author:** ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)\
**Post date:** [September 1, 2020, 6:21am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/4 "2020-09-01T06:21:56Z")

</div>

> [@DaymondLing](#):
>
> Python is undoubtedly faster in helping programmers express their concept in fewer lines of code”.

Only because of the `end` keyword 😉

In my experience, Python and Julia code is mostly similar in size, with Julia often be slightly shorter / easier.  
If performance matters, Julia code is usually much simpler than Python, because special techniques (like vectorization, Numba, etc.) are required in the latter.

---

<div class="post-metadata">

**Author:** ![Seif\_Shebl](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Post date:** [September 1, 2020, 9:28am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/5 "2020-09-01T09:28:57Z")

</div>

Unbalanced code with the omission of `end`s always hurt my eyes. Our ancestors had good reason when they wrote `end do`, `end if`, `end function`, `end program`, etc. Short code can be horrible for both humans and machines, look at this:

```julia
(lambda f, n: f(f, n))(lambda f, n: [(not n % 3 and "fizz" or "") + (not n % 5 and "buzz" or "") or n] + f(f, n+1) if n <= 100 else [], 1)

```

Or this:

```julia
from itertools import cycle 
(x or n+1 for n, x in enumerate(map(''.join, zip(cycle([''] * 2 + ['fizz']), cycle([''] * 4 + ['buzz']))))) 

```

Of course one can write bad code in any language, but the languages are, in large part, those who give people permission to do so.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 1, 2020, 9:29am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/6 "2020-09-01T09:29:42Z")

</div>

> [@DaymondLing](#):
>
> Really?

Keep in mind that this is a \<300 word blurb. I am not sure this is worth discussing; it is similar to the filler material on the back page of tabloids (“scientists find that \<X\> causes/cures cancer”).

---

<div class="post-metadata">

**Author:** ![danielw2904](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielw2904/32/10890_2.png) [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Post date:** [September 1, 2020, 12:26pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/7 "2020-09-01T12:26:52Z")

</div>

It’s a strange sentence to me. Is the implication that it takes longer to learn how to use fewer lines in Julia? Also I don’t think writing fewer lines of code is a very good goal in general. I don’t write

```julia
julia> for i in 1:10;println(i);println(i^2);end

```

very often even though it reduces the number of lines from the way I usually express this by a lot.

I don’t have much experience in Python but I spent years in R learning shorthand syntax for packages like `data.table` to get performant code. Way fewer lines, much longer learning time, not easily understood by people who do not know the package.

EDIT:  
See also the last sentences:

> The programming language is used by Google as a research language. Julia in combination with Google’s hardware Tensor Processing Units was the best combination for fast and easily expressible machine learning computation.

---

<div class="post-metadata">

**Author:** ![tisztamo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tisztamo/32/16200_2.png) [@tisztamo](https://discourse.julialang.org/u/tisztamo)\
**Post date:** [September 1, 2020, 1:15pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/8 "2020-09-01T13:15:16Z")

</div>

> [@danielw2904](#):
>
> The programming language is used by Google as a research language. Julia in combination with Google’s hardware Tensor Processing Units was the best combination for fast and easily expressible machine learning computation.

I guess this was written by GPT-3.

---

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [September 1, 2020, 1:33pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/9 "2020-09-01T13:33:44Z")

</div>

Could be! It makes me wonder if this quote from @viralbshah is genuine:

> If you are building a new search engine that’s heavily mathematical, or trying to predict the weather, or discovering a new bug, that’s where you use Julia. But if you are building a mobile app, Julia is not an answer to that. It’s for very large data sets, and where you are building a complex algorithmic application.

Using Julia to discover a new bug?

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [September 1, 2020, 1:34pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/10 "2020-09-01T13:34:26Z")

</div>

> [@danielw2904](#):
>
> It’s a strange sentence to me. Is the implication that it takes longer to learn how to use fewer lines in Julia? Also I don’t think writing fewer lines of code is a very good goal in general.

I think the claim is that python is less verbose than Julia, which seems way off to me. But the linked article is of such modest ambition and quality, that I don’t think there’s much point in over-thinking it.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 1, 2020, 2:29pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/12 "2020-09-01T14:29:01Z")

</div>

> [@cstjean](#):
>
> Using Julia to discover a new bug?

I think the context for “bug” (= pathogen) here is medicine.

---

<div class="post-metadata">

**Author:** ![DaymondLing](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daymondling/32/8474_2.png) [@DaymondLing](https://discourse.julialang.org/u/DaymondLing)\
**Post date:** [September 1, 2020, 8:34pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/13 "2020-09-01T20:34:15Z")

</div>

I agree within the Julia discourse community the article is not worth much discussion, I prefer Julia over Python for scientific work any day of the week.

I don’t know how the author formed that opinion or where they got the information from, it bothers me when the public at large sees these articles that can potentially give them the wrong impression.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [September 2, 2020, 12:46am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/14 "2020-09-02T00:46:44Z")

</div>

> [@DaymondLing](#):
>
> how the author formed that opinion or where they got the information from

yeah.

> [@DaymondLing](#):
>
> it bothers me when the public at large sees these articles that can potentially give them the wrong impression.

totally get you.

as a community we can put out more positive content. i think their point might resonate with some ppl as well. So I guess it’s about knowing such sentiments exists, but work to change things we can improve would be my general approach.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 2, 2020, 8:29am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/15 "2020-09-02T08:29:05Z")

</div>

> [@DaymondLing](#):
>
> it bothers me when the public at large sees these articles that can potentially give them the wrong impression.

It shouldn’t — people are free to write what they like, we have no control over this, which is fine.

What you _have_ some control over is whether to disseminate this kind of information (eg by discussing and linking to it, Google will rank it higher). If these kind of articles bother you, it is just best to ignore them.

---

<div class="post-metadata">

**Author:** ![janrpeters](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@janrpeters](https://discourse.julialang.org/u/janrpeters)\
**Post date:** [September 2, 2020, 7:15pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/16 "2020-09-02T19:15:44Z")

</div>

I hated about Python that it creates clumsy gigantic code when you are doing complex math … I only looked at Julia because Julia helped me express my concepts in fewer lines of code. It took me a few hours from my start at learning Julia to completely porting three months worth of python code … only requiring 1/10 of the code length.

---

<div class="post-metadata">

**Author:** ![janrpeters](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@janrpeters](https://discourse.julialang.org/u/janrpeters)\
**Post date:** [September 2, 2020, 7:58pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/17 "2020-09-02T19:58:41Z")

</div>

… and I have become a true believer!

---

<div class="post-metadata">

**Author:** ![SamBrand](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@SamBrand](https://discourse.julialang.org/u/SamBrand)\
**Post date:** [September 2, 2020, 9:34pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/18 "2020-09-02T21:34:13Z")

</div>

I’m a mathematical epidemiologist (topical at the moment…). I only found Julia because I was looking for a language to code in when I wasn’t do something “serious” in C++. Hated the R syntax, looked at Python and got bored having to think hard about vectorisation even to do something “non-serious”.

Basically, googled “Is there a language that is like Python but isn’t crappy” and found Julia 0.6.

I struggle with the idea that there is enough difference between the high-level syntax of Julia and python that anyone would really prefer one to the other. Julia steals all Python’s syntactic sugar.

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [September 2, 2020, 9:36pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/19 "2020-09-02T21:36:00Z")

</div>

Programmers are fanatical about what type of whitespace they use. every character of difference apparently is enough to inspire revulsion.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 3, 2020, 9:07am UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/20 "2020-09-03T09:07:43Z")

</div>

> [@Oscar\_Smith](#):
>
> every character of difference apparently is enough to inspire revulsion.

I am still waiting for someone to design a language where [various forms of whitespace](https://en.wikipedia.org/wiki/Whitespace_character) have different meaning.

Julia wasted perfectly good opportunities to be wacky with whitspace. In particular, the `MONGOLIAN VOWEL SEPARATOR` (U+180E) should utilized for some crucial piece of syntactic distinction as it is _both_ tricky to input _and_ invisible in a lot of IDEs.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [September 3, 2020, 1:21pm UTC](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872/21 "2020-09-03T13:21:05Z")

</div>

> [@Tamas\_Papp](#):
>
> I am still waiting for someone to design a language where [various forms of whitespace](https://en.wikipedia.org/wiki/Whitespace_character) have different meaning.

Why would you think nobody has done this yet? 😉

> **[Whitespace (programming language)](https://en.wikipedia.org/wiki/Whitespace_(programming_language))**
>
> Whitespace is an esoteric programming language developed by Edwin Brady and Chris Morris at the University of Durham (also developers of the Kaya and Idris programming languages). It was released on 1 April 2003 (April Fool's Day). Its name is a reference to whitespace characters. Unlike most programming languages, which ignore or assign little meaning to most whitespace characters, the Whitespace interpreter ignores any non-whitespace characters. Only spaces, tabs and linefeeds have meaning.\[

[Next page](https://discourse.julialang.org/t/python-is-undoubtedly-faster-in-helping-programmers-express-their-concept-in-fewer-lines-of-code/45872.md?page=2)
