DEV Community

Tom Watt
Tom Watt

Posted on • Edited on

P3 - Personal Porting Project

Password Strength - XKCD comic

What

It's a small idea based on the Password Strength - XKCD comic to create a simple application that will generate a random password from a collection of nouns and then recreate it in other programming languages.

Why

I like to take on new challenges and learn at the same time. I felt this is a great way to be able to learn new skills and techniques - and different Programming Languages - but also reinforce what I already know.

How

To keep it simple and quick to be able to test and run locally, I've used Docker Compose. This allows me to bring up multiple containers for the various Programming Languages and keep them separate.

I started with Python, as that's what I'm most comfortable with, and was able to get a skeleton/template to implemented in the other languages.

Progress

I've started to make some progress and recreated the application in Go and Node.

Go presented me with the challenge of being entirely new to me. The Syntax was somewhat familiar to Python but with the added Static Typing, needed use of Scanners to read files and needing to make Random Random(!?). It was more verbose with needed Error Handling but I have to say I liked it.
Additionally, building the binary at the end and being able to shrink the Docker Image from 300MB+ to 13MB using Multi-Stage Building was satisfying.

Node, again was entirely new to me as well. I originally intended for it to be Deno for TypeScript but came across no official Docker Image for Deno. So to support long term use, defaulted to Node. The use of CallBacks and Async totally threw me and I gave up and tried Rust - that didn't work out.
Then returned after thinking it through and reading more examples and documentation. The Syntax caught me out a few times but I managed to work my way through by going back to the skeleton/template to simplify my way of thinking.

Future Plans

Going to aim to get add in Ballerina, Ruby & Rust. Possibly, add more but I feel that's a good range of different languages and styles to start with. Next moving onto refactoring and making the applications suited to the languages.

Tests will need to be added as you always need tests.

Finally, adding use of HTML and CSS to create a UI and making the Docker Images as small as possible.

GitHub logo tomowatt / P3

P3 - Personal Porting Project

Top comments (0)