# Julia from the perspective of a pythonista

**URL:** <https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956>\
**Category:** General Usage\
**Tags:** feedback\
**Created:** [February 24, 2021, 7:45pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956 "2021-02-24T19:45:59Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![dariush-bahrami](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dariush-bahrami](https://discourse.julialang.org/u/dariush-bahrami)\
**Post date:** [February 25, 2021, 4:17pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/61 "2021-02-25T16:17:30Z")

</div>

> [@mihalybaci](#):
>
> Try [Julia Academy](https://juliaacademy.com/) for some basics, though maybe it falls short of a full “Julia course”.

actually I took Julia Academy courses. this is the proof 😃

 ![Capture](https://global.discourse-cdn.com/julialang/original/3X/b/4/b42882b0e8f16119d78da2c5bbe6468dc941e936.png)

> [@mihalybaci](#):
>
> It seems you’ve found the [MIT Computational thinking class](https://computationalthinking.mit.edu/Spring21/), which I really like myself (replace “Spring21” with “Fall20” to get to last years one that has completed).

This course was not bad but compared to something like [CS50](https://cs50.harvard.edu/x/2021/) it could became better in the future.

> [@mihalybaci](#):
>
> I also was a big fan of “Think Python” by Allen Downey – it’s how I learned classes – and there is an equivalent [Think Julia book](https://benlauwens.github.io/ThinkJulia.jl/latest/book.html) that is very nice as well.

I read this book, it can help in the beginning of the learning journey.

> [@mihalybaci](#):
>
> Though with any training material, be very mindful of the Julia version being used. For instance, “Think Julia” uses v1.1.0, so there _may_ be some syntax differences if you’re on v1.5.3. If you’re not sure of the Julia version, just look at the publication date.

You are right, if the educational materials are not updated regularly, they will gradually become obsolete.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 25, 2021, 4:24pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/62 "2021-02-25T16:24:48Z")

</div>

> [@dariush-bahrami](#):
>
> really wants to learn a subject,

“really wants” is something subjective. When I teach something I want that the students that really want (or need) learn and enjoy, but that is generally easy. It is harder to make things enjoyable and profitable for the ones that want (or need) less. My suggestions are hopefully to catch the attention of those as much as possible.

> [@dariush-bahrami](#):
>
> is much lower than educational materials in other languages.

I really cannot evaluate that and I trust your judgment. I liked many things I have viewed and read, but I have no parameter because I never used those resources in other languages. I think anyway that this feedback is important, because there might be people and companies willing to invest on that. To be truth, I myself have written quite extensive materials for the courses I teach. But they are not for the general public.

---

<div class="post-metadata">

**Author:** ![dariush-bahrami](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dariush-bahrami](https://discourse.julialang.org/u/dariush-bahrami)\
**Post date:** [February 25, 2021, 4:34pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/63 "2021-02-25T16:34:40Z")

</div>

> [@lmiq](#):
>
> I think anyway that this feedback is important, because there might be people and companies willing to invest on that.

I really like and hope that this happens because Julia has great potential and more importantly, it is fun to write code in it.

---

<div class="post-metadata">

**Author:** ![SadeghPouriyan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sadeghpouriyan/32/22293_2.png) [@SadeghPouriyan](https://discourse.julialang.org/u/SadeghPouriyan)\
**Post date:** [February 25, 2021, 4:37pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/64 "2021-02-25T16:37:21Z")

</div>

> [@sswatson](#):
>
> Whenever you see a major, long-standing problem in a widely used piece of software (e.g., Julia’s time-to-first-plot, or Python/R/MATLAB’s execution speed), the safe bet is that a ton of effort has gone into addressing the problem, and any lack of success in those endeavors is due to the inherent difficulty of the problem.

a “problem” is defined after someone makes a claim and that “problem” prevents achieving that claim. There is no expectation from Python to have high execution speed, whereas there is such an expectation from Julia, based on Julia’s claim about speed. This makes Julia’s time-to-first-plot an important issue comparing to Python’s execution speed.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [February 25, 2021, 4:45pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/65 "2021-02-25T16:45:21Z")

</div>

> [@SadeghPouriyan](#):
>
> This makes Julia’s time-to-first-plot an important issue comparing to Python’s execution speed.

While I would also love to see startup times further improved, where does Julia make a claim about its time-to-first-plot speed? It’s the runtime speed it makes claims about.

---

<div class="post-metadata">

**Author:** ![johnmyleswhite](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnmyleswhite/32/31_2.png) [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)\
**Post date:** [February 25, 2021, 4:47pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/66 "2021-02-25T16:47:23Z")

</div>

> [@SadeghPouriyan](#):
>
> There is no expectation from Python to have high execution speed

I don’t think this is true if you run a business that would benefit from Python being faster.

---

<div class="post-metadata">

**Author:** ![dariush-bahrami](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dariush-bahrami](https://discourse.julialang.org/u/dariush-bahrami)\
**Post date:** [February 25, 2021, 4:48pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/67 "2021-02-25T16:48:55Z")

</div>

> [@mihalybaci](#):
>
> I also just saw this [Discourse post](https://discourse.julialang.org/t/julia-from-total-beginner-to-power-user-youtube-channel/55882?) about beginner videos for Julia that may be useful.

Thank you for introducing this training course. It would be great if there was a topic that every time someone prepares a training course add its link to it.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [February 25, 2021, 4:53pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/68 "2021-02-25T16:53:50Z")

</div>

> [@dariush-bahrami](#):
>
> It would be great if there was a topic that every time someone prepares a training course add its link to it.

If it doesn’t need to be a discourse thread, everyone can easily submit a one-line PR to add a video/book/whatever to [Get started with Julia](https://julialang.org/learning) (to be precise, here is the GitHub repo: [GitHub - JuliaLang/www.julialang.org: Julia Project website](https://github.com/JuliaLang/www.julialang.org)). This should also be more prominent.

(You can even edit the source code and create the PR directly via githubs web interface.)

---

<div class="post-metadata">

**Author:** ![sswatson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sswatson/32/5135_2.png) [@sswatson](https://discourse.julialang.org/u/sswatson)\
**Post date:** [February 25, 2021, 4:59pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/69 "2021-02-25T16:59:16Z")

</div>

I would agree that Julia’s speed (fast execution but with a significant compilation penalty up front) can be more easily be misleading for beginners than discussing Python’s (snappy for anything lightweight or anything done in complied libraries behind the scenes, slow for anything heavy and written in Python). I would also agree that Julia’s latency issues are much more visible to beginners than Python’s. In fact, I would bet that quite a few Python users never even notice Python’s slowness, because for a wide range of use cases, the differences aren’t meaningful.

However, it is also true that people really, _really_ want to make Python faster, and a prodigious amount of effort has gone into doing just that. So my original point does apply to both of the examples mentioned, regardless of any semantic disagreement we may have about the scope of the word ‘problem’.

---

<div class="post-metadata">

**Author:** ![SadeghPouriyan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sadeghpouriyan/32/22293_2.png) [@SadeghPouriyan](https://discourse.julialang.org/u/SadeghPouriyan)\
**Post date:** [February 25, 2021, 5:04pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/70 "2021-02-25T17:04:27Z")

</div>

> [@johnmyleswhite](#):
>
> if you run a business that would benefit from Python being faster.

Although having faster execution speed can help dozens of businesses using python but it is wrong to expect high execution speed from a programming language that its goal is having a clear syntax or sth other than speed; in general we can’t expect sth that wasn’t been claimed.

---

<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:** [February 25, 2021, 5:12pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/71 "2021-02-25T17:12:58Z")

</div>

Higher runtime speed is number 2 on the wishlist (after strict type hints) of Python users according to

> **[Python Developers Survey 2020 Results](https://www.jetbrains.com/lp/python-developers-survey-2020/)**
>
> Official Python Developers Survey 2020 Results by Python Software Foundation and JetBrains: more than 28k responses from more than 150 countries.

Other top wishes in this direction are better parallelism and an official JIT.

---

<div class="post-metadata">

**Author:** ![dariush-bahrami](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dariush-bahrami](https://discourse.julialang.org/u/dariush-bahrami)\
**Post date:** [February 25, 2021, 5:18pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/72 "2021-02-25T17:18:25Z")

</div>

> [@lungben](#):
>
> Higher runtime speed is number 2 on the wishlist (after strict type hints) of Python users according to

I was wondering if there is such a survey in Julia or not?

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [February 25, 2021, 5:20pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/73 "2021-02-25T17:20:20Z")

</div>

I could’ve sworn we added a weaknesses/“why not Julia” section… somewhere… (to either the main website or the docs)… following a thread similar to this one to help set expectations. Maybe it’s still a PR? Anyone with better search-foo or memory on this one?

Yes, we run an annual survey: [2020 Julia User and Developer Survey](https://julialang.org/blog/2020/08/2020-julia-user-and-developer-survey/)

---

<div class="post-metadata">

**Author:** ![SadeghPouriyan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sadeghpouriyan/32/22293_2.png) [@SadeghPouriyan](https://discourse.julialang.org/u/SadeghPouriyan)\
**Post date:** [February 25, 2021, 5:36pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/74 "2021-02-25T17:36:37Z")

</div>

> [@sswatson](#):
>
> In fact, I would bet that quite a few Python users never even notice Python’s slowness, because for a wide range of use cases, the differences aren’t meaningful.

This is the second point I wanted to talk about, and thank you for mentioning it.  
Most python users, as you said, don’t face the problem of execution speed because, for a wide range of use cases, the differences aren’t meaningful. although @lungben referred to JetBrains Python Developers Survey 2020 and mentioned that “higher runtime speed” is the 2nd item in users’ wishlist, we don’t have any information about their main problem with python. Besides, this problem would not occur for a wide range of users that doesn’t need higher speed (although all agree that having a higher speed is better than a lower one!). But Julia’s long initial start time problem occurs to anyone who starts using it. If it was a problem for a small group that needed a feature, it wasn’t a big deal.

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [February 25, 2021, 5:40pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/75 "2021-02-25T17:40:08Z")

</div>

> [@stevengj](#):
>
> Probably you are confused about [invariance](https://docs.julialang.org/en/v1/manual/types/#Parametric-Composite-Types), e.g. you should have declared a parameter as `AbstractVector{<:Real}` but you declared it as `AbstractVector{Real}` instead — the former allows `Vector{Float64}` and the latter does not. This comes up a lot in the forums, e.g. [here](https://discourse.julialang.org/t/why-1-2-3-is-not-a-vector-number/52645) and [here](https://discourse.julialang.org/t/reason-behind-designing-parametric-types-as-invariant/18971) and [here](https://discourse.julialang.org/t/if-parametric-types-are-invariant-why-is-vector-int-a-subtype-of-abstractvector-int/53394) and [here](https://discourse.julialang.org/t/problem-with-complex-rationals/9474) etcetera.

Thank you, you are quite right about my confusion. I did read the posts you mentioned and am now slightly less confused. I still don’t know what the difference between AbstractVector{\<:Real} and Vector{\<:Real} is though. I had declared it as Vector{Real} which obviously didn’t work.

---

<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:** [February 25, 2021, 5:40pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/76 "2021-02-25T17:40:20Z")

</div>

A major difference is scaling:  
Run times scale with the size of the problem - doubling of the sample result in double run time.  
Compile times, in contrast, are constant. They are always a few seconds (depending only on the software you are using), independent of the calculation sample size. Thus, they become insignificant for numerically challanging stuff. On the other hand, they are rather annoying if your calculations themselves are very quick.

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [February 25, 2021, 5:41pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/77 "2021-02-25T17:41:00Z")

</div>

> [@lungben](#):
>
> Was the Win7 system 32 bit or 64 bit?

64 bit

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 25, 2021, 6:02pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/78 "2021-02-25T18:02:48Z")

</div>

> [@Jake](#):
>
> AbstractVector{\<:Real} and Vector{\<:Real}

Probably that should be split in a new topic. But if you use `AbstractVector` your function will accept, for example, `views`, `StaticArrays`, and other array types which are not `Vectors` in the strict sense:

```julia
julia> f(x::Vector) = 1
f (generic function with 1 method)

julia> g(x::AbstractVector) = 1
g (generic function with 1 method)

julia> x = [1,2,3];

julia> f(@view x[1:2])
ERROR: MethodError: no method matching f(::SubArray{Int64,1,Array{Int64,1},Tuple{UnitRange{Int64}},true})
Closest candidates are:
  f(::Array{T,1} where T) at REPL[1]:1
Stacktrace:
 [1] top-level scope at REPL[3]:1

julia> g(@view x[1:2])
1

julia> using StaticArrays

julia> x = zeros(SVector{3,Float64});

julia> f(x)
ERROR: MethodError: no method matching f(::SArray{Tuple{3},Float64,1,3})
Closest candidates are:
  f(::Array{T,1} where T) at REPL[1]:1
Stacktrace:
 [1] top-level scope at REPL[8]:1

julia> g(x)
1

```

Concerning `Real` vs. `<:Real` I like [my way](https://discourse.julialang.org/t/why-isa-x-1-y-1-array-tuple-stuff-number-1-false/55777/6) to explain this, for obvious reasons.

---

<div class="post-metadata">

**Author:** ![ggggggggg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ggggggggg/32/265_2.png) [@ggggggggg](https://discourse.julialang.org/u/ggggggggg)\
**Post date:** [February 25, 2021, 6:44pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/79 "2021-02-25T18:44:41Z")

</div>

Honestly, I feel like python gets too much credit here. It is easy to end up with python installs that have serious usability problems. I regularly have 5-20 time to first being able to type in ipython. I don’t really know why, because it varies from system to system and it’s not worth my time to debug a transient problem one system that isn’t a 100% show stopper (I work on many very similar, but slightly different computer systems running very similar, but slightly different pieces of equipment). I regularly (many times in the past few years) have issues where matplotlib is nearly unresponsive or hard freezes my terminal. At least some of the blame may fall on the somewhat opaque security settings my organization applies to our machines I always see these threads that take it as given that the python world has plotting and interactivity nailed, and it is not true. It’s mostly true, but I see exceptions on a regular basis.

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [February 25, 2021, 6:54pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/80 "2021-02-25T18:54:44Z")

</div>

> [@ggggggggg](#):
>
> Honestly, I feel like python gets too much credit here.

Absolutely. Here’s how I think about this:

Once you get familiar with a tool, and you come to understand it’s deficiencies and find workarounds for those deficiences, they stop bothering you as much. You get used to them and sometimes even stop noticing them.

Later, if you try out a different tool that has a different set of tradeoffs, strengths and weaknesses, you’ll maybe notice the strengths, but you’ll also definitely notice the weaknesses. When you compare that new tool to the old tool, it becomes very difficult to make objective comparisons because you’ve trained yourself to not notice the problems with your old tool.

This effect is why a lot of Python programmers will brush off complaints about speed, expressiveness or composability and say “nah it’s not that big a deal”. It’s also why a lot of julia programmers (myself included) will just brush off complaints about compiler latency, documentation and such.

[Previous page](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956.md?page=3)

[Next page](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956.md?page=5)
