Is it right way to create shortcode?

The codex explain, I think, very well the creation of shortcodes

http://codex.wordpress.org/Shortcode_API

A very basic shortcode

function foobar_func( $atts ){
    return "foo and bar";
}
add_shortcode( 'foobar', 'foobar_func' );

To use it, you just need to [foobar]

The first parameter on add_shortcodeis the name of the shortcode

function bartag_func( $atts ) {
    extract( shortcode_atts( array(
        'foo' => 'something',
        'bar' => 'something else',
    ), $atts ) );

    return "foo = {$foo}";
}
add_shortcode( 'bartag', 'bartag_func' );

To use it, just use [bartag foo="foo-value"]