diving into functional programming

 Today was my first time really getting into the functional programming course, and I actually think its really interesting. from what I have seen in the few lessons I have done, its about trying to keep your code as short and simple as possible. the example the course gave was this: to make a simple rule of having a red button on a web page in CSS, all you would need to do is this.

button {

  color: red;

}


where in python, you would need to do this.

from tkinter import * # first, import the library

master = Tk() # create a window

master.geometry("200x100") # set the window size

button = Button(master, text="Submit", fg="red").pack() # create a button

master.mainloop() # start the event loop


I have always been a fan of finding simpler ways to do things, and its been one of the things that has helped me become successful in construction as well. I am glad that there is a similar effort made in programming (obviously) to make things make sense in a short way. 


As a side note, I might need to look into getting a different keyboard or something to use. my wrists are starting to hurt just typing on my macbook after an hour or so each night. 

Comments

Popular Posts