programming -- Berry Web Blog -- page 1

Software Programmers are like Doctors…

Posted: 2015-09-15. Modified: 2015-12-21. Tags: Opinion, programming.

They must diagnose and treat complex problems every day. But the difference is:

for doctors, the platform stays the same.

in software, THE PLATFORM KEEPS ON CHANGING!


Is python pseudocode?

Posted: 2015-09-15. Modified: 2015-12-21. Tags: LISP, Opinion, programming.

People often state that python is the most similar programming language to pseudocode (what you write if you are trying to convey a piece of software to other humans rather than a computer). I've translated numerous pseudocode algorithms from books into various languages, and I agree that python often makes this process natural.

However I think an argument can also be made for LISP as the most "pseudo-code" like language. Perhaps while Python has the greatest surface similarity to pseudocode, LISP has the greatest actual similarity to pseudocode.

Why do I claim that LISP is similar to pseudocode? It's appearance is often rather different, after all.

I make this claim because of the intrinsic linguistic flexibility of a language supporting structural macros. The power of pseudocode is not just that it doesn't conform to a particular bracketing convention or function naming convention – the power of pseudocode is that you can introduce arbitrary code constructs, and explain them to your readers later on.

For example, consider the "with-redeclarations" construct, which rebinds all the functions executing within it. Lisp is MUCH closer to the ideal of the programmer being able to create arbitrary constructs than python is, and there are many instances of where you could imagine a way of thinking about a problem in pseudocode and translate the idea approximately into lisp, but have to rework it completely for python.

Therefore I conclude that while python does often look very similar to pseudocode written in a book, lisp is in a way also very similar to pseudocode because you can dream up very flexible code constructs just as you would if you were explaining a problem to someone with no fixed programming language.


Turing Machines are Overrated

Posted: 2015-09-15. Modified: 2016-01-06. Tags: programming, philosophy.

Constraints of runtime environments mean that not all turing-complete languages are equally powerful. Much of computing is pushing electrons over wires, not performing symbolic manipulation in the Turing sense. Therefore Turing equivalence of two languages does not necessarily imply that you can perform the same tasks in both of them – one may have drivers written to communicate directly with your gpu, while the other doesn't, for example.

Besides running "algorithms", computers can also interact with their environment. The Turing machine model models everything that can be done with the former capability, but nothing that can be done with the latter. This is a massive omission, and of course puts a lie to the "idea" that all programming languages / runtime environments / computers are equivalent. If computer A has freely available networkable features, while computer B is a strictly self-contained "algorithm" device, then there is an entire world of things you can activate or interact with with computer A which you can't with computer B.


A Minimal Set of Computer Libraries

Posted: 2015-09-15. Modified: 2015-12-21. Tags: programming, Opinion.

I am aware that modern business programming is essentially stringing together chains of third-party libraries which you only vaguely understand till you get the result you think you want. Rather than understand everything that goes on at every step of the process, you instead choose to understand the bare minimum to get to the next step.

But hobby programming doesn't have to be like this. Wouldn't it be fun to understand a set of tools at a level that you almost never have to crawl the web looking for quick-help tips? Wouldn't it be nice to be able to repurpose a set of libraries to accomplish everything you want to do as a hobby programmer?

Well, I think this may be true, for my needs at least. I am working on learning a set of libraries which I think can cover everything I need to do as a hobbyist, will report back with any insights I may gain.

The set of tools I am starting with is:

  • C.
  • Lisp. (Common and Emacs)
    • various common lisp libraries. todo add
  • SDL – graphics, audio.
  • OpenGL – graphics
  • GSL – GNU Scientific library.
  • LAPACK/BLAS – linear algebra
  • POSIX – file-handling and system level stuff.

With this set of tools, I can system-related stuff, math-related stuff, and multimedia-related stuff. That's a start at least.


No One Knows How to Do Anything Anymore

Posted: 2015-09-15. Modified: 2016-01-06. Tags: Opinion, programming, philosophy.

Do you think you know how to use piece of software X? No you don't. You've just learned enough of the facade of X that you can often get by without having to look for directions.

Much of modern software development (and life in general, for that matter), is crawling through the vast trove of information available on the internet to find a pre-made solution to a problem at hand. My observation, at least, is that programmers rarely take (or have) time to develop a thorough understanding of a problem or tool. Rather, we rush through assignments and tickets, pasting together components until it seems like we have what we need.

Forget algorithms and datastructures, the most important skill for a modern programmer to have is – google skills.


Links

Posted: 2015-09-15. Modified: 2017-08-20. Tags: programming, math, music, hobby.

1 Music

2 Programming

2.1 General

  • Andrew Gibiansky's personal blog A really interesting resource. Gibiansky has a variety of great tutorial-style articles, including discussions of Convolutional Neural Nets and Haskell.
  • Scripting: John Ousterhout In this well-known article John Ousterhout provides clean analysis of some of the various types of programming languages in existence, identifying strengths and weaknesses of different languages. He provides a survey of some research on the verbosity of software implementation in various languages and paradigms – in particular he finds that one line of a scripting language is often equivalent to between 5-10 languages of a systems language, and that OOP provides a ~20-30% LOC improvement over traditional procedural programming. He identifies some reasons why OOP code can sometimes be hard to reuse, and also identifies why scripting languages provide a great ability to reuse the code of others.
  • D.J. Bernstein's Website DJB is a cryptography expert who has written a number of excellent pieces of software, including qmail and daemontools. He has written quite a bit on computer security and internet standards.

2.2 Common Lisp

Above is a link to a pdf containing the final draft of the ANSI Common Lisp standard. I believe it can be treated as an authoritative resource on Common Lisp for the general user, and is a good alternative to the Common Lisp Hyperspec.

Please see this article for an explanation of how I obtained this pdf, licensing information (free to distribute, etc…, per the creators of the draft), and background information on why I created this pdf.

  • SBCL is my favorite Common Lisp implementation, and is also my favorite programming environment for my hobbyist programming.

2.3 Python

I like python a lot, and find it a very productive environment for interactive computing and experiments. Python's practical power is in large part due to its excellent ecosystem of libraries and tools. Below are some of the ones I have found useful to learn.

  • Scipy+Ecosystem SciPy and its related tools (Matplotlib, NumPy, Pandas, IPython,Scikit-Learn,…) really do form an amazing toolset for data analysis and mathematical problems. This is definitely my preferred toolset for these problems currently – I have tried some alternatives but I prefer the python libraries and toolset.

2.4 Other

  • Project Euler A fun and challenging math+programming challenge.
  • Excel Unusual Some pretty outlandish examples of what can be accomplished in Excel.
  • Maxima Maxima is a lisp-based CAS, with good documentation, and which also has an Android port. I like this software.

3 General Computer Usage

Below are links to some of the software packages which I like and use.

3.1 email client

  • Sylpheed is my favorite email client. It is extremely easy to set up with IMAP, and provides all the features I need and expect to use email. It is easy to build from source and has light resource requirements. See the FAQ for more information.

3.2 finances

  • I manage our finances in gnucash using ofxclient to automate download of transaction data.

    Actually currently I use a forked version of gnucash with a feature I have added, but I plan to try to upstream my feature eventually (upstream Gnucash is going through a good bit of code churn currently and I haven't had time to figure out the build for the latest version yet).

    These two tools make a reasonably good pair as long as your financial institutions support direct download of OFX files. I find that GnuCash is good for general accounting purposes, but is not so great for tracking investments over time however. I think there is some room for improvement in this area in the future.

4 Maths

  • No Layman Left Behind Intuitive and simple explanations of various concepts in mathematics and CS.
  • UAH Virtual Prob/Stat Laboratory a well-designed and written website covering a range of topics in probability and statistics. Includes good explanations of how to derive statistics formulas and practices, also includes interactive "apps" which allow you to experiment hands-on with the concepts being taught.
  • DSP Guide A great introduction to DSP for people like myself who are not specialists in the field. I have the hardback edition of the book, but I respect the author for making his work freely available on the internet. Before reading this book, other DSP books I have were fairly incomprehensible to me. After reading this book, I can read DSP books without much trouble. Highly recommended!.

5 Hobbyist

  • Sliderule Software If sliderules and calculating devices interest you at all, you may find the software on this site to be cool. The "Curta" mechanical calculator is particularly cool…

6 Miscellaneous

  • Project Gutenberg Access a volume of high-quality, public domain content here. It's a pity that the United States keeps extending copyright protection well beyond any reasonable bounds at the behest of media corporations. See this image for a depiction of how US copyright law has changed over the years.
Atom Feeds:
Tags: