DEV Community

32 Lines of Code

Jake Varness on October 28, 2018

At Cerner, we engineers work really hard to deliver innovative health care solutions. However, we also play (and hack) hard too! ...
Collapse
 
jonrandy profile image
Jon Randy 🎖️

Should really be restricted to a number of characters/bytes rather than a number of lines, since a line can be as long as you like. Also, allowing the addition of Vue or Bootstrap (or any other library) is adding hundreds if not thousands of lines, making the 32 line restriction meaningless.

Check this out - 1K of JS - js1k.com/2018-coins/demo/3185

(making of - romancortes.com/v2/nefertiti-1kb.html)

Also this game - also 1K of JS - js1k.com/2017-magic/demo/2846

(Github repo here - github.com/veu/js1k-2017)

Collapse
 
jvarness profile image
Jake Varness

Pulling in Vue and Bootstrap for something this simple is overkill for sure. I'm just glad I was able to take my first dive into Vue since there's been so much hype around it!

Collapse
 
vinceramces profile image
Vince Ramces Oliveros

I am using Flutter/Dart in VSCODE and IntelliJ IDEA(Android Studio) and their style guide makes it easy for productivity as well as readability of the code. after doing fancy myMethod().myFunction().whatEver().iDontCare();, dart will always format on save to maintain the code readable using Dart Format.

Good article for good practice in a simple problem. This will be helpful for someone who looks for a simple class or function.

Collapse
 
jvarness profile image
Jake Varness

Yes, simple problems are great for practice! It doesn't even have to be a new problem. Solve something you already solved but use a different language!

Collapse
 
jdsteinhauser profile image
Jason Steinhauser

I really like the challenge of doing things in 32 lines at most! Have you been inspired from some of your coworkers' submissions, either in learning a new language/library or thinking about a problem in a different way?

Collapse
 
jvarness profile image
Jake Varness

Hey Jason! Sorry it took me so long to respond to this!

So many of the submissions do so many cool things! When we demoed our favorite submissions to each other, I was shocked to see how much people could accomplish with so little code!

It also makes me think about whether or not a different technology would provide more benefits over the technologies we currently use. New technologies sprout up every day, and it's cool to see the potential!

Collapse
 
jdsteinhauser profile image
Jason Steinhauser

Excellent, thanks for the response!

Collapse
 
gypsydave5 profile image
David Wickes

It would be remiss of me to point to a much better Kotlin library than the ktor framework - http4k.

Collapse
 
jvarness profile image
Jake Varness

This looks awesome! I'll have to check it out. Thanks David!