What are the best monospace or fixed-width fonts to use for programming?

I'm still a huge fan of the classic Profont, originally a Mac-only font that now has been cloned on several other platforms.


ProFont originally offered 9-point and 12-point versions designed to match the spacing of Monaco exactly, but with clear articulation of similar characters like "0" and "O", "l" and "1".  Incredibly clear, even at 9-point.

How much of what sysadmins typically do is automatable?

While many of the routine tasks can be automated, any reasonable-sized deployment can have a lot of interesting and unexpected behavior under unexpected circumstances.  A good sysadmin needs to both automate routine tasks and be able to deal with the unexpected circumstances that come up (and automate their fixes if they happen often enough).

What are the main advantages and use-cases of currying?

If your functions are in curried form, that makes it more convenient to partially apply them. It's never necessary, but it's often syntactically lighter. For example, suppose that you have a list of integers xs, and you'd like to add 3 to each of them.

In Standard ML, the operator + has type int * int -> int. If you want to add 3 to each element of a list using map, you need a one argument function that adds 3, which you can get by partially applying +:

map (fn y => 3 + y) xs

In Ocaml, on the other hand, + is curried — that is, it has type int -> int -> int. (The arrow right-associates, so that's the type of a function that consumes an integer and produces a function that consumes an integer and produces an integer.)  This makes partially applying + a bit shorter:

map ((+) 3) xs

These same techniques work in untyped, higher-order languages such as Perl and Python as well, but it's easier to explain in a typed language, where you can see the difference between curried and uncurried + in their types.

If you write your functions in a curried style, the order of the arguments affects which arguments you can partially apply conveniently. For example, given a list of floats in Ocaml, it's syntactically lighter to find the reciprocal of every number than to divide every number by 2:

map ((/.) 1) xs             (* reciprocal of every number in xs *)
map (fun x -> x /. 2) xs    (* half of every number in xs *)

There are a few solutions to this problem. One, employed by Haskell, is operator sections, which allow partially applying either operand:

map (1 /) xs    -- reciprocal of every number in xs
map (/ 2) xs    -- half of every number in xs

More generally, the Scheme cut macro (http://srfi.schemers.org/srfi-26…) facilitates arbitrary partial application. For example, given a vector v and a list of indices into that vector indices, we can set each of those indices in the vector to 0:

(for-each (cut vector-set! v <> 0) indices)

In this example, <> is the placeholder for the argument that isn't partially applied; cut actually allows an arbitrary number of placeholders. Note that this is not an example of currying, but an attempt to provide a more flexible way to do partial application than currying provides.

How long does it take to master Erlang?

Try finding an online tutorial, but don't be afraid to ask a friend for help — if you're fortunate enough to have one that knows Erlang.  The core language isn't too bad if you're familiar with FP, but the associated concepts like gen_*, supervision hierarchies, and error handling are tricky.  Don't be ashamed to ask for help … it's not as straightforward as most of the languages you've learned.

Implement the things you're learning.  After you learn a concept, try building something that uses that concept.  If nothing comes to mind, ask someone for an assignment or find a tutorial with homework.  Reading tutorials and manuals will tell you how a feature works, but you won't really understand where it's appropriate to use until you've actually used it incorrectly a few times.  Experience is key; you'll probably find that after a while of programming Erlang that everything you wrote more than two weeks ago is complete crap.

Once you get into the real world use http://erldocs.com for reference.  It's the same material as http://www.erlang.org/doc but presented better.

Is it okay to use HRs in HTML?

No, absolutely not in these days of web-standards!

<hr> is a left-over from the early days of HTML when we had no reliable CSS to handle presentational stuff. It's a non-semantic element in your HTML code and should rather be done with proper CSS.

Basically, replicating the effect of a <hr> is a simple one-liner in CSS, e.g.

div {
border-bottom: 1px solid #000; /* makes a black line below the div-element */

What bugs me most about <hr> is its utter lack of semantic meaning.

Nowadays, you're supposed to write HTML code which focusses on breaking content up into semantically meaningful, structured chunks. <hr> doesn't help here at all. Other modern HTML entities like <section>, <aside>, even <div> are much more suitable to separate/isolate one piece of content from another.

And that's another reason why it should be avoided.

How much of what managers typically do is automatable?

Good management can't be automated because its mainly to do with exceptions. Normal operations should not require any activity from managers, because there should be procedures and automation in place. Management is needed to deal with special cases – failures in normal operations, continuous refinement to make "normal" better, and high level changes that affect what "normal" is.

One of the problems of management is that the feedback loop is much longer and the feedback is often less clear than in non-management jobs. If you write code, you have pretty direct feedback – it compiles or it doesn't, it passes the tests or it doesn't, it crashes or it doesn't. If you manage people who write code, you get reports of some kind as to whether it compiles, whether is passes the test, whether it crashes, and also whether the project is on schedule, what the requirements are, etc, but this is less direct.

Because the feedback is less direct, and often hard for you and others to track, bad managers can persist in an organization for much longer than bad coders. There are people who perform something that looks like "management" without any real effect on the organization at all – they collect reports, schedule work, and arrange statistics in charts with no understanding of what they're looking at. This absolutely could be automated, and its remarkably common.

Which is better for code editing- vi(m) or SciTE?

You did not specify what kindof coding, what language or for what purpose so I shall try to generically answer this.
This is a highly subjective question with Highly subjective answers.
I shall simply express my point of view.

Firstly, almost all master craftsmen-coders I know primarily utilize either vim or emacs for almost everything from code editing to writing pdfs to writing markup.
Rumor has it that some can even manage and perform all tasks on their OS, without every getting out of their editors. (This is certainly possible with the command line subshells, but you need to be gifted in the ways of the nix)

Secondly, comparing Vim and SciTE I find that although SciTE seems like a capable editor, the features it supports is a subset of the features vim offers.
Some of the features I find missing in SciTE are:

  • Lack of Macro support in SciTE (Record keystrokes and play them back!)
  • Window split support in SciTE (very useful while programming)
  • Lack of inbuilt shell/shell support in SciTE (Often needed while programming)
  • Lack of spell checking in SciTE
  • Limited regex support in SciTE (Find and replace fast dear Sir, find and navigate faster)
  • Lack of Function list provision (Vim can fetch functions from included header files  inc C/C++ etc. Extremely useful)
  • Lack of large-file support (files>4GB, Probably irrelevant for most coding, but mentioned for completeness' sake)
  • Lack of protocol support. (You may not know this but you can use vim to edit files directly over the server ref: Editing remote files via scp in vim )

These differences may or may not be important to you depending on what environment you're working in (editing PHP on a live server is very different from writing CSS which is again very different from writing a kernel module in C/C++)
but the point is that they do exist.

Lastly, Vim is a pretty tried and tested piece of software, it has been in use in the industry for quite some time now, many professionals and amatuer users alike, swear by it.
It has a huge community the world over and is very well supported.
It is highly customizable (probably SciTE is too, but you'll have a bit more to get it working to your liking), you have a whole gamut of .vimrc files available online (vim config files) for each and every programming language in almost possible indentation and coding styles.

The reduction in keystrokes and hence productivity increase that vim provides (after a bit of learning ofcourse) is comparable to few text editors out there. Once you become comfortable with vim, your hands don't move from the classic typing position, mouse usage drops to zero and you move blocks of code/text around like magic.

As you've probably guessed I'm a vim fan, but the facts I've mentioned here are true. And although SciTE maybe a capable text editor for most purposes you may ever need an editor for, if ever you wish to do heavy duty text editing, manipulation , you'll find yourself wanting for the advanced feature set and environment that vim provides.

PS: I know this is not a technical forum, but It is my humble opinion that you should Google technical questions such as these before posting them, or if you have already done so, please add what all you found and referred to, in your endeavor to solve the question, as part of the question description. Thanks !

A simple "Vim vs SciTE" query throws up quite a few useful results on Google such as:

  • Comparison of text editors ( << READ THIS )
  • SciTE and Vim Compared

What's the best way to release code as open source?

It largely depends on what you want to see happen to the project. The simplest license choice, given that you've moved on, is to apply a permissive license (e.g. Apache, BSD, MIT, etc). This will give follow-on developers the most flexibility in terms of how they leverage the code.

As for where you host it, given that you don't plan to be working on it, this is probably less critical. Google Code is an acceptable choice, and Github is rightfully receiving a great deal of attention for its social coding functionality. The latter, by leveraging Git rather than Subversion, also is more fork friendly in the event that this is the type of code that will be leveraged in many different ways.

What's the best way for a beginner to start learning Ruby on Rails?

Computer programming is something that you learn by doing.  To learn a programming language you need to use it.  In this case we're talking about ruby, but it applies to all programing languages.

After going through a few of the tutorials mentioned elsewhere on this page you will probably feel like you're comfortable following tutorials, but that you don't feel like "you know ruby". 

And you never will feel like you've truly learned the language until you start venturing out and using it without the hand-holding that most tutorials provide.

Here is what you need to do to actually learn ruby.

So shortly after completing a few tutorials, the approach you should take is the same approach that Japanese martial arts masters use to master their craft: kata.

If you're looking to become a Rex-Kwon-Do master, you'll practice reacting in response to a specific move an opponent makes with a certain choreographed patterns of movements until it becomes muscle memory.  You'll want to do the same with coding challenges.

So from various tutorials you'll learn what different commands you can write.  When you face your first problems it's common to feel overwhelmed.  There is SO MUCH stuff in that this ruby programming language has to offer.  Should you use an each command or a return one?

The nice thing about programming is that it is possible to solve all computing problems with a remarkably small number of commands – by mastering a relatively few commands you can glue them together to solve all your problems.  Once you master the most important commands of the programming language – you can work on some of the other "cosmetic" commands, which might allow you to solve a problem with 1 line of code instead of 3.

The master has encountered every single variation of every problem countless times and immediately has the muscle memory of how to solve the problem.  It's a reaction without even needing to think.

A beginner doesn't have these coding instincts.  To develop them, but you can develop them using kata.

Kata in programming are coding challenges that will push you towards using a small number of specific pieces of the programming language at your disposal to give you this muscle memory.

Here's an example of a programming kata.

Reverse a sentence, for example the turn the text "bob likes dogs" into the text "dogs likes bob"

This is a relatively simple problem, but it will require that you know how to do the following steps:

  • Covert text into a list of words
  • Reverse a list of words
  • Recombine the words together into a sentence

And the first kata you get will kick your ass! It may take you an hour or more and you might not be able to solve the problem.  You'll struggle and the process will feel frustrated.

And eventually you might give up and ask for help.  But then when you look at the code that solves the problem, you'll understand how and why it's working.  By fully understanding the solution to each kata before moving on to the next you'll start developing this mastery of the craft.

You'll appreciate what each piece of the program is doing and be better prepare for next time, when you'll have a different, but similar problem.

And then when you tackle your next programming kata, for example:

Remove the word "likes" from a sentence, for example turn the text "bob likes dogs" into "bob dogs".

This is a problem that has similar steps as the previous problem:

  • Convert text into a list of words
  • Remove one word from the list
  • Recombine the words together into a sentence

This second kata shares a lot of commonalities with the first one (it's 2/3's the same as the previous problem!).  So by fully understanding how the previous program works, you'll be able to do something similar for this problem.  You can re-use a lot of the same steps.

The key is to continue working through harder and harder challenges.  After you solve a number of different programming challenges without instructions of exactly what to type you'll realize that problems that used to challenge you are now really easy for you to solve.

And when you finally start solving the problems it will feel so satisfying and fulfilling to conquer such a hard challenge.

If you're looking to land a job as a web developer, you'll notice that on the technical interview process you'll be given kata to test your ability as a programmer.

The kata you'll be given as part of an interview test will probably be a lot harder than the ones that you're starting out with, but you need to work your way up to this level of question slowly.

Tools like tryruby and RubyMonk can give you a 360° view of the ruby programming language.  Learn Ruby The Hard Way is a good overview and I'd suggest completing the study-drills they have as well (the study-drills are kata at a timely fashion!).

From there, to take your ruby-fu to the next level, solve problems from sites like CodeWars and excercism.io.  Codewars in particular is super cool because you can review solutions other people have written.  Some people will use cool tricks on their solutions and you can learn from them.

Finally CodeAbbey has some really complicated challenges, which will help you really master the language.
Before you know it, you'll know exactly when it's the right time to: Sweep the Leg, Johnny.

[As a side-note this is a slightly different answer than How do I learn Web Development? which is a related question, since ruby is often used in Web Development]

I also can suggest going through the Intro course I've setup for my online coding bootcamp, Firehose.  It's free and takes most people around 2 weeks to complete it. It's is a combination of instruction and coding challenges and whether you're looking to sign up for a coding bootcamp or not I think most people learn a lot from it.

Firehose Intro to Web Development Course – 2 Weeks Free

If you liked my answer, it would mean a lot to me if you upvoted it, by pressing the light blue button below.