Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Software IT Technology Linux

What Programming Language For Linux Development? 997

k33l0r writes "Recently I've been thinking about developing (or learning to develop) for Linux. I'm an IT university student but my degree program focuses almost exclusively on Microsoft tools (Visual Studio, C#, ASP.NET, etc.) which is why I would like to expand my repertoire on my own. Personally I'm quite comfortable in a Linux environment, but have never programmed for it. Over the years I've developed a healthy fear of everything Java and I'm not too sure of what I think of Python's use of indentation to delimit blocks. The question that remains is: what language and tools should I be using?"
This discussion has been archived. No new comments can be posted.

What Programming Language For Linux Development?

Comments Filter:
  • by alain94040 ( 785132 ) * on Saturday December 06, 2008 @07:46PM (#26015955) Homepage

    First, let me start by saying that the definition of an experienced programmer is that they don't care about the particulars of any given language. Experience means they have seen many languages come and go and they will continue to adapt.

    That's the long-term skill that will keep putting money in your pocket. Coming out of college, it's important you know that.

    That being said, congratulations on sticking with Linux in a Windows world. Purely from a job perspective, there might be more jobs on the Windows platform, but they are also more boring. So your school is doing the right thing by exposing you to as much Windows IT as possible, and you are doing the smart thing by escaping to the better side.

    To answer your question: Linux is not so different from a programming point of view, but it has a set of standard libraries and utilities that can be combined in many amazing ways. I'm old-fashioned, so I still program in C++, but what I would also recommend that you explore are some of the fun scripting languages like Perl. I wouldnt' particularly recommend more modern and high-level languages on purpose: they hide too much of Linux, so what's the point for you?

    Learn about true modularity: whatever it is that you are trying to build on Linux, someone already did 90% of the work. You just have to build up from there. Algorithms are the same on Windows and Linux, but that mindset makes all the difference.

  • Learn C and Python (Score:5, Insightful)

    by volsung ( 378 ) <stan@mtrr.org> on Saturday December 06, 2008 @07:51PM (#26015985)

    C will give you a good base for learning how the system calls and libraries work, but Python is a lot more fun and better for any program where being close to the metal is not important.

    And seriously, if you use a decent text editor, in a few weeks you'll forget Python's indentation conventions ever bothered you.

  • Comment removed (Score:5, Insightful)

    by account_deleted ( 4530225 ) on Saturday December 06, 2008 @07:56PM (#26016015)
    Comment removed based on user account deletion
  • A valuable skill (Score:4, Insightful)

    by MathFox ( 686808 ) on Saturday December 06, 2008 @08:00PM (#26016043)
    Now Microsoft is on the way down and Apple and Linux are moving up:

    learn to write cross-platform applications

    It isn't that hard, just pick a programming language that's available on both Linux and Windows and try to write programs that work on both Operating Systems. It can be done with some care!

  • by base3 ( 539820 ) on Saturday December 06, 2008 @08:02PM (#26016053)
    More like insightful.
  • Re:Java (Score:5, Insightful)

    by samkass ( 174571 ) on Saturday December 06, 2008 @08:02PM (#26016057) Homepage Journal

    I second Java. It's very fast, very portable, well-supported, scales from embedded to enterprise, has great IDEs, is open source, and has a huge body of libraries, sample code, and support.

    I'm not sure why you call your fear of Java "healthy". Fear of any particular technology is unhealthy-- it prevents you from making rational decisions about them.

  • None. (Score:4, Insightful)

    by grapes911 ( 646574 ) on Saturday December 06, 2008 @08:04PM (#26016075)
    Focus on techniques rather than specific languages. Make sure you develop a strong foundation and new languages will be easy to pick up later. For a student, the foundation is way more important than a particular language.
  • I See Your Problem (Score:2, Insightful)

    by Nom du Keyboard ( 633989 ) on Saturday December 06, 2008 @08:08PM (#26016097)
    I see your problem. Instead of C# they should have been teaching you Visual Basic.

    [Ducks rocks, stones, brickbats, flames, gunfire, flying fanboys, Steve Jobs, and moderately sized precision guided asteroids]

    Not only does that let you write in Visual Studio as effectively as C#, but you with very little extra effort you can expand that to also write and maintain Microsoft Office applications including Access written in Visual Basic for Applications, legacy applications written in Visual Basic 6/5/4, and Visual Basic Script based code. And that gives you a wide field of expertise dealing in a lot of the existing code already out there.
  • by siride ( 974284 ) on Saturday December 06, 2008 @08:09PM (#26016103)
    With good libraries or a language runtime, you shouldn't have to make any system calls. And the few times that you do, it can be wrapped in a thin abstraction layer within your program.
  • by rjh ( 40933 ) * <rjh@sixdemonbag.org> on Saturday December 06, 2008 @08:11PM (#26016109)

    This question is remarkably easy.

    The UNIX API is written in C. If you don't know C, you won't be able to understand UNIX system calls.

    Beyond that, learn Java and learn Python. You yourself say you have a "fear of Java." Sounds like a pretty good reason to learn it. Likewise, you say you're not sure about Python's use of indentation. Sounds like another good reason to learn it.

    It is usually good practice to learn one new language a year. These recommendations should be seen as beginnings not endings.

    My final bit of advice is to learn PROLOG, LISP, Haskell or Erlang. And by 'learn,' I mean 'become fluent in.' These languages are radically different from anything you've experienced before. Learning how to think differently about problems will make you a much better programmer, regardless of what language you ultimately wind up using in the private sector.

  • Re:I like Python (Score:3, Insightful)

    by 19thNervousBreakdown ( 768619 ) <davec-slashdot&lepertheory,net> on Saturday December 06, 2008 @08:12PM (#26016117) Homepage

    I don't like Python. Not one bit, but I'm willing to admit that my dislike is mostly aesthetic, which has prevented me from really exploring it, so I can't debate its pros and cons with any pretense at having made an informed decision.

    That said, the idea of using whitespace as syntax ... well ... Oh God, I can't lie, it's horrible. But. But! There's ways around it. Ideally a code editor would make line-leading whitespace visible while keeping the rest invisible. Once you get more than one person working on a project, different indentation preferences (expand tabs to spaces vs. not) it's ridiculously easy to have weird mistakes creep in.

    Anyway, that's completely the opposite of what I meant to say. A little thing like syntax shouldn't be enough to stop you from getting to know a language. Hey, it's easier to give good advice than it is to take it, and as I understand Python makes a lot of things really easy.

    That said, Linux is C, and if you use that or C++ you'll never run into one of those situations where you have to step outside (or rather, below) the library to do what you want to do, which can get nasty quick.

  • C. Just C. (Score:2, Insightful)

    by TimHunter ( 174406 ) on Saturday December 06, 2008 @08:16PM (#26016141)

    Every other (modern) language is a derivative of C. (Well, except for Lisp, but that doesn't get a lot of use in Linux programming.) Perl, Python, and Ruby are written in C. "C is the atmosphere we breathe."

  • Re:None. (Score:3, Insightful)

    by david.given ( 6740 ) <dg@cowlark.com> on Saturday December 06, 2008 @08:22PM (#26016167) Homepage Journal

    Damn straight. Focusing on one language will cripple you. Learn as many languages as you can; you'll be a better programmer for it. Learning Smalltalk taught me about OO. Learning Forth taught me about code factoring and reuse. Learning assembly taught me C (and learning C taught me assembly). Learning Python taught me about the joys of good libraries, and learning Lua taught me how awesome a tiny, fast scripting language can be. And learning Haskell taught me how much I have still to learn.

    There are a lot of *very cool* domain-specific languages out there, most of them written in the 80s and 90s --- not much has changed in the world of programming languages in the past decade! --- and they're well worth a look. Even if you never write any production code in any of them, they'll teach you huge amounts.

  • by loufoque ( 1400831 ) on Saturday December 06, 2008 @08:30PM (#26016211)

    As usual, people are talking of "C/C++".
    However there is no such thing. There is C, and then there is C++. They are very different languages.
    C++ suffers from a rather poor reputation because most people don't really know it, and because most code that has been written in it is really C-ish (C with classes) or worse, Java-ish (as if C++ was about OOP...).

    Anyway, my point is that it's a language that needs to be learnt separately from C altogether.
    It's both as low-level and as high-level as you want, bringing you the best (or worse, depending on how you use it) of both worlds.

  • Re:Mono (Score:4, Insightful)

    by SirLurksAlot ( 1169039 ) on Saturday December 06, 2008 @08:35PM (#26016245)

    This is being modded as flamebait but it is actually a valid suggestion considering that the OP is coming from a MS background. Mono will allow the OP to ease their way into development in in a 'nix environment without having to jump in headfirst with a language or languages that bear little semblance to the tools they're already using. It's all well and good to suggest that the OP start learning C, Python, Perl, $_nonMSLanguageOfChoice but looking at it practically it makes more sense to transition more slowly.

    It is also worth pointing out that the parent didn't say anything inflammatory like "Don't, just stick with MS and .NET," or "Linux is for phags!!!!1" They simply offered another option with the suggestion that they start with something familiar. Disagreeing with someone doesn't mean your mouse should instantly jump to the flamebait or troll options.

  • by TheRaven64 ( 641858 ) on Saturday December 06, 2008 @08:35PM (#26016247) Journal

    My final bit of advice is to learn PROLOG, LISP, Haskell or Erlang

    If the original poster ignores every other post, and every other sentence from your post, and just reads this, then they will have the correct answer.

    Learning `Linux' means learning POSIX / SUS. Then it means learning whatever library you use on top of these. It's not an interesting problem. Learning Prolog, Lisp, Haskell, Erlang, FORTH, and Smalltalk will teach you how to think about writing code, even if you never use any of these languages to write a real application.

  • by Jerry ( 6400 ) on Saturday December 06, 2008 @08:38PM (#26016267)

    Exactly, and the best tool to do that with is QT4 from Trolltech.

    Using their new, free, Qt-Creator GUI RAD IDE one can write source once and compile for either Linux or Windows.
    Qt-Creator is available for free on both platforms.

    With careful use of compiler defines one can also, with the same code, write against Oracle and PostgreSQL in the same source and compile on either platform without changing a line of code.

    Compile in the static mode and you won't have to worry about missing libraries.

  • Re:Java (Score:5, Insightful)

    by Matheus ( 586080 ) on Saturday December 06, 2008 @08:41PM (#26016285) Homepage

    I was also curious about your "healthy fear of anything Java"
    Really? You are way too young to be developing "healthy fears". Java, like *every other language, has its issues but there is nothing abnormally nasty about it to treat it like a plague. Specifically relating to your .NET experience Java is a significantly more mature language than C#. You are more likely to get better performance and stability out of Java's virtual machines just because they've had more time to be beat up by a vast community of developers. M$ did a good job of getting C# out the door but like any child it has some growing up to do.

    As many of these posts have mentioned: Don't limit yourself. Try everything. Obviously for Linux purposes knowing C (and a healthy amount of Bash scripting and Perl) is useful purely because the OS is built on it BUT for developing applications on top of it many languages have benefits depending on what you are trying to implement and so eliminating anything from your list will hurt you in the long run.

    "Free your mind and the rest will follow"
    -En Vogue

  • Re:Java (Score:4, Insightful)

    by binarylarry ( 1338699 ) on Saturday December 06, 2008 @08:43PM (#26016291)

    That's because you can get within a few percentage points of native code performance with Java's VM.

    Most of the people who are hesitant to use "managed code" are old codgers, elitist fruits and brainwashed newbies who have to be forced into new paradigms, instead of being genuinely interested in new trends.

    It's best to avoid types.

  • by darkwing_bmf ( 178021 ) on Saturday December 06, 2008 @08:47PM (#26016309)

    C first. It is the lingua franca of the Unix world. Even if you don't use it for yourself, you have to understand it because so much is written in it. And if you don't understand it, no one will take you seriously. One of my first Linux installs was so I could teach myself C cheaply and I needed a free, as in beer, compiler.

    Then after that, any language that you think might be interesting. Try multiple languages. I personally like Ada and there's a free GNAT Ada compiler for Linux.

  • Fear of Whitespace (Score:5, Insightful)

    by bitspotter ( 455598 ) on Saturday December 06, 2008 @08:51PM (#26016335) Journal

    I just started learning Python a couple of months ago (I come from a Perl/PHP web development background).

    Really, get over the whitespace-indentation thing. It's such a small thing to get hung up on compared to how much more powerful, elegant, and flexible the syntax is (for starters). That, and it encourages you to indent source code properly anyway.

  • IndentationError (Score:5, Insightful)

    by ksw2 ( 520093 ) <[obeyeater] [at] [gmail.com]> on Saturday December 06, 2008 @08:56PM (#26016347) Homepage

    If something like indentation is a show-stopper for your choice of language, then you are missing the point.

    Computer languages are about data structures and idioms for manipulating them efficiently. In contrast, whitespace is a cosmetic, superficial thing.

    Yes, I adore Python. (I wish I had paid attention to it ten years sooner than I did.)

  • Indenting code (Score:3, Insightful)

    by photonic ( 584757 ) on Saturday December 06, 2008 @09:02PM (#26016383)
    From the summary:

    I'm not too sure of what I think of Python's use of indentation to delimit blocks.

    Have you ever actually tried using python? I am very much in favor of capital punishment for everyone who doesn't properly indent his code in other languages anyhow, so being forced to indent in python wasn't really a problem for me. I do not understand why people keep bringing up this argument, there are valid reasons [python.org] why python was designed this way and it is something you get used to after 5 minutes. And if you really insist on using braces, you can still use them:
    if button_pressed: #{
    launch_missiles() #this line must be indented but slashdot does not allow me to
    #}

  • Re:Indenting code (Score:5, Insightful)

    by kabloom ( 755503 ) on Saturday December 06, 2008 @09:08PM (#26016423) Homepage

    this line must be indented but slashdot does not allow me to

    A very good reason to use a language that delimits its blocks explicitly. C will work great even in forums that lose their linebreaks. (Perl too? I don't use it enough to know.)

  • by tomhudson ( 43916 ) <barbara,hudson&barbara-hudson,com> on Saturday December 06, 2008 @09:09PM (#26016427) Journal

    C - absolutely. C isn't going away any time soon, and it works on ALL platforms, not just linux (and in many cases porting to bsd is just a recompile and a few extra headers). You'll also have to learn to write your own make files - not a hard job.

    And you'll find you'll need perl and bash scripts.

    Everything else is just "for this type of app, these are what most people use ... pick whatever you feel most comfortable with."

  • by narcberry ( 1328009 ) on Saturday December 06, 2008 @09:10PM (#26016445) Journal

    Your first problem is thinking a programming language is for linux development, and perhaps another is for windows development.

    What you should actually be asking yourself is, what is the problem I'm trying to solve, not what is the os I can use.

    Your question as stated has a million unquantifiable answers (heck, if you don't have a problem to solve, ASP.NET is just fine on linux). Ask the right question, what programming language should I use to solve problem x, and now you will get intelligent answers, and at least one remark about turing complete languages are all turing complete.

    /rant off

  • Re:Java (Score:5, Insightful)

    by FishWithAHammer ( 957772 ) on Saturday December 06, 2008 @09:13PM (#26016471)

    Managed code performance is good enough for essentially anything aside from high-performance video games (and even that isn't far off).

    "Java is slow" is a stupid old myth. Does it not occur to you that JIT compilers compile to native code?

  • Re:I like Python (Score:4, Insightful)

    by LaskoVortex ( 1153471 ) on Saturday December 06, 2008 @09:13PM (#26016473)

    That said, the idea of using whitespace as syntax ... well ... Oh God, I can't lie, it's horrible. But. But! There's ways around it. Ideally a code editor would make line-leading whitespace visible while keeping the rest invisible. Once you get more than one person working on a project, different indentation preferences (expand tabs to spaces vs. not) it's ridiculously easy to have weird mistakes creep in.

    Look, this is everyone's biggest beef with python if they are not yet proficient at it. Somehow, we have come to believe that whitespace is sacred and that a language shouldn't tell us how to use it. I'm not sure how to convince you otherwise except this: don't knock it until you have tried it. Once you really delve into the language, you will wonder why anyone ever would program in any other language for general purpose programming.

    Now, to more directly address your whitespace concerns:

    • You won't miss your whitespace freedom--in fact you impose your own whitespace rules on the code you right already. Python formalizes and enforces this good habit via syntax.
    • Since whitespace is syntax, you can use very standard tools to normalize it across a module in a couple of fractions of a second. Differing whitespace habits will never be a problem if you normalize whitespace before you begin coding on a collaborative module.
    • You won't mind the whitespace enforcement. In fact, after you go back to code you wrote a few months prior, you will be happy that something forced you to have consistent whitespace. Whitespace enforcement and other features of the language will shift your habits towards writing more reusable and maintainable code.
    • You will forget, for the most part, that whitespace enforcement is even part of the syntax once the language becomes second nature to you. In other words, you will so habitually use whitespace correctly (because you are forced to by syntax) that you will not even realize that you are using it as you code. All of the sovereignty over your whitespace that you thought was important to you will disappear because you will forget about its existence.

    So give it a try and quit spreading FUD to all of those people who want "control over their whitespace". There are bigger things to think about, like whether you or someone else will be able to comprehend or reuse your code in six months.

  • by lilomar ( 1072448 ) <lilomar2525@gmail.com> on Saturday December 06, 2008 @09:16PM (#26016499) Homepage

    Hm, OP mentions that he already knows C#, but would like to develop on linux. Parent mentions that with Mono, C# is an option for developing on linux, even providing a helpful link. Parent gets modded down.

    Sigh. Sometimes /. gets to me...

  • Re:Java (Score:3, Insightful)

    by FishWithAHammer ( 957772 ) on Saturday December 06, 2008 @09:17PM (#26016501)

    Specifically relating to your .NET experience Java is a significantly more mature language than C#. You are more likely to get better performance and stability out of Java's virtual machines just because they've had more time to be beat up by a vast community of developers. M$ did a good job of getting C# out the door but like any child it has some growing up to do.

    Rampant bullshit. You'll get somewhat better performance out of HotSpot than the Microsoft or Mono CLRs--not that much better, but definitely better--but in almost seven years of using .NET regularly (I started in March '02), the CLR has not been the cause of a single crash in anything I do. "Good job of getting C# out the door" my ass, you troll, it's been just shy of seven years since its release!

    (And if you want to be taken even remotely seriously, drop the childish "M$" crap.)

  • Re:C or C++ (Score:3, Insightful)

    by CSMatt ( 1175471 ) on Saturday December 06, 2008 @09:18PM (#26016507)

    Mono has to play catch-up with Microsoft's .NET framework, and is usually a full version number behind. There are also some patent concerns with parts of .NET, especially the non-standardized parts like Windows Forms. The free Java implementations had the same problem until Sun's release of the official Java under the GPL.

    So yes, you can develop for Mono if you wish, but be prepared to always have to use an older version of C# and everything else related to .NET if you want full compliance.

  • Re:Indenting code (Score:3, Insightful)

    by photonic ( 584757 ) on Saturday December 06, 2008 @09:23PM (#26016547)
    This says more about slashdot than about python. If you want to copy complete programs, you always download the source files themselves, so you dont have this problem. There are plenty of websites that contain code snippets (the online python manuals, various blogs, ...), which do preserve the indentation which can be pasted directly into a python interpreter. There might be some annoyances sometimes, but if you write your own code in a decent editor the forced indentation is more a blessing than a curse.
  • by Goaway ( 82658 ) on Saturday December 06, 2008 @09:25PM (#26016569) Homepage

    The you probably have either not used it much at all, or else you have used it far too much.

  • by GreyWolf3000 ( 468618 ) * on Saturday December 06, 2008 @09:25PM (#26016573) Journal
    Everyone programming for Linux should start with C until they have a solid understanding of how the Von Neumann architecture really works. Once you "get" virtual/physical memory, compilation of C into IL, IL into assembler, and how linkage works, start toying with POSIX threads. Once you really understand the tradeoffs and performance implications of things like dynamic binding and certain aspects of object oriented programming, you can move up to something like Ruby or Python and *really* understand not only what you are doing, but what that interpreter is doing for you.
  • by lamapper ( 1343009 ) on Saturday December 06, 2008 @09:26PM (#26016577) Homepage Journal
    Great post...

    ... it is also pertinent to note here that the GNU standards document, section 3.1 [gnu.org]: "Which Languages to Use" strongly advises plain old C for both performance and absolute maximum cross-platform compatibility.

    I remember for years C being considered faster on systems than C++, although I believe over the years the gap, if there still is one at all, has narrowed? What is true, someone share it with me as I am curious? Are there any incompatibilities when using C++ and migrating to different Operating System environments any more like their use to be in the dark ages?

    Can you compile C++ down small enough to use in embedded devices or does C++ still pull in libraries that are not needed or too big? My guess is you can exclude the libraries that you do not need, correct? (Not trying to start anyone flaming, I honestly do NOT know.)

    If you're writing web software use PHP, but it will make you feel dirty inside.

    I know there are Ruby on Rails camps and Python advocates, however does not PHP still run faster than either? (Take the same programmer, writing code with expert knowledge with all three programming languages, would not his final product , from a strictly performance issue in PHP be faster than Ruby or Pythong?)

    Considering that PHP was written with the web in mind and delivering web pages...do you really want anything else from strictly performance issues?

    Granted I understand that you can probably prototype in other languages much faster...

    Also your feel dirty comment, is that because of the ease in which a poor programmer can create unstructured code? If so would it not be the fault of the programmer and not the language specifically? (i.e. Assembly for the 8088, ..286, ..386 and IBM Mainframe made me feel dirty sometimes with they way you were forced to branch, but it was fast...and no I am far from an expert Assembly programmer.

    Also from a modularity, library, procedure / function, object perspective, if you have been coding in any of them PHP, Python or Ruby on Rails, would you not have a significant library built up where the library issue becomes a non-issue?

    FYI, personally I do not have a preference and simply choose what is convenient for me to use that will get the job done, period. I honestly do not know the nuances between them...and I am sure that there are some.

    I do not have any Ruby on Rails or Python experience and am looking forward to learning more about them. To date I have been able to do everything I need to do with scripting and PHP...so my knowledge is very limited and I admit that freely. Further my Perl knowledge has been with simple scripting only, I have not had a 8 hour a day, 5 day a week Perl coding job.... Further when competing in an ACM Programming contest at college, of the 40 programmers who competed, I was 20th...so I have no delusions I know I am an average programmer and am okay with that. I always get the job done one way or another regardless.

    Funny off-topic story...the ACM Programming contest: I finished my first problem in a little over 2 hours. A friend of mine who placed, with his team representing our university, second in the world at the international contest in a previous year, finished his first program and had it judged correct in 27 seconds. (Since he had already officially represented the University twice over the years, he was ineligible for that years team and was competing just for the fun of it.) They give you the programming packets and allow you to look at them 10 minutes before the official start time, thus when the clock started he started typing and he was much, much faster typist than my 30 wpm with 5 mistakes, lol. I have nothing but respect for all of you who can put me to shame with your incredibly fast and excellent programming skills. As f

  • Re:I like Python (Score:3, Insightful)

    by 19thNervousBreakdown ( 768619 ) <davec-slashdot&lepertheory,net> on Saturday December 06, 2008 @09:31PM (#26016597) Homepage

    It's not FUD, and it's not my whitespace that I'm worried about. I'm an absolute nazi about getting it right (tabs for indents, spaces for alignment!).

    One issue with it is, it's a pain in the ass to get most code editors to leave it alone. Granted, that's a flaw in the code editors, but it doesn't change the reality that if you sit down at some terminal that you haven't carefully configured, editors do all kinds of funky things to your whitespace. Expand tabs to spaces. Strip blank line indentation--I know Python ignores that, but it's still a pain in the ass sometimes. Changes indent levels because of a line continuation. Whatever. Cut/paste code, all sorts of things that you can't see changes. It only gets worse when working with someone who isn't anal about their whitespace, or is anal in a slightly different way.

    Whitespace is a great tool for expressing the intent of your code. That said, the intent doesn't always match the rules perfectly. Sometimes, on a continued line you might want to line the next one up with the open paren on the function call. Sometimes you might want to line it up with the second open paren. When your language doesn't care about that, not only are you free to express that "this line is a part of this function call" but if you don't like it, you can run it through a code prettifier. Try that with Python, and you could end up changing what your code does which is, in my opinion (I stress that's my opinion, we're talking about liking a language here, not whether it's good) is just plain wrong.

    Look, this argument is total flamewar territory, which is why I'm trying to keep it in terms of liking rather than objective quality. These are my reasons for not liking it, you gave your reasons that you do like it, and that's fine, but I've done enough work in it to know that I don't care for it. Far be it from me to try to convince someone otherwise if they want to program in Python, I just hope it remains the only wide-usage language that cares about the stuff and that I never have to work on a project that uses it extensively (although SCons is the bomb diggity, I love that one).

  • Re:C/C++ (Score:2, Insightful)

    by barton ( 47087 ) on Saturday December 06, 2008 @09:32PM (#26016599) Journal

    I agree about learning how to use libraries, I would also highly encourage you to learn how to use Linux its self. Knowing how the Kernel and the shell interact, and learning to use the shell well will give you a tremendous amount of power.

    Linux is tremendously well written, as is bash. Unix, and by extension Linux, has a very good design philosophy. Learning them well will teach you far more about programming Linux than learning a particular programming language.

  • Re:I like Python (Score:5, Insightful)

    by cowmix ( 10566 ) <mmarch.gmail@com> on Saturday December 06, 2008 @09:40PM (#26016645) Homepage

    That'a reminds me of something else I like about Python.. its language is documented.

  • by Anonymous Coward on Saturday December 06, 2008 @09:44PM (#26016669)
    So true. Sit down at a command shell with a copy of "The C Programming Language" on the table next to you and you'll be immersed in Unix lore in no time. There's a reason it's a classic.

    I also recommend learning shell scripting - it will teach you tons of awesome little tricks to think in the unix way - pipelines, devices as files, the fork/exec model, capturing and redirecting command output, command syntax and all that other good stuff. Once you know the unix way and the std library you can learn to use *any* unix scripting language very effectively.
  • by molarmass192 ( 608071 ) on Saturday December 06, 2008 @09:50PM (#26016709) Homepage Journal
    You're stoking one hell of a flame war here but here's my $0.02 ...

    C vs C++ ... there used to be (ie. mid-90s) a very slight advantage for using C in terms of speed, but it's probably narrowed to the femtosecond range on todays CPUs. I like C++ but I stay away from a lot of the stream methodology. I use C++ as an OO C.

    PHP vs Python ... same thing as C vs C++. PHP used to be faster, however Python under mod_python is slightly faster than PHP under mod_php. I've used both, and once you get over the wanna-be-COBOL indent thing, Python is more programmer friendly than PHP and Ruby IMHO.

    All that aside, I've done some Objective-C work lately and I think I might like Obj-C over C++, due solely to the really nice init/release/autorelease mech for memory allocation. However, for server side, rock solid 5 9s uptime, I'm still a believer in Java.
  • by martin-boundary ( 547041 ) on Saturday December 06, 2008 @09:53PM (#26016731)
    That's a bad reason for not blockifying single line ifs. You could just put { } around the statement on the single line, ie write if ( ) { } all on one line, or even if ( ) { }; in case your editor has trouble with indentation. You'll get the same benefits, the compiler will do the right thing, and if later some idiot decides to expand the conditional statement, they won't forget to add the braces.
  • Re:Java (Score:3, Insightful)

    by modmans2ndcoming ( 929661 ) on Saturday December 06, 2008 @09:55PM (#26016733)

    It is more mature, but C# fixes a lot of what is wrong in Java (lack of automatic boxing of primitive types anyone!).

    To compare them, they are both completely adequate for the same problem domain. Also consider that Java 2 was a reboot of Java so you kind of have to go off of that as your starting point, with that taken into consideration, you really only have a few more years of maturity for Java.

  • by Tacvek ( 948259 ) on Saturday December 06, 2008 @10:06PM (#26016797) Journal

    Embedded device toolchains often let you use a subset of C++ that includes part of the the STL, since EC++ does include an STL Subset.

    However, there is no real reason for that, as full C++ can work just fine, assuming a good C++ implementation. I'll admit that on a micro-controller, you might have severe issues with C++ (because even a tiny bit of unnecessary overhead in unacceptable on those), but somewhat less constrained applications full C++ is definitely possible. (Even though many people refuse to believe it, because of major misconceptions about C++ code size and speed, caused by some early and very poor quality compilers and libraries.)

  • Re:Java (Score:5, Insightful)

    by alanwj ( 242317 ) on Saturday December 06, 2008 @10:23PM (#26016891)

    The reason to fear Java doesn't really have much at all to do with any merits of the language itself. The reason you should fear Java is that it doesn't really add anything to your resume to distinguish you. There are, frankly, a LOT of extremely mediocre programmers on the market, and a common attribute they share is that they only know Java.

    That said, DO learn Java. Not knowing how to use one of the most popular tools in your field is also not a smart idea. Just don't by any means think that your education is done.

    For what it's worth, here are the four major things I look for when interviewing programmers.

    1. Do you know C? (whether you are going to be programming in C is irrelevant)

    If you don't know C, you probably have very little understanding of how computers work. C is language you can depend on to be on pretty much every platform; C is the language external APIs and foreign function interfaces are specified in; C gets the job done when all your layers of abstraction fail you.

    2. Do you know a functional language such as Lisp, Scheme, or Haskell?

    Programming in a functional language changes the way you think about programming in general. Programmers that understand functional programming generally are able to produce better solutions to problems even in imperative languages. Structure and Interpretation of Computer Programs is available online for free. Read it today and improve your skillset.

    3. Can you write a compiler from start to finish?

    The theory surrounding language parsing (automata, state machines, regex, grammars, etc) is fundamental to computing. In fact, computing itself is usually defined in terms of it. Once you understand it, you find you apply it all the time.

    The ability to translate high level languages into optimized machine instructions requires that you understand your platform at every level. This is important because it lets you understand the tradeoffs you are making when you choose one tool or method over another.

    4. What is your current personal project?

    What your project is doesn't matter all that much, as long as you have one. Good programmers are usually always working on some personal project that excites them.

  • Re:I like Python (Score:5, Insightful)

    by Jason Earl ( 1894 ) on Saturday December 06, 2008 @10:23PM (#26016897) Homepage Journal

    Just for your information, Python isn't picky about spacing inside of open parentheses (or brackets) so you are free to express yourself there. I used to feel the same way as you do about whitespace as syntax, but now I actually appreciate it.

    The real advantage to whitespace as syntax is that everyone has to follow the same rules, and the rules are sane. I once worked in an environment where the Perl hackers that wrote the original code didn't believe in indenting at all (they all used nano as their editor). Collaborating with people that don't believe in indenting at all is quite difficult. After that, I was glad to use a language that requires some indentation.

  • by tomhudson ( 43916 ) <barbara,hudson&barbara-hudson,com> on Saturday December 06, 2008 @10:24PM (#26016899) Journal

    That's a bad reason for not blockifying single line ifs. You could just put { } around the statement on the single line, ie write if ( ) { } all on one line, or even if ( ) { }; in case your editor has trouble with indentation. You'll get the same benefits, the compiler will do the right thing, and if later some idiot decides to expand the conditional statement, they won't forget to add the braces.

    I like my code clean and concise. If some idiot (your term for them) is stupid enough not to either add braces to blockify the statements or use the comma operator to keep it as a single statement, they'll learn quickly enough. In a modern editor, if you cut-n-paste the code, it will adjust the indent accordingly, and it will be painfully obvious where they went wrong.

    ... and those extra semi-colons "just in case" are also ugly.

    I belong to the school of thought that holds that if it looks ugly, it probably isn't done right. At the office, I'm not ashamed to have others review my code - it's cleaner, more of it fits one one screen at a time, so you can get a quicker grasp of it, etc. Those benefits outweigh the risk of an incompetent coder having a brain fart.

    Remember, the purpose of source code is to communicate intent - first, to the compiler, second, to you and anyone else reviewing it. The compiler doesn't care, but people aren't compilers.

    Heck, I've seen people who are so unsure of how the language works that they blockify the contents of their case statements, put a break after the last statement in a switch, and braces around every one-line else clause because they're not *sure* as to which "if" the compiler will think it belongs to. These same people always end up being the ones who have code that is indented so much that most of the action takes place in the right-hand margin, and they also indent every parameter that far as well, rather than let it word-wrap, or clean up their code. And they've done so much drag-n-drop of code that it's a mishmash of spaces and tabs.

    They inevitably learned on Windows. They feel they need an IDE with auto-suggest, templates for almost every type of project, and built-in "project management" because they can't write a make file to save their lives ... when deprived of Visual Studio, they fall back on compiler shell scripts rather than ask for the nickel tour of "make", or *gasp* buy a book and read it!

    Clean, concise code - it's not just good looking, it's cheaper to debug and maintain.

  • by ChrisWong ( 17493 ) on Saturday December 06, 2008 @10:29PM (#26016955) Homepage

    I know you hate Java, but do reconsider. Since you have established your .NET skills, you will probably cover the vast majority of the universe of software job opportunities if you can add Java to the list. Of course there is a lot valid stuff outside of .NET and Java, but those are the dominant players, professionally speaking.

    You won't be locked into the Java language. The Java ecosystem is much larger than that: the Java class libraries, of course, but also Spring, Hibernate, J2EE, the Apache goodies, Eclipse, debuggers, profilers, monitoring etc. If you expect to integrate your software with a future unknown codebase -- perhaps by acquisition or merger -- there is a good chance it will be Java-based.

    Ruby, Python, JavaScript and other languages do run on the Java JVM, but I suggest taking a look at languages that really sprung up from Java, like Groovy and Scala. Groovy appeals to the dynamic typing camp, and Scala to the static typing camp. The advantage with these languages is that they integrate into the Java platform just about as well as the Java language itself. You can write real Java-visible classes in these languages that integrate seamlessly with the rest of the Java platform, including annotations, generics and enums. Other languages can run in the JVM and call Java classes, but it's likely a one-way street. Java classes cannot call, say, a JavaScript class (JavaScript has no classes!).

    My own experience has been with Groovy, which claims Smalltalk, Ruby and Python as its inspiration. It's much more productive, powerful and readable than Java. Yet it integrates well with all things Java. And yes, it's production code deployed on Linux.

  • by SanityInAnarchy ( 655584 ) <ninja@slaphack.com> on Saturday December 06, 2008 @10:31PM (#26016971) Journal

    Yes, you're going to make things harder on yourself if you try to use C#, or Visual Basic, etc.

    And yes, knowing C will help. A lot.

    But the answer is the same, no matter what platform you're on. The answer is, "It depends what you want to do."

    For instance: It helps to know C, but if you'll be doing, say, web apps, it would be ludicrous to be doing it in C. If, on the other hand, you're doing things with hard realtime requirements, C might be the upper end of what you'd use. And there's all kinds of things in between.

  • by that this is not und ( 1026860 ) on Saturday December 06, 2008 @10:46PM (#26017075)

    I am mostly an Assembly Language programmer and it can teach some bad habits. I don't generally trust anybody else's code, so end up coding up everything from scratch. It's a solitary practice. That said, 'pointers' and other things that seem weird and remote to many people are painfully obvious if you started out in Assembly.

    Bare hardware and real memory addresses rule. However, a bare-metal assembly language programmer will mostly work with embedded controllers in this day and age. Yay for the little 8 bitters and even the 4 bitters. There are still billions being deployed.

  • by DiegoBravo ( 324012 ) on Saturday December 06, 2008 @10:46PM (#26017077) Journal

    >> First, let me start by saying that the definition of an experienced programmer is that they don't care about the particulars of any given language.

    That maybe true at some extent, but remember that the definition of an experienced software architect (or corresponding title) has a lot to do with using the right tool for the current situation. Of course what's the right tool is not too easy to decide... more often than not, it is just the one that you (and your team) feels more comfortable with, and almost never that new fancy technology that suddenly turned popular in all the blogs.

    Now the original question... developing "for Linux" almost always means automatically developing for any platform (almost any language "for Linux" is open and available everywhere.) The only "linux-specific" exceptions maybe are the kernel and drivers(using C/ASM), but I think you're just thinking of standard use of the languages. From that point of view, the original question turns irrelevant, and you can just select any open language for other desired features; typically application domain, learning curve, fan club, etc...

    regards,

  • by Anonymous Coward on Saturday December 06, 2008 @10:47PM (#26017089)
    Wouldn't you rather avoid the products of the other companies that aren't finding these bugs?
  • Re:Java (Score:4, Insightful)

    by binarylarry ( 1338699 ) on Saturday December 06, 2008 @10:52PM (#26017109)

    Java was designed for networked applications.

    It shows because the Java stack and libraries written with it rarely have built in flaws that allow computers/servers to be compromised.

    So there's one reason and it's a big one if you think about it.

  • Re:I like Python (Score:3, Insightful)

    by Blakey Rat ( 99501 ) on Saturday December 06, 2008 @10:56PM (#26017143)

    It's not FUD, and it's not my whitespace that I'm worried about. I'm an absolute nazi about getting it right (tabs for indents, spaces for alignment!).

    One issue with it is, it's a pain in the ass to get most code editors to leave it alone. Granted, that's a flaw in the code editors, but it doesn't change the reality that if you sit down at some terminal that you haven't carefully configured, editors do all kinds of funky things to your whitespace. Expand tabs to spaces. Strip blank line indentation--I know Python ignores that, but it's still a pain in the ass sometimes. Changes indent levels because of a line continuation. Whatever. Cut/paste code, all sorts of things that you can't see changes. It only gets worse when working with someone who isn't anal about their whitespace, or is anal in a slightly different way.

    If this is seriously a problem for you, you're bordering on Obsessive-Compulsive Disorder. And I'm not even kidding around; you actually care whether a blank line is tabbed or not?

    If you could get past the OCD, your life would be a whole lot easier if you just let the editor do the tabbing and spacing for you. And you'd work better with others, to boot.

  • by mR.bRiGhTsId3 ( 1196765 ) on Saturday December 06, 2008 @11:13PM (#26017211)
    Makefiles are easy, Makefile.am(s) are easy. configure.acs are where the pain is. Every time I have to do anything with them, I feel like I want to cry and then end up cutting and pasting a whole bunch of junk from some other configure.ac.
  • by Gazzonyx ( 982402 ) <scott,lovenberg&gmail,com> on Saturday December 06, 2008 @11:15PM (#26017221)
    I thought that the operating system doled out the memory... that's the reason that once Firefox uses 300 MB of memory, it will always use 300 (on windows, I haven't bother to check under any other OSes). So, even if the JVM deallocated the GC'ed memory, Windows will keep that chunk of memory earmarked in case the JVM asks for it again. All that being said, you are correct, everything is a time/space tradeoff and the logical choice is usually to trade off space for time.
  • by computational super ( 740265 ) on Saturday December 06, 2008 @11:33PM (#26017329)
    C - absolutely.

    Another thing that C has going for it is that virtually all Linux apps are written in C. So, if you ever want to install anything from source, and something goes wrong, you'll be glad you know a thing or two about C so you can figure it out (and even submit a patch that ends up being applied to a big, established project like WINE - that's a pretty awesome feeling, let me tell you). All *other* languages interpreters are written in C - it's always worthwhile once you've gotten comfortable with a language like Java to sit down and write your own interpreter in C so you can really get a good feel for what it's actually doing.

    So, yeah, I second the parent. Definitely C.

  • Re:I like Python (Score:3, Insightful)

    by 19thNervousBreakdown ( 768619 ) <davec-slashdot&lepertheory,net> on Saturday December 06, 2008 @11:55PM (#26017417) Homepage

    I know a whole lot of really good programmers. That I know of, none of them have tabs set to 8 characters. Most use 4, some use 3. I prefer 2.

    Can you change how many spaces a tab is worth in that feature? I can't see it being realistically useful if not. That also doesn't solve the situation of different people with different tab expansion working on a single project.

    You can argue all you want that "this is the way tab is" which is great in theory, but completely ignores the reality of how people work. And yeah, people should change how they work if they're working on Python, but it seems a little odd that one language has all these new rules that most editors don't have great configuration options for.

    I just don't get the huge benefit of it. Forcing code to be readable? If they didn't use whitespace as syntax, you could run it through tools that fix it up automatically! Plus any programmer that's so lazy that they don't get that right is going to write pretty shitty, undisciplined code, and it's not going to get better in Python. The drawbacks seem to seriously outweigh the benefits.

    Is there any other benefit to it I'm not thinking of?

  • by Linzer ( 753270 ) on Sunday December 07, 2008 @01:16AM (#26017811)
    Well, go to India and see how little truth there is to this. Real Indians speak English. Of course, they also speak Marathi or Kannada or Tamil or Bengali and so on, but the lingua franca is English, not Hindi.
  • by Jeremi ( 14640 ) on Sunday December 07, 2008 @01:27AM (#26017881) Homepage

    I think I might like Obj-C over C++, due solely to the really nice init/release/autorelease mech for memory allocation.

    I've done just a bit of Obj-C programming, and I didn't see much advantage of init/release/autorelease over plain old C malloc()/free(). What I mean is, under C, I have to remember to free() each object that I malloc(). Under Obj-C, OTOH, I have to remember to [release] each object that I alloc (or retain). In either case I need to remember to explicitly execute a cleanup/release action to match the allocate/retain action, and if I don't get it right, the object is (effectively) leaked. That means I have to manually check every code-path to ensure that each of my ref-count-incrementing actions is matched by exactly one ref-count-decrementing action, which is tedious and error-prone. It's actually even worse than that, as Objective C has several different conventions regarding how system APIs handle ref-counts... some of them will have ref-counted the objects they return and expect you to [release] the objects when you're done with them, others don't... so it's quite easy to do the wrong thing.

    Compare that to C++, where I can (and do) use templates to create a reference-counting system that automatically frees objects at the appropriate time, and no explicit calls to free()/release()/decrement_ref_count()/whatever-you-want-to-call-it() necessary, ever:

    void FooBar()
    {
    MyClassRef myRef(new MyClass); // MyClassRef constructor increments the new object's refcount to 1
    MyClassRef anotherRef(myRef); // MyClassRef copy constructor increments the object's refcount to 2
    /* anotherRef's destructor executes here, decrements the object's refcount to 1 */
    /* myRef's destructor executes here, decrements the object's refcount to 0, and so the object is auto-deleted */
    }

    With that system, there is almost no way for me to mess things up(*). I don't have to remember explicitly to call any sort of (release) or (dealloc) function for each object I create, because it is guaranteed to be called for me by the destructor of the last Ref object.

    So I must be missing some key insight about Objective C's memory management system, because even with reference counting it seems almost as error-prone as C's manual memory management.

    (*) One way to still mess things up would be to create cyclic references, i.e. A refs B and B refs A. But that's a problem for any reference-counting scheme, and the solution is either to avoid cyclic references or go with a full-blown garbage collector.... and I've yet to find that I need to do the latter.

  • Re:Tabs are EVIL (Score:2, Insightful)

    by HeronBlademaster ( 1079477 ) <heron@xnapid.com> on Sunday December 07, 2008 @01:30AM (#26017887) Homepage

    Oh, I could configure my editor to auto-convert tabs to spaces, but that wouldn't fix the problem I was describing.

    You see, I like using four-column tabs. That would make tabs turn into four spaces. My professor uses three-space tabs. When I copy his code into mine, Python will still blow chunks until I make it consistent.

    Oh, and if you're this rude to me without knowing me, I don't want to work for you.

  • by Jeremi ( 14640 ) on Sunday December 07, 2008 @01:36AM (#26017911) Homepage

    The problem with C++ is that it's a crazy, crazy language. At first, it was just a superset of C, but now there's all kinds of stuff...it's mutated into a totally different kind of thing. C has this elegant simplicity going for it. There's nothing the matter with C++...except that C is (pretty much) perfect.

    That's all true... but I think you're missing something: all of that crazy stuff was added to C++ because it is useful. Of course, any given program will probably only need a small subset of those features, but for the programs that really do need feature X, having it available in the language is a big time-saver.

    I've done a good amount of both C and C++ programming, and these days when I need to write in C I generally end up writing a fair amount of code to manually re-implement functionality that I would get 'for free' in C++.

    I'd say C++ is a lot like English: a big, overgrown, complicated, mess -- and damn useful if you want to get things done. (If you care more about elegance and simplicity, there is always Esperanto, for whatever good that does you)

  • Re:Java (Score:3, Insightful)

    by dacut ( 243842 ) on Sunday December 07, 2008 @03:13AM (#26018253)

    "Java is slow" is a stupid old myth.

    Java is still glacially slow at startup. Even before you get to the JIT stage, it has to decompress the JARs, extract the class files, validate them, and then start executing the bytecode (or incur a JIT compilation cycle and then execute native code). Validation can take a fair amount of time -- doing so requires each method to be simulated (making sure the stack stays coherent no matter how a given instruction is reached, for example) -- though the Hotspot JVM lets you disable this. A fully native application, on the other hand, just maps the files into memory, applies relocations (if that's even necessary these days), and then starts executing.

    For server code, I don't care about Java's startup time. I'm usually checking out a number of database connections, catching up on logs, and doing a zillion other things which make the JVM startup tasks insignificant. For a small command-line utility, on the other hand, the difference is very noticeable.

    Also, even in native code, Java is performing a number of extra security and boundary checks which equivalent C code usually doesn't have. I consider this a feature.

  • Re:Tabs are EVIL (Score:4, Insightful)

    by nschubach ( 922175 ) on Sunday December 07, 2008 @03:29AM (#26018313) Journal

    Therein is YOUR problem, not mine. Tabs are evil only if the programming language makes them evil. Tabs are a highly efficient way to program and keep indentation. It allows developers to view the code a bit more in their preferred style so it's easier for them to read (2 spaces, 3 spaces, 4 spaces or I've even seen 8 spaces.) Not using tabs makes it more difficult to edit the code or share code. If you create a template of code that's indented using spaces, you pass me a piece of code that doesn't look right with my code and is harder to read in the overall scope of things. Also, if you use formatting to show your intentions in the program you probably need to rework your program to better make sense or make use of the language constructs.

    When I get a source file indented with spaces, I then waste time converting these spaces (and the alignment specific readability) you made. I say alignment specific readability because you thought it would be more readable to put all your arguments on a line of their own and hit just enough spaces to line them all up just right so it's readable for YOU on YOUR screen. Now I get your code and it only uses up 25% of my screen width and I now have to scroll up and down more because of your style.

    By using spaces (and according to your post "tone"), you are essentially telling me that you are an arrogant programmer only thinking of your own stylistic ways and methods and that you will never work well with other people unless they do it your way. Even then, you will likely criticize that person for spacing something wrong. You strike me as a micro management type person.

    Ideally, my perfect language/editor would format the file as it was loaded. Source code would not rely on indentation to function properly and line feeds would be meaningless. Each source file would be saved compressed without formatting. Each developer could open that file and it would format to their style.

  • by Anonymous Coward on Sunday December 07, 2008 @03:35AM (#26018341)

    Shell scripting is a real scripting language by which you can even create GUI apps

    Look, I first learned shell scripting in 1983. I've been writing bits of shell script code ever since, even the years I was working in Windows I used Thompson Toolkit and (more recently) Cygwin. So I think I'm qualified to review the above statement.

    While shell scripting is indeed a "real" language (certainly Turing-complete) it's hard to recommend it for anything beyond simple stuff. Any kind of non-trivial use of shell code gets baroque. Every single time you reference a variable with a file name in it, you need to carefully quote it in case the file name might contain a space.

    And that "even create GUI apps" is almost trolling. Yes, you can use kdialog or some similar tool to make simple popup boxes, but it would be an absolute nightmare to do anything nontrivial.

    And one thing about programs: when they are useful, they get added to. Your simple shell script thing may turn into a horrible maintenance nightmare if it grows too big.

    I just started a new job. Just the other day I was re-writing a useful shell script that I've written in the past, so I can have it in the new job. And I kept getting bitten by quoting errors and such. I scrapped the code and re-wrote it in Python! It's simpler, it's cleaner, it's easier to understand and change. And, it still works exactly like a shell script, because I set the first line to:

    #!/usr/bin/python

    Which would you rather write?

    if test x$FOO != x -a "$FOO -gt 0"; then
    gcc "$MYFILENAME"
    if test $? -ne 0; then
    echo "could not compile file"
    exit 1
    fi
    fi

    or:

    if os.getenv("FOO", 0) > 0:
    fname = os.getenv("MYFILENAME")
    result = subprocess.call(["gcc", fname])
    if result != 0:
    print "could not compile file"
    sys.exit(1)

    The great thing about the shell script is that you can just run programs without the "os.system" rigamarole, and you can check environment variables just by naming them. But that if syntax is just painful. In the "x$FOO" code, the "x" is there because $FOO might contain nothing (or just white space) in which case you will actually get a syntax error! You don't need to use "x" but you need something there or your program could crash just by someone changing an environment variable to a blank value. I don't like the need to hack like that. Then we have "-a" for "AND" and another expression which is true if $FOO is greater than 0. I tried out the code, and it didn't work... then I put it in quotes, and it did work. Why does the AND expression need to be in quotes? Who knows?

    That Python program isn't an obvious win here, because in a few lines we are doing a lot of environement variable checking and running programs. But if you start to do any nontrivial work in your program itself the Python one will stomp all over its poor shell equivalent. And even here, I will claim that the Python code is much easier to read and understand if you come back to it after six months and try to figure out what the hell you were thinking when you wrote it.

    The best thing about shell scripts is that they are easy to get started. This is a valid shell script:

    echo "Now running gcc!"
    gcc myfile.c

    But this isn't much worse:

    print "Now running gcc!"
    subprocess.call(["gcc", "myfile.c"])

    When most of what you are doing is running external programs, the simplicity of shell scripts is great. But the more you try to use shell scripts to write real code, the more painful and annoying it gets.

    Also, a good scripting language like Python has a vast

  • Re:Java (Score:1, Insightful)

    by Anonymous Coward on Sunday December 07, 2008 @04:08AM (#26018447)

    While I agree that your list is something that programmers should aspire to, it's pretty overkill when it comes to hiring programmers. The vast majority of the programming jobs out there are really boring technically. It's primarily programming business logic, and someone capable of writing their own compiler will be bored out of his/her mind doing that kind of work, not to mention costing more than someone more suited for that sort of mundane programming.

    It's been my experience that unless the work is particularly challenging, the best mix is one or two knowledgeable, experienced programmers and then mix in a multitude of "minions" to handle all the tedium that's frankly below what serious programmers should be working on. You also avoid many of the problem personalities that tend to come with more advanced programmers...too many of those are a recipe for disaster.

    For what it's worth, the team that I've assembled at my current employer is primarily junior developers straight out of college. I look for simple problem solving skills, the ability to write code with the best-case big-O for the problem being solved and, since it's a web-based application, the ability to write thread-safe code (not the ability to write multi-threaded code, mind you, that's handled by the application server). Junior programmers are cheap (coming straight from college, most of them actually think that $60k is a lot of money), have very few poor habits and the office is fairly conflict-free. I spend my time reviewing their code, mentoring them when they approach a problem in a way that can be improved upon. And when there's something that is complex enough, I take a more hands on approach. All that leaves me with more mental programming energy to devote to my personal projects.

    I've worked in environments where most programmers were at my level it didn't work nearly as well as our current team does.

  • by Douglas Goodall ( 992917 ) on Sunday December 07, 2008 @04:24AM (#26018497) Homepage
    I was one of the longer holdouts, writing assembler long after C compilers got really good. This went on until the day I used the compiler switch to see the generated assembler code coming out of the compiler. Addressing modes I was aware of but had never bothered to use were accessing carefully aligned data items in a structure referenced off a base register. Several times I still wrote better code for specific routines, but overall the code generators are fantastic these days. If the profiler says you are wasting too much time in a specific routine, it might make more sense to find out why the compiler is not optimizing correctly, rather than counting the cycles of hand written code. Knowledge of assembly can help you use the C compiler more efficiently, but we are long time past the point where we should be coding large amounts of code, "by hand". Smarter people than I have spent hundreds of man years on the code generators, and I for one would like to leverage off that work.
  • by CBravo ( 35450 ) on Sunday December 07, 2008 @05:12AM (#26018645)

    It would be bad to _not_ know C. It's like driving a car and not knowing about car mechanics. Maybe it won't be your last or most used language. I would be weird to only know perl, java or c++. And while you are at it somewhere in your future, start with it so you won't 'doh' yourself too much. The only drawback is that it won't learn you good style unless you get a good course/book (c can get ugly).

    My final goal would be to know a half a dozen languages and be prepared to learn a few of the other two dozen. Call it job security/flexibility. If that is your goal, it is good to understand the hardware (since all programming languages cannot do more than the hardware allows). C is pretty close to the hardware and gives you a better feeling for what hardware can do (and I can't think of alternatives that are a better choice). Although I love assembler, I cannot recommend it. I can recommend to learn about compilers though.

  • by 615 ( 812754 ) on Sunday December 07, 2008 @05:30AM (#26018685)

    ... and those extra semi-colons "just in case" are also ugly.

    En garde!

    To me, omitting syntax that isn't strictly necessary is a form of premature optimization. It takes more work to determine whether a statement needs to be terminated with a semi-colon than it does to subconsciously terminate _every_ statement; it takes more work to translate between the block and inline form of an if-statement as code evolves; it takes more work to rearrange case statements if some include an implied break.

    I used to strive for "compactness" in my code. When I realized how much keeping track of all my own formatting rules and exceptions was costing me brain cycles (plus the aforementioned issues), I switched to striving for consistency.

  • by Anonymous Coward on Sunday December 07, 2008 @05:40AM (#26018709)
    and these days when I need to write in C I generally end up writing a fair amount of code to manually re-implement functionality that I would get 'for free' in C++.

    Odds are you're ignoring one of the true fundamental virtues of programming: Reusability.

    You see, when you have a rock stable ABI, like C affords you, you can create these things called "Libraries", which future products can then depend on, often times even in other languages like Python and Java. And those products can then be depended on, and so on and so forth until you have a whole working system.

    I laugh every time I hear someone say something like "Oh C++ has [blah] "for free"". No, you don't have it for free, someone else just coded it, stuck it in your fat C++ library and now 10 years later people bicker about whether it was actually the right approach to standardize so much of this crap, when so many different "standard libraries" are so totally and hopelessly incompatible.

    C's standard library is so spartan that you can write your own "standard library" full of goodies like lists and queues and trees and other time savers, and you never have to get into such arguments to begin with.

    Or, if you're incredibly lazy, you can use some of the community maintained, amazing C libraries that already exist. My personal favorite happens to be GLib, but anyone who's written enough code in C to have an opinion on the subject has probably written one of their own or come across one they like as well (such as eGLib in Mono, the Apache Portable Runtime Library in Apache, and the list just curls on...)

    So yeah, all of that stuff was added to C++ because it was useful... Just as long as you're working on one project, with one version of [OS], with one compiler...
  • Re:Java (Score:4, Insightful)

    by IkeTo ( 27776 ) on Sunday December 07, 2008 @06:03AM (#26018775)

    import slashdot.reply; public class Reply { public static void main(String[] args) { try { I hate Java for one single reason: to express any idea you need 3 times as much code. } catch (Exception e) { and the whole idea of checked exception is simply silly. } } }

  • Web Software... (Score:2, Insightful)

    by g4b ( 956118 ) on Sunday December 07, 2008 @08:55AM (#26019519) Homepage
    I disagree. PHP might have been advisable 5 years ago, atm. it is wiser to stick to Python, Java or Ruby on the Web Platform. After Django and co. nobody really considers PHP to be a wise call.
    On the Front End again things like Laszlo or better GWT (Java written Forms for HTML translated in pure JS) are worth looking.

    Basicly coming from a Windows world and knowing .Net I however don't understand the problems with Java. Especially for Servers and in near future for games and 3d web-apps (not applets, but java hot-start apps) Java will and is the way to go. Also learning the strength of eclipse is in my eyes a very good step for each coder.

    The indentation problem of Python is just something you have getting used to. After getting used to it, you start to love it. After loving it, you start to write python apps even where you are not supposed to...
  • Re:C or C++ (Score:3, Insightful)

    by ThePhilips ( 752041 ) on Sunday December 07, 2008 @09:23AM (#26019627) Homepage Journal

    I second. I'm pretty appalled on how clueless new young programmers on resource management.

    N.B. As I was taught 15 years ago, programming is art of resource management. That was my teacher's way of saying the famous "algorithms + data structures == programmes," but pitching that all programs all the time use system resources (CPU, memory, files, etc) and your programs will always be as good as your understanding of the resources.

    C, if nothing else, teaches how to manage resources and resource management skills are pretty much what defines a good programmer.

    After you have grasped on how all stuff is managed and how it really works under the hood, Perl becomes irreplaceable tool at helping managing them very easily. Perl documentation is excellent on telling you precisely what Perl does and how much of what overhead the given code has.

    I bring up resource management because it feels stupid that every time pure Java/C# programmers have problems they come to me: most questions amount to "we do this but whole system explodes" (because e.g. they have tried to allocate and object for 0 ... MAX_INT). And when you tell them that you have to eventually free the memory, they act surprised since they have thought that Java/C# handles that all for them and they expect it to e.g. automagically clear the list which keeps references to all the object which code doesn't intend to use anymore. This is primitive template example, but happened more than once to me.

    Understanding resource management is quite tiresome and for smaller projects is overkill. But for anything large enough you have to know it and you have to understand it. I haven't seen a single large Java project written solely by pure Java programmers: very very likely that they have number of ex-C folks on the team. I guess the same goes for C# and Python.

    Knowing C and Perl - not as languages - but as tools to work with system resources is invaluable knowledge. Learning another way to express your thoughts gives you nothing (I know probably more than 20 languages), but the very and most important is the knowledge of the system resources and how to work with them properly. Some standard libraries (e.g. Java) had put abstraction level way too high to allow to learn about system resources and to write efficient programs.

  • by tepples ( 727027 ) <tepples.gmail@com> on Sunday December 07, 2008 @09:25AM (#26019641) Homepage Journal

    C isn't going away any time soon, and it works on ALL platforms

    C doesn't work on Xbox 360 XNA; only C# works for that. C doesn't work on smart phones that use J2ME MIDP; only Java works for that. C doesn't work for the client side of web applications; only JavaScript and ActionScript work for that. C doesn't work for the server side of web applications installed on shared hosting; generally, interpreted languages whose names start with P work for that. In general, C compilers targeting sandbox virtual machines such as these aren't high-profile, if they exist at all.

  • by kmsigel ( 306018 ) * on Sunday December 07, 2008 @09:25AM (#26019643)

    >I am mostly an Assembly Language programmer and
    >it can teach some bad habits. I don't generally
    >trust anybody else's code...

    I find that (not trusting other people's code) to be a good thing, no matter what language/platform you are using. I use assembly, C, and C++ for embedded and desktop programming. To the greatest extent possible I write all code myself.

    For x86 embedded work, that means writing the MBR (and everything else on up) myself. For Win32 work, that means using a basic application framework that someone else wrote (and I've spent 13 years fixing and improving) and doing pretty much everything else by myself. (To be fair, I also use the IJG library for JPEG encoding/decoding. The IJG library is good stuff.)

  • by Hurricane78 ( 562437 ) <deleted @ s l a s h dot.org> on Sunday December 07, 2008 @09:42AM (#26019729)

    Hmm... I have a completely different point of view.
    I program stuff *once*. Including all the things you mentioned above. I abstract them into levels where memory management, linkage, and threads do not matter anymore.
    That's why I'm programming in Haskell, O'Caml and Python. In my eyes, Haskell is the perfect middle point between machine code and human logical thinking.
    If I would have to write in C, the first thing I'd do, would be to write libraries that do the low-level stuff for me, so I can concentrate on the pure algorithms.
    But someone did this already. And they did it really well. So well that you lose no freedom, except when you *want* to interface with hardware (eg drivers/os).

    So why reinvent the wheel... again... and again...?

    And I really understand what I am doing, without knowing the low level stuff. Because I'm writing algorithms, and user interfaces, and data structures. Not drivers.
    So please stop being so arrogant. ;)
    Your style has its place. But when you follow the whole philosophy of CS, it should be a minority by definition. :)

  • by Anonymous Coward on Sunday December 07, 2008 @10:51AM (#26020197)

    You need to know what's possible and what isn't.

    If you want to do anything useful (a program which performs complex calculations then exits without ever doing anything with the results isn't useful), you need to use system calls, either directly or indirectly.

    If you want a library function and it doesn't exist, you can write it. If you want a system call and it doesn't exist, you're shit out of luck.

    And you can't entirely abstract away details with a library. You need to know that e.g. if a library has an open descriptor and you fork, the child will inherit that descriptor, which probably means that the descriptor won't get closed so long as the child lives.

    Understanding system calls is important even for admins with no interest in programming. If you don't understand section 2 of the manual, you don't understand Unix. At all.

  • by Jeppe Salvesen ( 101622 ) on Sunday December 07, 2008 @12:26PM (#26021065)

    It's better in the long run to write unit tests for your code, than spending time re-implementing what others have done for you.

  • by VGPowerlord ( 621254 ) on Sunday December 07, 2008 @01:03PM (#26021355)

    I find that (not trusting other people's code) to be a good thing, no matter what language/platform you are using. I use assembly, C, and C++ for embedded and desktop programming. To the greatest extent possible I write all code myself.

    So, you take the time to rewrite things like stdio?

  • by BlueCodeWarrior ( 638065 ) <steevk@gmail.com> on Sunday December 07, 2008 @01:39PM (#26021675) Homepage

    I did learn C++, back in the day when it was a superset...but I stopped, because I didn't really like it.

    I mean, how the hell can you write a program these days without OOP,

    Honestly... I don't really like writing most things in OO style. I tend to find that most of the time, OOP is just done for OOP's sake, and it's much easier to just program in a procedural manner. A lot of "OO" code is just procedural code in OO clothing.

    However, sometimes, it does make sense. Quite a bit of the coding I do is OO code. But that's usually because I'm working with other people who write in OOP style first.

    exceptions

    I don't like exceptions. It could be that I've been exposed to too much bad Java code, but again, I've found that most of the time, a try/catch block is wrapped around the smallest amount of code that it needs to be. Is

    try { func(); } catch (Exception $e) { die("Died calling func: " . $e->getMessage(); }

    really better than

    #define TEST_ERROR(f, msg, ...) if(0 == f(__VA_ARGS__)) { fprintf(stderr, "Fatal error: %s", msg); }
    TEST_ERROR(func, "Error calling func")
    ?

    generic containers/algorithms

    Nice. But hardly neccesary.

    user-defined data types

    structs?

    I mean hell, C can't even deal with strings in any reasonable way.

    For your value of 'reasonable', anyway. I'll admit that it requires a tiny bit of extra knowledge compared to other languages, but it's certainly not difficult, and follows pretty logically from C's core ideas.

  • by BitZtream ( 692029 ) on Sunday December 07, 2008 @03:21PM (#26022773)

    I too have a healthy fear of Java, but that is changing.

    I feel it VERY important to state that Java apps as a general rule are bloated crap.

    I also feel it VERY important to state that Windows apps as a general rule are bloated crap.

    I used to avoid Java like the plague due to the slow bloated feel of the apps I had used. Fortunately, recently I was forced to write a Java servlet because a library for that I wanted to use was a java library and it was the only one with a license acceptable to the project I was working on.

    In the course of writing the Java servlet I came to learn that Java and the JVM aren't the problem, its just the poorly written apps that I've seen. I meantioned Windows above because it suffers from the same misconception to most non-techies (techies have their own more legitimate reasons for disliking it). Most Windows (and Java) developers suck. They aren't developers, they are people who wrote an app for some other reason. Whatever that reason my be isn't important. Whats important is that we see a lot of crappy Java and Windows apps because those are things that lots of people have easy access to. Pretty much EVERYONE has a Windows machine of some sort they can use, and most of those Windows machines hava JVM. Since you can easily setup a Windows or Java development machine for little to no cost or technical ability, the barrier to entry is low enough that those non-developers can write bad apps that give the language (or OS) a name as a poor performer, when in reality, 99% of the time, the app is the issue, not the engine under it.

    I write this post as a former Java hater, who now maintains a servlet that services hundreds of thousands of hits a day, certainly not the biggest web app by any standard but it is a high performance application doing image manipulation in 'real time' for its end users. I still think you should learn C (C++ is good as well, but do C first IMO and you stand a better chance of using object oriented languages properly rather than abusively), but if you are a good programmer, Java can be an excellent language and runtime enviroment to build on. I would not have wanted to write my web servlet in C or C++ in this case.

    So for the Java haters, just think about why you hate Java. Do you hate it because of the shitty apps you've used, or because there REALLY is an actually problem with it?

  • by mgiuca ( 1040724 ) on Monday December 08, 2008 @12:10AM (#26027785)

    Another person complaining about the use of the term "C/C++". I hear this all the time, "it's so ignorant when people say C/C++".

    Well perhaps it isn't an ignorant lumping-together of two distinct programming language, but a mention of the common ground between the languages, or shorthand for "C or C++".

    For instance, I might say, "You should never dereference a null pointer in C/C++". Here I am not naively referring to C/C++ as a language. I am merely saying that you should never dereference a pointer in C, or C++ -- take your pick which language I am referring to because my statement applies to both.

    I could just as well say "types are computed at runtime in Perl/Python", for the same reason.

  • by mathew7 ( 863867 ) on Monday December 08, 2008 @03:58AM (#26029681)

    Why Java? Because I can concentrate more on the programming logic side rather than worry so much about memory resources, it has a lot of library support, and it runs on most real operating systems as well as those marketed by Microsoft.

    In your case it probably is not valid, but the problem of new SW is that they seem to forget everything about resources. This is especially true to those MS IDE/tools users that have never seen/studied assembly. And with java and C# (never used it actually), it seems that pointer operations (which is the hardest for new programmers) seem to disappear.

  • by kmsigel ( 306018 ) * on Monday December 08, 2008 @08:29AM (#26031037)

    What you say is catchy, and sounds like it should be true, but it isn't.

    When great programmers are creating truly great (and novel) applications the time to learn, fix, and modify someone else's code to do what you want it to do is similar to writing your own code. And in the end, if you are a great programmer, the code you write yourself will be better than what you found and then had to fix/modify.

    Of course I'm not talking about re-writing a TCP/IP stack, a NIC driver, a graphics library, a thread scheduler, or the like. I did all of those things in part because I enjoyed it (I was sort of on a sabbatical) and in part because I knew it would pay off for me in the long run (I've already used my embedded OS on two substantial projects).

    But this myth that whatever you are doing must have 90% of the code already written somewhere "out there" is just that, a myth. Yes, if you are doing something boring that is 90% just like a bunch of other things that other people have done then maybe that's true. For what I do, it is not true.

  • by Hognoxious ( 631665 ) on Tuesday December 09, 2008 @05:37AM (#26044685) Homepage Journal

    A good software developer is like a skilled mechanic or manufacturer. He knows which pre-existing parts to use when fixing or creating a car.

    A great software developer builds new kinds of cars. If existing parts were sufficient for that task, he isn't building something new.

    Unfortunately, pointlessly rewriting something can cause a programmer to think he's in the second category, when in fact he's barely in the first. This does happen, I've cleared up the resulting mess more than once.

    If existing parts were sufficient for that task, he isn't building something new.

    Not at all. You can create something new from a combination of existing components. Conversely, if you reinvent the wheel, it's still just a wheel.

  • by Secret Rabbit ( 914973 ) on Wednesday December 10, 2008 @04:18AM (#26056819) Journal

    Most (?) programmers have this thing about languages. They program in different ones until they find one they really *really* like. After that, EVERYTHING is about that language. Unfortunately, this is ridiculous.

    Every language has its strengths and weaknesses. Every programmer has certain levels of competency with the different languages. Every project has its requirements.

    In other words, pick the language that best meets the requirements of the project FIRST. THEN look at your competency in that language and come to the conclusion whether to proceed to the next best language, or use that one.

    Btw, I once learned a language to do a project *while* *working* *in* *industry*. If you aren't able to do that, or don't want to do that, then this industry probably isn't as compatible with you as you think.

    But, if you want my opinion based on my experience: learn as many languages as you can. The more languages you learn, the better you will be overall. You'll be surprised just how different you have to think in any given language to get the job done.

If you think the system is working, ask someone who's waiting for a prompt.

Working...