# The delightful conciseness of Julia

**URL:** <https://discourse.julialang.org/t/the-delightful-conciseness-of-julia/40947>\
**Category:** Offtopic\
**Created:** [June 7, 2020, 8:31pm UTC](https://discourse.julialang.org/t/the-delightful-conciseness-of-julia/40947 "2020-06-07T20:31:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 7, 2020, 8:31pm UTC](https://discourse.julialang.org/t/the-delightful-conciseness-of-julia/40947/1 "2020-06-07T20:31:30Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/5/b/5b3da846130333d7eed7ef042089322766d1e802.png) ![image](https://global.discourse-cdn.com/julialang/original/3X/1/e/1e43c29290e895fb3d4d75a7009b391524b650b6.png)

The code does the same thing: Integrate the conductivity matrix and the heat load.  
The deal.ii code on the right is in C++. The Julia is I think easier to read, and, at least in my test, it runs (slightly) faster.

EDIT: Second measurement: deal.ii code is ~6% _faster_. Not sure why the first measurement indicated the opposite. Sorry about the misinformation.

EDIT 2: To satisfy a request for references: [GitHub - PetrKryslUCSD/Elfel.jl: Extensible library for finite element programming](https://github.com/PetrKryslUCSD/Elfel.jl) (examples/heat/heat\_poisson\_q4.jl), [http://dealii.org/](http://dealii.org/) (step 3).

EDIT: Third measurement on a laptop with no load other than the calculation: codes run at the same speed.

---

<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:** [June 8, 2020, 6:54am UTC](https://discourse.julialang.org/t/the-delightful-conciseness-of-julia/40947/2 "2020-06-08T06:54:53Z")

</div>

Please post quoted code — screenshots are difficult to read.

> [@PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530):
>
> This is a short post on how to use backticks (` and ```) to quote code, so it is easy to read. This post can be linked to new users who are confused by this feature. Why By quoting your code, you get a monospaced font (which preserves indentation) and syntax highlighting. This makes it easier to read your code and help you. Displayed code looks like this: function displayed\_code(x::Int, y::Int) if x \< y println("x is smaller") else println("or not") end end Inline…

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 8, 2020, 1:59pm UTC](https://discourse.julialang.org/t/the-delightful-conciseness-of-julia/40947/3 "2020-06-08T13:59:14Z")

</div>

You’re right, one has to click to enlarge the images to _read_ the code. But even when one looks at the code from afar, when the code can no longer be read, I believe my point can be made.
