Rasmus​.krats​.se

Denna sida på svenska

Posts tagged “development”

Reminiscing this and that, on the web since 1994.

Keep It Short & Simple

Posted 2025-12-15 22:20. Tagged , .

Most experienced programmers know that KISS means Keep It Simple, Stupid. But should it? I think a better interpretation would be Keep It Short (and) Simple?

It is good that people know they should keep their programs simle – and that some even does. I don’t doubt that the edgyness of calling code—and the people who wrote it—stupid is part of why the KISS meme is so well known, but I have two objections.

Read whole Keep It Short & Simple.

Web frameworks in Rust

Posted 2020-09-09 20:48. Tagged , , .

When doing a web application server, one of the first things to decide is which web application framework or request handler library to use. In Rust, there are more alternatives for that question than in most programming languages, and anyone who has ported some code from tomcat jsp to play framework or from flask to django may dread making the wrong choice. On the other hand, Rust being very strict on static typing makes it very easy to do major refactorings, and I have switched existing projects from iron to nickel to gotham to warp myself without too big problems.

This page collects some of my personal thoughts on each alternative as of September 2020.

Read whole Web frameworks in Rust.

Rust and me in 2019

Posted 2019-01-26 16:25. Tagged , , , .

There is A Call for Community Blog posts over at the Rust Programming Language Blog. This is my entry, briefly describing my hopes and expectations for Rust, it’s eco-system and my own participation in 2019.

Read whole Rust and me in 2019.

Rust and the web in 2018

Posted 2018-01-07 22:50. Tagged , , , .

There is A Call for Community Blogposts over at the Rust Programming Language Blog. This is my entry.

I mainly do server-based web service development. The server sends html, css, images, and javascript to the browser. The javascript implements progressive enhancement for the content, but the site should be usable and as nice as possible even with javascript disabled. So while I certainly do RESTful json API:s, I also do server-side html templateing, css (and scss) minification, etc. I think Rust has great potential here, partly because of optimization and execution speed, but mainly because the type safety and fearless concurrency make it easy to actually get things right and avoid unpleasant surprises at runtime.

Read whole Rust and the web in 2018.

A compiling template system in Rust

Posted 2016-10-07 18:32. Tagged , , , .

When developing web applications, it is often useful to have a template system. Something that lets you write generic versions of web pages, that the application can fill with the specific content for each page it should show.

There exists lots of languages to write such templates, such as mustache, jinja2, and play 2 scala templates (twirl). Most fits very well with a dynamic language, where you can get properties from an object, or even call a method, by its name in a plain string. In a statically compiled language, the actual names of fields and methods are not relevant, and generally not present, after compilation. This makes a dynamic template language a hard match for a compiling language such as rust. So why not try to create a better match?

Read whole A compiling template system in Rust with 3 comments.

Some ways to log stuff in java

Posted 2013-11-14 15:10. Tagged , , .

Logging in java is a mess. For a long time there was no standard way of logging in java, so there is a lot of 3:rd party solutions. Apache commons logging, slf4j, and log4j are probably the most used.

By now, there is standard java.util.logging package, but most people stick to the old 3:rd party solutions. As we shall see, that isn’t really surprising, since java util logging kind of sucks.

I have done some exploration of different options for logging in java.

The code I base this text on is available as kaj/explorelogs on github. I explore the industry-standard logging packages slf4j, log4j, and appache commons logging as well as java.util.logging. And I take a look at the Loggger in play framework 1.x as well as my own wrapper around log4j.

Read whole Some ways to log stuff in java.