HackerTrans
TopNewTrendsCommentsPastAskShowJobs

jsontwikkeling

no profile record

Submissions

Show HN: Algorithms and Data Structures in TypeScript – Free Book (~400 Pages)

amoilanen.github.io
65 points·by jsontwikkeling·قبل 4 أشهر·22 comments

comments

jsontwikkeling
·قبل 4 أشهر·discuss
OK, I am not sure who these are. I would not promote my post like this. They are indeed new accounts
jsontwikkeling
·قبل 4 أشهر·discuss
Sorry, definitely my mistake for sharing too early.
jsontwikkeling
·قبل 4 أشهر·discuss
Clear, sorry, my mistake. I just was excited to share and hoped it can be useful.

Though I genuinely wrote a substantial part of the book myself.

I will finish the review on Github in the coming days/weeks and will hopefully get some collaborators there
jsontwikkeling
·قبل 4 أشهر·discuss
The goal was to share the book which I finished and ask for review and feedback.

Feedback is clear, I should never had posted and will probably not post in the future.

Hopefully the book will be useful for those who find it, I will get feedback elsewhere and will finish reviewing it myself
jsontwikkeling
·قبل 4 أشهر·discuss
It was not the goal and I was posting in my personal capacity. I just used it together with Claude Code on my personal project. Because I work with it regularly it is natural that I used it.

I wanted to mention the tools I used including Claude Code. I hope it does not seem that I am here to promote Anthropic tools as well?

I just thought it appropriate to mention for the correct attribution, because the heavy lifting was done by the tools, not by me
jsontwikkeling
·قبل 4 أشهر·discuss
As you can see I was never hiding and my identity can be viewed and verified quite openly

I just mentioned the tools I use normally and it is my personal project done on my personal time of which my employer is not aware.

I might not mention the tools I used but they did the bulk of the work so I thought appropriate to mention.

Promoting Zenflow or Claude Code was not my goal. They are mentioned purely for the attribution purposes
jsontwikkeling
·قبل 4 أشهر·discuss
I am just referencing the tools I used (also Claude Code, by the way) because the bulk of the work was done by them.

This is what I was taught: work should be attributed correctly. If I would not mention the tools it would seem if the book was written entirely by me which is not the case.

This is a book which was started by me, I did use the AI tools I normally use in my daily routine on my personal projects. They are secondary in this post though.

I posted in my personal capacity and my employer is not aware or connected to this - the book is entirely mine.

It is not AI slop. A large part of its content was written originally by me 10 years ago.

But if it has offended anyone and I should not had posted the work which I have not fully yet reviewed myself, then sorry
jsontwikkeling
·قبل 4 أشهر·discuss
The main goal of posting early was to gather feedback and peer review as soon as possible. I hope it can become a collaborative effort with external contributions.

The book is still a work in progress, and I have tried to be transparent about that. If you have specific concerns about the quality or suggestions for improvement, I would genuinely appreciate hearing them.
jsontwikkeling
·قبل 4 أشهر·discuss
It is your choice. I have read a good part of the book, also wrote a part of it and am in the process of finishing the review. The more reviews - the better. The book is officially in beta and this is fully transparent
jsontwikkeling
·قبل 4 أشهر·discuss
Exactly - this is precisely why I built the project as an integrated repo centered around code and tests first, with the book as one of the produced artifacts rather than the other way around.

Having both an engineering and academic background, I felt there's underappreciated potential in bringing software engineering best practices - tests, type contracts, CI - into an algorithms textbook. Most CS teaching treats code as illustration. I wanted it to be the source of truth.

And agreed on structural typing for graphs. TypeScript lets you define a Graph<T> interface and defer the representation choice, which maps very well to how the topic is actually taught - abstract properties first, concrete implementations second.
jsontwikkeling
·قبل 4 أشهر·discuss
It might seem so, but it is not an AI promoted post. The book was finished with the AI tools, but a bulk of it was written by myself plus the structure and direction.

And I am human, who first finished a similar course roughly 20 years ago, worked as a TA and taught students programming and algorithms
jsontwikkeling
·قبل 4 أشهر·discuss
Great to hear that. I actually think TypeScript is very fit for the purpose, even better than Python (lacks types) or Java (bulkier).

Type signatures document contracts directly:

  export function rabinKarp(text: string, pattern: string): number[]
Clear that it takes two strings and returns match positions. No separate explanation needed.

Interfaces model return types and ADTs cleanly:

  export interface ShortestPathResult<T> {
    dist: Map<T, number>;
    parent: Map<T, T | undefined>;
  }

  export function dijkstra<T>(graph: Graph<T>, source: T): ShortestPathResult<T>
It's also lightweight, flexible, has familiar C-like syntax, and unlike pseudocode — you can actually run everything.

Re: generics feeling awkward — in TypeScript they feel pretty natural. The type inference helps a lot, you rarely need to spell out type parameters at call sites.