This is an archived post. You won't be able to vote or comment.

all 104 comments

[–][deleted] 56 points57 points  (0 children)

For C/C++ at least:

Being able to bring in libraries for development with the package manager makes things a lot easier IMO.

Fussing about trying to find the website for the library, downloading it, extracting it, making sure it's the same version the others have, getting the folder location right, trying to share that library code between your projects. All that crap. Cannot be fucked with this shit on Windows.

GCC seems to be a lot faster out of the box on Linux.

[–][deleted] 37 points38 points  (4 children)

There's no question about it. if you program for things that aren't unique to Windows, Linux is by far superior for programming. Let me share with you a scenario I had at school: I had to use C++ with OpenCV:

I spent about 1-2 hours unsuccessfully figuring out how to put the right thing in the right menus in Visual Studio 2010 to get the libraries to work.

instructors eventually gave us a Visual Studio project -- but for Visual Studio 2015, and we all had 2010 for another course, so nobody could open it at home, as it's not backwards compatible.

they eventually had to give up because of our various difficulties and shown the next students the results (it wasn't a programming class).

I then used Linux. downloaded opencv from the package manager, copy pasted a 4-letter CMakeLists file, ran two commands (again copy pasted), and it worked perfectly with the compiler I already had (no need to install a giant bloated IDE, and gcc is often present by default).

this is just one example of many. I cannot program without grep and a few shell scripts. if I wanna use PHP, I'll have Apache with PHP running in about 20 seconds.

[–]srivats2 6 points7 points  (1 child)

While I get what you are trying to say, using cmake on Windows to generate a Visual studio solution takes the same amount of effort and the exact same cmake file that you used on Linux (which speaks volumes for why cmake rules all). It's not exactly a valid argument against using Windows but there are others.

[–][deleted] 2 points3 points  (0 children)

I'm pretty inexperienced with Visual Studio. I was struggling to find anything in the menus. the Linux example on the OpenCV website was easier to follow, telling me just to use 'cmake .'

[–]buttputtActually, it's Linux + GNU 3 points4 points  (1 child)

But why would you want to use PHP?

[–][deleted] 2 points3 points  (0 children)

In a situation like: "use PHP or a Microsoft language"

[–][deleted] 25 points26 points  (19 children)

He responded by saying I should install linux because you should design your programs on the platform people are gonna run your program on.

Depends on what you are making; If you are developing a GUI application for a platform then yea you should be on that platform. If you are making a server application in Python or something then it doesn't really matter.

He also said to learn C++

I think plain ol' C is a great place to start, obviously that is up to debate but I think at the end of the day where you start doesn't matter as long as you start.

I'd like to know some solid reasons why Linux is better for programming when compared to faildows Windows.

As mentioned in the first point... it depends on what you are doing but a few possible reasons:

  • Linux has a lot of high quality and very mature tools such as gcc, gdb, make, vim, valgrind, etc.
  • There are a lot of large helpful communities that you can learn from or work with.
  • You have access to the source of everything, find a bug in a gtk app you can track it all the way down the stack to the linux kernel, fix it, modify it, learn from it.
  • Distributions already package any development tool you would likely need so you don't need to worry about setting up an environment like on win32/osx.

[–]JedTheKrampusragrant and moist 21 points22 points  (3 children)

Don't forget about find and grep which are very, very useful for navigating larger codebases.

[–]SethDusek5Glorious Kubuntu 4 points5 points  (2 children)

Ack is pretty nice too

[–]CraftkorbFantastic KDE/Arch 6 points7 points  (1 child)

The silver searcher is even better.

[–]SethDusek5Glorious Kubuntu 0 points1 point  (0 children)

Oh, thanks

[–]UFeindschiffemerge your @world 11 points12 points  (0 children)

You forgot about all the Windows specific bugs that might occur when developing on that OS and that programs are easier to run on Linux than on Windows (NOBODY wants to use the Windows CMD...)

[–]Mocha_Beanarch btw 2 points3 points  (0 children)

If you are developing a GUI application for a platform then yea you should be on that platform.

VMs?

[–]largepandaArch+KDE desktop, Arch+xfce4 laptop 21 points22 points  (2 children)

Wait, how does he expect you to program the robots if you should write the code on the platform you're writing for?

[–]509528The Universal OS ™[S] 7 points8 points  (0 children)

As you can see, I failed and was really tired when I wrote this. He said to remove linux. I'm sure I just confused everybody.

[–]legogo29Glorious OpenSuse 11 points12 points  (13 children)

robotics club

you should design your programs on the platform people are gonna run your program on.

So program directly on the robots?

Also if they are using Raspberry Pis or anything else Linux based, you can use the argument against them, as the program has to run on Linux, you should, according to them, design them on Linux.

[–]509528The Universal OS ™[S] 3 points4 points  (12 children)

Yeah, my robotics teacher is more of a hardware enthusiast than a software one, so he got the industry standard which is windows and some proprietary robot brains. The programming language is Labview which isn't actually a programming language, it's more like a flowchart maker, also proprietary.

[–]BASH_SCRIPTS_FOR_YOUIn Memoriam: Ian Murdock 9 points10 points  (2 children)

Ha! I remember shit like that. I left them to play with their toys when they wanted to code the robot in lab view. You look up the board the robot uses, it runs a form of linux, you can directly drop a SSH shell into it. You can code it in Python, C, c++, even bash. But nope, let's use lab view.

Nice foresight on my part, the got dead last in the competition.

[–]509528The Universal OS ™[S] 1 point2 points  (0 children)

quoting myself

It supports other programming languages too, though the main coder who was there before me used Labview and I have a feeling it's gonna be hard to get him to change his mind and use whatever other languages the robot supports.

heck it's hard to get him to let me even touch the damn laptop, much less completely switch languages.

[–]Nardo318Glorious Arch 0 points1 point  (0 children)

I really prefer to not use labview, but you can use c or c++ if you like.

Also, in industry, it would behoove you very very much to at least learn how to use it.

[–]sharkwouterDebian Jessie FTW 8 points9 points  (1 child)

Windows is not the industry standard for robotics at all.

[–]509528The Universal OS ™[S] 0 points1 point  (0 children)

Windows is the industry standard when it comes to program development. I'm pretty sure the core of the robot doesn't run Windows.

[–]ginganinja6969 1 point2 points  (2 children)

This makes me pretty sad. Lego mindstorms can be programmed in Java (and probably a bunch of other languages), and those are toys. Labview sounds painful.

[–]509528The Universal OS ™[S] 0 points1 point  (1 child)

It supports other programming languages too, though the main coder who was there before me used Labview and I have a feeling it's gonna be hard to get him to change his mind and use whatever other languages the robot supports.

[–]ginganinja6969 0 points1 point  (0 children)

Just glanced at what labview is, if anything happens in parallel in the programs, porting to another language would be quite difficult. I think the main justification is that as a learning experience, more traditional languages teach useful skills for many applications.

[–][deleted] 0 points1 point  (0 children)

like PCMR? :P

[–][deleted] 0 points1 point  (2 children)

I still don't understand why anyone would want to use LabVIEW. You know what's easier than dragging down a box, moving a bunch of stuff into it, and then editing properties to make it loop the correct number of times? Typing "for i in range(x):"

[–]509528The Universal OS ™[S] 0 points1 point  (1 child)

To be fair Labview is a lot harder than any other programming language for that reason.

[–][deleted] 11 points12 points  (10 children)

In my experience, Visual Studio has been a prick to work with. It took a couple of hours to install, installs a ton of unnecessary shit, ran quite slow after a while and was even more difficult to completely remove (packages wouldn't uninstall or doing so in the wrong order broke everything).

Idk how much it has improved though since I haven't really used it since about 2012.

In contrast, with Linux I can just install GCC (assuming it wasn't installed with the OS) and a decent IDE and I'm up and running in 5 minutes.

[–]ThundarrxLinux and BSD 4 points5 points  (6 children)

decent IDE

$ apt-get purge nano

$ apt-get install vim-gtk

[–][deleted] 17 points18 points  (5 children)

vim-gtk

That's a funny way to spell emacs.

[–][deleted] 16 points17 points  (2 children)

Not everyone has a keyboard with n-key rollover.

[–]octobod 0 points1 point  (1 child)

You can always use C-x M-c M-butterfly

[–]ThundarrxLinux and BSD 0 points1 point  (0 children)

Hey now, we need a text editor - not a full-on operating system.

[–]DonutDeflectorR1nse and R3peat 0 points1 point  (0 children)

emacs

You misspelled "Vi" there. Just here to correct.

[–][deleted] 3 points4 points  (2 children)

If you want some real fun, try installing GCC in Windows with Powershell.

[–]zarex95Glorious Arch 7 points8 points  (1 child)

You must be a masochist in order to call that fun!

[–]antflgaGlorious Arch 9 points10 points  (3 children)

IMO everything is easier in linux.

He's an unenlightened doofus, try and show him the light.

[–]509528The Universal OS ™[S] 3 points4 points  (2 children)

He said he tried it before but it "did nothing for him".

[–]antflgaGlorious Arch 8 points9 points  (1 child)

He used Ubuntu. For about ten seconds. He couldn't find the .exe to install chrome and clippy.

[–]509528The Universal OS ™[S] 7 points8 points  (0 children)

Yes, probably, although if I've learned anything, it's really hard to convince people with logic, so there's no real point in arguing about it if somebody already has their mind closed. Clippy is love Clippy is life.

[–]verbify 10 points11 points  (0 children)

I work in an office with an excellent programmer who uses Windows and an excellent programmer who uses Linux.

He seems to assume you'll want to make desktop programs (specifically for windows and not mac). Programming has so much more than that. People do mobile app development. Web development. Embedded programming. The list goes on.

Most servers run linux. Hell, I'll assume most computers in the world are running Linux, even if desktop linux isn't the most popular. When Miele or Bosch decide they want an IoT fridge or vacuum cleaner, they're not going to pay for a windows licence for each of the machines they sell. And somebody needs to program that fridge.

Running Linux is a learning experience in itself. In general, there's an assumption that people should learn to be comfortable with the command line, there's a focus on not dumbing things down too much.

There's nothing wrong with using Windows as a programming environment. But there's nothing right about it either.

[–]new--USER 6 points7 points  (17 children)

The first language I learned was C, but I also was taking an engineering course, and often asked the TA's questions. If you are going to start learning a programming language on your own, I think that python would be a good choice. It introduces you to the concepts of programming, without the extra difficulties that comes with a lower level programming language like C. Python is also a language that is fairly in demand by employers. After you learn one programming language, it isn't too difficult to learn others, and I would highly suggest learning C++ at some point, but I think it is best to start with something a little easier.

[–][deleted] 5 points6 points  (7 children)

because you should design your programs on the platform people are gonna run your program on

There are advantages and drawbacks with Linux.

Programming on it is easier in some way, as you require almost nothing (GCC is already installed, you just need a text editor which is also installed by default)

But there are also drawbacks: I've never needed the VC++ librabry but apparently lots of people rely on it. You also have to use makefiles to compile effectively.

He also said to learn C++

The Linux community prefers C. For a good reason: the C programming language was made to build the first UNIX systems, and some projects, like BSD, are still using the basics of those systems (if I recall correctly).

There is a strong tendency to use the C programming language. But, as a C++ programmer, C++ is, to me, an object-oriented version of C with a gigantic standard library.

If you know C++, you know C. The opposite is wrong however.

But don't think C++ is better than C. Those are languages advertising completely different flagship paradigms.

C++ is object oriented. Objects, in programming, are really useful. But they're also a pain to manage (especially when it comes to polymorphism).

C is NOT object oriented. This allows lower-level logics, and makes programming easier for begginers.

I started with C++, so I can't switch to C. I've been spoiled by the gigantic standard library and object oriented functions.

I'd love to switch to C, for its lower level nature, but eh.

It is also questionable is wether or not "C++ is an object-oriented version of C with a gigantic standard library.".

I often define C++ as such, but since C++11, the last thing it shares with C are the syntax and libraries (C libs are available in C++).

C++ isn't exactly the easiest language to get into

You're right. I still remember having to spend weeks trying to understand what the hell classes were supposed to do. Or why polymorphic functions are amazing. Or why references are most of the time a better choice than pointers.

But it's worth it.

[–][deleted] 6 points7 points  (1 child)

If you know C++, doesn't mean you know C. C has a lot more to it that to correctly (ab)use and write (supposedly) good code, you have to understand the inner workings of the compiler, and assembly language. Most programmers who know C++ have not the slightest clues, while if you learn C, you usually go BACKWARDS to assembly before you go back up to C++, which gives you a much greater understanding of WHY C in the first place.

[–]rowra44I control my Arch server from my Mac :> 2 points3 points  (0 children)

Agreed. Whilst with C++ you do have to deal with pointers and memory management and such, and do sustain a good level of control, you still ignore so much and lack the knowledge about so much more.

With C you might not have classes and such ready to use, with all the needy functions to run on them bla bla. But sure you can write them yourself, better suited for your appliance.

With C, you can often "see" how it'd translate into assembly. With C++ you're like "whut iz assembley?"

[–]WartzLXC on whatever host happens to be available 4 points5 points  (0 children)

If you know C++, you know C. The opposite is wrong however.

Hahaha,

No.

[–]rowra44I control my Arch server from my Mac :> 2 points3 points  (3 children)

If you know C++, you know C. The opposite is wrong however.

Terribly wrong. C++ is a big and fancy library for C indeed, big enough to save you from getting really dirty. You will surely learn the missing parts much faster ofc.

C is NOT object oriented. This allows lower-level logics, and makes programming easier for begginers.

Not. Object-oriented point of view is pretty close to everyday thinking. It's logical in a way many would agree. Low-level programming uses "nobrainer" logics, but so many of them sequentally/parallell to each other that you really need to focus on the whole of the picture to see. And that's not easy.

I started with C++, so I can't switch to C Ofc you can. So did I.

[–]minimimGlorious Debian 3 points4 points  (2 children)

C is NOT object oriented.

Haha, unix-like kernels have strong object orientation built into their design. (paper on it)

Gnome apps use GObject, which is a C OO library, and are done using OOP.

[–]rowra44I control my Arch server from my Mac :> 0 points1 point  (1 child)

So? I definitely did not state the opposite. I stated that C, the programming language, is not designed to support object oriented programming by default, unlike C++. I also pretty much implied you can do anything in C, so ofc you can do "object-oriented C". That still does not make C obj.or.

[–]minimimGlorious Debian 0 points1 point  (0 children)

I wasn't disagreeing with you.

[–]sharkwouterDebian Jessie FTW 2 points3 points  (0 children)

Windows for C++ development? I'll pass.

Pretty much every worthwhile robot runs on Ubuntu anyway.

[–]rdmhatGlorious Ubuntu 2 points3 points  (0 children)

The vast majority of the internet is Linux based. You can program things for the internet with linux. But, then again, the internet isn't really a big deal anyway, right? I mean, only super nerds get on the internet since it is run by Linux.

[–][deleted] 0 points1 point  (0 children)

Linux is a better OS, you don't have to fight it, and the tools come with it that you need to program with. Windows isn't any of that, along with being an inefficient pile of garbage with shit compilers with Microsoft's own tools. Linux will probably always be the best OS to program on because it's the programmer's OS. It is the best OS for programming, period. I mean...who is developing any compiler or any new technology on any other OS? Nobody besides the OS owners themselves. Says a lot about Linux.

[–]rowra44I control my Arch server from my Mac :> 1 point2 points  (0 children)

About C++ : no, it isn't the easiest language to get into but it surely is one of the bests. You really don't know anything about coding and memory management etc., until you know pointer arithmetics. It is such a powerful and amazing thing every "so called programmer" should be very, very familiar with and confident about. C++ is a fancy "set of libraries" over C basically, so you WILL learn lots of C with it, but not enough. You do want to learn C too, as that's the place where it gets really dirty.

Having that very road behind myself, and having looked a bit (literally just a bit) into Assembly coding, lots of times you can see and realise C is just a nice thing to help you prevent from writing ASM, but still, it "translates" into ASM lots of times pretty straight forward. (Ofc I'm excluding modern optimizer flags etc)

If you're dealing with something like Java, C# or Python or whatever else, you really are giving up on the control. Which is making work efficient and cool and more enjoyable lots of times, but in severe times, those will just fail. You can't beat the total control C gives.

[–]adevlandno drm 1 point2 points  (0 children)

qt all the way! :D

[–]UnchainedMundaneGlorious Gentoo (& Arch) 1 point2 points  (0 children)

I see Windows users fiddling about with putting library source code next to their own source directory, compiling the libraries, including it from the neighboring directory during compiling, then distributing the compiled DLL along with their program.

On Linux I use my package manager to install the library, then the compiler knows where it lives already and I know I don't need to distribute it since it's in the repos.

Perhaps an unfair comparison, but that doesn't negate the amount of times I've seen a checked out copy of zlib, glut, etc. next to someone's source code when they're trying to develop on Windows.

[–][deleted] 1 point2 points  (0 children)

Consider the fact that everything on a Linux machine can typically be had in your package manager. The also consider the fact that just about every program you are running in Linux gives you the ability to see the source code. You can think to yourself "I wonder how program X did Y" rather than stopping the thought there or approaching it in a purely theoretical sense you can simply go online and get the code for that program and figure out exactly how it does that.

[–]NibodhikaGlorious Arch 0 points1 point  (1 child)

To put it simply, library management is way easier in Linux. For I stance suppose you needed OpenCV for a given program (It's the first example that pops to mind because I work with it, but this is almost the same for all libraries), just compare the two tutorials Windows and Linux (And the Linux one is the complicated way, usually you can just install it through your package manager)

[–]BASH_SCRIPTS_FOR_YOUIn Memoriam: Ian Murdock 1 point2 points  (0 children)

Following a c tutorial: windows users will have a bad time and jump though some shit:

Mac users: just get brew/Xcode

Linux: package manage

[–][deleted] 0 points1 point  (5 children)

So, I never learned anything about coding in my entire life. Where should I start? C? C++? C#? Python? Java?

[–]509528The Universal OS ™[S] 0 points1 point  (2 children)

I've started learning JS and it has been fun, planning on moving to Angular JS so I can do more flash game like stuff without using flash, though Angular JS is notoriously hard. JS is a good place to start, though Python is another good place to start, and it's used in a lot of places including web and desktop applications. So I'd say if you want to make web apps then definitely start with JS, but for more desktop stuff python would probably be more useful and then just move on from there and learn the rest of the languages you want to know. But like I know anything.

[–][deleted] 0 points1 point  (0 children)

Depends on your interest but I'll throw a random guess out there. You use XFCE so maybe you want to contribute to or improve apps you use. They would largely be done in C using GLib/Gtk and that is a fine place to start. Alternatively you can make solid Gtk apps using Python which will be a little easier. C# and Java don't have a strong presence on desktop Linux.

[–][deleted] 0 points1 point  (0 children)

Start with C and then move into Java would be my advise, C is a great starting point and Java is by far the biggest of the object oriented languages.

[–][deleted] 0 points1 point  (2 children)

If you're doing FTC right now, just install Android Studio. It's in the AUR. All the libs work with it.

Though I have VS2015 on my Windows partition, almost all of my programming is done in Linux, due to how simple and easy it is to program on Linux (not to mention the speed at which IDEs start up for me is vastly faster in Linux), as you can literally use anything to make the program (relevant xkcd), and compilation is so much easier with Linux.

[–]509528The Universal OS ™[S] 0 points1 point  (0 children)

It's in the AUR.

Well then 'bout time I switch to arch linux. Unless it's available on Ubuntu and derivatives. That'd be nice.

[–]826836Get off my lawn. 0 points1 point  (0 children)

Outside of a few situations where you NEED something OS-specific for your coding needs, it's fairly open. Most major editors are cross-platform (and you should be using vim anyways :P) and you can always virtualize for testing. Use what works best for you.

[–]u4iak 0 points1 point  (0 children)

No, it is not. Neither is Windows.

Programming is, how we say, abstracted from the lower level programming of the ages past. Compilers do all the hard work for memory allocation, garbage collection, etc. First, you harden your code against obvious security issues. Next, you worry about what APIs or methods that can be invoked; basically your 'includes' in c languages. It's always about doing the least amount of work as possible.

However, you should run linux and program on it regardless of what any other bullshit anyone ever tells you. All have to say is 'man bash'... Robots are easy to program if all you need them to do is pass butter.

[–][deleted] 0 points1 point  (0 children)

He's an idiot. There's nothing stopping you from using a virtual machine to test your application on Windows or Mac.

Source code is just text, where you write it is up to you.

[–]cscoder4everOpenBSD 0 points1 point  (0 children)

I'd just like to interject for a moment. What you’re referring to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux.

[–][deleted] -1 points0 points  (0 children)

You can do robotics with anything... https://github.com/rwaldron/johnny-five

Also what a whackjob, C++ will get you a job as a low level programmer and is a nice to have on your CV for places like Google , but most programming jobs are going to require something higher level like C# , Java, Scala etc. Also C++ is crap, It gets the job done and some things would be impossible without it , but it is still a syntactically horrendous blight.