Slashdot Mirror


Short Coding Projects?

sapped asks: "Whenever somebody advocates a new programming language for you to try, they will usually suggest writing something in it that will take you an hour or two to code, so that you can get a feel for it. My problem is that I tend to go from extremely trivial ideas straight to stuff which will keep me busy, for at least a few days. I don't seem to have a handy in-between size project that I can test stuff in. The closest I came to this was writing a little ad-blocking proxy for my browser, a few years back. Any ideas on neat small non-trivial projects?"

4 of 122 comments (clear)

  1. Re:a little easy but... by saden1 · · Score: 4, Informative

    you can always got to Topcoder and check out some the problems they have over there. They have all sorts of coding problems with varying difficulties.

    --

    -----
    One is born into aristocracy, but mediocrity can only be achieved through hard work.
  2. Depends on your programming language by Nice2Cats · · Score: 3, Informative
    I think you need to be a bit more specific about which programming language you are talking about. In Python, a program that lets you write an email with your favorite editor and send it via SMTP is something you can do a few hours; however, in assembler, some of the most easy problems quickly get tricky:

    .file "helloworld.c"
    .section .rodata.str1.1,"aMS",@progbits,1
    .LC0:
    .string "Hello World"
    .text
    .p2align 4,,15
    .globl main
    .type main, @function
    main:
    pushl %ebp
    movl %esp, %ebp
    subl $8, %esp
    andl $-16, %esp
    movl $.LC0, (%esp)
    call puts
    leave
    ret
    .size main, .-main
    .section .note.GNU-stack,"",@progbits
    .ident "GCC: (GNU) 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)"

    Now try doing that without looking up things in a book -- obviously I cheated here and just used the GCC. You see what I mean, though: Writing a mail program in assembler is somewhat more tricky than Python.

  3. Re:Short coding project? by damiam · · Score: 3, Informative

    Some NP problems are solvable in polynomial time. NP-complete problems, which the parent was probably referring to, are currently not.

    --
    It's hard to be religious when certain people are never incinerated by bolts of lightning.
  4. Tetris by marcovje · · Score: 4, Informative


    I usually write a tetris clone.

    Basic operation is 400-1000 lines typically