

Ask HN: Can you recommend a path to developing on linux? - WickyNilliams

Hi,<p>I am, by profession, a .NET web developer. I wish to start programming more in my free time, perhaps whip up a few interesting projects, and at the same time learn some new skills. So an obvious path is to start with development on Linux as it's something I'm absolutely unfamiliar with. Therefore I'm looking for advice, useful links etc. on how to get into the world of development on Linux.<p>I really need help from the ground up so i can hit the ground running, but without being thrown into the deep end so badly that it's too much of an uphill struggle - i want to be eased into it basically!<p>I'm only vaguely familiar with Linux as an OS, so firstly is there a particular distro that is recommended for development purposes? Will Ubuntu suffice? Also I have no idea what tools to use to develop. I understand vim and emacs are proficient IDEs, but they seem like something i should explore at a later date given their seemingly steep learning curve. Finally I'd like some objective discussion on which language(s) i should choose to get me going, specifically with web development being my main focus e.g. if Python is suggested, why is it a good choice, what are the downsides, what frameworks should i investigate etc.<p>So that nobody takes offence, I apologise in advance if i've used the wrong terminology throughout my question - I've really been living a life of ignorance when it comes to Linux and the tools available.<p>Thanks
======
_dps
There are a few different things that fall into "Linux Development".

1) Comfort/facility with something like the bash or zsh shells, including
scripting (as a kid I wrote complex .bat files for DOS, and bash scripting was
a revelation). If your'e on Windows you can acquire this knowledge efficiently
by installing Cygwin (which provides a bash-like shell).

2) Knowledge of the common GNU tools, and common piping idioms (e.g. "grep
pattern myfile | sort | uniq" to find all the distinct matches for some
regular expression in a file). Piping in general is something that you don't
often use in other environments. Again, this is knowledge you can acquire
efficiently in Cygwin without Linux.

3) Understanding the various pieces that come together to make a (non-
graphical) Linux environment work. For this I strongly recommend starting with
an emulator like qemu ("Q" is the OS X port) to emulate a vanilla x86 machine
and then get Tiny Core Linux running on it. Tiny Core starts from the absolute
minimum, but gives you a convenient graphical "app browser" for installing the
things you need piece-by-piece (read about and install coreutils, openssh,
"compiletc" (gcc + glibc), make, and optionally python or ruby).

4) Becoming proficient in one or both of the holy traditions (vi or emacs).
Tiny Core will have vi already installed (to get an idea of what the holy war
is about, consider the fact that vi is included in Tiny Core but the emacs
source download is about four times as large as all of Tiny Core).

I'll elaborate a bit on the qemu aspect. One of my biggest frustrations
getting started with Linux was getting my hardware to work "right". While that
was more than a decade ago, and most hardware will be autodetected on a modern
distribution, there are still many tiny annoyances (power management, GPU
acceleration, trackpad gestures, bluetooth, whatever). Qemu makes all these
problems go away because your host OS handles the hardware. Learning Linux
coming from Windows is hard enough without chafing from hardware problems.

For someone from a Windows background, 80% of the important ideas about Linux
can be acquired incrementally by using Cygwin to learn about bash, and a
virtualized Tiny Core to understand the Linux tools ecosystem. At some point
you'll know these things well enough and you may want to run a for-real linux
machine (though I personally have converged on OS X with a virtualized Tiny
Core for development work).

If you do all of that, you will know what you need to be a Linux application
developer (though you may need to learn something like GTK to build graphical
applications).

If you decide to go the Qemu/Tiny Core route, feel free to email me with any
questions (email in profile). It's actually easy, but not super-intuitive if
you don't have experience with Qemu.

~~~
WickyNilliams
Wow, that's a thoroughly comprehensive response. I've never investigated tools
like Cygwin or Tiny Core, but they sound like a great starting point.
Incrementally is definitely how i want to learn Unix as there are so many
radical paradigm shifts for me to get to grips with i risk overwhelming myself
if i get too immersed. It seems, as i get more replied here, that the command
line is so integral to Unix that my original plan to avoid that as much as
possible (i.e. just get on with web development) is not realistic. Your
recommendations will help immensely now that i've come to that realisation.

To be honest, some of the hardware compatibility issues you mention aren't of
much concern to me (providing i don't encounter any _serious_ issues, i can
deal with bluetooth not working for instance) as i plan to dual-boot
windows/linux and still use windows as my primary OS, but linux for dev.

I should perhaps edit my question title to be more clear, as i'm specifically
interested in web development via Linux (at least for the moment), but thanks
for the advice on native app development.

I'll be sure to get in touch if/when i go down the Qemu/Tiny Core route.
Though consider this prior warning that you're opening yourself up to a
constant stream of emails from a frustrated linux noob ;-)

Thanks again for the detailed answer

~~~
_dps
Ah, web development. I see. Well, that's actually 90+% the same on Windows for
most use-cases. For example, if I were starting a small web app in Linux I'd
probably use Python and Bottle. I'd do the same on Windows. To be clear: I'm
not recommending that you use Windows to _deploy_ web applications in Python.
I'm just saying that you can develop the applications on Windows and deploy on
Linux with very little hassle.

Unless you actually care about native Linux applications, or specific
performance-related features like Linux's epoll (or BSD's kqueue), then you
can definitely jump into "the Linux way" of web development with Cygwin and
either Python or Ruby. I haven't used Ruby since 2005, but in Python most of
the difference between Windows development and Linux development is details of
the os and sys modules (anything else has to do with stupid details of
threading performance).

On a second reading, it sounds like you might be conflating getting beyond
.NET with Linux development. It's entirely possible to learn Python or Ruby
web development on Windows, though I'd strongly suggest either using a full
Cygwin installation or at least Unix Tools for Windows
(<http://unxutils.sourceforge.net/>).

Linux is worth learning, but it's not the same thing as (for example) Python
web development. They're mostly independent. Things like Node.js are still
mostly *nix-only (last time I looked), but I'm sure that will change over
time. On the positive side, you can get Haskell/GHC for Windows ;-)

------
loupgaroublond
Probably the most important thing to know coming from the Windows world is
that in Unix (which includes Linux) is that the OS is the IDE. From the way
the OS is set up, where and how libraries are stored on disk, how you install
things, to using various editors, tools, the command line and compilers, it is
an IDE.

When you work with a 'stack' or a runtime like Mono, Python, a JVM, many of
these details are partially hidden from view. The same if you use an IDE like
Eclipse or MonoDevelop.

The better you understand this, the more shallow the learning curve will be
with any tool you use, even emacs or vi.

As for getting started, here's a few pointers. It doesn't matter which distro
you use, it's 2011, they all work pretty well. Instead pick the one you're
most comfortable with. Mint and Ubuntu are good contenders because they are
both easy to use, and Mint is based on Ubuntu. Fedora is better if you
absolutely must use cutting edge tech. Suse is great for giving you a shiny
frontend, close to cutting edge tools and an integrated environment that's
also developer friendly. Just pick one, if you like it, stick with it for six
months.

The same goes for runtimes and frameworks. Pick one you like, because a friend
recommended it. Try the tutorials. If you like it, and get along with the
community behind it, play around with it for 3-6 months before moving on.

Most importantly, find a friend who's using Linux already. Don't pester that
person too much with questions, but just chat at least once a week about it.
Focus on what you did, what you like, what was difficult. Chances are, your
friend will be able to tell you, 'oh, sure, you could just do Foo and get this
result'. Part of the learning experience is a week of pain you don't forget,
solving it on your own, and then learning that other people solved the same
problem.

~~~
WickyNilliams
That's an interesting perspective that had never occurred to me. I'll be sure
to take note of the subtleties of installation, the file system etc to see how
this OS-as-IDE thing is manifested. To be perfectly honest, I'm not even
familiar with how the file system works in Unix. I almost feel embarrassed
saying that as a computer science graduate with many years of professional
programming experience!

Are you recommending avoiding IDEs completely(in the traditional definition of
the IDE, not the OS-as-IDE paradigm you described) to expose myself to Unix as
much as possible, or just to have an awareness of what's going on behind the
curtain?

Cool, i'm already 95% decided on Ubuntu, so that's no longer a concern. Good
to hear someone weighing in with other distros though, you rarely hear of
anything beyond Ubuntu these days, so thanks for that.

I only really know one Linux aficionado/proponent, so i will definitely be
leaning on him when i need to, though as you say i want to put myself through
the pain for the purpose of learning and rather than seeking help at every
opportunity. Saying that, last time i discussed Unix with him he ended up
recommended that i just skip GUIs completely and go for FreeBSD. He must think
i'm either a sadist or incredibly brave! Hopefully he won't shun me because of
my need for a GUI :)

~~~
loupgaroublond
IDE's are a bit of a closed off garden, to use a bad metaphor. They provide
all the components you need, editors, terminals, shortcuts to run commands,
but when you learn that you can choose between using an IDE or building up a
toolset on your own, then you can make a better choice for the job at hand.
There are some really good IDEs out there and once you learn both, it's
personal preference. I certainly use both depending on the task.

/bin and /sbin - binary files go here, namely programs /lib - all the shared
libraries and other code that gets executed by programs /libexec - other kinds
of executables that are not shared libraries or command line programs /src -
source code /src/include - all your C headers /share - shared resources, data,
game data, pictures, wallpaper, icons etc... /share/doc - documentation /var -
runtime data, log files

So what's /usr? These resources get split between / and /usr for historical
reasons. There's a push to put everything in /usr and get rid of the split. Go
look it up if you want to know why it's this way.

The thing to notice here is there are no program specific directories at the
top level. This is because all programs are thought of as small tools or cogs
that you can build larger tools upon. It's a system, not a way to run a couple
of different apps in their own sandbox.

------
div
Install ubuntu or mint.

Once you have that set up, it really is just a question of what stack you want
to work with.

If you don't want to start using vim or emacs right away, which is
understandable, there are a lot of text editors out there. You will just have
to do a bit of looking around to find something you like.

The best thing you can do right now is to get a linux box up and running and
then write a simple hello world in rails or django.

For bonus points, get a github account and commit your first steps to a github
repository.

Doing that will give you a good bit of exposure to the shell and finding your
way around the OS.

~~~
WickyNilliams
I'll have a quick gander at Mint but at the moment i'm favouring Ubuntu,
purely because i've had some experience with it.

Excuse the elementary questions that follow, but i really am _this_ ignorant
to the whole Linux ecosystem!

What stacks are available? Are there relative merits which may influence my
decision, or does it amount to simply picking the one i like the look of and
stick with it?

What are the most popular text editors? I'm used to running Visual Studio as
my IDE, is Eclipse the only editor that will offer similar depth of
functionality? for example, integrated debugging, code completion, refactoring
tools

I've actually got a GitHub repo already! What happens if i get bonus points
before i get any normal points?! Some kind of exception thrown presumably ha.
But then that was on Windows, and whilst i did set it up through the command
line (GitBash) i later relied on a GUI tool in my IDE for further interaction.

~~~
div
Well, there's a ton of technologies you could play around with, from lisp to
haskell, ruby to python to any jvm language.

If you go with Java or Scala, Eclipse, IntelliJ or NetBeans are good choices.
Personally I prefer IntelliJ where you can check out the community edition.

For scripting languages such as php, ruby or python, vim and emacs are the
goto editors (i use emacs myself). On the other hand IntelliJ and Eclipse have
plugins or alternate builds for these languages as well.

If you come from .NET and your main goal is to broaden your horizon, I'd
definitely try to go with a plain text editor like jEdit or SciTE and pick a
scripting language.

Since you said you're into webdev, the rails or django frameworks will
probably get you the most bang for your buck.

~~~
WickyNilliams
I'm not keen on Java as it's just another language with a C-style syntax, i
want to have my mind blown and eyes opened. Plus after using .NET for so long,
I don't think i can ever go back to the awkward namespaces and classes of the
Java framework. I wrote my dissertation using the then new OO features of
PHP5, so PHP is out of the running as I wouldn't be treading the new ground
that i sorely seek.

I concur with you that IntelliJ is great, JetBrains consistently produce
superb tools. I use the WebStorm for all my front-end coding (mainly for JS
code completion, linting and refactoring), and ReSharper for serious
productivity and refactoring when i'm doing back-end stuff in Visual Studio.
ReSharper is possibly the greatest IDE enhancement of all time.

Funny you mention jEdit, it was my text editor of choice when i was at
university - we were encouraged not to use tools that hold your hand like
Eclipse or NetBeans. My only fear is that if i try to build something big in
jEdit (i'm thinking thousands of lines of code) it'll become a maintenance
nightmare working with nothing but text files - i think i'll eventually need
something that has a concept of projects etc. or am i missing something here?

I'm starting to gravitate towards Python and Ruby as primary choices of
language as they're both popular and seem to have well-established web
frameworks.

------
pandeiro
There's value in "easing into" it, namely you won't have to try very hard, but
let me play devil's advocate, based on my experience learning to program in in
Linux over the past 3-4 years.

Don't waste (much) time with the slick GUIs of Ubuntu/Mint/Gnome/KDE. The
reason to learn Linux, which you may or may not already realize, is UNIX.
That's where the power is.

ArchLinux plus a decent window manager is the best way to meet your new
friends cat, diff, patch, rsync, wget, curl, git, du, top, free, ssh, man,
bash, and of course, the one and only emacs.

Gonna be a fun, challenging year for you. Good luck.

~~~
WickyNilliams
Almost sounds like you're daring me to dive in head first! I expect I'll go
with Ubuntu initially if only because I'm kind of familiar with it. That and I
won't go into future shock by ditching my shiny GUI's straight away - my fear
is if i do this I'll be so overwhelmed it'll just put me off the whole idea. A
gradual descent into the darkness is what i desire!

I'm definitely down with learning Unix in the long run, but my it's not my
primary goal. I want to learn new programming languages in particular, but I'm
sure to get where i want with those it'll be impossible to avoid dabbling with
Unix, in which case i expect I'll learn it by proxy

A year?! I was hoping for around two weeks! I jest, I expect this to be
ongoing for years just as your adventures have. I'm also being realistic that
between work, my girlfriend and learning guitar i don't expect to be making
rapid progress, but I'm content with that :)

------
abdulhaq
I could spend a lot of time explaining why python, eclipse and pydev make a
good development platform etc., - but I think you need to explore your own
thoughts a bit more. It seems you're unstatisfied with something and think
that Linux is the answer, but you don't know why. Tell us more about your
goals first.

~~~
WickyNilliams
Haha no i'm perfectly content, i just wish to broaden my horizons. Basically
it feels like i've only ever seen one side of the coin having been a windows
developer since graduating (I had some experience with Linux during
university), so i'm just looking for some direction to take me to new and
interesting places.

So with that in mind my goals are a little vague beyond what i've said above -
I literally just to get exposure to some new languages, new tools, new ways of
doing things. Maybe when i do try all these things I'll feel unsatisfied with
my old tools (kind of a "never know what you're missing type scenario"); but
for now it's purely just as a learning exercise.

Onto your recommendations: Do you know any excellent resources for learning
python? Are there any good interactive online tutorials to my learning if
Python was where i started? What are the web frameworks available for me to
work with? I'm kind of interested in Ruby as it seems there are many great
resources and tools to help you learn (i've just stumbled acorss Why's
Poignant Guide and it's got me very curious, though maybe because of the
haphazard, quirky style of authoring)

I expect Eclipse will be my IDE of choice since i have used it before and the
paradigm is recognisable. Are there any alternatives IDEs that I should dip my
toes into before i settle on Eclipse out of familiarity?

~~~
abdulhaq
OK well I'll give you my personal perspective. For learning python, python.org
actually has a very good tutorial. Then there is also
<http://www.diveintopython.net/> which is excellent. For web frameworks I use
cherrypy which is very minimal. Seeing as you want to learn, I'd recommend you
start with that as you'll get a better overview of what's really going on in
the guts of a web framework. Emacs is excellent but I switched to Eclipse for
its subversion integration.

------
adatta02
This is going to be an unpopular answer but you could take your .NET skillset
and start developing applications running on Mono - <http://www.mono-
project.com/Main_Page> \- now and then see where the path takes you.

Best of luck!

~~~
WickyNilliams
haha, didn't expect someone to drop the M-bomb!

I really want to try new things, rather than just taking my skillset to a new
OS, so i'll politely decline your suggestion. Thanks anyway

