a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by user-inactivated
user-inactivated  ·  4062 days ago  ·  link  ·    ·  parent  ·  post: What language(s) are you currently learning?

A dialect of Lisp named Scheme. It's the most interesting programming language I've ever seen.

I've tried to learn Python, but soon afterwards ditched it. It's one of the most boring languages to learn. The uninteresting syntax is groan-worthy.





rob05c  ·  4061 days ago  ·  link  ·  

I highly, highly recommend the SICP (also available online).

The SICP uses Scheme. But it doesn't just teach the language. It teaches you how to program, and think, functionally. Things like the different types of recursion (tree-recursive, vs linear recursive, vs iterative [did you know you can write a recursive program that executes iteratively‽]).

Highly recommend it. It will help you learn to think functionally to a much greater degree than an ordinary Scheme tutorial.

FYI I'm kind of in the same boat. I was taught OO and Imperative programming, and I've been trying to make the vertical ascent to FP. It's hard to find the time.

wasoxygen  ·  4032 days ago  ·  link  ·  

Thank you very much for this suggestion. I have been wanting to try functional programming for a long time, after seeing so many inscrutable and concise solutions on Project Euler. I never managed to get far with Haskell, though.

In addition to the web version you linked to, Chris Krycho has created a nicely-formatted Kindle version. I am 4% through it and managed to write my first Scheme code for Exercise 1.3: "Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers."

  (define (square a) ( * a a))
  (define (sumofsquares a b) (+ (square a) (square b)))
  (define (<= a b) (or (< a b) (= a b)) )
  (define (sosbig2 a b c) 
    (cond 
      ( (and (<= a b) (<= a c)) (sumofsquares b c))
      ( (and (<= b a) (<= b c)) (sumofsquares a c))
      ( (and (<= c a) (<= c b)) (sumofsquares a b))))
I am using a handy online interpreter.

delta, how's your progress coming?

user-inactivated  ·  4031 days ago  ·  link  ·  

Well, I decided I didn't like Scheme's syntax + there aren't many frameworks & libraries that support it.

I'm learning C now, and I like it a lot more. The main reason I'm learning C is that I plan to use OpenWRT for a science fair. Your code above is pretty damn beautiful, though.

I wrote a program yesterday because my sister wanted a program related to flowers. (✿◠‿◠)

  #include <stdio.h>
  main()
  {
    int rose_amt = 12;
    int daisy_amt = 7;
    int tulip_amt = 23;
    int sunflower_amt = 42;
    int rose;
    int daisy;
    int tulip;
    int sunflower;
    int exit_value;

    printf("This program will calculate the grand total number of days\nit will take for four different kinds of flowers to grow.\n\n");
    printf("Roses take %d days to grow.\n", rose_amt);
    printf("Daisies take %d days to grow.\n", daisy_amt);
    printf("Tulips take %d days to grow.\n", tulip_amt);
    printf("Sunflowers take %d days to grow.\n", sunflower_amt);

    printf("\nHow many roses do you wish to plant?\n");
    scanf(" %d", &rose );

    printf("How many daisies do you wish to plant?\n");
    scanf(" %d", &daisy);

    printf("How many tulips do you wish to plant?\n");
    scanf(" %d", &tulip);

    printf("How many sunflowers do you wish to plant?\n");
    scanf(" %d", &sunflower);

    printf("\nIt will take a grand total of %d days for all the flowers to grow.\n", rose*rose_amt+daisy*daisy_amt+tulip*tulip_amt+sunflower*sunflower_amt);
    printf("\nWould you like to exit?\n");
    scanf("%d");
    return 0;
  }
user-inactivated  ·  4061 days ago  ·  link  ·  

Thanks for the resource & information! I definitely need to learn how to program before attempting to learn. Many people don't understand the difference; one of my friends learned the complete syntax of Python, then realized he didn't know how to do anything with it (thanks, Codecademy).

By the way, Scheme is my first venture into programming outside of HTML+CSS and looking at Python a few years ago. We'll see how it goes.

user-inactivated  ·  4062 days ago  ·  link  ·  

Meanwhile I'm just sitting here learning Python. :) Lisp seems really cool though, I would like to look into it more at some point.

At the moment its Python and Javascript (Angular) which have both been really interesting to me so far.

user-inactivated  ·  4061 days ago  ·  link  ·  

Hey, we all have our own opinions and preferences. :) Python is definitely one of the best general programming languages, it's just not for me.

If you ever look into Lisp, make sure you learn a dialect and not Common Lisp. Also, the syntax will look completely alien to someone with experience only in Python and JavaScript.

What kind of applications are you looking to develop?

rob05c  ·  4061 days ago  ·  link  ·  

    make sure you learn a dialect and not Common Lisp

Why do you say that?

user-inactivated  ·  4061 days ago  ·  link  ·  

In terms of actually utilizing the language in applications, there are more options for Scheme and Clojure when compared to Common Lisp.

rob05c  ·  4061 days ago  ·  link  ·  

That's interesting. I definitely agree about Clojure. But I was under the impression there were a lot more Common Lisp applications out there than Scheme. I don't know, I'm not an expert in any of them.

user-inactivated  ·  4061 days ago  ·  link  ·  

Neither am I. I simply do my best to learn, so please try to disprove me if I'm wrong.

user-inactivated  ·  4061 days ago  ·  link  ·  

I have worked with a few languages already but these are my current interests. Yeah I briefly have looked at Lisp I remember the unique syntax. I'm looking to make web applications, APIs, mobile apps.

user-inactivated  ·  4061 days ago  ·  link  ·  

Ah! My uncle is a computer scientist and often creates mobile applications with Sencha Touch. What languages have you worked with?

user-inactivated  ·  4061 days ago  ·  link  ·  

Cool, I'll have to look into Sencha more, I was considering using PhoneGap but this looks really nice! I have used PHP and Perl mostly, with predominantly web programming in jQuery, Coffeescript, or vanilla JS. Recently went back and took a class in C to get some fundamentals, and worked through some tutorials in Ruby but nothing in depth.

For a while I was researching node.js for my current project but I ended up switching to Python with Flask at the last minute because I was running into a ton of issues with the automated node build tools and dependency hell. I'd still like to try node again for an api but so far Flask is working really nicely.