# Learning by reading source code

**URL:** https://discourse.julialang.org/t/learning-by-reading-source-code/95740
**Category:** New to Julia
**Tags:** question
**Created:** [March 8, 2023, 3:36pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740 "2023-03-08T15:36:01Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![vsoler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vsoler/32/30667_2.png) [@vsoler](https://discourse.julialang.org/u/vsoler)
#### Post date: [March 8, 2023, 3:36pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/1 "2023-03-08T15:36:01Z")

</div>

I am relatively new to Julia.

In order to learn how to write good code, I was thinking of reading the source code of some “simple” packages. That would help me, I think.

Can you suggest some packages that would be suitable for me, as a newcomer to Julia?

Any other ideas apart from the one I am mentioning here?

I am currently reading “Think Julia”, which I like a lot, but I think it is not enough for me.

Another idea that I have is perhaps look for people in the area of Barcelona, Spain (or no matter where) and have the possibility of exchanging knowledge, practices, pieces of advice …

Any suggestions are welcome

---

<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: [March 8, 2023, 3:40pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/2 "2023-03-08T15:40:12Z")

</div>

What’s your background? The package I would suggest depends fairly heavily on where you’re coming from.  
If you’re mathy, Primes.jl is pretty clean.  
If you’re CS, maybe Datastructures.jl?  
If you’re Bio, there’s a ton of bio code out there.

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [March 8, 2023, 3:45pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/3 "2023-03-08T15:45:26Z")

</div>

I guess it also depends what you mean by “writing good code”:

- If it’s about style, there are guidelines out there such as [GitHub - invenia/BlueStyle: A Julia style guide that lives in a blue world](https://github.com/invenia/BlueStyle) or [GitHub - SciML/SciMLStyle: A style guide for stylish Julia developers](https://github.com/SciML/SciMLStyle)
- If it’s about performance, check out the [Performance Tips · The Julia Language](https://docs.julialang.org/en/v1/manual/performance-tips/) for some common pitfalls
- If it’s about the technical aspects of designing a whole package, [GitHub - JuliaLang/Pkg.jl: Pkg - Package manager for the Julia programming language](https://github.com/JuliaLang/Pkg.jl) and [GitHub - JuliaCI/PkgTemplates.jl: Create new Julia packages, the easy way](https://github.com/JuliaCI/PkgTemplates.jl) are good places to get started
- If it’s about elegance / simplicity / julianicity, the resources above will already get you far. I think there was another Discourse thread recently listing packages with great and readable code, but a quick search yielded nothing

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [March 8, 2023, 3:47pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/4 "2023-03-08T15:47:55Z")

</div>

This also reminds me of the following articles / documents, which are less Julia-specific though

- [Ten simple rules on writing clean and reliable open-source scientific software](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1009481)
- [https://www.imo.universite-paris-saclay.fr/~antoine.levitt/calsci.pdf](https://www.imo.universite-paris-saclay.fr/~antoine.levitt/calsci.pdf)

---

<div class="post-metadata">

### Author: ![vsoler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vsoler/32/30667_2.png) [@vsoler](https://discourse.julialang.org/u/vsoler)
#### Post date: [March 8, 2023, 3:53pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/5 "2023-03-08T15:53:19Z")

</div>

my background is Business Administration, although I started “telecom” engineering studies (and didn’t finish them), and I am relatively fluent, with some limitations, in math and statistics.

I also like to download stock market quotes, put them in DataFrames and try to find patterns as if I were an investor.

Right now I am reading about the “structs” in Julia, and try to understand how they would mimic the OOP paradigm, although I already know that Julia, with its multiple dispatch philosophy just follows an alternative paradigm.

I hope this helps

---

<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: [March 8, 2023, 3:54pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/6 "2023-03-08T15:54:19Z")

</div>

Where to start? Forget OOP in the first place…

---

<div class="post-metadata">

### Author: ![vsoler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vsoler/32/30667_2.png) [@vsoler](https://discourse.julialang.org/u/vsoler)
#### Post date: [March 8, 2023, 3:56pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/7 "2023-03-08T15:56:00Z")

</div>

I try to, but I’m coming from python !!!

---

<div class="post-metadata">

### Author: ![mdogan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mdogan/32/47244_2.png) [@mdogan](https://discourse.julialang.org/u/mdogan)
#### Post date: [March 8, 2023, 4:08pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/8 "2023-03-08T16:08:50Z")

</div>

It is tough to guess what you me be precisely interested in, but if you have an interest in investing or finance in general you may want to check **[PortfolioAnalytics.jl](https://github.com/doganmehmet/PortfolioAnalytics.jl)** which I am actively developing. I aim to make it a tool for quantitative portfolio analytics. (investment returns, risk metrics, portfolio optimization etc).

To download market data you can use **Market Data.jl**.

---

<div class="post-metadata">

### Author: ![vsoler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vsoler/32/30667_2.png) [@vsoler](https://discourse.julialang.org/u/vsoler)
#### Post date: [March 8, 2023, 4:35pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/9 "2023-03-08T16:35:34Z")

</div>

**ndogan** , that sounds awesome !!!

let me know if you would like some help, suggestions in developping your package or anything else.

I’ve been working lately (with excel & python) on models that try to make it better than the market index (S&P500 for example), so I have some expertise.

I’ll have a look at yor package. Thank you

---

<div class="post-metadata">

### Author: ![mdogan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mdogan/32/47244_2.png) [@mdogan](https://discourse.julialang.org/u/mdogan)
#### Post date: [March 8, 2023, 4:58pm UTC](https://discourse.julialang.org/t/learning-by-reading-source-code/95740/10 "2023-03-08T16:58:30Z")

</div>

@vsoler, thanks very much. Of course, I am definitely open to any suggestions, feature requests and improvements. The aim is to make it a useful tool for everyone and any contribution is more than welcome.

The package is under heavy development and for sure there is a big room for improvement.
