The thing that my job is requiring me to do. Trial by fire. But also after the 4th or 5th language and Nth framework, it gets much quicker to pick up new ones.
Ask HN: What do you code when learning a new language/framework?
21–30 of 171 posts
Re: Ask HN: What do you code when learning a new language/framework?
#22Re: Ask HN: What do you code when learning a new language/framework?
#23I'm not gonna write a compiler in Rust, and I'm not gonna write a web server in Haskell (reading between the lines the opposite is true).
So just for example
Kotlin => a quick web app or a mobile app
Python => rewrite some bash script I've been meaning to improve, or write some statistical analysis with numpy
In the process I get to learn a new domain at the same time, and get to see what that looks like when an ecosystem actively tries to make it easier.
Of course sometimes it's good to try to use a language for something it's not commonly used for, and find out how much programming can suck when no-one has worked on smoothing out the edges.
Re: Ask HN: What do you code when learning a new language/framework?
#24Re: Ask HN: What do you code when learning a new language/framework?
#25It's far from a true comprehension of the language, but it is really helpful to tackle problems that I've already done a few times in languages I am more familiar with to help relate concepts and highlight the differences.
Re: Ask HN: What do you code when learning a new language/framework?
#26If you're a good pianist and you have to learn the violin, I think it's best to start with scales and arpeggios just like any other beginner, except you go faster because your existing knowledge transfers to the new instrument. Trying to make your way through Beethoven's violin concerto starting on your first day with the violin seems to me like a ridiculous approach.
Re: Ask HN: What do you code when learning a new language/framework?
#27I've got pretty good experience with both, so knowing the algorithms is helpful. Where it gets harder isn't the language itself, but usually the idioms for expressing certain concepts.
For example, Rust doesn't have default parameters, so the builder pattern is pretty common.
Re: Ask HN: What do you code when learning a new language/framework?
#28When that fails, because there's no non-exploity solution ... I drop it.
Otherwise, next, I look for easy multithreading.
Then I look for ways of plotting pixels on an easily available canvas.
Then I code an effect.
The last new language I've learned was python. For that one it was different. With no experience in python specifically, I've asked the friend, who recommended it to me, to give me a problem and I'll code him a solution.
I'm an autodidact and generally don't like using tutorials, papers and whatnot. Google is all I need. He wanted a webscraper ... and two hours later, after lots of fiddling around figuring out how the language works, I was done.
Then I made an effect. It was slow. D'uh. :-)
Re: Ask HN: What do you code when learning a new language/framework?
#29Re: Ask HN: What do you code when learning a new language/framework?
#30This is how I started my career in the first place as a software engineer and this is how I continue learning new languages w/o the feeling to artificially build something useless
I usually start like that:
- add a mouse/keyboard emulator library, on the way you usually find out how good native system integrations are and how to integrate dependencies into your project
- write a brutally easy script of some mouse clicks/movements or similar to have something in place you can build on
- generalize the script
- make use of basic code features like functions, code logic, abstractions
- maybe add some math for screen resolution independent mouse movements ore more natural movements or typing events
- have some basic idea of concurrency by waiting a random time before input events
- how about adding openCV or a similar screen capture tool? now you can capture a single color indicating a specific event to make things more interactive- get more creative in what you want to detect
- figure out what are the limitations of the language of your choice, how many fps can you archive and what are the bottlenecks?
- when you are at this point you opened the door to an endless journey of adding more and more features and optimizing your code
the first steps are often just c&p from stackoverflow + some basic lookup from the documentation. with this approach you have a working prototype rather quickly and you are in full control on how fast and in what direction you want to go
by the time everything feels repetitive in what you are doing you probably already have a basic idea of the language and can decide on how or if to continue.
needles to say, don't spoil yours and others fun by applying this approach to PVP oriented games. also you will probably have a hard time since there are way more efficient ways + anti cheat tool will detect you