DEV Community

Rachael Ellen
Rachael Ellen

Posted on

How to be more productive when learning a new language

You know that way when you pick up a new programming language? You've coded before, picking a new one up should be a breeze...every one is talking about it after all and it's the next best thing since sliced bread. But - then you start and you realise there's actually a lot more to it than your previous coding experience and you basically have to start and learn everything again from scratch. It all starts to stack and feel a bit insurmountable and then finally oops! You're stuck in the brain bog being unproductive.

Comic strip showing a path eventually ending up in a bog with a cartoon brain sitting unhappily in the middle

Well this happened recently when I was learning how to use Flutter for the first time to build an app for work that maps the countries where coffee comes from. I was excited to learn a new language and quickly remembered/realised...learning new stuff is hard. Maybe it's just my brain but there were so many new things to learn for this project. It all felt just a tad overwhelming and like the end result was very far away.

A cartoon brain standing confusedly at the base of a cliff wondering how to get to the top

This is of course the classic steep learning curve when it comes to learning anything new and is completely normal and natural, especially when there are multiple new elements to learn. In my case, that was learning Dart, Flutter, VSCode, mobile development, working with GeoJSON, UI, UX etc...

To help combat brain boggage and those difficulties in knowing how to get to the end result, I found it helped my productivity to make the most of online tools and resources to help me along the way. Every brain is different, and we all learn in different ways, but finding the right tools can feel like a life line when you are feeling stuck.

Here are some things that helped me up the steep learning curve and ultimately made me more productive than I would have been otherwise!

A cartoon brain in a life buoy floating in a bog looking happy

1. Get Started Guides
Rather than jumping in and madly splashing around hoping for the best, I started slow and worked through the Write your first Flutter app guide. This has so far been one of my favourite coding get started resources - it's presented in a Codelab, and is really accessible, giving you the option of either reading through, or watching YouTube snippets of the steps as you go through the tutorial. I also enjoyed the little artworks keeping it all friendly and easy to understand. The more accessible a get started guide is, the better and I appreciated options for all kinds of learning from the folks at Flutter for that.

2. Sample Code
These days there's just no need to have the expectation on you to write every piece of code completely from scratch from the depths of your brain. I mean you can, if that's your gig. But after getting the basics of Flutter down, I found it very helpful to look through sample code to help me get my eye in. This included Flutter example code (and videos) and also code from the ArcGIS Maps SDK for Flutter beta sample repo.

2. Deserializing JSON into objects
I knew for this project I'd have to deserialize GeoJSON into objects to work with them effectively in the app. Building this beast of a class felt quite daunting for being brand new to Dart and also for what was quite a complex GeoJSON file. However, I found an open source library called quicktype that generates strongly-typed models and serializers from JSON type scripts to a number of languages, including Dart. All you have to do is put in the JSON you want decoded, and it will return a prebuilt class that you can then use in your project. Quicktype have a handy website front end (https://app.quicktype.io/) for this - it worked first time and I was so grateful not to have to build this myself!

3. JSON Formatter
The GeoJSON file I used is super hefty, holding nested geographical information about country border locations as coordinate pairs, and information on country geometry, name etc. There are any number of ways you can show this file to get it to make sense, but I found another online tool that helped me break it down into readable chunks was JSON Formatter. It also helps validate JSON, useful if you're editing and accidentally remove a bracket...

4. API Key storage
This problem isn't unique to Dart or Flutter, but it did help to learn of the options available for it from this helpful blog post by Andrea Bizzotto. I ended up using the envied package as it was straightforward and intuitive to implement!

5. ChatGPT
I've learned that using ChatGPT as an assistant for "reviewing" code / making code "suggestions" allows me to not only get unblocked quickly, but also to learn why things didn't work the way I expected. For example, it helped me get out of a confused rut when it came to implementing a grid view within a sliding up panel. I gave it the code I had along with a prompt to review it and make suggestions as to why it wasn't working in the way I intended. It then suggested compilable code and explained what I was missing, and broke it down into easy to read steps that I could understand. I find trawling through StackOverflow etc pretty exhausting and overwhelming (and brain-boggling) so it was great to have ChatGPT available as a tool to help me get unstuck.

A word of caution though, don't blindly follow it - it will make mistakes (e.g. incorrect method names, wrong imports, won't compile, doesn't know full app context, etc), and it won't always do what you want. You may also have a better way of structuring the code than what it suggests. So take it with a pinch of salt otherwise use it as a great learning tool in the absence of a team to bounce it off!

Happily ever after

Eventually I got the app (sneak peek below) completed thanks to these productivity enhancers (check it out here on Github)! If anyone has any other favourite online resources or open source tools they use for productivity and making learning new languages easier, I'd love to hear them.

Image description

Top comments (1)

Collapse
 
anjie_mf profile image
Anjie_MF

Using ChapGPT, it is the tutor I can never afford. It's really helpful because I prefer study in the dead of night.