Hi guys.
I just finished a book (desktop publishing): Build Super Helpful and Interesting Things with Julia.
It contains 40 programming exercises at levels easy to moderate (everything is relative)
that are haphazardly scattered through the chapters. If you are interested, you may give it a try.
The book is available freely under CC BY-NC-SA 4.0 license and was submitted as a proposal (PR) to julialang.org. Chances are that in the future it will be listed at: Books
const Flt = Float64
const Str = String
const Vec = Vector
Your global definitions at the beginning of the book are essentially changing the basic syntax design of the language. It’s technically valid code, but breaking conventions creates unnecessary barriers for others to understand the code, especially when the payoff is only saving typing a few characters.
Hi @greatpet,
You may be right. Unfortunately, just like my previous book, this one is also written (at least in part) for myself. It is shared with others in hope that it will be of use to someone else.
Julia is rather a dynamic programming language, so I suspect that adding the
types (custom or ingrained into the language) to the code is not gonna be to
everybody’s liking anyway.
I’m not a professional programmer, so feel free to ignore the not so good ideas and use only the ones that suit you.
Overall, I recommend that everyone should solve the tasks on their own (and in their own style) 
The style is definitely not idiomatic Julia: you are using it like C, manually restricting to specific concrete types.
Because of this, I would not recommend listing it in the Books section.
Hi @Tamas_Papp,
I understand your reasons.
The decision is not mine, anyway. I guess I can only accept it.
Hm I see two challenges here:
Function naming
While there is no 100% strict rule, I think one conclusion from The current state of function naming style is that it is either meshedcase (but mainly in Base) or snake_case, but you seem to follow something else.
Variables too often in global scope
I did not check many of the problems but it seems in a solution like Solution - Build SH*T with Julia you set a bad example by nearly always using global constants. I think that is not something one should do in Julia.
Besides that one I looked only into Problem 2 (so the first problem?!) Problem - Build SH*T with Julia where you specify in the problem that matrix multiplication should return an Int? That is wrong and super misleading.
I fear I have to agree with Tamas here. I also do not like that the Book title tries to be a pun – and one with a swear word.
Hi,
I see that my book steered more commotion than I intended.
Therefore, at least for now, I closed the PR and made the repo private.
I see I have to rethink the book and your comments. Maybe I make some changes and reopen it later.
I’m sorry for all the trouble. Please don’t take it the wrong way.
No worries, I hope I commented in a constructive way, I did not intend to demotivate you.
As for
I think this is not a good approach to a book where users are expected to learn about Julia, since they have to know Julia already well to see then which ideas suite them and which not. In my opinion a book (or any learning material actually) should aim to convey knowledge and only good ideas to a potential reader/learner.
Hi guys,
Today I finally had a moment to think about your comments.
I renamed the project to a less offensive: Julia. Projects from a Recreational Programmer’s Drawer.
As for the code suggestions, they are valid.
Still, I decided to leave it as it is for a few reasons:
- this is my book, and writing the code this way (camelCase, type declarations, type synonyms, etc.) gives me more joy and makes it easier to maintain and debug it (the factors are decisive for me)
- I may not be good enough to write a much better code (I’m not a pro) and I don’t want to exchange comments on the book indefinitely
- Most importantly. This small hobby project took me already more than a year. Initially I wanted to add 50 tasks, but I gradually grew tired and I don’t want to invest much more time in it
And so:
- since the book is not Julianic enough I decided not to resubmit a PR to Books
- I restored the project online with some cosmetic changes. No one is under an obligation to read it.
If you are a professional Julia programmer or programmers, feel free to fork the project and correct the code with your explanations.
Let me know if you do. If the community considers it good I will add a link to it (and maybe I will learn a thing or two myself).
That’s it.
Do you accept PRs for your book?
The examples are interesting (it is difficult to come out with good examples…) and most of the issues (aside the redefinition of core Julia types) relate to individual snippets of code.
Hi @sylvaticus,
If you found a bug or an instance of bad English (I’m not a native speaker) then definitely so.
I also appreciate significant code improvements.
Small improvements not so much, because I don’t want to spend too much time on the project (I’ve got some other things to do). I also really like to have types in my code (sorry for stubbornness), although I’m sure the type declarations could be improved.
Long story short, If you are willing to spend your time on it then yes.
I will visit the project or the discourse every now and then and see what happens (but it’s not gonna be every day). Moreover, be patient with me, I never dealt with PRs and Issues as a project manager before.
Not to quibble with your own coding preferences - you should keep doing whatever that makes you productive in personal projects - but I want to clarify that people here are not advocating for avoiding types. Doing so would defeat the purpose of using Julia, as the type system is one of Julia’s most important features. I think the general guideline is using type annotations strategically, preferring abstract types and parametric types over concrete types, to increase the reusability of the code. For example, see this section of the SciML Style Guide for Julia:
In other words, Julia’s optimal type annotation style is different from both the C style (concrete types) and the traditional dynamic language style (no annotations at all).
Hi @greatpet,
Thank you for the link (I’ll read it).
I admit, that I’m not quite familiar with the proper type system in Julia.
As I recall it, when I first discovered Julia I just quickly read through: learn X in Y minutes + Think Julia and just started to write some programs with it.
The reason I made my books public and for free was because I perceive Julia as a good and undervalued programming language (big props to everyone who created it and contributes to packages, blogs, etc., very good job!).
Unfortunately, I didn’t find too many free resources (I prefer books) at the time when I started (I remember reading Python books and writing solutions in Julia to practice the language). So one of my reasons was to fill the hole (despite the fact that the community seems to be strongly mathematically inclined and I’m not really capable to provide much value here).
If any of you guys would like to submit the changes to make my typing system (and its description in the books) more Julianic then I would appreciate it. I know this should be my obligation as an author, but rewriting it now would be too time consuming and as I said I don’t want to spend much more time on the project (from my point of view its been more than a year). Anyway, I hope that despite the flaws the books add some small value to the community.