Slashdot Mirror


What Programming Language For Linux Development?

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?"

997 comments

  1. It doesn't matter as long as it's on Linux by alain94040 · · Score: 4, Insightful

    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.

    1. Re:It doesn't matter as long as it's on Linux by Burnhard · · Score: 1

      but what I would also recommend that you explore are some of the fun scripting languages like Perl

      Forgive me Alain, but "fun" is not a word I tend to associate with Perl!

    2. Re:It doesn't matter as long as it's on Linux by Goaway · · Score: 3, Insightful

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

    3. Re:It doesn't matter as long as it's on Linux by Anonymous Coward · · Score: 0

      Purely from a job perspective, there might be more jobs on the Windows platform, but they are also more boring

      What evidence do you have to back this statement up?

    4. Re:It doesn't matter as long as it's on Linux by westlake · · Score: 1
      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

      The new kid on the block might be offered a job at Pixar fresh out of school.

      He might also win the Tri-State Lottery.

      There is something to be said for pursuing the more modest rewards of a regular paycheck and the chance to gain some practical experience in your chosen profession.

      Boredom is subjective.

      Windows is a significant presence in almost every market segment. If you can find nothing of interest going on there, that says more about you than it does about the OS.

    5. Re:It doesn't matter as long as it's on Linux by timeOday · · Score: 1

      I will chime in for perl. Perl is a great productivity-booster for innumerable little jobs and bits of analysis that I do day-to-day. I would never consider perl a replacement for a "real" programming language in a large application, but I think it compliments C++ wonderfully. "Practical Extraction and Report Language" is exactly what it is, and I don't really care for some of the more recent extensions such as object orientation. (Python may offer the best of both worlds, I don't really know).

    6. Re:It doesn't matter as long as it's on Linux by rhathar · · Score: 1

      That's true.

      A fifth of our company are programmers (~20/100) and we do nothing but Linux and web-based work.

      Looking at that and usage of things like Python out there (Google, CCP, Nasa, Maya, Reddit) I think you'd better back up that 'purely from a job perspective' comment!

      --
      http://www.chaotickingdoms.com
    7. Re:It doesn't matter as long as it's on Linux by therpham · · Score: 1

      Personally, I've always preferred to think of it as a Pathologically Eclectic Rubbish Lister. It does such a good job at handling all my rubbish, too!

    8. Re:It doesn't matter as long as it's on Linux by GigaplexNZ · · Score: 1

      That's true. A fifth of our company are programmers (~20/100) and we do nothing but Linux and web-based work.

      And your company must be the only place that employs programmers. Where I work, a rough guestimate would put our programmer count to around 1000 (out of perhaps 3000) and we almost exclusively deal with Microsoft platforms.

      I'm willing to agree with the statement that there are more job opportunities on Microsoft platforms even without the conclusive evidence because it just seems to make more sense. Windows has a much larger market share of desktop computing, and much of the Linux software is open source software written by skilled enthusiasts in their free time. There are a lot of Linux servers out there and clearly there must be Linux related jobs out there, but I wouldn't expect the numbers to be high enough to offset those of Microsoft.

      Remember, the original post said

      there might be more jobs on the Windows platform

      so I wouldn't expect any evidence to back that up.

    9. Re:It doesn't matter as long as it's on Linux by DiegoBravo · · Score: 2, Insightful

      >> 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,

    10. Re:It doesn't matter as long as it's on Linux by that+this+is+not+und · · Score: 1

      Maybe he's had to touch somebody else's perl code too much.

    11. Re:It doesn't matter as long as it's on Linux by mR.bRiGhTsId3 · · Score: 1

      It doesn't help that Perl isn't actually a language. If I remember correctly Perl is defined by whatever the reference implementation executes and considers correct. Not a particularly rigorous definition for a language, particularly one so widely used.

    12. Re:It doesn't matter as long as it's on Linux by jhol13 · · Score: 1

      wouldnt' particularly recommend more modern and high-level languages on purpose: they hide too much of Linux

      This is exactly why I would recommend something other than C/C++.

      But then, the question itself was a flamebait.

    13. Re:It doesn't matter as long as it's on Linux by BlueCodeWarrior · · Score: 1

      There is something to be said for pursuing the more modest rewards of a regular paycheck and the chance to gain some practical experience in your chosen profession.

      Agreed.

      Windows is a significant presence in almost every market segment. If you can find nothing of interest going on there, that says more about you than it does about the OS.

      For me, it comes down to using the best tools. I only want to use what's best for the job, and I believe that only rarely is Windows the best tool.

      I guess this backs up your point, it does say more about me than about the OS itself...

    14. Re:It doesn't matter as long as it's on Linux by BudAaron · · Score: 1

      I read and scanned through this thread. My life started teaching COBOL and assembly language for Control Data Corporation's line of computers. I learned C, C++ and a slew of other languages through the years. I now make a substantial living writing in Visual Basic 2008 for Windows and thank god every day for Intellisense. My real question is a very, very honest one. How does one earn an income writing open source? At this point I know how to earn a living in Microsoft technologies but haven't a clue how to earn in the Linux and other open source venues.

    15. Re:It doesn't matter as long as it's on Linux by i.of.the.storm · · Score: 1

      I have to agree with that statement, I don't see what Windows has to do with making a job boring. I don't think there are that many game programmers using Linux, or at least they have to run the games in Windows most of the time. That's probably fairly interesting to a lot of people.

      --
      All your base are belong to Wii.
    16. Re:It doesn't matter as long as it's on Linux by Anonymous Coward · · Score: 0

      The way you earn an income writing open source code is to work for a company that uses open source software itself or supports other companies who use open source software. I don't know the exact percentages, but a majority of people who contribute to Linux, Apache, and other large open source projects are employed by companies who use that software or otherwise benefit from the existence of that software and so are interested in improving it to make it serve their needs even better.

      There are some companies that are devoted to developing and selling a specific open source product. MySQL, Codeweavers, and others, not to mention companies like Red Hat, Novell, Mandriva, etc. who sell Linux distributions. I don't know (but would be interested to learn) what portion of the population of open source programmers is employed by companies who sell open source products vs. by companies that use open source products.

    17. Re:It doesn't matter as long as it's on Linux by msormune · · Score: 1

      If you're a pro who doesn't mind picking up a new language every once in a while, why the hell would you write the application so they would be bound to GNU/Linux platform?

      If you use the standard ANSI C and C++ libraries, why in the world would you write platform specific code? Unless you really have to, like for a device driver.

      There's no "better side" like Linux. If you're REALLY a pro you will agree. Operating systems are just platforms and tools like libraries and languages.

    18. Re:It doesn't matter as long as it's on Linux by Anonymous Coward · · Score: 0

      the obvious choice is Pascal

    19. Re:It doesn't matter as long as it's on Linux by Lennie · · Score: 1

      Microsoft isn't king on the web(servers). Netcrat confirms it. :-) And the web is where a lot (new ?) interresting things are happening.

      --
      New things are always on the horizon
    20. Re:It doesn't matter as long as it's on Linux by GigaplexNZ · · Score: 1

      I didn't say they were king of servers. What I was suggesting is that the lead that Linux might take away in the server world in terms of job prospects probably isn't sufficient to offset the lead that Microsoft has in the desktop world. I could easily be wrong, but it would surprise me.

    21. Re:It doesn't matter as long as it's on Linux by Anonymous Coward · · Score: 0

      I agree your line "experienced programmer is that they don't care about the particulars of any given language". So why not start learning Python. Since you program in C++, next step would be Qt-4. Very amazing(since the cross-platform software like VLC, Skype, Google Earth all use Qt). For some time i will stick with Python ( After i learn Python wx library i will explore python-qt4). Java hasn't done anything bad but with Qt-4 you can develop beautiful GUI. For backend no need to say we learnt programming when we started c. All of them follow the same basic only little tweaks. So for a new exploration first Python then Qt.

  2. C or C++ by Amazing+Quantum+Man · · Score: 4, Informative

    The *nix API is in C.

    Alternatively, you could look at Perl, as well.

    If you're really desperate, you could use Mono, but I wouldn't recommend it.

    --
    Fascism starts when the efficiency of the government becomes more important than the rights of the people.
    1. Re:C or C++ by incripshin · · Score: 1

      The *nix API is in C.

      <sarcasm>Are you talking about the Single *nix Specification (S*Sv3)?</sarcasm>

    2. Re:C or C++ by Facegarden · · Score: 0

      If you're really desperate, you could use Mono, but I wouldn't recommend it.

      I'm curious why you say that? I am extremely new to programming anything but embedded stuff, but c# has been super easy to learn. I started about a month ago and i just released my first software utility to a few customers yesterday. I admit knowing very little about the alternatives, but c# works great for me. I'm not doing driver development or anything complex, just simple apps to access small databases etc, and c# shows no signs of being limited in anything i intend to do. I also played with Mono in Ubuntu and it seemed fine. Not as full-featured as VC# for windows, but not bad. If he's already learning c# as he said, it seems worthwhile to me to learn how to use mono.

      check out their success stories here: http://www.mono-project.com/Companies_Using_Mono

      -Taylor

      --
      Worldwide Military budgets: $2100 billion. Worldwide Space Exploration budgets: $38 billion. Really, world? Really?
    3. Re:C or C++ by Anonymous Coward · · Score: 0

      > If you're really desperate, you could use Mono, but I wouldn't recommend it.

      Do you mind giving a reason for that?

      Also: What about Java?

    4. Re:C or C++ by FishWithAHammer · · Score: 1, Redundant

      Knee-jerk hatred of anything related to Mono, basically.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    5. Re:C or C++ by Joce640k · · Score: 0, Flamebait

      ...you mean "C++". This is 2008, nobody should be using C except as a last resort.

      --
      No sig today...
    6. Re:C or C++ by mysidia · · Score: 2, Informative

      Sophisticated graphical applications are no fun to write in C.

      I for one would recommend Python, Ruby, or Java for desktop apps that a user interacts with graphically.

      And C for low-level system tools (kernel drivers, compilers, and modules that need to interact with hardware directly).

    7. Re:C or C++ by Joce640k · · Score: 1

      "c# shows no signs of being limited in anything i intend to do"

      Which leads to the correct answer to the OP's question.

      ie. First decide what sort of programs you're going to write, then choose something suitable.

      --
      No sig today...
    8. Re:C or C++ by CSMatt · · Score: 2, Insightful

      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.

    9. Re:C or C++ by Spy+der+Mann · · Score: 1

      Sophisticated graphical applications are no fun to write in C.

      I for one would recommend Python, Ruby, or Java for desktop apps that a user interacts with graphically.

      I do not recommend python at all for desktop apps. Python is especially itchy about dependencies. Unless you have access to the computers in question and don't plan to mass deploy your applications.

    10. Re:C or C++ by Anonymous Coward · · Score: 0

      Isn't that contagious?

    11. Re:C or C++ by mysidia · · Score: 2, Informative

      I have mass-deployed apps written in Python on Linux, and it works just fine, if you do things correctly. In fact, the Redhat base distribution includes desktop applications that are written in and require python.

      An example is the popular package management tool called: Yum.

      I do not recommend python at all for desktop apps. Python is especially itchy about dependencies. Unless you have access to the computers in question and don't plan to mass deploy your applications.

      No matter what language you write your application in, you will need to use SDKs and libraries for a graphical application; these will involve many dependencies.

      What's nice about Python and Perl is most conventional Linux distributions include it by default.

      Even Java has the disadvantage of your users having to have a JRE installed.

      You will need to build packages for your application for easy installation, no matter what language you write for, for Linux you would generally build a RPM, which would declare the proper RPMs for Python packages and system libraries that you need installed to run your app.

      If you write your program in C, you will need many libraries to program efficiently, in addition to all the common graphics libraries, as the C language includes very little, and it would be a headache without some major SDKs to help.

      If you know of a few C libraries, or a C framework that makes it very easy to write sophisticated desktop apps without having to constantly re-invent the wheel, I would be very interested.

      In the mean time, C as a language is lacking. While there are some good tools for it, there's not really a good answer to a simple elegant framework for desktop apps that provides about everything you need.

    12. Re:C or C++ by oliderid · · Score: 1

      Well I had a large project (server) under mono few months ago and Mono + monodevelop did the trick. But of course if you want "linux programming" you would be slightly disappointed :-), it looks so much like windows ;-).

      The problem I had were the weak winform port for the rest...And few problems while marshalling across platefom...For the rest well it works.

    13. Re:C or C++ by Amazing+Quantum+Man · · Score: 1

      Licensing/patent issues, mostly, plus the fact that it's at least 1 version behind .NET.

      As for no Java, TFS said the guy was looking for something besides Java.

      --
      Fascism starts when the efficiency of the government becomes more important than the rights of the people.
    14. Re:C or C++ by BlueCodeWarrior · · Score: 1

      Why I don't use mono? I don't see the point in programming an app with a Microsoft framework on Linux.

    15. Re:C or C++ by Falstius · · Score: 1

      If you know of a few C libraries, or a C framework that makes it very easy to write sophisticated desktop apps without having to constantly re-invent the wheel, I would be very interested.

      gtk with glade is relatively painless. Didn't play so well with threads though when I last developed with it (a few years ago).

    16. Re:C or C++ by EvilRyry · · Score: 4, Interesting

      That's only if you need features from the latest versions of MS.NET, mostly in the cases of porting existing applications. Mono is a strong platform in its own right and perfectly suitable for developing Linux applications.

      And you do NOT need to use an old version of C#. The compiler is C# 3.0 compliant and they plan on adding C# 4.0 support shortly after it is released.

      Thanks for playing.

    17. Re:C or C++ by Anonymous Coward · · Score: 0

      The original question is a plant. It's being used to throw in a bunch of plugs for mono and other MS technologies. Why? Because Linux is hot and there's worldwide support spreading fast. Microsoft knows if they lose control of the developers then it is game over.

      Microsoft does not 'do' crossplatform.

    18. Re:C or C++ by StarkRG · · Score: 1

      Just because it's a knee-jerk reaction doesn't mean it's wrong.

      Personally I wonder why anyone would start learning real* programming with anything other than C/C++. It's the basis of the majority of the other commonly used languages out there and the majority of the rest have similar syntax and/or keywords. Sort of like learning Latin, the basis of all romance languages, except that the Roman Empire is still around so the language isn't dead.

      * I'm not counting the silly qbasic stuff I played with in middle school... and no, I don't consider Visual Basic that much more advanced...

    19. Re:C or C++ by ThePhilips · · Score: 2, Insightful

      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.

      --
      All hope abandon ye who enter here.
    20. Re:C or C++ by gbjbaanb · · Score: 1

      To anyone thinking about going C#, I woudl strongly consider using VB.NET instead. Yup, I know its VB, but think about this: it and C# both turn into the same code, they both have roughly the same syntax - to the point where you can say C# is VB with curly brackets!

      VB is a lot easier to use, they have features in the tools that are much nicer than C#s, and they have a few features that C# doesn't have like conditional exceptions (eg. catch x as exception when x.code = 10)

      It also have the advantage that you don't get so mind-muddled swapping between C/C++ and C# as it tries to get credibility by looking like C++ code. Until MS produces a first-class Python language for .NET, really go with VB. You can also leverage your skills to writing wscript code them too (in VBA). And, its so blinking obvious you don't need to learn anything, the IDE helps you along.

      The only problem is that people will think you're not a real programmer, but if you're writing .net apps in either, you're not anyway :)

    21. Re:C or C++ by gbjbaanb · · Score: 1

      Remember Mono is only really suitable for writing Suse apps. If you didn't get it from Novell, you're liable to be sued as the patent protection only applies to the deal they have with Novell, not anyone else.

      It still doesn't have WPF or LINQ support does it now?

    22. Re:C or C++ by gbjbaanb · · Score: 1

      hear hear.

    23. Re:C or C++ by fejjie · · Score: 1

      Uh, actually it does have LINQ support. WPF doesn't matter because so few people are actually coding for WPF.

    24. Re:C or C++ by FishWithAHammer · · Score: 1

      Conspiracy theories are fun.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    25. Re:C or C++ by FishWithAHammer · · Score: 1

      Because people don't learn by shooting off their foot, as much as the old graybeards might want them to. Add complexity by adding, say, pointers ("pointers are just manipulable references") later on in the process--don't front-load it with crap that's an artifact of fighting a language rather than learning the principles.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    26. Re:C or C++ by StarkRG · · Score: 1

      I really don't see where the complexity lies with pointers, all named references are pointers, most of them are just automatically dereferenced. It's like a symlink for a bit of memory. If you can't understand that you probably shouldn't be programming.

      Also you don't have to stick with C/C++ you just start there.

    27. Re:C or C++ by FishWithAHammer · · Score: 1

      I agree that it's not that complex, but I also feel that you should be learning how to think about programming when learning, not how a specific language interacts with the metal.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    28. Re:C or C++ by StarkRG · · Score: 1

      Actually, I see it the other way around: you should know how the system is dealing with your data, what it does, when, how often, basically just how the computer processes. if you don't understand that then you're going to end up with unexpected results and bugs.

      Learn the base first, then build on that.

      ALL programming languages use variables, variables are memory pointers so learning about pointers is going to help you no matter what language you end up with.

      MOST programming languages have functions and other re-usable code, the names of these are also pointers and can be handled as such (you can pass a function as the argument to another function (not just the result).

      I've never met an object oriented language that didn't follow the same basic construct: data wrapped inside interfaces. I've come across two main types: c++ style and smalltalk style. Most major (widely used) OOP languages follow the c++ style. All use pointers in some way.

      Without the knowledge and control of a language with pointers it's the difference between driving a car and using a keyboard to drive a computer game, you're totally disconnected.

    29. Re:C or C++ by Anonymous Coward · · Score: 0

      GTK+

  3. I like Python by pembo13 · · Score: 4, Interesting

    Works beautifully in Linux and Mac, and well in Windows. May not be the best if you're building CPU intensive apps however.

    --
    "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    1. Re:I like Python by 19thNervousBreakdown · · Score: 3, Insightful

      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.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    2. Re:I like Python by fuzzyfuzzyfungus · · Score: 1

      You don't necessarily want the meat of a CPU intensive app to be python; but using python to marshal bits of high performance code seems to be quite common and popular. Numpy and Scipy come to mind. You can embed chunks of C as well.

    3. Re:I like Python by pembo13 · · Score: 1

      In contrast, one of the things I love about Python is it's use of whitespace.

      --
      "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    4. Re:I like Python by HeronBlademaster · · Score: 1

      I don't mind Python's use of whitespace; what bugs me is that there's no standard for it. My professor gives us code that has spaces for indentation, so I can't copy his code into mine without manually replacing his spaces with tabs, and vice versa.

    5. Re:I like Python by LaskoVortex · · Score: 4, Insightful

      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.

      --
      Just callin' it like I see it.
    6. Re:I like Python by OAB_X · · Score: 1

      The Python "standard" is one tab = five spaces, tabs are inserted as spaces.

      Any development environment worth its salt will let you insert tabs as spaces.

      That and find/replace all works quite well too.

    7. Re:I like Python by tomhudson · · Score: 1

      In contrast, one of the things I love about Python is it's use of whitespace.

      ... so no brainfuck for YOU!

    8. Re:I like Python by he-sk · · Score: 2, Informative

      There's a standard: It's spaces.

      From http://www.python.org/dev/peps/pep-0008/:

      The most popular way of indenting Python is with spaces only. The
      second-most popular way is with tabs only. Code indented with a mixture
      of tabs and spaces should be converted to using spaces exclusively. When
      invoking the Python command line interpreter with the -t option, it issues
      warnings about code that illegally mixes tabs and spaces. When using -tt
      these warnings become errors. These options are highly recommended!

      For new projects, spaces-only are strongly recommended over tabs. Most
      editors have features that make this easy to do.

      --
      Free Manning, jail Obama.
    9. Re:I like Python by CSMatt · · Score: 3, Funny

      import antigravity

      Enough said.

    10. Re:I like Python by 19thNervousBreakdown · · Score: 3, Insightful

      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).

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    11. Re:I like Python by kaens · · Score: 4, Funny

      4 spaces. Not 5. 5 is right out.

    12. Re:I like Python by maxume · · Score: 1

      four spaces.

      --
      Nerd rage is the funniest rage.
    13. Re:I like Python by cowmix · · Score: 4, Insightful

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

    14. Re:I like Python by mweather · · Score: 1

      Personally, even when I'm using a bracketed language, I fix any copy and pasted code that uses different indentation than the rest of the code. It's a good coding practice. So when time came to learn Python, things like that didn't bother me since I was fixing the indentation anyway.

    15. Re:I like Python by Anonymous Coward · · Score: 0

      You're a bell end; you know that don't you.

    16. Re:I like Python by Mr+Z · · Score: 1

      Manually? You've never used "unexpand"?

    17. Re:I like Python by Jason+Earl · · Score: 4, Insightful

      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.

    18. Re:I like Python by LaskoVortex · · Score: 1

      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.

      Yes, good. I don't want to convince you personally to like python. Please use whatever language *YOU* like best, even if its perl. But if I can convince you of any one thing, it would be to not publicly decry python just because of your own very personal and intimate reservations about syntactical whitespace. It seems that the smartest people (who do not also know python) are disposed to have this reservation about the language. But it is a reservation that stems not from intelligence but from a general ignorance of the python language.

      --
      Just callin' it like I see it.
    19. Re:I like Python by Dolda2000 · · Score: 1

      I can't copy his code into mine without manually replacing his spaces with tabs, and vice versa.

      In that case, your editor is doing something hideously wrong. Python's parser follows the traditional rule that a tab forwards to the next column divisible by 8, which is how all reasonable programs interpret Tab characters.

      Many programs that have functionality for writing Python code avoid the use of tabs completely, though. Emacs being one of them.

    20. Re:I like Python by Blakey+Rat · · Score: 2, Insightful

      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.

    21. Re:I like Python by SleepingWaterBear · · Score: 1

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

      Mod parent up!

      If there's a single feature that makes python stand out, it's that python has such a high standard of documentation that it is easy to pick up a new project grab the modules you need and start working. The documentation even extends to the implementation of python itself, which makes extending python via modules written in C really easy.

      If you're looking for a language that will allow you to write clean code, and accomplish complex projects quickly and easily, Python is the way to go; the white space convention may seem odd at first (I certainly was very suspicious of it), but after a couple hours you'll find it quite comfortable, and you'll only get one indenting error for every ten semi-colons you would have forgotten in C, so it's ultimately a big time saver.

      This isn't to say Python doesn't have its downsides. I've been working on several large projects, and performance issues do come up, but those can be worked around via C modules when necessary. All in all, thanks to the clear syntax and excellent documentation you'll find that you can write programs many times quicker in python than in C within just a few days of learning it.

    22. Re:I like Python by Anonymous Coward · · Score: 0

      I don't like Python either, but it seems to be good for writing desktop apps with minimal barriers to entry. Considering your other choice is C, it's an easy decision.

    23. Re:I like Python by tylerni7 · · Score: 2, Funny

      I know know what the fuss is about brainfuck, it's a bit annoying, but as far as esoteric programming languages go it isn't that bad.

      If you like using whitespaces, you should love whitespace!

    24. Re:I like Python by 19thNervousBreakdown · · Score: 1, Interesting

      No, it's not OCD. I'm picky about it because it has real (admittedly tiny) effects.

      When inserting code after a blank line, I end up having to hit tab 2-4 times, sometimes more, before I insert that new line (or after, whatever). Some editors flat don't have an option to do it for you, and it's not always worth or possible it to fire up (or even install) your preferred one. It's just a pain in the ass. Extra keystrokes, they add up.

      Plus, I dunno. Sometimes I scroll up and down a section and watch the cursor. It's kind of a low-level routine in my brain that I don't have to expend conscious though on, if that cursor stays in the same column, it's all one piece. Helps me visualize the code better, hold more information in my head at once. With those blank lines, it makes me think for a tenth of a second or two, and lose the "picture" in my head.

      There's a ton of other reasons I like my blank lines to obey indenting that I can't think of right now, but it's basically a "beaten to death with feathers" situation where there's a million little nagging things about it that end up taking 0.2 seconds extra. And I work fine with others, if they're not right I fix 'em if I'm doing a bunch of work in one section and don't bother otherwise.

      Besides, aren't you being a little OCD in getting antsy in the pantsy over my preferences?

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    25. Re:I like Python by 19thNervousBreakdown · · Score: 2, Informative

      If you're looking for a language that will allow you to write clean code, and accomplish complex projects quickly and easily, Python is the way to go; the white space convention may seem odd at first (I certainly was very suspicious of it), but after a couple hours you'll find it quite comfortable, and you'll only get one indenting error for every ten semi-colons you would have forgotten in C, so it's ultimately a big time saver.

      OK, I gotta call you out on this one.

      I'm sure I've forgotten a semicolon, but I certainly can't think of a time it's happened. If it does, it prevents compilation. That's important. It's not an invisible mistake. Can you think of even one situation where forgetting a semicolon would still result in code that compiles? I wouldn't be completely surprised if there is, but I can't think of one, and if it exists it's an edge thing.

      If you mess up indentation in Python, there's a real good chance it'll still run, but do something different. That's a serious issue.

      Look, I'm not ragging on Python, it's got way too many people that love it and have accomplished really nice stuff really fast for me to say it's a bad language. Just, maybe it's nice in spite of the whitespace stuff.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    26. Re:I like Python by 19thNervousBreakdown · · Score: 2, Insightful

      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?

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    27. Re:I like Python by Tablizer · · Score: 1

      How about this solution: Fork off Python and replace the fork with a C-style syntax version of it. Then we can have the benefits of Python without the white-space/tab problem.

      (Except provide an alternative to the C-style switch/break shit. Keep the old for backward compatibility, but offer a more modern case/switch statement.)
         

    28. Re:I like Python by Blakey+Rat · · Score: 1

      When inserting code after a blank line, I end up having to hit tab 2-4 times, sometimes more, before I insert that new line (or after, whatever). Some editors flat don't have an option to do it for you, and it's not always worth or possible it to fire up (or even install) your preferred one. It's just a pain in the ass. Extra keystrokes, they add up.

      You could just use an editor that works right.

      Besides, aren't you being a little OCD in getting antsy in the pantsy over my preferences?

      Nope. I don't give a shit if you're OCD or not, I just didn't know if you'd realized it. Trying to do you a favor.

      For what it's worth, I still think you're OCD, and I also think you need to find a good editor and just stick with it. All of your concerns would disappear if you had an editor that didn't suck, and then you used only it.

    29. Re:I like Python by Anonymous Coward · · Score: 0

      Well, I've programmed in Python for many years now and to be quite honest, indentation mistakes are rarely occur (especially if one adopts a standard with regard to spacing and sticks by it).

      At any rate, the -t and -tt switches catch them.

      So yes I take your point, but it really isn't a deal breaker.

    30. Re:I like Python by Jack9 · · Score: 1

      So now you have 2 things to worry about? Does the version of Python I want to use (if any) work on the platform AND does it have a compatible editor? How is this a reason to use Python? Help me here.

      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
    31. Re:I like Python by 19thNervousBreakdown · · Score: 0, Flamebait

      Yes, I should definitely cure my OCD by adamantly sticking to exactly one editor all the time. That's a good one.

      Also, thank you, thank you, thank you, for diagnosing my terrible affliction over Slashdot posts. You've changed my life already. Most trained psychologists, couldn't do that. You must be a genius.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    32. Re:I like Python by Anonymous Coward · · Score: 0

      He's keyboard diagnosing OCD because someone doesn't want to type 30% more. Don't feed the troll.

    33. Re:I like Python by Amazing+Quantum+Man · · Score: 4, Funny

      <VOICE type="Jean-Luc-Picard>There are FOUR SPACES!</VOICE>

      --
      Fascism starts when the efficiency of the government becomes more important than the rights of the people.
    34. Re:I like Python by BlueCodeWarrior · · Score: 1

      Can you think of even one situation where forgetting a semicolon would still result in code that compiles?

      while(*p++ = *q++); anything_else();

      I wouldn't be completely surprised if there is, but I can't think of one, and if it exists it's an edge thing.

      Correct.

    35. Re:I like Python by 19thNervousBreakdown · · Score: 1

      Durf, yep, forgot about that. I always do while(whatever) {} instead of while(whatever); but yeah, thanks, I knew there was something.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    36. Re:I like Python by Dolda2000 · · Score: 1

      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.

      You seem to be confusing the Tab character (ASCII 9) with the idea of "indentation in programming". Indeed, I too use 4 columns for each step of indentation (though it's worth noting that the Linux kernel source and many other projects do use 8 columns per level).

      However, that is quite separate from the Tab character as such, which works like I described in all reasonable programs (forwards to the next column divisible by 8).

      Therefore, arguing how the Tab character works is quite different from ignoring how people work. People should be allowed to change their levels of indentation indeed (and they can in Python as well -- Python only requires that they be consistent, not that they use indentations of 4 columns each), but that is not the same as letting editors interpret the Tab character any way they want.

      The problem is that some editors written by clueless people (Eclipse, I'm looking at you) do take the liberty to redefine the Tab character, thus producing code that is illegible to everyone else, and I'm guessing that that is what HeronBlademaster is having trouble with.

      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.

      I generally agree with you here, though. I, too, dislike Python's forced indentation rules. I can't really say I care that much either, though. It's not like it breaks the entire language (except, of course, when people use broken text editors).

    37. Re:I like Python by 19thNervousBreakdown · · Score: 1

      The problem is that some editors written by clueless people (Eclipse, I'm looking at you) do take the liberty to redefine the Tab character, thus producing code that is illegible to everyone else, and I'm guessing that that is what HeronBlademaster is having trouble with.

      The thing is, it's not just some. Visual Studio, VIM, NotePad++ I can think of exactly where in the options it is off the top of my head, and I can't think of a single code editor that doesn't let you redefine tab (yes, actual tab characters) stops, and I'm pretty sure I'd remember because it'd be odd. Do you know of one that doesn't let you do that?

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    38. Re:I like Python by MikeBabcock · · Score: 1

      Python is actually well-enough documented that sending new users to the doc page is worthwhile and they often actually figure out how to do what they wanted to do as a result.

      Python is a great language imho.

      --
      - Michael T. Babcock (Yes, I blog)
    39. Re:I like Python by Dolda2000 · · Score: 1

      Well, it's one thing that most editors will let you redefine tab. If nothing else, at least that lets you cope with code that is written with ill-defined tabs.

      The difference is that Eclipse (and I think Visual Studio as well, now that you mention it) use non-canonical tabs by default, without you having to ask for it.

    40. Re:I like Python by Sj0 · · Score: 1, Flamebait

      Besides, aren't you being a little OCD in getting antsy in the pantsy over my preferences?

      Listen. Your first and last paragraphs were only one line, which is fine.

      But your second paragraph had FIVE lines while your third and fourth had FOUR.

      You're a real asshole, you know that? Quit being an indecisive prick and chose one. THREE lines or FOUR.

      --
      It's been a long time.
    41. Re:I like Python by HeronBlademaster · · Score: 1

      I set tabs to take up four columns. Eight is (visually) too big. Visual Studio's default is to make a tab go up to the next divisible-by-four column, so you're way off-base saying "all reasonable programs interpret tab characters" as forwarding to the next divisible-by-eight column.

      Another problem: Some developers set their editors to put in 2, 3, or 4 spaces when they hit the tab key, instead of putting in a tab character. Causes conflicts with those of us who don't, unless we agree on a standard. That was my chief complaint - Python doesn't have a standard that I'm aware of.

      You realize that in Python you can use spaces instead of tabs for all your indentation needs, right? And that as long as you're consistent, it'll work with whatever you use? My professor uses three spaces for each level of indentation. I use a single tab. When I paste his code into mine, I get all sorts of errors from the Python interpreter until I replace his method of indentation with mine.

      How, exactly, is my editor supposed to know that when I paste from code sample X it should replace three-space-indentation with tabs, but from code sample Y it should replace two-space-indentation with tabs? I would actually complain if my editor tried to do that for me, because half the time it would be wrong.

    42. Re:I like Python by Simmin · · Score: 1

      Actually, when you python code with indentation errors, it alerts you (in the Command line) and won't run the program.

    43. Re:I like Python by HeronBlademaster · · Score: 1

      Good to know.

      Does it say anything about using two spaces, or three, or four, or one? Does Python blow chunks if I use four spaces, but my coworker uses three?

    44. Re:I like Python by HeronBlademaster · · Score: 1

      Well I use search/replace, so it's not hard, I just meant that it's not automatic, and Python doesn't work unless I do it.

    45. Re:I like Python by Anonymous Coward · · Score: 0

      So now you have 2 things to worry about? Does the version of Python I want to use (if any) work on the platform AND does it have a compatible editor?

      Please. You are looking pretty trollish here. If you program at an internet cafe, then no one can answer that question for you. If you have a draconian dumbass sysadmin who insists that emacs is a security liability, then I'm sorry. If you have a reasonable sysadmin and or you admin your own computer, then you have no worries--there are a lot of good editors. If you have to travel a lot, then get a laptop. If you are too clueless to install a program, then you probably won't even be able to grasp basic so just give up programming now and apply at a burger joint. I honestly can't think of any real life scenario where someone can't depend on having a good editor available. Last I checked it was 2008 and pushing 2009 very imminently. Seriously, who has problems getting a good editor on their system or installing an interpreter? If this is a problem, then it probably doesn't matter what language you use because you are probably not going to get anything done anyway.

    46. Re:I like Python by SleepingWaterBear · · Score: 1

      Most of the time indentation errors cause a syntax error that prevents execution, but you're right that python code with an indentation error that still runs is much more likely than C code with a missing semi-colon that still runs. That said, indentation errors are quite rare in my experience because the indentation is so visibly clear that it's hard to not notice a mistake. Even when an indentation error doesn't cause a syntax error, it is almost always very obvious on execution.

      In thousands on lines of code, I've never had an indentation error that took more than 2 minutes to find, and indentation errors are very rare in any case.

    47. Re:I like Python by HeronBlademaster · · Score: 1

      I don't like using spaces instead of tabs (random personal preference with little or no basis). I set the tab display width to four columns.

      I end up using find/replace, but it's still time I wish I didn't have to waste.

    48. Re:I like Python by mechsoph · · Score: 1

      Can you think of even one situation where forgetting a semicolon would still result in code that compiles?

      for( i=0; 0 != fun1(i); i++) //;
      non_loop_fun();

    49. Re:I like Python by HeronBlademaster · · Score: 1

      Yeah, I usually fix indentation too, but I usually like to see whether it works at all before I bother...

    50. Re:I like Python by Dolda2000 · · Score: 1

      I set tabs to take up four columns. Eight is (visually) too big. Visual Studio's default is to make a tab go up to the next divisible-by-four column, so you're way off-base saying "all reasonable programs interpret tab characters" as forwarding to the next divisible-by-eight column.

      Well, I never did consider Visual Studio a reasonable program, though. Even Microsoft's terminal emulators are wise enough to interpret tabs by the standards, so they're just being inconsistent in their decision to use non-canonical tabs in VS. Reasonable text editors make the tab key forward 4 columns (or whatever the user wants, or triggers auto-indentation like in EMACS), but do not emit an ASCII 9 character just because of that.

      That was my chief complaint - Python doesn't have a standard that I'm aware of.

      I'm sorry that you have that experience. I, for my part, have never once seen a Python program that has not been indented in levels of 4 columns. That is also what you see in all example code in the Python docs.

      My professor uses three spaces for each level of indentation. I use a single tab.

      I see. I thought your problem was that you used a text editor that put a Tab character (in the sense of being an ASCII 9) into the file to mean four spaces, and that your professor simply used 4 space characters (in the ASCII 32 sense), and that that was causing the trouble. Obviously, you have a real problem (and you should probably yell at your professor for not using 4 columns indentations).

      How, exactly, is my editor supposed to know that when I paste from code sample X it should replace three-space-indentation with tabs, but from code sample Y it should replace two-space-indentation with tabs? I would actually complain if my editor tried to do that for me, because half the time it would be wrong.

      Indeed, I agree, and there is no way that your editor could know that. I'd just like to clarify that neither I am a great fan of Python's use of whitespace (though I haven't had any problems with it, so I haven't cared either). I just thought you were having the old problem of using a stupid editor.

    51. Re:I like Python by Anonymous Coward · · Score: 0

      If I were architect god on any system of value, I'd aim for a combination of C/C++ libraries to do the algorithmic heavy lifting and a scripting language to glue it all together. So learn both, and learn the C APIs of your scripting language of choice.

      For me, that language is currently Python. The whitespace thing is a minor annoyance, but does make for compact, cleanly formatted code. Between the kitchen-sink standard library and such syntactic sugar as list comprehensions, array slices, and docstrings, the language is a pleasure to work in. There are real gotchas (weird scoping, etc), but you'll find that in any language.

    52. Re:I like Python by walterbyrd · · Score: 3, Informative

      According to: PEP 8, Style Guide for Python Code, each indent should be four spaces.

      http://www.python.org/dev/peps/pep-0008/

    53. Re:I like Python by Jeremi · · Score: 1

      Can you think of even one situation where forgetting a semicolon would still result in code that compiles? I wouldn't be completely surprised if there is, but I can't think of one, and if it exists it's an edge thing.

      Well, since you asked... here's one that has bit me once or twice:

      int x= 10;
      while(DecrementAndReturnValue(&x) > 0) ;
      printf("All done!\n");

      Okay, that example is a bit contrived... but the point is, if you forget the semicolon in line 2, the code will compile and do the wrong thing. (specifically, it will print "All done!" ten times instead of just once at the end)

      Moral of the story: do it this way instead, to avoid any chance of trouble:

      int x= 10;
      while(PrintDecrementAndReturn(x) > 0) {/* empty */}
      printf("All done!\n");

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    54. Re:I like Python by HeronBlademaster · · Score: 1

      Yeah, I specifically choose to use tab characters instead of spaces. I don't know why; habit, I guess.

      My search for a good editor goes on, though recently it has been delayed by my desire to switch entirely to Linux. In Windows I'm using Visual Studio for C++ and C# Windows programs, and EditPlus for other things. I haven't decided what to use in Linux yet; my search has been fruitless, so I just stick with gEdit...

    55. Re:I like Python by Anonymous Coward · · Score: 0

      Have you tried programming in Python for any length of time? The whitespace thing is funny, you hate it at first ( I did too! ). And then it becomes irrelevant. And then .. you notice how freaking fast you are coding and how readable your code is compared to {} languages. The truth is that 90% of the time in a {} langauge you wind up indenting just like python anyway, but with python, no need to outdent once for each }, you just pop back up. Winds up being so much more compact on screen.

    56. Re:I like Python by Anonymous Coward · · Score: 0

      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.

      It's not FUD. The poster was stating opinion. So quit telling people how to think.

    57. Re:I like Python by OAB_X · · Score: 0, Troll

      Four, not five.

      I'm sorry already! It's not like I actually do python programming.

    58. Re:I like Python by cryptoluddite · · Score: 1

      Ultimately the problem with indent meaning something is that a lot of programming is style, including indenting. Is COBOL a "bad" language because the meaning of a statement depends on which column it starts on? No... but it is a "boring" language because of that.

      It's also lossy. When I type "}" my editor shifts the indent down just like when editing python and I type "^H" it does the same. The difference is that the C program forever is marked with how the structure of the program is supposed to be. The information that "the block ends here" is part of the program whereas in a python program there is no such information, and I say that because whitespace changes for all sorts of reasons but no editor ever adds or removes actual visible characters unless specifically told to do so.

      You say people won't 'miss' flexible whitespace, and you're right. But what I will miss is 'end' or '}' or '.'. These things are in the code because they are useful information.

    59. Re:I like Python by mortonda · · Score: 1

      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.

      Which of course is possible in any language, even in perl. I gave python a try once upon a time, and the thing that killed me was that at the time, the language supported a push operation on an array, but had no pop function (or was it the other way around). I kid you not, the function was missing. I found out that it was added in the next dot release... but I've never been able to really like python, partly due to the whitespace, and partly due to the frustration that insued due to that past omission.

      I also have to agree with LaskoVortex: having something *unseen* have the ability to change the behaviour of code is just scary.

    60. Re:I like Python by mortonda · · Score: 1

      gah, I looked up when I should look down. I meant to agree with 19thNervousBreakdown on that last point. I should go to bed now.

    61. Re:I like Python by syousef · · Score: 1

      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.

      The people telling you they don't like formal rules about the use of whitespace in syntax usually have tried it. "Old timers" probably had a gut full of problems this introduced into COBOL or FORTRAN code. (Or MAKE files that differentiate bewteen space and tab, so that there is no difference between correct and incorrect code when printed on paper).

      When designing a language if you really want to enforce a formal way of formatting your code, stop at producing warnings, and let them be switched off. Anything else is horrible.

      --
      These posts express my own personal views, not those of my employer
    62. Re:I like Python by sydneyfong · · Score: 1

      Have you actually TRIED whether indenting the continued lines as you wanted work? Because unless I'm mistaken, you CAN actually indent the continued lines pretty much like how you wanted.

      --
      Don't quote me on this.
    63. Re:I like Python by Myen · · Score: 1

      Huh, I find that tutorial-as-documentation to be horrid (I don't want to do it in those steps, and it's a giant pain in the ass to look up any syntax). The standard library, though, does have excellent documentation in the same place. But that's not the syntax.

    64. Re:I like Python by johanatan · · Score: 1

      I think that mixing tabs and spaces is bad. In fact, I think that using tabs at all is bad.

    65. Re:I like Python by bar-agent · · Score: 1

      That was probably the best episode of any Star Trek ever made.

      --
      i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]
    66. Re:I like Python by pjt33 · · Score: 1

      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?

      Surely everyone who uses version control cares about editors playing with whitespace, because it makes it harder to read your diffs.

    67. Re:I like Python by mweather · · Score: 1

      Then use a decent IDE that can fix indentation.

    68. Re:I like Python by MichaelSmith · · Score: 1

      The fact that C is crap in this regard doesn't make it okay for python to have a similar problem. We should be finding safer ways to do this kind of stuff.

    69. Re:I like Python by Anonymous Coward · · Score: 0

      FUD:

      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.

      Once a parenthesis is open you are free to use newline and whitespace as you see fit, so you can split a function call over many lines without having to worry about the meaning of your indentation.

    70. Re:I like Python by MichaelSmith · · Score: 1

      Have you tried sending python code in an email? Or embedding it in something like a wiki?

    71. Re:I like Python by 19thNervousBreakdown · · Score: 1

      No, I was just wrong.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    72. Re:I like Python by LaskoVortex · · Score: 1

      The people telling you they don't like formal rules about the use of whitespace in syntax usually have tried it. "Old timers" probably had a gut full of problems this introduced into COBOL or FORTRAN code.

      Here is some code for the "Old Timers":

      python != cobol
      python != fortran

      Trust me, I know the limitations of python and I could go on about where it is lacking or what is wrong with it--but the whitespace issue is not included. I simply refuse to believe that would be a deal killer for an intelligent person, but alas it is. Strange world.

      --
      Just callin' it like I see it.
    73. Re:I like Python by LaskoVortex · · Score: 1

      No, I was just wrong.

      How is that necessarily different from FUD?

      --
      Just callin' it like I see it.
    74. Re:I like Python by Albert+Sandberg · · Score: 1

      Can you think of even one situation where forgetting a semicolon would still result in code that compiles?

      while(*p++ = *q++); anything_else();

      I've been programming this and that for 20 years and I don't think I _ever_ made that mistake. And even if I did once or twice, hardly something devastating came out of it.

    75. Re:I like Python by 19thNervousBreakdown · · Score: 1

      Well, first off, the term FUD implies an intent, or even an organized campaign. I did not even have the first, let alone the second. Secondly, it more than implies and specifically means Fear, Uncertainty, and/or Doubt. Trying to say that my statement was an attempt at any of those would require stretching the words themselves, and not the entire phrase--which, as a near idiom it really should be, to beyond what any reasonable person would accept. I was not trying to instill any of those against Python, merely saying that I did not like its whitespace requirements. I was mistaken on one particular aspect of that.

      Given that in my original post I explicitly said not to let a little thing like Python's annoying whitespace issues stop him from checking it out, I think calling a single mistaken syntax recollection FUD is just plain silly.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    76. Re:I like Python by Anonymous Coward · · Score: 0

      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.

      Look, this is everyone's biggest beef with Soviet Russia if they are not yet used to it. Somehow we have come to believe that communism is sacred and that a nation shouldn't tell us how to use it. I'm not sure how to convince you otherwise except this: don't knock until you have tried it. Once you really delve into communism, you will wonder why anyone would ever believe in another ideology.

      1. You won't miss your freedom-- in fact you impose your own restrictions of freedom to the way you live already. Communism enforces this good habit via ideology.

      2. Since lack of freedom is the norm, you can use a common set of rules to convert entire small societies. Differing attitudes towards freedom will never be a problem if you normalize the citizens before you let them into the rest of the society.

      3. You won't mind the governments restrictive rules. In fact, when you visit other people, you will be happy that something forced their limited freedom as well. Restriction of freedom and other mechanisms of communism will shift your habits towards a more reusable and uniform population.

      4. You will forget, for the most part, that restriction of freedom is even part of ideology once it becomes your way of life. In other words, you will so habitually conduct yourself correctly(because you are forced to by the government) that you will not even realize that your life is restricted. All of the sovereignty over your freedom 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 freedom". There are bigger things to think about, like whether you or someone else will be able to contribute to your government as long as possible.

    77. Re:I like Python by phlipped · · Score: 1
      I'm also aware that this is flameware territory, but I can't let some of those claims against my beloved Python go unanswered ...

      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.

      Well, in Python, you don't need to use parens/braces around code blocks anyway. ;) But seriously, to counter that particular example, Python doesn't care where a continued line starts. Nonetheless I realise that the underlying message you put forward is that the intent of the code may not always match the formatting. And I agree. Python fails in this particular situation. But this particular situation occurs so rarely that it simply doesn't matter.

      You can run it through a code prettifier. Try that with Python, and you could end up changing what your code does

      But then a code prettifier that knows how to deal with Python code should be smart enough to not do anything to change the code's behaviour. Not to mention that if Python code compiles, then it's already pretty ;) (well, mostly, anyway)

      Anyway, the point is, I am a total Python convert. It was definitely weird at first, but nowadays whenever I code in something that's not Python, it makes me cringe - every missed semicolon, every unmatched brace. Sure, I try to create matched pairs of braces as i go, and keep the formatting nice, but somehow it doesn't always work out as well as I planned. And frankly, I don't like distracting myself by having to worry about those kinds of things. I'd rather just debug the logic, not the syntax.

    78. Re:I like Python by he-sk · · Score: 1

      From the same page as above, the standard is 4 spaces.

      Python doesn't care how much whitespace you use to indent a code block, but obviously it has to be consistent for each individual code block.

      This will work:

      def myFun():
          print "4 spaces"

      def coworkerFun():
            print "6 spaces"

      This will not:

      def myFun():
          print "4 spaces"
            print "6 spaces"

      --
      Free Manning, jail Obama.
    79. Re:I like Python by Anonymous Coward · · Score: 0

      i dunno. i think anyone who gets so hung up on whitespace can hardly be called a real programmer. a real programmer doesnt see the syntax, they see the potential of the language specifed with the sytax. do you hate on lisp because you dont like parentheses too?

    80. Re:I like Python by ThePhilips · · Score: 1

      I do not think that after C# learning Python would bring anything new. I'd say one need to know at least two orthogonal in their concepts languages. That's why I actually brought up C & Perl in another comment.

      Or probably my thought would be clearer this way: Python and C# have lots of common concepts and "learning" Python would amount to nothing more than learning new syntax of doing stuff the same way. C or Perl are quite orthogonal and force you to think and approach problems differently.

      For language complementing C# I would advise Perl, mainly because Perl is well supported across all platforms, thus your knowledge will not be locked to Linux, but also might benefit Windows side of work.

      --
      All hope abandon ye who enter here.
    81. Re:I like Python by Draek · · Score: 1

      Also, it's documented well. After using the horrors of MSDN to learn the .NET Framework, yes, there's a *huge* difference.

      --
      No problem is insoluble in all conceivable circumstances.
    82. Re:I like Python by ancienthart · · Score: 1

      Here here. I'm not a professional coder, (self-taught) usually code only to solve short to medium term problems. But when I write something in Python, it makes _sense_!!! A few years ago, I had built an electronic kit (a usb electrocardiogram actually) that had a windows application but no Linux application.
      I debugged the usb chatter that the electrocardiogram used (partly by firing random code at a usbserial connection, partly by decoding the pic assembler that had come with the kit) and was able to build a gui (Tkinter) application (that could run on Linux) in about a day and a half. A few years later, I realised that I wanted to tidy the code up a bit (Including some data filters to clear out the noise.) and wonder of wonders, I could actually _read_ and _understand_ what I had written back then!
      In my own time I have deciphered (Which is a _far_ cry from actually programming) Java, Javascript, C, C++, Fortan (Ugh!) Basic (Double Ugh!), PIC and AVR assembler (Ma, I have a headache), but the only languages that I can honestly say I can program in are Python and UNIX Shell.

    83. Re:I like Python by SleepingWaterBear · · Score: 1

      You've got me there. Most the time doing either of those is a bit of a hassle. I just send code as an attachment in emails. As for the wiki, writing it's no problem, but copy and pasting code is a nuisance. However, there are editors that can handle that gracefully (I just don't happen to use one).

    84. Re:I like Python by Blakey+Rat · · Score: 1

      That's why you check-in whitespace changes separately from code changes, and log them as such.

    85. Re:I like Python by cervo · · Score: 1

      I have been using Python for about 2 years now and the space think still bothers me. It did not stop me from learning the language, and I still like the fact that it is much easier to read than Perl. However the white space thing bothers me. Many editors default to using either spaces or tabs for indentation. With Python I need to worry what the autoindent is doing. If I chose to indent with tabs, I have to make sure all my editors are using tabs, if I choose to indent with spaces, I have to make su re that all my editors are using spaces and the same number of spaces. It makes the code more consistent but it is a pain, especially when getting someone else's file. Then I need to worry whether they used spaces or tabs...it's a big mess. I like { and }.

    86. Re:I like Python by BlueCodeWarrior · · Score: 1

      Totally true. I'm on C's side (see my other comments in this thread). But I was pointing out that that there is at least one case where code without a semicolon will still compile.

    87. Re:I like Python by BlueCodeWarrior · · Score: 1

      I agree with your first sentence, but disagree with your second. I like wielding power tools.

    88. Re:I like Python by Martin+Geisler · · Score: 1

      I think you don't know how the indention actually works in Python. The only indention requirement is blocks must be indented to be recognized as such.

      So you can indent a block with 1, 2, ... spaces or TABs. You can even mix and match as you choose, and you can change your mind from one block to another.

      The following code runs fine:

      if 10 < 20:
          print "Hello"
      else:
         print "Goodbye"

      Here the "then" branch of the if-statement is indented with a single TAB character (that might not survice in the comment, but it was a TAB in the file I tested with). The "else" branch is indented with three spaces.

      All in all there is *nothing* to worry about with indention in Python -- you only have to be consistent within a single block and you really hope you would do that anyway :-)

    89. Re:I like Python by Anonymous Coward · · Score: 0
      I haven't seen a language in 20 years that DOESN'T use whitespace as syntax. Python, C, C++, Perl, PHP, ASP, Ruby, C#, HTML, Java, JavaScript,... EVERY SINGLE ONE will use the space character as part of parsing syntax.

      Proof: Try adding a space into the middle of a keyword or variable name.

      HP2000 Basic and HP Edit/3000 (if you call commands a language) were probably the last of this, where spaces could appear anywhere (or nowhere) without affecting the program's meaning (except, of course within a string constant).

      So your grounds for resisting Python don't hold up (at least the way you expressed it).

    90. Re:I like Python by Chapter80 · · Score: 1
      I have never ever had an indentation error in Python "still run". I'll get an indentation error.

      I HAVE struggled NUMEROUS times debugging poorly indented code (mine and other's) which was compiling fine, but executing counter-intuitively due to the mis-alignment.

    91. Re:I like Python by Chapter80 · · Score: 1
      I have never ever had an indentation error in Python "still run". I'll get an indentation error.

      I HAVE struggled NUMEROUS times debugging poorly indented code (mine and other's) which was compiling fine, but executing counter-intuitively due to the mis-alignment. (BUT NEVER IN PYTHON!)

    92. Re:I like Python by ibbie · · Score: 1

      "You don't necessarily want the meat of a CPU intensive app to be python; but using python to marshal bits of high performance code seems to be quite common and popular. Numpy and Scipy come to mind. You can embed chunks of C as well."

      This does work quite well. Everyone knows that C is faster than Python - so when you hit a point where you need speed, you write that in C and import it into your Python code. It's fairly easy to do, as is the reverse - writing the code in C and using an embedded Python interpreter. Perhaps not what you'd want to use for a micro-controller, but choosing the right tools to use is always important.

      Here's an overly simplistic example, for those who are curious:

      #include <Python.h>

      void exec_py(const char* code)
      {
        Py_Initialize();
        PyRun_SimpleString(code);
        Py_Finalize();
      }
      /* tada! */

      --
      The wise follow a damned path, for to know is to be forsaken.
    93. Re:I like Python by k8to · · Score: 1

      If your editor sucks so much that it can't reformat without using tabs, then you need to move into the nineties, son.

      --
      -josh
    94. Re:I like Python by syousef · · Score: 1

      python != cobol

      python != fortran

      That's called a straw man. I didn't say that Python is COBOL or Python is FORTRAN. I said they had something in common, and that people who have experienced languages with that common feature have had bad experiences with it and are not just speculating on some aspect of coding they've never had any experience with. I'm saying they have very good reason to distrust the syntactic relevance of white space.

      Trust me, I know the limitations of python and I could go on about where it is lacking or what is wrong with it--but the whitespace issue is not included. I simply refuse to believe that would be a deal killer for an intelligent person, but alas it is. Strange world.

      So are you intentionally implying that if someone disagrees with you on this point they're not an intelligent person? You're not going to get anywhere having a genuine debate with someone if that's your attitude.

      --
      These posts express my own personal views, not those of my employer
    95. Re:I like Python by LaskoVortex · · Score: 1

      That's called a straw man. I didn't say that Python is COBOL or Python is FORTRAN. I said they had something in common, and that people who have experienced languages with that common feature have had bad experiences with it and are not just speculating on some aspect of coding they've never had any experience with.

      Fair enough:

      python.whitespace != cobol.whitespace
      python.whitespace != fortran.whitespace

      --
      Just callin' it like I see it.
    96. Re:I like Python by LaskoVortex · · Score: 1

      Look, this is everyone's biggest beef with Soviet Russia

      Yeah, its also everyone's biggest beef with any sort of syntactical rules at all. Syntactical anarchy, I say!

      --
      Just callin' it like I see it.
    97. Re:I like Python by Jack9 · · Score: 1

      "Good Editor" is a matter of perspective. From a python perspective, it's one that uses indentation in a way the interpreter recognizes. This is non trivial on say...a router or old ultrasparc. If you cant think up a scenario where you can't depend on having a SPECIFIC editor available, you are still a student and are ignorant.

      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
    98. Re:I like Python by bXTr · · Score: 1

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

      All languages are documented.

      --
      It's a very dark ride.
    99. Re:I like Python by HeronBlademaster · · Score: 1

      I've gone over this before elsewhere...

      I don't want my IDE to guess what indentation each code snippet uses. Inevitably it will be wrong half the time.

      How is the editor supposed to know that code snippet X uses three-space-indentation, but code snippet Y uses two-space-indentation, while code snippet Z uses four-space indentation?

      Sure, you could contrive cases where it's easy to tell which is which, but contrived cases rarely reflect real world usage.

    100. Re:I like Python by HeronBlademaster · · Score: 1

      I don't understand what you're getting at, dad. My editor is capable of inserting spaces instead of tabs, I just choose not to do that... but changing that doesn't solve the problem of my professor using a different number of spaces for indentation than I do.

    101. Re:I like Python by HeronBlademaster · · Score: 1

      So Python has a recommendation but not an enforced standard. That's what bugs me.

    102. Re:I like Python by syousef · · Score: 1

      Yep and

      having your left arm amputated != having your right arm amputated

      Doesn't mean I'd like to experience either.

      --
      These posts express my own personal views, not those of my employer
    103. Re:I like Python by he-sk · · Score: 1

      Give me a break. You feel the obsessive need to "fix" your professors code, but bitch about Python gracefully handling code with different styles.

      Here's a hint: Every programming language has both requirements and recommendations. For example, the style guide for Java says to enclose EVERY code block in braces.

      Yet:

      if (true)
          doStuff();

      is perfectly valid code. Personally I'm grateful that this particular standard is not enforced, because I find those braces ugly. I don't give a damn that this is a common source for errors, because my code is unit tested.

      Be conservative in what you send, be liberal in what you expect is an old networking adage. That means that not all standards are enforced.

      --
      Free Manning, jail Obama.
    104. Re:I like Python by HeronBlademaster · · Score: 1

      It's not about "fixing" my professor's code. It's about his code working when I paste it into *my* code. If I didn't *have* to fix his code, I probably wouldn't, especially considering that it's a school assignment that will become completely irrelevant two weeks from now.

      My complaint was that because Python has no enforced indentation standard, I simply *can't* copy and paste snippets from my professor's code into my code. The difference between that and your example is that with your example, I *can* copy brace-less if statements into my code, even though I use braces everywhere.

      That is, the difference between my complaint and your example is that Python's lack of enforcement of this standard results in lower portability, while Java's does not.

    105. Re:I like Python by he-sk · · Score: 1

      Okay, I think I understand your problem. I guess you're using bad tools then. Even Vim is smart enough to adapt the indentation of pasted code, you just have to tell it how. A modern IDE will almost always change indentation according to the relevant standard. Your beef shouldn't be with Python, which gracefully handles different styles, but with your editor that creates bad code.

      An easy fix to your problem would be telling your editor to auto-convert every tab to 4 spaces. Then your code would be compatible with your professor's code.

      --
      Free Manning, jail Obama.
    106. Re:I like Python by HeronBlademaster · · Score: 1

      You weren't listening. Python blows chunks if I use four-space indentation and I paste in some code with three-space indentation. That's the problem. It has nothing to do with my editor.

      How would you suggest I tell an editor how to adapt the indentation of every single code snippet I paste in? I'm not going to go change some indentation conversion setting somewhere every time I paste a code snippet.

      Do you really want your editor to ask you about indentation every time you paste in some text? I wouldn't want my editor to try and guess; it would be wrong half the time anyway.

    107. Re:I like Python by Anonymous Coward · · Score: 0

      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?

      Way to go ad hominem. He is probably talking about vim's block selection mode. Sometimes you have to tab out on a blank line to get everything selected or pasted in correctly. Block selection can literally save you HOURS of rote data entry work. So so yeah.. there is a non OCD reason for wanting to be able to control what your text editor is doing.

    108. Re:I like Python by balbeir · · Score: 1

      Why not choose the better scripting language then and use ruby.

    109. Re:I like Python by he-sk · · Score: 1

      Your editor should see that the the current code block is indented with 4 spaces and convert the pasted code to this indentation style on the fly. It should also be smart enough to figure out that you're working on Python code and adapt its settings itself. No intervention necessary.

      As I said, even Vim can do this (1). So does TextMate, a popular OS X editor. These aren't even dedicated IDEs and if they can do it, there's no excuse for your editor not doing it.

      And yes, I want my tools to make an educated guess as often as they can, because that's what they are there for: To save me time by automating monotonous and highly repetitive tasks.

      Also, if your professor uses 3 spaces for indentation and you only use Python in his class, you might want to consider adapting to his style.

      (1) It's been a while, but I think that set autoindent smartindent does the trick.

      --
      Free Manning, jail Obama.
    110. Re:I like Python by HeronBlademaster · · Score: 1

      I guess we'll have to settle on disagreement then - I really don't want my editor guessing what indentation I want out of pasted code. Say I paste a single line with six spaces in front. Should it convert it to eight spaces or twelve (or four or none)? The answer depends mostly on the source I'm copying from, and has little to do with the code I'm pasting into. No editor can possibly know, so any correct guess will be just that - a guess that was correct by blind luck.

      Anyway my whole point is that this is a deficiency in Python itself. It's the only language I use that depends on whitespace, so it's the only language that has this portability issue (C, Java, PHP, etc don't care what indentation I use, so there are no compilation issues with different indentation styles). I would rather fix the language than have my editor try to be smarter than me.

      There's a simple fix - just change the Python spec to mandate four spaces for indentation. Then this entire issue simply disappears.

    111. Re:I like Python by he-sk · · Score: 1

      The answer depends mostly on the source I'm copying from, and has little to do with the code I'm pasting into.

      Are you sure? If I paste code, I want it to be indented according to the surrounding code. Let's say, the pasted code is just a couple of statements with no indentation, but you're inside a three-times nested if block. Do you want the code pasted with no indentation as copied, or do you want it indented so it visually fits inside the if block?

      There's a simple fix - just change the Python spec to mandate four spaces for indentation. Then this entire issue simply disappears.

      I'm trying to argue that with the right tools there is no issue. But we may have to agree to disagree.

      --
      Free Manning, jail Obama.
    112. Re:I like Python by daver00 · · Score: 1

      "If you mess up indentation in Python, there's a real good chance it'll still run, but do something different. That's a serious issue."

      This is no more likely to happen than missing a semicolon, and the chaos that will ensue from that. If you stuff up your whitespace, chances are the code will just not run, simple.

      I'm a complete coding noob, and engineering student, and I make zero whitespace errors when I code python. I'm sure a big experienced and mature coder like yourself can handle it if I can.

      This "I hate whitespace" stuff is an alarmingly parochial attack on a given language. You are clearly used to reading curlies and other screen barf as something meaningful. Python uses whitespace to be more human readable, this helps debugging other peoples code, you know, real world stuff, teamwork and all that. I get the impression here that these ideas upset precious little coders just a bit too easily.

      This is an argument akin to Newton vs Leibniz notation in calculus. No mathematician will have this argument because it is a fucking stupid argument to have. You use what makes sense to be used in a given scenario. Precious little coders, my god.

    113. Re:I like Python by k8to · · Score: 1

      Uh, son. Notice where I said 'reformat'. Maybe you should, you know, look that up.

      --
      -josh
    114. Re:I like Python by Da+Fokka · · Score: 1

      In Sovjet Lisp, parentheses express you!

    115. Re:I like Python by badkarmadayaccount · · Score: 1

      Whoa! Deja vu! It's like I'm reading LISP evangelism. All well, Python IS pretty much a LISP dialect, albeit an interpreted one, without the parenthesis (is that a con? *ducks*).

      --
      I know tobacco is bad for you, so I smoke weed with crack.
    116. Re:I like Python by Anonymous Coward · · Score: 0

      I took a look at Python and I liked the ease of it, but I found (and I may not have a very valuable opinion since it was only like a week of working with it) that there was a lack of built in control for the programmer to utilize. Also because it doesn't require blocks and such to be marked as well as in other languages it can be very difficult to keep track of things...

    117. Re:I like Python by mweather · · Score: 1

      How is the editor supposed to know that code snippet X uses three-space-indentation, but code snippet Y uses two-space-indentation, while code snippet Z uses four-space indentation?

      Easy. Just set the default indentation in the settings.

    118. Re:I like Python by xiaomai · · Score: 1

      Man what is w/ programmers that use nano? (there are a couple guys at my work using it... I thought it was a joke at first). Anyway, real editors (vi/emacs) or even command-line tools can reformat that code for you.

    119. Re:I like Python by Jason+Earl · · Score: 1

      Yes, you can always reformat Perl. However, if I had checked the reformatted Perl into the version control system then my friends using nano would have had an apoplexy. Sometimes Perl's "more than one way to do it" allows people just a little too much leeway.

      I realize that's an extreme example, but it illustrates nicely why whitespace as syntax isn't such a bad idea. Eventually you are probably going to tend up collaborating with someone else on the codebase. In C like languages this invariably leads to friction as everyone involved has their favorite code formatting rules. With Python this discussion basically boils down to tabs versus spaces, and no one really argues for tabs any more.

      There are reasons to prefer other programming languages over Python, but if the whitespace issue is really your primary hangup then you either need to get a real text editor, or you probably format code very very badly.

    120. Re:I like Python by Blakey+Rat · · Score: 1

      This thread is ridiculous.

      Name me one circumstance where you might be writing PYTHON code on an router or old Ultrasparc. You could just write the code from your computer and send it to the device over the network. Assuming you have a router which includes a Python interpreter in the first place.

      If you cant think up a scenario where you can't depend on having a SPECIFIC editor available, you are still a student and are ignorant.

      Yeah, and for the 0.00001% of the time I might spend in this hypothetical scenario, I can hit the goddamned Tab key. But that's no excuse for using a shitty editor when you're *not* writing code on a router.

    121. Re:I like Python by PenquinCoder · · Score: 1

      XKCD references on /. ??? What's next,import Cyanide&Happiness ?

  4. Language you need to be proficient in. by Salo2112 · · Score: 5, Funny

    Hindi.

    1. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 0

      Flamebait, indeed! Mod the guy funny, like he deserves!

    2. Re:Language you need to be proficient in. by base3 · · Score: 1, Insightful

      More like insightful.

      --
      One CPU cycle wasted on digital restrictions management is ONE TOO MANY.
    3. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 0

      Thank you! Come again!

    4. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 0

      Thank you, come again!

    5. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 5, Funny

      I am not having hear of the language insightful, please telling me where it is I can learned of it.

      Regards,
      Anonymously Cowarding

    6. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 0

      Unfortunately, that answer is both informative and insightful, not funny.

    7. Re:Language you need to be proficient in. by Linzer · · Score: 3, Insightful

      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.

      --
      Gravitation is a theory, not a fact.
    8. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 0

      Thats just sad. You're insulting people. 1.1 BILLION of them. Hope all of them decide to crap on you AT THE SAME TIME hehehe.

    9. Re:Language you need to be proficient in. by carou · · Score: 1

      Apparently, casual racism is funny in slashdot.

    10. Re:Language you need to be proficient in. by base3 · · Score: 1

      What racism? Is it not a fact that IT jobs are being exported to India where Hindi is one of the commonly spoken languages? Now if someone had used a slur, you might have something, but that didn't happen. Grow a fucking skin.

      --
      One CPU cycle wasted on digital restrictions management is ONE TOO MANY.
    11. Re:Language you need to be proficient in. by base3 · · Score: 1

      Oops -- I see you were referring to the pidgin English and not my post -- my apologies. I try not to make fun of people in that particular way because while I know that if I were in a country where the official language was other than English I would make it my first order of business to learn the local tongue, I also know that the post's example of broken English is a better degree of speaking than I would accomplish in the local language for quite some time.

      --
      One CPU cycle wasted on digital restrictions management is ONE TOO MANY.
    12. Re:Language you need to be proficient in. by carou · · Score: 1

      I see you were referring to the pidgin English and not my post.

      Quite.

    13. Re:Language you need to be proficient in. by horza · · Score: 1

      My Indian friend was telling me he learned English when he grew up because his parents were from different regions and were forced to use English to communicate with each other. Anyway Russian would be better, much more money in writing botnets.

      Phillip.

    14. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 0

      Thank you for calling Microsoft...

    15. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 0

      Apparently, casual racism is funny in slashdot.

      If you immediately know what they're talking about without any mention of specifics, it must be true.

    16. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 0

      Hindi.

      Better learn Chinese. It outsmarts Hindi =)

    17. Re:Language you need to be proficient in. by Anonymous Coward · · Score: 0

      No, wrong h-language. Hexadecimal is what's needed.

  5. How much do you want to learn? by modmans2ndcoming · · Score: 5, Informative

    C/C++, C#, Objective-C, Java, Python, Perl, [insert language of choice]

    All can be used to do Linux development.

    KDE, stick to C++ and Python.

    Gnome, stick to C and C# and Python.

    GNUStep, stick to Objective-C

    Java and Perl and any other language you choose can be used as well, but the desktop environment support for them is little to non-existent, depending on the language.

    1. Re:How much do you want to learn? by bersl2 · · Score: 1

      Gnome, stick to C and C# and Python.

      Is Vala a usable option yet?

    2. Re:How much do you want to learn? by erikina · · Score: 2, Interesting

      No, and due to the lack of momentum, I doubt it ever will be. But you can add C++ to the Gnome. Gtkmm is quite complete, or you can call Gtk+ methods fine.

    3. Re:How much do you want to learn? by TheRaven64 · · Score: 1

      GNUStep, stick to Objective-C

      Or Smalltalk. I rewrote a load of the compiler this weekend so blocks are proper closures, rather than just downward funargs. The new version will be in Etoile 0.4.1 (probably January), or you can download it from svn now. Objective-C is basically Smalltalk for C programmers - if you're not already a C programmer then Smalltalk might be a better option.

      --
      I am TheRaven on Soylent News
    4. Re:How much do you want to learn? by mebrahim · · Score: 1

      Why are you assuming he's going to write desktop GUI apps? ... (or am I wrong?)

    5. Re:How much do you want to learn? by Ed+Avis · · Score: 1

      Actually, there is a java-gnome interface that is reasonably complete.

      --
      -- Ed Avis ed@membled.com
    6. Re:How much do you want to learn? by imbaczek · · Score: 1

      ever heard of this mono thing?

    7. Re:How much do you want to learn? by somenickname · · Score: 1

      Actually, I would argue that gtk (gnome) apps are probably easiest to develop in perl. Not only are the gtk wrappers for perl intuitive to use but, in some cases, they are a huge improvement over other languages. For example the way Lists/Trees are handled in the gtk wrappers for perl is one of the slickest ways I've seen to handle a complex widget.

    8. Re:How much do you want to learn? by FishWithAHammer · · Score: 2, Interesting

      Yeah! I mean, it's only used in the most widely used desktop environment. And it's only leaps and bounds better than the usual drek.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    9. Re:How much do you want to learn? by sir+fer · · Score: 1, Funny

      sounds like a virus.

      --
      Debian FTW ;o)
    10. Re:How much do you want to learn? by AJWM · · Score: 0, Flamebait

      ever heard of this mono thing?

      Yeah, it's a disease. The host is lethargic and slow, and can suffer inflammation.

      --
      -- Alastair
    11. Re:How much do you want to learn? by tomhudson · · Score: 1

      ever heard of this mono thing?

      Yes. If you've got mono, see a doctor.

      As for memory management, valgrind now works great even for threaded programs, so there's no excuse for needing the hand-holding and performance hit of a "managed language" that has patent issues.

    12. Re:How much do you want to learn? by Anonymous Coward · · Score: 0

      Do you mean to say that now java applications won't look like windows apps using Windows Explorer dlls wherever possible?

    13. Re:How much do you want to learn? by Anonymous Coward · · Score: 0

      I use WxPerl (WxWidgets for Perl). An application I've recently written both runs on XP and Linux (the program was developed on XP and ran without any problems the first time I tried it on Linux (after I had installed WxPerl of course).

    14. Re:How much do you want to learn? by Foofoobar · · Score: 1

      Yeah I hear it being pushed by Miguel De Icaza but I don't see it being accepted as an alternative by Microsoft nor being accepted by developers outside of Novell. So again... how is this an ideal language for development on Linux? At least Gnustep works and is proven to be cross platform,

      --
      This is my sig. There are many like it but this one is mine.
    15. Re:How much do you want to learn? by jbolden · · Score: 1

      Could you give an example with code?

    16. Re:How much do you want to learn? by quanticle · · Score: 1

      Well, those languages can also be used to write command line programs as well. Also, given that the OP comes from a Windows programming background, its more than likely that he/she has some desktop GUI application experience.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    17. Re:How much do you want to learn? by Anonymous Coward · · Score: 0

      Java is integrated in the desktop environment via swing, which is part of it.

    18. Re:How much do you want to learn? by Foofoobar · · Score: 1
      allow me to translate...

      Yeah! I mean, it's only used in the most widely HACKED, VIRUS PRONE, UNSTABLE DESKTOP environment BUT STILL NOT ADOPTED BY SERVERS OR ANYONE OUTSIDE OF THAT COMMUNITY. And it's only leaps and bounds better AT CREATING DEVELOPERS WHO CANNOT THINK FOR THEMSELVES AND CREATE PROGRAMS THAT ARE EQUALLY UNSTABLE AND HACKABLE than the usual drek.

      Couldn't agree with you more.

      --
      This is my sig. There are many like it but this one is mine.
  6. Why not stick with C#? by Anonymous Coward · · Score: 5, Interesting
    1. Re:Why not stick with C#? by lilomar · · Score: 2, Insightful

      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...

      --
      The creator of this post (Jacob Smith) hereby releases it, and all of his other posts, into the public domain.
    2. Re:Why not stick with C#? by cryptoluddite · · Score: 1

      Why would you program in a Java that has different-just-to-be-different syntax, is less free, has smaller library of code, and runs slower on all systems including Win32 and much slower on Linux? Does mono live on planet Endor?

    3. Re:Why not stick with C#? by Anonymous Coward · · Score: 0

      Microsoft's .NET runs faster on Windows than Java does. Mono is quickly catching up to Java performance on Linux with Mono's new Linear IR implementation. Mono 2.2 (in beta2 right now) also ads smarts for SIMD, something Java doesn't have.

    4. Re:Why not stick with C#? by Anonymous Coward · · Score: 0

      I agree. I'm currently writing an enterprise-class piece of software, and with the current version of Mono, "It Just Works" on Windows, Linux and Mac.

      Hooray.

    5. Re:Why not stick with C#? by Anonymous Coward · · Score: 0

      Agreed. Mono is mature. Stick to what you know.

      If you want to continue using Visual Studio, you can.

    6. Re:Why not stick with C#? by Anonymous Coward · · Score: 0

      Miguel? Is that you?

  7. Learn C and Python by volsung · · Score: 4, Insightful

    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.

    1. Re:Learn C and Python by erikina · · Score: 1

      in a few weeks you'll forget Python's indentation conventions ever bothered you.

      Agreed. That's about the time it takes, until the lack of good debugging will get to you. :P

    2. Re:Learn C and Python by Yacoby · · Score: 0

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

      What indentation conventions?

    3. Re:Learn C and Python by volsung · · Score: 1

      I know this is mostly a snarky comment, but I'm curious what you think is lacking in the debugging. I used to write a lot of Python (and hope to get back to it soon) and the debugging tools were never one of the things that annoyed me.

    4. Re:Learn C and Python by AuMatar · · Score: 0, Troll

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

      Yup, because you will have dropped the language entirely by then.

      I've worked with it professionally. We had on average 4 bugs a week due to the indentation bullshit, each of which took multiple hours to debug. It was not just inefficient, it was counter-productive. Python is absolutely unusable on real world projects (any project where you aren't the sole developer) due to that indentation crap.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    5. Re:Learn C and Python by Anonymous Coward · · Score: 0

      Python is absolutely unusable on real world projects (any project where you aren't the sole developer)

      Like Youtube?

    6. Re:Learn C and Python by SanityInAnarchy · · Score: 1

      And how many bugs a week do you have due to misplaced parentheses?

      It also sounds as though you weren't doing nearly enough testing, if you were discovering 4 bugs a week -- I don't care what language it is, syntax errors should not be taking you that long to resolve, because you shouldn't be letting enough syntax build up, untested, before realizing there's a problem.

      --
      Don't thank God, thank a doctor!
    7. Re:Learn C and Python by mickwd · · Score: 4, Informative

      "We had on average 4 bugs a week due to the indentation bullshit, each of which took multiple hours to debug."

      Any chance you could name the company you work for?

      Because I want to avoid your products.

    8. Re:Learn C and Python by imbaczek · · Score: 5, Funny

      I've worked professionally with a hammer and it was totally unusable. We've had 4 finger smashes a week. Hammers are absolutely unusable on real world projects; worse, they're counter-productive due to that finger crap.

    9. Re:Learn C and Python by HeronBlademaster · · Score: 1

      To be fair, there is a fairly easy way around that. Mandate that everyone use tabs for indentation, and let them set whatever display width they want.

      That doesn't solve the "oops, that should have been tabbed over one more to be inside the if statement" problem, but you can run into that in C/C++ as well - just forget to put { } around a multi-line if statement (some lazy bums don't put them around single-line if ;), or alternatively, put the ending } around an extra line of code. Either of those takes just as long to debug as Python's indentation woes.

      Granted, Python's indentation is much easier to screw up, but never let it be said that C is immune to scope programming problems...

    10. Re:Learn C and Python by erikina · · Score: 1

      In certain situations, syntax errors in interpreted languages can be pretty hard to track down. If you don't test absolutely every code path, you're bound for trouble.

      Every since dealing with that crap, I've vowed to never use a language unless it's a) Compiled. b) Strongly typed.

    11. Re:Learn C and Python by Anonymous Coward · · Score: 0

      Python is absolutely unusable on real world projects (any project where you aren't the sole developer) due to that indentation crap.

      While I admire a good rant, you know this statement is manifestly false if you look around the Internet for more than 30 seconds.

    12. Re:Learn C and Python by tomhudson · · Score: 1

      just forget to put { } around a multi-line if statement (some lazy bums don't put them around single-line if ;),

      No, we just understand that in c, the proper use of {} is to convert a multi-statement line syntactically into a single statement.

      blockifying every single-line statement is childish, and makes for less code on the screen, so more scrolling, and less chance to catch a bug. Ditto for putting the opening parenthesis of a function call on a new line - it's a waste of screen real estate, and with todays' wide screend totally inexcusable. Semantically, it's just another statement, and should follow the same rules.

    13. Re:Learn C and Python by STFS · · Score: 4, Informative

      Python is absolutely unusable on real world projects (any project where you aren't the sole developer) due to that indentation crap.

      Would you mind repeating that? I don't think the guys developing the following projects heard you:

      I could go on... but you get the point.

      If your software team is having problems with the significance of white spaces in Python, my bet would be that, no offense, the team was to blame.

      The trick is to coordinate the "white space rules" between members of the team. If it can't pull that one off, I wouldn't trust them to write code for a production system anyways.

      --
      You don't think enough... therefore you better not be!
    14. Re:Learn C and Python by Joebert · · Score: 1

      I moved from Windows XP to Ubuntu Linux earlier this year and I wrote my first desktop application, a Linux color picker, for Gnome using C.

      Some of it was very frustrating, but fun for the most part once I got the hang of it and it works a lot better than what I could do with something like Adobe AIR.

      --
      Wanna fight ? Bend over, stick your head up your ass, and fight for air.
    15. Re:Learn C and Python by cowmix · · Score: 1

      You are insane.

      The force indentation is a LIFE SAVER when working in large groups.

    16. Re:Learn C and Python by xant · · Score: 3, Informative

      Trolling? I'll bite.

      Free: http://pythonide.blogspot.com/search/label/spe
      Free: http://die-offenbachs.de/eric/index.html
      Free: http://docs.python.org/library/pdb.html#module-pdb (and included with Python)
      Commercial, but excellent (my team uses it): http://www.wingware.com/
      Commercial: http://www.activestate.com/Products/komodo_ide/index.mhtml

      If you really love Visual Studio for some reason: http://www.activestate.com/Products/visual_python/index.plex
      If you love Eclipse: http://pydev.sourceforge.net/

      And for the lazy, "import pdb; pdb.set_trace()" has always been my favorite way to debug python software. Add that line anywhere; get a breakpoint. Make it conditional with an if statement.

      Not to mention introspection right down to the bytecode at runtime (there is even a Python module that lets you edit the bytecode at runtime, if you are sufficiently crazy).

      In short, you have not used Python for more than 10 minutes if you really think the debugging isn't good.

      IHBT. HAND.

      --
      It's rare that you're presented with a knob whose only two positions are Make History and Flee Your Glorious Destiny.
    17. Re:Learn C and Python by bledri · · Score: 4, Informative

      Python is absolutely unusable on real world projects (any project where you aren't the sole developer) due to that indentation crap.

      It's fine if you don't like Python and don't want to use it, but to say that it's completely unusable on real world projects is a bit absurd. And while you may find it hard to read, I think it's obvious because if it looks like code is a block, it is. The main trick to read and follow PEP-8, use a decent editor and write unittests.

      --
      Some privacy policy Slashdot.
    18. Re:Learn C and Python by martin-boundary · · Score: 2, Insightful

      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.

    19. Re:Learn C and Python by Stormx2 · · Score: 1

      My god, I wish I had mod points for you good sir.

    20. Re:Learn C and Python by rhathar · · Score: 1
      --
      http://www.chaotickingdoms.com
    21. Re:Learn C and Python by Mr+Z · · Score: 1

      I count myself among those who don't like Python's syntactically significant whitespace. In my particular case, I use a particular programming idiom that I use when debugging code. I put temporary debug statements in column 0 of my code, purposefully, so that they stick out like a sore thumb and are easily found and removed later. They're "out of band" over there.

      You can see some examples in this code. I had left in some "jzp_printf" calls in some code I added for saving voice samples to disk. You can see those near the top.

      That idiom works in multiple languages, but it doesn't work in Python. Of course, it shouldn't be hard to write a translator that translates { } style blocks into Python translation as a preprocessing step.

    22. Re:Learn C and Python by tomhudson · · Score: 3, Insightful

      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.

    23. Re:Learn C and Python by Anonymous Coward · · Score: 1, Insightful

      Wouldn't you rather avoid the products of the other companies that aren't finding these bugs?

    24. Re:Learn C and Python by Anonymous Coward · · Score: 0

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

      So we come to the real question. VIM or EMACS?

    25. Re:Learn C and Python by collinstocks · · Score: 1

      I do a lot of programming in python and I find that the language itself is easy enough to use that you rarely need to debug, and when you do a few print statements will suffice. Also, the ability to test out your program or bits of it in an interactive python interpreter makes programming correct code the first time even simpler since if you are unsure about something, you can test it out in the terminal. You can also find help on any module from within the terminal by using the help() function.

      No, debugging tools are not a problem in python...

    26. Re:Learn C and Python by collinstocks · · Score: 1

      Syntax errors in python are detected as soon as the module is loaded. Since python code convention tells you to load modules unconditionally at the top of each file, you should be able to find any syntax errors as soon as you start the program. The python interpreter also tells you the file, line number, and traceback of all errors, so they should be easy to find.

      If I'm not mistaken, python also has a special IndentationError, so finding problems with indentation (great grand parent) should not be taking so long.

      In reference to the parent, I agree that being strongly typed is an advantage. I think that python could be much much faster if it were statically typed.

      I'm not sure why you require everything to be compiled, though. It isn't necessarily an advantage to have to compile your program every time you wish to test it after changes.

    27. Re:Learn C and Python by Anonymous Coward · · Score: 0

      I can't remember what PEP it was, but the standard for indents in python is FOUR SPACES. That's not that hard to coordinate...

    28. Re:Learn C and Python by Anonymous Coward · · Score: 0

      Right. Because there are as many alternatives to a hammer as there are alternatives for Python.

    29. Re:Learn C and Python by Anonymous Coward · · Score: 0

      Right, because there are as many alternatives to hammers as there are alternatives to Python.

    30. Re:Learn C and Python by Amazing+Quantum+Man · · Score: 1

      I put temporary debug statements in column 0 of my code, purposefully, so that they stick out like a sore thumb and are easily found and removed later.

      You too? I do that too! It really does make them easy to find.

      --
      Fascism starts when the efficiency of the government becomes more important than the rights of the people.
    31. Re:Learn C and Python by martin-boundary · · Score: 1

      I get what you're saying, but I'll remind you that some of those habits you listed can go back to old compiler bugs/warnings. Not necessarily relevant today, though.

    32. Re:Learn C and Python by HeronBlademaster · · Score: 1

      We're in the days of 1900x1200 widescreen monitors. You can't spare a few lines of text for some extra braces for clean-looking code? You can't scroll your mouse wheel one extra time?

      I put curly braces around my single-line if statements because I want them to look the same (I think it looks cleaner), and it's easier to put in braces before I fill in the code than it is to add them later.

      I'm confident that my code is clean; I gladly let my coworkers and manager look over it. It's too bad that you appear to think your way is the only clean way.

      I learned to code on Windows using an IDE with auto-complete. That doesn't make me a bad programmer, and it's sad that you think "bad programmers inevitably learned on Windows". I know my way around a makefile. I learned both ways of doing things on my own.

      Oh, and by the way, even competent coders have brain farts once in a while.

    33. Re:Learn C and Python by Alpha830RulZ · · Score: 1

      in a few weeks you'll forget Python's indentation conventions ever bothered you

      Took me about 15 minutes.

      --
      I was taught to respect my elders. The trouble is, it's getting harder and harder to find some.
    34. Re:Learn C and Python by Jeremi · · Score: 1

      they blockify the contents of their case statements

      Agreed that it's not always necessary to do that, but then again it sometimes is... i.e. when you are declaring class objects on the stack in your case statements. If you don't, you get an error like this:

      test.cpp: In function 'int main(int, char**)':
      test.cpp:17: error: jump to case label
      test.cpp:14: error: crosses initialization of 'A a'

      Given that, I can see why some people would just put in the braces all the time, to avoid having to deal with the problem.

      put a break after the last statement in a switch

      That's actually a very wise thing to do, as a defense against the time in the future when some bozo adds another case to the end of the switch statement, and forgets to add a break statement above it. Voila, he's accidentally created an unintended fall-through condition where two cases get executed instead of just one... and a hard-to-find logic error that will be a bitch to debug. Better to just put in the (harmless) extra break statement up front and save debugging time later.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    35. Re:Learn C and Python by evilviper · · Score: 1

      I've worked professionally with a hammer and it was totally unusable.

      You're actually not far wrong. Nail guns have by and large replaced hammers in construction. Of course there's always the odd bit of temporary framing (eg. for cement foundations, stairs, walkways, etc.) but they're 90% of their job goes to nail guns today.

      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    36. Re:Learn C and Python by AuMatar · · Score: 1

      Use the comma operator to make it a single statement? In nearly a decade of professional development and well over in hobby work, I've never seen that done. I'd bounce the code review if they did. Just put in some damn parenthesis.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    37. Re:Learn C and Python by Anonymous Coward · · Score: 0

      If they really have 4 bugs a week that take 4 hours each to debug, and those bugs are really just caused by whitespace errors... yeah, I'll avoid those guys like they are radioactive.

      It's just not that hard. Set your text editor to indent using spaces. On your revision control system, set checkins to run a script that checks for lines indented with any tabs mixed in with the spaces, and make the checkin fail if there are any.

      If everyone just uses spaces, there will be zero bugs caused by mixing spaces and tabs. And space/tab errors are the only way I can think of to have actual bugs caused by indentation in Python.

      So, if this hypothetical software company really exists, and they really are burning 16+ man-hours per week on tab/space bugs in Python code, week after week, then they are so incredibly dysfunctional that I have to assume that their products would be buggy in ways they haven't even figured out yet.

      Really I think this comment was just a troll, so this doesn't really matter.

    38. Re:Learn C and Python by nschubach · · Score: 1

      To be fair, I like to use blocks for everything because (to me) it's easier and clearer to read. I also keep the opening block on the same line as the if/case/for and close it indented to the first character of the block statement. (Java style)

      Now, you may use indentation to clarify your code, but I use block endings to stop my train of thought in the same manner. It doesn't mean I know less about programming or the language than you do. That's pretty arrogant. By blocking everything it makes the intent VERY clear. It takes two more strokes of the finger and it doesn't take up that much more space. Also, as the GP mentioned in reply, it doesn't hurt to keep the program functioning correctly IF someone with less talent happens to put another line of code in there.

      I understand the idea of placing as much code on the screen at one time. That's why I religiously place single function blocks on the same line as the if as the GP stated. [ if(something) { doSomething(); } ] I do the same for switch statements as well. If I can get a simple case to align with the ones above it for readability, I will do so. I also make the intention known that I want to do nothing if no cases are true.
      switch (something) {
            case (1): { run(blah); break; }
            case (2): { runother(blah); break; }
            default: { /* do nothing */ }
      }
      Contrary to your statement, it's not because I don't understand the code. It's because it clarifies to anyone else reading it that I didn't forget or overlook something. (It's like my own N/A, or "This page intentionally left blank")

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    39. Re:Learn C and Python by 615 · · Score: 2, Insightful

      ... 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.

    40. Re:Learn C and Python by IkeTo · · Score: 1

      > We had on average 4 bugs a week due to the
      > indentation bullshit

      I'm still using it as the primary language, after starting a project with 3-5 people and working on it for 5 months. The number of bugs we have been checked into the repository which is later found to be due to indentation problem is exactly zero. We have the simple rules in place that every indentation level is 4 spaces, and tabs should never appear in the code at all. Perhaps that would help?

    41. Re:Learn C and Python by Martin+Soto · · Score: 1

      No, we just understand that in c, the proper use of {} is to convert a multi-statement line syntactically into a single statement.

      You're right on the mark, sir! Compilers deal with this stuff quite easily, why should people have problems with it? You are showing us the True Way here: forget about improving programming languages or implementing sensible coding conventions. They just take time and cause too many unproductive flamewars in Slashdot. Instead, ask people to learn to parse code just like compilers do, without ever missing the lack of a semicolon, or misinterpreting indentation as syntactical scoping. This will get rid of all those pesky programming errors at once, and will probably eliminate world poverty and cure cancer as a side effect.

      Now, the way you speak, I suppose you already taught yourself these incredible compiler-true-perfect-parsing abilities, didn't you? Would you mind to share your method with us? I, for one, am really interested...

    42. Re:Learn C and Python by tomhudson · · Score: 1

      We're in the days of 1900x1200 widescreen monitors. You can't spare a few lines of text for some extra braces for clean-looking code? You can't scroll your mouse wheel one extra time?

      I use keyboard shortcuts, you ignorant clod :-)

      Seriously, hi tech gives (higher-res monitors) and users take away ... my secondary monitor at work is 1600x1200, coupled with my laptops' 1440x900 I have more screen real estate than you, but why should I waste it on superfluous braces. Read the c language spec - braces are for blocks of code and for enums. NOT for single lines.

      While I was half-joking about the keyboard shortcuts, it's only half-joking. I can't believe how many times I've seen people use the mouse to select code, then select "Edit->Copy", then use the scrollbars to go down a page, then use the mouse to select the insertion point, then select "Edit->>Paste." Over and over and over. Then, since they inevitably copied more or less white space than they wanted, futx arround with the formatting some more (select the extra spaces with a mouse, go to the menu, select Edit->Delete") Do that a couple hundred times a day and you're losing 20 or more hours a month, 240 hours a year. And they're all coders from a Windows background. Heck, even the old Wordstar keyboard shortkuts weren't THAT hard to learn.

    43. Re:Learn C and Python by tomhudson · · Score: 1

      put a break after the last statement in a switch

      That's actually a very wise thing to do, as a defense against the time in the future when some bozo adds another case to the end of the switch statement, and forgets to add a break statement above it. Voila, he's accidentally created an unintended fall-through condition where two cases get executed instead of just one... and a hard-to-find logic error that will be a bitch to debug. Better to just put in the (harmless) extra break statement up front and save debugging time later.

      Smarter to just put a "default:" label right after your last case label. It not only makes it obvious that the last case is now the default case as well (so order your case statements accordingly), but it also avoids the superfluous break statement. Conveys more information with less noise.

      Of course, you also have times when you want case statements to "fall through" to the next one as well - and it's not just for the semi-contrived example of "workday/weekend". I've seen code where it's obvious that the coder didn't know you're allowed to "fall through" to the next statement - lots of code duplication in several cases ...

    44. Re:Learn C and Python by tomhudson · · Score: 1

      Use the comma operator to make it a single statement? In nearly a decade of professional development and well over in hobby work, I've never seen that done. I'd bounce the code review if they did. Just put in some damn parenthesis.

      You'll see this all the time in for-loop code. for (i=0, total=0; i ... so, are you going to bounce code that does this style of initialization, which is actually easier to debug, since you don't have to worry about total having gotten clobbered by someone adding new code after your original write-up?

      > It's in the language spec, so why not use it? This is perfectly legit, and legible, code. Just like this: if (x) y += tmp=a, a=b, b=tmp, a;

      Its safer than using a SWAP(a, b) macro, and if you're familiar with this particular use of the comma idiom, you only need to look at the last variable in the comma-separated list to know that the code does a y+= a, and you'll quickly learn to recognize that the comma-separated code is a simple swap.

    45. Re:Learn C and Python by Anonymous Coward · · Score: 0

      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.

      I really think the Python language is much more productive than any other. The code is perfectly readable and you'll write, in the same time, 10 times more functionality than with any other language. And this way, the team of coders can be 10 times smaller, avoiding problems of communication between them.

    46. Re:Learn C and Python by tomhudson · · Score: 1

      I agree with putting a default statement in your switches. I stick mine just below the last case statement, and let it "fall through'. This way, it not only marks the last case as also being the default case, but it gives a place to cleanly add new cases w/o breaking code.

    47. Re:Learn C and Python by tomhudson · · Score: 1

      syntactically, c isn't that complicated a language. Compare it to perl, which, as someone once said, looks like line noise.

      We all make bone-headed mistakes, and hopefully, we all learn from them. For example, after getting bit by an else statement that is indented so that it looks like it belongs to an outer-level if, you learn to associate the else statement with the preceding/nearest if, and you'll quickly spot code that is indented "wrong".

      Ditto for single-line statements that aren't blocked. When you want to add a statement, you automatically add the { }. What's the big deal? You forget one time, pay your dues, lesson learned, and move on. You shouldn't suddenly have this urge to "protect yourself" by blockifying every single piece of code ... that's on a par with commenting every single line ... a waste of time.

    48. Re:Learn C and Python by SanityInAnarchy · · Score: 1

      In certain situations, syntax errors in interpreted languages can be pretty hard to track down.

      You'll have to be more specific... Certain types of errors may be harder, but syntax errors?

      The worst I've had is a syntax error in a roughly 1k-line JavaScript file. Two things to learn about that: Missing brackets, parens, commas, and semicolons can cause just as much trouble as significant indentation, and all of these problems are easily avoided by not having 1k-line long files!

      Every since dealing with that crap, I've vowed to never use a language unless it's a) Compiled. b) Strongly typed.

      Both of which have nothing to do with syntax errors.

      I'm confused -- your complaint was about syntax errors, correct? And you do realize that it's just as possible to have a compiled, statically-typed, significant-indentation language as it is possible to have an interpreted, dynamically-typed, curly-brace-delimited language?

      --
      Don't thank God, thank a doctor!
    49. Re:Learn C and Python by cervo · · Score: 1

      Yeah get with the 21st century, nail guns are the way to go. Why smash a finger when you can drive a nail through your entire hand!!!

    50. Re:Learn C and Python by quanticle · · Score: 1

      Well, I really like Python, but I agree with the grandparent that lack of good debugging tools is really annoying. Frankly, I'd like a debugger that'd allow me to easily insert breakpoints and watchpoints into a program. Also, I'd like the debugger to be standardized and included with the default distribution of the language. C, C++, Java, Perl and Ruby all come with debuggers. Why doesn't Python?

      More than just debuggers, though, the lack of external tool support for Python in general bothers me. Frankly, I'd like a sort of Python IDE that'd do the sort of things that Eclipse does for Java, or Anjunta does for C/C++.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    51. Re:Learn C and Python by quanticle · · Score: 1

      I know you're just trying to own a troll, but I have to thank you for posting these links. I'm a relative newcomer to Python, and I've been trying to get my hands on some tools like these.

      Thanks!

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    52. Re:Learn C and Python by J.+J.+Ramsey · · Score: 1

      "I put temporary debug statements in column 0 of my code, purposefully, so that they stick out like a sore thumb and are easily found and removed later."

      This also makes it harder--especially for other programmers not used to your convention--to see the block of code to which your debug statements apply. Simply commenting the statements as being debugging statements would be far more straightforward.

      Python's whitespace syntax rules out your own idiosyncratic practice, but it was never a good practice to begin with.

    53. Re:Learn C and Python by Mr+Z · · Score: 1

      *shrug* When I'm debugging my own code, the readability matters most to me. When I check in the debugged code, I'll have removed my temporary debugging statements. That's the whole point of temporary debug statements that are easy to remove.

      If some debug code is more permanent, then yes, I indent it with everything else for precisely the reason you mention. Go take a look in that same file I posted above for instances of calls to "dprintf".

      The temporary debug statements (the ones that were in column 0) in that file are a fluke. I had hacked in a feature (saving voice samples) and accidentally checked in some debug statements that should have been deleted or turned into actual status messages. (That's why I don't have more examples to show, since they don't persist. I have plenty more examples of "permanent debug" statments indented with the code.) The fact these temporary statements are in column 0 makes them stick out similarly to "// XXX: FIXME" or "// XXX: DEBUG", but it's clearer that they're meant to be deleted on sight.

    54. Re:Learn C and Python by BitZtream · · Score: 1

      You know, I'm the first to say that using indention for syntax is retarded. I do however fully understand why python people like it from the formatting perspective. Forcing everyone on my team to use a consistent format has been the worst part about bringging on new devs. Perhaps I've just got stuck with some devs who don't like change or had a hard time breaking habits, which I understand, but having the language require everyone to be on the same page means that reading code afterwords has got to be much easier, even when the code comes from some random yahoo you've never met before.

      I'm insanely anal about our code following specific style rules, so much so that our CVS server checks the style on commit and if it fails, aborts the commit and tells the developer to run our astyle script on it. Unfortunately having the CVS server just reformat on commit has the side effect that even if you immediately do a diff after commit, you may see changes because of the reformatting since the client doesn't resync with the server. If anyone has a work-around for that problem I'd love to hear it :)

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    55. Re:Learn C and Python by jonaskoelker · · Score: 1

      We had on average 4 bugs a week due to the indentation bullshit

      I want to avoid your products.

      I want to avoid working there. The coders must be pretty incompetent. And since they're there, so must the management.

    56. Re:Learn C and Python by ibbie · · Score: 1

      Well, I really like Python, but I agree with the grandparent that lack of good debugging tools is really annoying. Frankly, I'd like a debugger that'd allow me to easily insert breakpoints and watchpoints into a program. Also, I'd like the debugger to be standardized and included with the default distribution of the language. C, C++, Java, Perl and Ruby all come with debuggers. Why doesn't Python?

      It does come with one, although I have to admit that I prefer winpdb, since it not only has an optional GUI for debugging, but it supports debugging/breakpoints remotely - which is really nice for mod_wsgi and mod_python apps.

      I can't really offer any help in regards to an IDE - vim does what I need it to, without wasting a bunch of resources.

      --
      The wise follow a damned path, for to know is to be forsaken.
    57. Re:Learn C and Python by Anonymous Coward · · Score: 0

      C will give you a good base for learning how the system calls and libraries work, but Ruby 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 programming language like Ruby, in a few weeks you'll forget Python's indentation conventions ever bothered you.

      Fixed.

    58. Re:Learn C and Python by horza · · Score: 1

      Isn't the old joke about C that it's like having a powerful gun pointed at your foot and there's no safety catch?

      You must be a bit retarded to constantly have bugs due to Python indentation. But amateurs can be railroaded into reasonably good coding by using process. Simply make company policy to add a closure comment on the last line of an indented block.

      if a == b:
          a = 1
          b = 2 # end of if block
      c = 3

      That should help.

      Phillip.

    59. Re:Learn C and Python by k8to · · Score: 1

      You are clearly lying. The parse-time exceptions you get from broken indentation are blatantly clear, and logic flow changes you get from indenting incorrectly are only possible if you fail to understand the whole concept of indentation in code.

      --
      -josh
    60. Re:Learn C and Python by Anonymous Coward · · Score: 0

      Really? I find that strange. I am a professional C++ programmer and I have wasted days on tracking down a stray bracket in some header file. The problem is that the error message ends up at a totally different place than the fault. That has yet to happen to me in python.

      What I really like about the indenting in python it that it follows Don't Repeat Yourself, one of the absolute central tenets of programming. C++ code MUST have indenting AND brackets. Brackets because the language demands it, and indenting because humans can't reasonably read the code without it. Why have two systems when one will do? Why duplicate the information on the structure of all your code? Now that I've used python the decision taken in C seems rather bizarre.

    61. Re:Learn C and Python by Erich · · Score: 1

      Put a backslash at the proper indent level and then you can put the next line at whatever indent level you wish.

      --

      -- Erich

      Slashdot reader since 1997

    62. Re:Learn C and Python by Anonymous Coward · · Score: 0

      Damn! Another tool I need to learn how to use? When will it stop.

    63. Re:Learn C and Python by Anonymous Coward · · Score: 0

      Go back to sucking your uncles cock. And quit lying on /., cock sucker.

    64. Re:Learn C and Python by HeronBlademaster · · Score: 1

      Silly people.

    65. Re:Learn C and Python by Anonymous Coward · · Score: 0

      CCP

    66. Re:Learn C and Python by Anonymous Coward · · Score: 0

      Civilisation 4. (Civilization for you yanks.) http://en.wikipedia.org/wiki/Civilization_4#Customization

    67. Re:Learn C and Python by Anonymous Coward · · Score: 0

      "I've worked with it professionally. We had on average 4 bugs a week due to the indentation bullshit"

      What editor were you using? And you know that bit where at the beginning of a project you all agree on how to indent - who broke the rules?

      In fact, what the hell were you using to indent? 2 tabs and a space?

      The only time the indentation in python becomes a problem is when a block is more than one page long. Which means your blocks are too long. This is a feature.

    68. Re:Learn C and Python by Anonymous Coward · · Score: 0

      You got to be kidding!

      First if you have that many indentation problems, your programmers need some training in writing clean, maintainable code.

      Second, indentation issues are not that hard to figure out. You shouldn't even run into them in execution if you use the right code checking tools before.

    69. Re:Learn C and Python by daver00 · · Score: 1

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

      ...and thats the Python philosophy to a tee.

    70. Re:Learn C and Python by glenstar · · Score: 1
      if (x) y += tmp=a, a=b, b=tmp, a;

      I say you exercise your pinky finger so you can hit the big ENTER, {, } and TAB keys on your keyboard. Honestly, is saving half a dozen keystrokes worth the lack of readability of your code? I am neck-deep in a project where the coding "standards" call for single line conditionals to be on one line and it drives me crazy.

    71. Re:Learn C and Python by Anonymous Coward · · Score: 0

      > they blockify the contents of their case statements

      I blockify case statements so it's easy to declare variables within, and not because I'm unsure of how the language works.

      > put a break after the last statement in a switch

      Yes, to prevent unexpected fallthroughs if you decide to tack on another case below it. Defensive programming.

      > and braces around every one-line else clause
      > because they're not *sure* as to which "if"
      > the compiler will think it belongs to.

      It makes for easily inserting/removing code without statements accidentally dropping out of the if. All to easy if you add then remove debugging printf()s or add/remove statements.

      > 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..

      Folks with that problem probably have huge procedures that scroll on for pages that should really be broken up into functions.

      I'd say one of the best examples I've seen of clean coding is the original AT&T source code for unix circa 1975 which can be found in the Lions book ("Lions Commentary on UNIX 6th Ed."). The unix API and C libraries are also great examples of function calls. As opposed to WIN32 which is a horrible abuse of waaay too many calls, and too many arguments.

    72. Re:Learn C and Python by Anonymous Coward · · Score: 0

      I don't see how pictures of attractive, scantily-clad women proves the usability of Python.

    73. Re:Learn C and Python by tomhudson · · Score: 1

      You're just doing a swap, what's the big deal? There are other languages (perl, assembler) that let you swap two variables with one instruction, and it' safer than using a macro. The use of the comma operator makes it obvious which variable you want returned, saving anyuone reviewing the code from any doubt.

      The "one-line conditional all on one line", well, I've done it both ways. If there's no "else" clause, what's the big deal. If there IS an else clause, then no, I stick it on a separate line, unless it's short, in which case the whole if-else statement is easily transformed into a one-liner using the ternary (a ? b : c) operator.

    74. Re:Learn C and Python by tomhudson · · Score: 1
      For the default in a switch, why not make the code self-documenting by making the last case fall through to the default statement:

      case NO_DATA:
      default:
      // the NO_DATA code goes here

      ... your NO_DATA situation is now clearly also your default situation, and nobody should "make the mistake" of forgetting to add a break if they want to insert a new case;

      As for the debugging printfs, that's a good case for using the comma operator in a macro to avoid introducing errors if you define something ...:

      #ifdef DEBUG_PRINTF
      #define INT_BEFORE(v) printf("before: %d\n", v),
      #define INT_AFTER(v) , printf("after: %d\n", v);
      #else
      #define INT_BEFORE(v)
      #define INT_AFTER(v)
      #endif

      for (i=0, total=0; i /*debugged version - no commas needed */ INT_BEFORE(total) total += i INT_AFTER(total);

      The language has it, why not use it?

    75. Re:Learn C and Python by glenstar · · Score: 1
      The "one-line conditional all on one line", well, I've done it both ways. If there's no "else" clause, what's the big deal. If there IS an else clause, then no, I stick it on a separate line, unless it's short, in which case the whole if-else statement is easily transformed into a one-liner using the ternary (a ? b : c) operator.

      Sorry, I was a bit flippant in my response because I am dealing with a codebase full of one line conditionals and in many cases I am having to change them because a new statement has to be included. That is why I tend to always write:

      if (a==1)
      {
      b=1;
      }

      so when I have to add a c==1 into it I can easily. The only caveat, for me, is when you know the statement within the conditional will ALWAYS be one line. Rarely, in my experience, can you definitively make that call.

    76. Re:Learn C and Python by Anonymous Coward · · Score: 0

      Sure you did.

      Lying sack of dog shit. Someone should cut off your balls so that you don't burden the world with more stupid fucking children.

    77. Re:Learn C and Python by dodongo · · Score: 1

      At the risk of sounding glib -- and though I do write Python code, I am probably not a good Python coder by any measure -- but did you just totally not look at the stack trace? I have never seen anything close to 'indentation bullshit' that amounts to much of a puzzle. I don't mean this to sound like a flame or anything, I'm just interested as to whether there's actually a case where if you were following Python code practices at all, you'd actually encounter a problem like this that took hours to debug that wasn't caused by your own inability / lack of awareness with respect to how Python handles its whitespace.

  8. Mono by reSonans · · Score: 4, Informative

    Mono could make the transition very easy for you, depending on what your doing.

    --
    Light the blue touch-paper and retire immediately.
    1. Re:Mono by wmbetts · · Score: 0, Offtopic

      How is this flamebait?

      --
      "Ubuntu" -- an African word, meaning "Slackware is too hard for me". - stolen from Dan C alt.os.linux.slackware
    2. Re:Mono by SirLurksAlot · · Score: 3, Insightful

      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.

      --
      God, schmod. I want my monkey man!
    3. Re:Mono by HeronBlademaster · · Score: 1

      What I don't understand is that reSonans got modded insightful, but someone three posts up said exactly the same thing and got modded flamebait...

    4. Re:Mono by pembo13 · · Score: 1

      Which other suggested language doesn't work in Windows?

      --
      "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    5. Re:Mono by SirLurksAlot · · Score: 1

      I might've worded it poorly, but I wasn't trying to say that those languages don't work on Windows. What I was trying to say to is that those are languages which were not created by Microsoft. C#, VB.NET, VBScript, etc were all created by Microsoft, whereas C, Perl, Python et al were not. While it is true that the latter can just as easily be used in Windows they are more closely associated with 'nix-based development.

      --
      God, schmod. I want my monkey man!
    6. Re:Mono by Alpha830RulZ · · Score: 1

      Mod +3 civil.

      --
      I was taught to respect my elders. The trouble is, it's getting harder and harder to find some.
    7. Re:Mono by Anonymous Coward · · Score: 0

      Mono is ideal for this scenario.

    8. Re:Mono by jabithew · · Score: 1

      Disagreeing with someone doesn't mean your mouse should instantly jump to the flamebait or troll options

      No, in those circumstances "Overrated" is traditional on Slashdot.

      --
      All intents and purposes. Not intensive purposes.
  9. What do you want to develop? by kwabbles · · Score: 4, Informative

    Do you want to develop KDE apps? How about GTK apps? Do you want to submit kernel patches, or create system utilities?

    You may want to be more specific, however - C, C++, Perl and Python are pretty much the norm.

    --
    Just disrupt the deflector shield with a tachyon burst.
    1. Re:What do you want to develop? by Anonymous Coward · · Score: 0

      Do you want to develop KDE apps? How about GTK apps? Do you want to submit kernel patches, or create system utilities?...

      ... Or do you want to get paid for your work?

    2. Re:What do you want to develop? by Anonymous Coward · · Score: 0

      Exactly what I was thinking. The task should definitely influence the choice of programming language.

      sh, awk, perl, and tcl come in very handy on the scripting side and tcl doubles as a great embedded command language for your project. You'll also want to learn how to use the basic unix data/text processing tools like sed, cut, sort, uniq, etc (there is a long list of them).

      If you are doing web stuff then you'll probably want to focus on something like PHP, Ruby, Python, or Java (Groovy makes a great addition to Java); and you'll probably need to toss in a good dose of javascript.

      If you are doing unix tools and system programming then you are talking mostly about C or sometimes C++. If you are a unix system admin then Perl would definitely be a good choice to know along with sh and other unix tools.

      I think that if I had to recommend something in "general" for someone to start learning programming with, it would probably be Java. Grab yourself free copies of: Sun's JDK 6 and Eclipse and you are good to go. If you want something scripty to add into the mix then grab a free copy of Groovy and you can poke around with java objects right from the command-line (and have access to a very powerful scripting environment as well).

      Also, serious programmers have to also know things like build automation tools (make, ant, etc), source code control systems (CVS, subversion, etc), and bug tracking systems (bugzilla, jtrac, jira[commercial sw but common], etc).

      Enjoy

  10. C/C++ by erikina · · Score: 4, Interesting

    C/C++ are the languages you'd want to go for. They can do *everything*, have great support, are fast etc.

    Take a look at Qt and Gtk. They're the two big GUI toolkits. I personally like Qt more, it's better documented and much easier to get running in Windows (and macs). As for the python, there's nothing wrong with its indenting. The problems of the language are much deeper. No language is going to be perfect, it's a tool .. just use it.

    As for IDE's, if you're coming from a MS background take a look at the latest netbeans. It's a little slow (fine on new hardware though) and a bit better than Eclipse for C/C++ support.

    1. Re:C/C++ by dkf · · Score: 4, Interesting

      C/C++ are the languages you'd want to go for. They can do *everything*, have great support, are fast etc.

      Let's be honest here. C and C++ are very fast indeed if you use them well (very little can touch them; most other languages are actually implemented in terms of them) but they're also very easy to use really badly. They're genuine professional power tools: they'll do what you ask them to really quickly, even if that is just to spin on the spot chopping peoples' legs off. Care required!

      If you use a higher-level language (I prefer Tcl, but you might prefer Python, Perl, Ruby, Lua, Rexx, awk, bash, etc. - the list is huge) then you probably won't go as fast. But unless you're very good at C/C++ you'll go acceptably fast at a much earlier calendar date. It's just easier for most people to be productive in higher-level languages. Well, unless you're doing something where you have to be incredibly close to the metal like a device driver, but even then it's best to keep the amount of low-level code small and to try to get to use high-level things as soon as you can.

      One technique that is used quite a bit, especially by really experienced developers, is to split the program up into components that are then glued together. You can then write the components in a low-level language if necessary, but use the far superior gluing capabilities of a high-level language effectively. I know many people are very productive doing this.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    2. Re:C/C++ by drspliff · · Score: 2, Informative

      As for C/C++ IDEs I've tried and disliked both KDevelop and Anjuta, Eclipse/CDE and Sun's netbeans based stuff are quite nice, but my poor little laptop doesn't like them.

      I ended up settling with Code::Blocks, it's lightweight and native (C++/wxWidgets) and supports all the de-factor features.

    3. Re:C/C++ by Brandybuck · · Score: 1

      I'm not sure about netbeans, but the other stuff is spot on. Learn C++ (you'll learn C for free along the way). Then learn Python as a second language. Add in Qt (and PyQt) and you're set.

      --
      Don't blame me, I didn't vote for either of them!
    4. Re:C/C++ by Richard+W.M.+Jones · · Score: 1, Interesting

      Are C/C++ really fast? Have you got figures to back it up? I'm not just talking about using C directly, but using C with some heavyweight library like Gtk which does its own very inefficient implementation of objects (glib), uses reference counting, and adds tons of asserts (which in a true HLL could be eliminated by the compiler). As Wikipedia would say ... [citation needed].

      Rich.

    5. Re:C/C++ by walshy007 · · Score: 0, Flamebait

      Are C/C++ really fast?

      if you have to ask that question, you will have to surrender your geek card at the door

      as for using large libraries, if you don't need the functionality why use it? and if you do do you really think you can implement it in a more efficient manner quickly?

    6. Re:C/C++ by erikina · · Score: 0, Flamebait

      Are C/C++ really fast? Have you got figures to back it up?

      Give me a break. Of course it is. And no, I'm not going to provide figures for an accepted fact.

      I'm not just talking about using C directly, but using C with some heavyweight library like Gtk which does its own very inefficient implementation of objects (glib), uses reference counting, and adds tons of asserts (which in a true HLL could be eliminated by the compiler).

      Jesus Christ. Do you have any idea what you're talking about? You think if the detail is hidden from you, it doesn't exist. As for removing asserts and debug stuff, I can't think of an easier way than with C. You can even just use the preprocessor (#IFDEFINE) to remove the body of the function. Then let the compiler optimize out any use of it. Try that with Python/Ruby.

      As Wikipedia would say ... [citation needed].

      Rich.

      w/e

    7. Re:C/C++ by Psychotria · · Score: 1

      This may be of interest.

    8. Re:C/C++ by martin-boundary · · Score: 2, Interesting

      You have a good point, but don't forget that C/C++'s (potential) speed gain is not just about writing faster functions, but also about controlling exactly the memory layout of the program. Even if Java or Python is using the same third party libraries as you might use in C, the data will still be wrapped in ungodly layers of memory management garbage. With a higher level language, there's no fine grained control of memory that can ensure that what's needed really fits in L1 or L2 cache.

    9. Re:C/C++ by FishWithAHammer · · Score: 1

      With a higher level language, there's no fine grained control of memory that can ensure that what's needed really fits in L1 or L2 cache.

      And in a modern operating system there's no way to control whether it all ever actually ends up in that cache at the same time (such is probably counterproductive as opposed to demand caching anyway!).

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    10. Re:C/C++ by erikina · · Score: 1

      As for C/C++ IDEs I've tried and disliked both KDevelop

      Yeah, it feels like a clunky shell around Kate, but I've been playing with KDevelop4 from SVN and they've done some really nice work. Hopefully they're nearing a release.

      and Anjuta

      Yeah, it's trashy. If you want something very minimalistic, geany is quite nice. I use it on my laptop.

      Eclipse/CDE and Sun's netbeans based stuff are quite nice, but my poor little laptop doesn't like them.

      Yeah, even my Pentium 4 doesn't like it. Netbeans has to be the most intensive application. In fact, it seems to use more resources than running another OS in a virtual machine. Which is telling you something.

      I ended up settling with Code::Blocks, it's lightweight and native (C++/wxWidgets) and supports all the de-factor features.

      Code Blocks is pretty decent. I do wish they made releases more often though.

    11. Re:C/C++ by Anonymous Coward · · Score: 0

      I agree regarding the IDEs. Code::Blocks has come a long way and is much more stable these days. If the OP has been using Visual Studio, I think he'll feel at home with Code::Blocks since the GUI has a similar design.

    12. Re:C/C++ by barton · · Score: 2, Insightful

      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.

    13. Re:C/C++ by Anonymous Coward · · Score: 0

      To which versions of netbeans and eclipse are you referring?

      My previous experience has shown Netbeans to be at least a couple of years behind Eclipse in terms of the maturity of its C support.
      Netbeans makes an OK (if slow) C editor, or IDE for small, single-target projects.
      But Eclipse CDT truly is a complete IDE for large C based projects, and scales down to small ones perfectly well too. What it's not good for is just quickly editing a single arbitrary file on the filesystem, but that's what Vim is for.

    14. Re:C/C++ by Anonymous Coward · · Score: 0

      Another, often overlooked, cross-platform UI framework is wxWidgets.

      It's been a couple of years since I've worked full-time with it, but I've kept up with it and it's a wonderful framework that will allow you to develop C/C++ applications that run on a variety of platforms - Windows, Linux with a GNOME desktop, OS X etc.

      You can also create UI's with wxPython and wxRuby as well...just something to consider.

    15. Re:C/C++ by Forrest+Kyle · · Score: 1

      So if C is too slow, what language do you use when speed matters? Literally just curious. Not trying to be facetious, although it was tempting. =)

    16. Re:C/C++ by martin-boundary · · Score: 1

      Huh? When you know the cache line length for the hardware, then you *know* how many bytes of consecutive physical memory are being fetched at the same time, and using that information you can lay out your data locally. It's got nothing to do with the OS, although you might want to ask if the OS honours physical data alignment. In practice if you're unsure, you would write a little test program to find out.

    17. Re:C/C++ by binarylarry · · Score: 1

      Uh wuh? You ever hear of virtual memory?

      --
      Mod me down, my New Earth Global Warmingist friends!
    18. Re:C/C++ by Antique+Geekmeister · · Score: 1

      Machine code. Knowledge of the internals of the hardware can allow you to tune operations even better than a general compiler, such as gcc, can.

      But if you have to go to that level, it's often a good idea to modify your compiler to support such optimizations. This is common with gcc for specific new hardware, such as portable devices, firewalls, and routers.

    19. Re:C/C++ by martin-boundary · · Score: 1

      Do you understand how a processor physically fetches data from memory? Processor virtual memory is at a higher conceptual level than cache line size (and OS virtual memory is even higher). All the bytes within a single cache line are physically consecutive. All the bytes within a set of cache lines need not be physically consecutive. If you align 8 consecutive bytes correctly, then you are guaranteed that they will fit in a single cache line, and therefore they will be physically read/written simultaneously, whenever that happens.

    20. Re:C/C++ by inflex · · Score: 1

      > C/C++ are the languages you'd want to go for. They can do *everything*, have great support, are fast etc.

      One thing to make clear, the 'speed' of a language is primarily about the implementation of it, not the specification. If the language specification defined the speed, then we'd not have compilers generating different performance code.

    21. Re:C/C++ by Narishma · · Score: 1

      IMO Qt does everything wxWidgets does and more, better and easier.

      --
      Mada mada dane.
    22. Re:C/C++ by Forrest+Kyle · · Score: 1

      While I'm aware that machine code can be optimized slightly better than C code, no one programs in it. (Maybe only electrical engineers when working on very specific types of embedded systems.)

      Saying C is too slow compared to machine code is like saying driving to work takes too long compared to flying a jet plane. While technically true, the alternative is not reasonable.

    23. Re:C/C++ by Antique+Geekmeister · · Score: 1

      The question I answered was what you use _when_ C is too slow. The next significant software improvement available is machine code. And goodness knows, I've had to use machine code myself when dealing with some interesting low power, custom-built device work, where speed and battery life are deeply related and your resources are extremely limited.

      Usually, we don't need that much speed, or we simply throw more CPU power at the problem and avoid the programmer cost of diving down to the machine code level.

    24. Re:C/C++ by Anonymous Coward · · Score: 0

      Yes, speed is nice, but if a language is error prone that matters too as far as productivity goes. Let's also not forget that Java at this point is about as fast as C++ (perhaps not considering class loading time).

    25. Re:C/C++ by martin-boundary · · Score: 1

      One thing to make clear, the 'speed' of a language is primarily about the implementation of it, not the specification.

      Not necessarily. For example, some languages have pointers, others don't even have references. Assuming equally capable implementations(*) of the languages, having pointers available means that some faster algorithms can be coded.

      (*) You can think for example of a single language which has pointers, versus the same language where you voluntarily restrict yourself to not use pointers.

    26. Re:C/C++ by Timothy+Brownawell · · Score: 1

      While I'm aware that machine code can be optimized slightly better than C code, no one programs in it. (Maybe only electrical engineers when working on very specific types of embedded systems.)

      I've seen multiple x86 assembler versions of SHA-1 in the same program, optimized for different processor families (old Intel vs old AMD vs things with SSE2). There's also a tiny notepad replacement that some crazy person wrote entirely in assembly ("grown up notepad" or something, I think). I also know that a few small parts of the Linux kernel must be done is assembly, but AIUI this is more often due to "cannot be expressed in cross-platform languages" rather than performance.

    27. Re:C/C++ by mechsoph · · Score: 1

      Even if Java or Python is using the same third party libraries as you might use in C, the data will still be wrapped in ungodly layers of memory management garbage.

      Actually, using a garbage collector can reduce the memory used by a program since you can much more easily reuse portions of data structures. Of course, that doesn't mean Java or Python tend to do a good job of that...

    28. Re:C/C++ by SanityInAnarchy · · Score: 1

      Give me a break. Of course it is. And no, I'm not going to provide figures for an accepted fact.

      I agree that it's generally accepted -- I often make that assumption, and while I assume it's possible to go faster than C, I'm not sure any language has managed to do so with any reliability.

      That said, it was an "accepted fact" that manual garbage collection (direct calls to malloc/free) is faster than automatic garbage collection (the norm in high-level languages) -- the assumption being that a programmer could always figure out what policy is best for the situation at hand.

      And that is strictly true, but only in the sense that a programmer could manually re-implement a garbage collector. There are cases where garbage collection physically outperforms manually using malloc/free. Even when there is some performance lost, there obviously is an audience for BoehmGC.

      You can even just use the preprocessor (#IFDEFINE) to remove the body of the function. Then let the compiler optimize out any use of it. Try that with Python/Ruby.

      Easy enough to use, if the VM was smart enough. For instance:

      SOME_CONSTANT = false
      def foo
        if SOME_CONSTANT
      ...
        end
      end

      The only real difference is that with Python/Ruby, the above would have to happen at runtime, not compile time. But there are other optimizations which can only happen at runtime -- there is, in fact, an audience for LLVM's implementation of C.

      In fact, there was a case in which a certain program running on a certain RISC processor ran faster in an optimized emulator than natively -- on the exact same processor.

      Taking all of the above into account, I think it's a reasonable question to ask.

      --
      Don't thank God, thank a doctor!
    29. Re:C/C++ by SanityInAnarchy · · Score: 1

      This is not always the gain you might think. There are cases where the memory management you're doing by yourself -- all those malloc/free calls, plus the implementation of malloc/free itself -- pushes you out of cache enough that a garbage collector is actually faster.

      Granted, in C you always have the option of writing or using a garbage collector, or of trying to beat it. But to me, that's like saying you can always do inline assembly, when you think you can beat the C compiler. Technically, yes, you can, but computers are getting fast enough that you really shouldn't have to, 99% of the time.

      --
      Don't thank God, thank a doctor!
    30. Re:C/C++ by dch24 · · Score: 2, Interesting
      In case you didn't catch the reference:

      http://www.cryptonomicon.com/beginning.html

      THE HOLE HAWG OF OPERATING SYSTEMS

      Unix has always lurked provocatively in the background of the operating system wars, like the Russian Army. Most people know it only by reputation, and its reputation, as the Dilbert cartoon suggests, is mixed. But everyone seems to agree that if it could only get its act together and stop surrendering vast tracts of rich agricultural land and hundreds of thousands of prisoners of war to the onrushing invaders, it could stomp them (and all other opposition) flat.

      It is difficult to explain how Unix has earned this respect without going into mind-smashing technical detail. Perhaps the gist of it can be explained by telling a story about drills.

      The Hole Hawg is a drill made by the Milwaukee Tool Company. If you look in a typical hardware store you may find smaller Milwaukee drills but not the Hole Hawg, which is too powerful and too expensive for homeowners. The Hole Hawg does not have the pistol-like design of a cheap homeowner's drill. It is a cube of solid metal with a handle sticking out of one face and a chuck mounted in another. The cube contains a disconcertingly potent electric motor. You can hold the handle and operate the trigger with your index finger, but unless you are exceptionally strong you cannot control the weight of the Hole Hawg with one hand; it is a two-hander all the way. In order to fight off the counter-torque of the Hole Hawg you use a separate handle (provided), which you screw into one side of the iron cube or the other depending on whether you are using your left or right hand to operate the trigger. This handle is not a sleek, ergonomically designed item as it would be in a homeowner's drill. It is simply a foot-long chunk of regular galvanized pipe, threaded on one end, with a black rubber handle on the other. If you lose it, you just go to the local plumbing supply store and buy another chunk of pipe.

      During the Eighties I did some construction work. One day, another worker leaned a ladder against the outside of the building that we were putting up, climbed up to the second-story level, and used the Hole Hawg to drill a hole through the exterior wall. At some point, the drill bit caught in the wall. The Hole Hawg, following its one and only imperative, kept going. It spun the worker's body around like a rag doll, causing him to knock his own ladder down. Fortunately he kept his grip on the Hole Hawg, which remained lodged in the wall, and he simply dangled from it and shouted for help until someone came along and reinstated the ladder.

      I myself used a Hole Hawg to drill many holes through studs, which it did as a blender chops cabbage. I also used it to cut a few six-inch-diameter holes through an old lath-and-plaster ceiling. I chucked in a new hole saw, went up to the second story, reached down between the newly installed floor joists, and began to cut through the first-floor ceiling below. Where my homeowner's drill had labored and whined to spin the huge bit around, and had stalled at the slightest obstruction, the Hole Hawg rotated with the stupid consistency of a spinning planet. When the hole saw seized up, the Hole Hawg spun itself and me around, and crushed one of my hands between the steel pipe handle and a joist, producing a few lacerations, each surrounded by a wide corona of deeply bruised flesh. It also bent the hole saw itself, though not so badly that I couldn't use it. After a few such run-ins, when I got ready to use the Hole Hawg my heart actually began to pound with atavistic terror.

      But I never blamed the Hole Hawg; I blamed myself. The Hole Hawg is dangerous because it does exactly what you tell it to. It is not bound by the physical limitations that are inherent in a cheap drill, and neither is it limited by safety interlocks that might be built into a homeowner's product by a liability-conscious manufact

    31. Re:C/C++ by martin-boundary · · Score: 1

      The big example where this sort of thing matters is when you have a lot of data to process fast. You'll be allocating a huge chunk of memory that you want to access randomly, or that you want to work on repeatedly, say 80% of physical memory. You want to make sure that the layout is efficient and well localized, so that you're not stalling the CPU while it's fetching the next piece of data, but once you've used it you won't need it again for a long time, enough to completely fill the cache with completely unrelated data, etc. In those types of problems, even using the STL has too much overhead, and you might be storing data that you have to uncompress whenever it's needed because ordinary integers are too wasteful. Optimizing compilers don't really help with data layout issues.

    32. Re:C/C++ by dkf · · Score: 1

      In case you didn't catch the reference:

      Thanks. I didn't feel like googling.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    33. Re:C/C++ by dkf · · Score: 1

      Yes, speed is nice, but if a language is error prone that matters too as far as productivity goes. Let's also not forget that Java at this point is about as fast as C++ (perhaps not considering class loading time).

      Theoretically yes, but I work quite a bit with Java for a living and it's a PITA to actually get it to go that speed when dealing with real problems. Plus there's a real tendency among most of the Java world to do everything in Java. I prefer to use multiple languages: a low-level one for raw grunty power, and a high-level one for ease of sticking my high-power components together. To me, Java meets the model of a low-level language, and I prefer to use it as such.

      OTOH, if you're doing webservices you're probably going to end up having Java or C# involved: the libraries there really are more advanced. They've had a lot of developer effort thrown at them, and not all of it was wasted.

      The real measure of productivity is how quickly you can get to a working solution to the actual problem. Everything else is just messing around. So ease of development counts, as does stability, testing and debugging. Implementation performance doesn't always count so much; it depends on the situation (nobody is too bothered if you're a few microseconds faster at getting back to waiting for the user to click on a button). Just remember: the right tools for the job.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    34. Re:C/C++ by Richard+W.M.+Jones · · Score: 1

      (My original comment up there was modded down to -1, but it's interesting to read the answers anyway)

      You want to make sure that the layout is efficient and well localized, so that you're not stalling the CPU while it's fetching the next piece of data, but once you've used it you won't need it again for a long time

      Exactly right! In the past I used C code to manually lay out OCaml objects to optimize access, so I could still use a nice high-level language, but get the speed advantage. The data size was approx 34 GB, stored in an mmap segment backed by a file. Section 6 in this document describes it.

      Rich.

    35. Re:C/C++ by Richard+W.M.+Jones · · Score: 1

      So if C is too slow, what language do you use when speed matters? Literally just curious

      To be fair, I didn't actually say that C is too slow. I questioned whether glib's awful abstractions slowed things down, and asked if anyone had benchmarks.

      Nevertheless, I'll plug OCaml here. It's about as fast as C and far nicer to use. As I mentioned in another comment, you can use C to fine-tune the layout of OCaml structures in memory to get maximum performance.

      Rich.

    36. Re:C/C++ by martin-boundary · · Score: 1

      I've never programmed in OCaml, but your module looks cool. +1 Cool :)

    37. Re:C/C++ by Cultural+Sublimation · · Score: 1

      I really don't get why the parent was modded to -1. He makes a very good point: while C/C++ may indeed be very fast for pure algorithmic stuff of the kind you find on the Shootout, when you consider large real world applications that advantage quickly diminishes. The reason is that the languages (either C or C++) don't offer built-in mechanisms for memory management (among others), forcing one to use libraries that are far from being optimised (not because their authors are dumb, but because they are very difficult to optimise anyway).

    38. Re:C/C++ by Anonymous Coward · · Score: 0

      > Taking all of the above into account, I think it's a reasonable question to ask.

      It would be if it wasn't for assembly: for assembler functions written in yasm/nasm C basically is the only high-level language that can call them. C also is the only language where basically all compilers have support for inline-assembly and/or intrinsics, which can be another good deal faster.
      Most programmers won't need it, but if performance really matters you _will_ have to use SIMD instructions or streaming writes that bypass the cache or prefetches etc. (other kinds of assembler optimizations are hardly ever worth it).
      It should be noted that Java, Python etc. probably could add support for these with reasonable effort (as intrinsics, not real assembly of course), but it seems they actually do not even want to compete on that level where the actual hardware architecture matters, so don't expect that performance gap to ever close.

    39. Re:C/C++ by Anonymous Coward · · Score: 0

      Did you PERSONALLY develop Windows Vista? Holy shit! It's a good thing thee kernel dev's don't think like you, or the friggin' thing would take a CD full before the OS was installed. /rant

      Don't get me wrong, high level languages have their purpose. Their purpose is not intended to be anything bigger than "grep". Try writing the original DOOM in Python, and tell me you can run it on a PIII let alone a 386! I love what Python does, but fuck - if your program is going to be of any size (or repetition) you need something faster than "interpreted". Even FreeDOS has C and C++. Other than graphics requirements (that's a consideration also...) I would use C for anything and everything of more size/repetition compared to "grep".

      The overall size of the project should be taken into consideration as well. Is it a "next-gen" game? Is it a special calculator? Is it a business database system? Interpreted languages are totally awesome, but at a large size you sacrifice too much speed.

      I write in C and sh (POSIX conforming shell script). If it is small, I write a script -- why dick with the in-outs of C? If it's a big-un, I write in C -- the performance hit or ability to execute a 603285-lines-of-code shell script is insanity in comparison! /rant_2.0

      Consider the overall size of the project, as well as the target OS(es) or problem(s). Also consider any Integrated Development Environment for the language. This may/may not be important to your purpose.

    40. Re:C/C++ by SanityInAnarchy · · Score: 1

      C also is the only language where basically all compilers have support for inline-assembly and/or intrinsics

      By the same token, most of the interpreted languages I've mentioned allow some modules to be written in C, even inline C.

      So then the question becomes, if you can get 80% of the game by writing 2% (not 20%) of the program in C, wouldn't you rather write the rest of the program in something else?

      --
      Don't thank God, thank a doctor!
    41. Re:C/C++ by Anonymous Coward · · Score: 0

      Oh, I fully agree, though I am more a fan of splitting a a program level (e.g. Python Gui frontend for your C backend).
      You just should not forget about the costs: You still have to know C very well for those 2% and you have to maintain the interface between those languages - and with many scripting languages to C I think this is far more difficult to do than with C and asm - the data structures may not be very suitable to C or not specified, it may be hard or impossible to call script functions from the C code, the garbage collector might make assumptions your C code might easily break etc.
      I have not looked much, but from what I see the "inline C" features are not comparable to what gcc offers for inline assembly (and even that is not that great).
      I think it is justified to say that far more effort went into C compilers than any of the scripting languages and Java - even though that is partially due to C's very on deficiencies.

    42. Re:C/C++ by bgamari · · Score: 1

      +1. This is a very good point. I'm shocked with how hopelessly out of touch most of the above comments are with reality. If I need to write a Lattice QCD simulation which will take weeks to run and consume gigabytes of memory, I would accept no other language than C. That being said, desktop applications are not HPC applications. Far from it, the programmer's time frequently matters far more in desktop programming. While higher level languages like OCaml, Python, Ruby, C#, Haskell, and the rest may be slower, from a desktop perspective this should hardly be noticeable in a properly designed desktop application. If the user is seeing any type of latency whatsoever, whether from IO or computation, you are doing it wrong. In particular, I think the GNOME project's dependence on C for so much of its stack is a tragedy. The widespread usage of such a low-level language like C for desktop applications has the potential to open up security holes (unchecked buffers anyone?), crashes (anyone use Evolution?), horribly structured code (anyone look at some of the older gnome platform code?), and just plain stagnation (it's not easy to maintain such a vast codebase of C). Moreover, gobject itself is most certainly not as well optimized as a compiler could do. The lack of compile-time information requires it to be be extremely generalized. While this is in the name of ease of binding, even most bindings don't map to gobject in a reasonable way. If I am programming in python, I want my code to look like python, not some gobject/python hybrid (although the python bindings are admittedly improving, albeit slowly). I think that the original poster brought up a very informative point. I think what is even more interesting, however, is how quickly the /. crowd began to raise strawmen to attack. Trying to have a debate about proper languages for desktop programming when people are set on developing for HPC is impossible. This idiocy is what makes me dread reading slashdot comments.

    43. Re:C/C++ by tietokone-olmi · · Score: 1

      That's not so bad. You'll know you're not using them well from the segfaults, which are instantly debuggable with gdb and valgrind.

      Whereas with managed-runtime languages like C# and Java and Python and Ruby, you only know that you're not using the language well from the utterly ridiculous hardware requirements of the program. Which is a flag that for a person who got into software engineering in 2002 completely doesn't start waving until somewhere around the "2 gigahertz and 2 gigabytes until it runs smoothly" mark.

      Therefore, proper use of C or C++ results in efficient applications more often than in C# or Java. Assuming that the person asking the article's question is not an idiot who would sorely require padded gloves such as C# or Java, it would be a smart idea to learn C. (Or possibly C++, even though it's sort of horrifying.)

    44. Re:C/C++ by Anonymous Coward · · Score: 0

      You should be trying wxWidgets. It is even easier to get running on Windows, since uh, it has been on that platform far much longer than Qt or GTK, and actually does not have as much Unix-style hurdles when trying to build or install it on Windows as the other two. Its .dll also is not as big because it uses the native dialog objects.

    45. Re:C/C++ by Anonymous Coward · · Score: 0

      I'd go for....

      a) Design the project as modules
      b) Build all the modules in a high level language
      c) If performance is acceptable skip to step f)
      d) Profile resource utilisation
      e) Recode bottlenecks in C/C++
      f) Profit :-)

    46. Re:C/C++ by Anonymous Coward · · Score: 0

      My rule of thumb is 'if you wouldn't write it in assembly, don't write it in C' â" because let's face it, C isn't much more productive. C++ is marginally better, with copious use of non-standard libraries, but unless you *really need* that 33% speed boost that it will give you over a natively compiled high-level language like Haskell on current CPUs, the 1000% increase in code size, roundabout code style, and myriad bug opportunities introduced by the lower-level language are really not worth it.

  11. Indirect answer by Anonymous Coward · · Score: 0

    You need to be able to adapt to different environments. I have a funny position with 50% SQL, 40% beaurocracy, 10% emergency! That emergency component can be one of a number of different popular technologies (ksh, perl, python, vb, c, php, even cobol) and existing programs are not all trivial. Whilst my boss is always willing to pay for a short-term expert, I always insist on having a go and invariably get it done cheaper. My only exposure to VB had been changing some constants in a VB-embed-in-Excel ages ago and one month ago I had to write something from scratch (~1,000 lines).

    So my indirect answer: whatever the job demands. Adapt! ;-) To build those skills, find something open source to contribute to if you please. Write many small programs for yourself from scratch in different languages (this is what I do).

    My university training enforced the use of a very broad range of tools: Haskell, C, Java, sh, Perl, Python, C++, Erlang, PHP, SQL, and even some Tcl. I guess that has helped too.

  12. Comment removed by account_deleted · · Score: 5, Insightful

    Comment removed based on user account deletion

  13. What do you want to program? by Hapless+Hero · · Score: 4, Interesting

    That is the first question you should ask yourself, actually. ;)

    One thing you might learn, from a tinkering-with-Linux point-of-view, is shell scripts. Surprised no one mentioned them yet. They aren't really "programming" in the sense of creating apps, but they are fun and a cool part of Linux.

    --
    Move sig now.
    1. Re:What do you want to program? by mebrahim · · Score: 5, Interesting

      Why do people usually underestimate shell scripting? Shell scripting is a real scripting language by which you can even create GUI apps for a modern desktop environment like KDE.*

      * for example using kdialog

    2. Re:What do you want to program? by Hapless+Hero · · Score: 1

      Okay, I didn't mean they were "fake." I just meant they were unwieldy, in my experience, for writing something like a web browser or some other major desktop app. I wholeheartedly support shell scripting! It's very important. I still mean to say that you need to know what you are looking to write before you go choosing a language. Certain languages are suited to some things and not others.

      --
      Move sig now.
    3. Re:What do you want to program? by Anonymous Coward · · Score: 1, Insightful

      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

    4. Re:What do you want to program? by Anonymous Coward · · Score: 0

      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

      While I generally agree with your premise, this can be written as:

      if [ -n "$FOO" ] && [ "$FOO" -gt 0 ]; then
                if ! gcc "$MYFILENAME"; then
                          echo "could not compile file"
                          exit 1
                fi
      fi

      Maybe still not as nice as the python, but not as ugly as before either.

    5. Re:What do you want to program? by Anonymous Coward · · Score: 0

      a friend of mine wrote an irc bot in bash. It worked half-assed (but that was beta), but it was possible.

    6. Re:What do you want to program? by Anonymous Coward · · Score: 0

      I agree that your use of "&&" is better than using the "-a" feature of test. And I'll concede that the "[ .. ]" form does look a little better.

      However, as far as I can tell, "test -n $FOO" is NOT a working replacement for "test x$FOO != x"

      I do not have FOO set in my shell or my environment.

      # test x$FOO != x && echo y || echo n
      n
      # test -n $FOO && echo y || echo n
      y
      # test -n && echo y || echo n
      y
      # test -n "" && echo y || echo n
      n
      # bash --version
      GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)
      Copyright (C) 2007 Free Software Foundation, Inc.

  14. A valuable skill by MathFox · · Score: 3, Insightful
    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!

    --
    extern warranty;
    main()
    {
    (void)warranty;
    }
    1. Re:A valuable skill by Zironic · · Score: 1

      as long as you're not making any system calls?

    2. Re:A valuable skill by siride · · Score: 4, Insightful

      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.

    3. Re:A valuable skill by Zironic · · Score: 1

      Isn't using system specific system call libraries technically equivalent with rewriting everything for each system?

    4. Re:A valuable skill by Java+Pimp · · Score: 1

      If you stick to the POSIX api there won't be too much trouble. Not saying that there won't be any but Windows does have somewhat decent POSIX compatibility support. Much of the low level stuff like sockets, file i/o, threads, etc... are there. I don't know anyone that wants to write even somewhat portatble code that tries to invoke system calls without some C runtime library that abstracts the OS away. Where you run into trouble is with the more "Windows-y" stuff like that ingenious construct that is the registry... blech!

      Anyway, more than just a language that is available on both platforms, a cross-platform library like WxWidgets (which encapsulates more than just GUI components...) can make it pretty easy to do cross-platform applications in something like C++.

      --
      Ascalante: Your bride is over 3,000 years old.
      Kull: She told me she was 19!
    5. Re:A valuable skill by Jerry · · Score: 3, Insightful

      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.

      --

      Running with Linux for over 20 years!

    6. Re:A valuable skill by binarylarry · · Score: 1

      Isn't using system specific system call libraries technically equivalent with rewriting everything for each system?

      No.

      --
      Mod me down, my New Earth Global Warmingist friends!
    7. Re:A valuable skill by AnalPerfume · · Score: 1

      Regardless of the market/mindshare momentum of Microsoft, Apple & *nix, making cross platform apps really should be encouraged. There's nothing worse than apps not being cross platform, an underdeveloped / featureless version on some platforms, or something which looks like a drag queen in a beauty contest (QT only apps on Gnome/XFCE and GTK only apps on KDE).

      I'm trying to find time to start to learn programming myself for at least small projects, so easy to learn and cross platform is a must.....for which all roads seem to lead to Python, and compiled with GTK / QT etc as required. That said, I've seen several people here mention that Python is not as quick for large apps, I've no idea so I'll assume that's the voices of experience talking.

    8. Re:A valuable skill by FishWithAHammer · · Score: 3, Informative

      And you're stuck GPLing everything or paying for a license before you do any development. Stupid and shitty.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    9. Re:A valuable skill by Anonymous Coward · · Score: 0

      Yeah ok, but in reality you can do your prototyping and decide whether your program is commerically viable and then still buy a license. They won't know and even if they did, they're not going to make an issue of it. After all, they get a license.

    10. Re:A valuable skill by Anonymous Coward · · Score: 0

      Do you need to rewrite an app that makes use of cin and cout for every system?

    11. Re:A valuable skill by FishWithAHammer · · Score: 1

      I prefer working legally.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    12. Re:A valuable skill by blackest_k · · Score: 1

      I'd have thought taking without giving anything back is shitty, stupid would be to allow yourself to be exploited in this way.

      The deal seems fine to me, give and take or if you insist pay and get paid.

      If your any good then anything you do that you GPL is something you can show on a CV or as samples for potentially clients. Having a track record is good for anyones career.

      An experienced developer has done his apprenticeship and can earn a living, seems reasonable to pay for the tools you use to earn that living.

      what else do you suggest as an alternative?
                 

    13. Re:A valuable skill by justaguylikeme · · Score: 1

      On the other hand, provided that he's just looking to learn some development skills in Linux, Qt offers a great tool kit with an extremely comprehensive easy-to-use API, an up-and-coming IDE and (very importantly, IMHO) cross-platform development capabilities. It's not shitty if he's just looking to test the waters and get some experience. At this point, so what if it's GPL'd? That seems to fit hand-in-hand with the Linux experience... Linux wouldn't exist as without Open Source code. Later on, should he want to do serious development in Qt, a license would be an option for new projects. Remember, while Qt licensing doesn't allow a project that's started with the GPL'd version to be released under the commercial license (i.e., no developing under the free version, then buying a license later to "make it commercial"), there's nothing that says you can't use the free version to get familiar with the API, do some learning, and hone your skills, then later buy a commercial license to *begin* new projects. That's what I did.

    14. Re:A valuable skill by Anonymous Coward · · Score: 0

      Not if most of your work is released under the GPL. And on a side-note: I'm really bored of seeing your uninformed trolling on Slashdot. When are you going to shut up or leave?

    15. Re:A valuable skill by FishWithAHammer · · Score: 1

      Um. You misunderstand. I have no problem with paying for a license to release the product. I have a serious problem with "you can't even develop a proprietary app without buying a license first".

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    16. Re:A valuable skill by FishWithAHammer · · Score: 1

      Spoken like a true anonymous coward.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    17. Re:A valuable skill by Anonymous Coward · · Score: 0

      Hmm... Why do you use UNIX then?

      I, for one, use it because it finally unifies namespaces and I DON'T have to use a bazillion libraries/translate manually between namespaces to connect parts of the systems. Just "cat /dev/hubble | scale -method nearest-neighbour -resolution 2048x2048 >/dev/printer" in principle.

      Have you read "The Hideous Name http://netlib.bell-labs.com/cm/cs/doc/85/1-05.ps.gz " by Rob Pike and P.J. Weinberger?

      So if you did UNIX programming (as opposed to using UNIX as some kind of complicated DOS or just to launch your own OS in a process - that's fine, of course, but...), you would be using system calls (or at least libc wrappers of them) every ten lines or so, because when your program communicates with the rest of the system, it uses system calls. And if it's not communicating, what is it doing? Reinventing the wheel?

      I realize that doing so is out of fashion today...

    18. Re:A valuable skill by RiotingPacifist · · Score: 2, Informative

      If you don't distribute then how is using GPL tools for internal development illegal?
      troll much?

      --
      IranAir Flight 655 never forget!
    19. Re:A valuable skill by dkf · · Score: 1

      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!

      Alas, it's not nearly as simple as that if you're doing GUI apps. The key problem is this: different platforms have different conventions. While there are similarities between typical Linux and Windows apps, they're not at all identical. And OSX apps really are different (and many users on that platform are incredibly picky).

      There's at least one commercial app that I use (occasionally) that feels like a Linux app on all platforms, which isn't great on Windows and really sucks on OSX. I know it was written in Qt. I dare say that you could probably do a better job.

      On the other hand, if you're developing non-GUI apps, there's probably only two key platforms to worry about: POSIX and Windows, with minor variations in each. Two is quite manageable, especially if you can wrap much of the platform-specific gunk into a small part of the program.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    20. Re:A valuable skill by Lumpy · · Score: 1

      And you dont have to pay a license for every lib you use under windows?

      Jeebus, back in the day when I wrote Windows apps we had to pay for a LOT of libraries that were binary blobs that made a function easy. Paying for something that makes your app work on 2 different platforms is moot.

      Or are you one of those " I pay for nothing" kind of people?

      --
      Do not look at laser with remaining good eye.
    21. Re:A valuable skill by Anonymous Coward · · Score: 1, Informative

      This cannot be true -- think about it.

      "you're stuck GPLing everything" -- the GPL covers distribution, not use or even development.

      "or paying for a license before you do any development" -- like I said, when you want to distribute, but not before.

      Stupid and shitty FUD, maybe.

    22. Re:A valuable skill by Jerry · · Score: 1

      Well, since I have been using Linux for 10 years, and enjoying the benefits of the contributions of MANY other programmers, I find NOTHING wrong with GPL'ing any application that I write, and have done so.

      My employer paid for, and renews, a Qt License. The support from Trolltech is excellent, second to none and better than most, especially when one considers what they get for what they pay to the likes of Oracle or Microsoft.

      I learned C++ and Qt just three years before I retired. My first effort with both tools is documented here:
      http://wiki.qtcentre.org/index.php?title=Programming_in_Qt4_and_C%2B%2B'

      --

      Running with Linux for over 20 years!

    23. Re:A valuable skill by Nethead · · Score: 1

      That link points to an empty page. -Joe

      --
      -- I have a private email server in my basement.
    24. Re:A valuable skill by FishWithAHammer · · Score: 1

      "Internal development" can involve working with contractors, etc., which could very well may be considered distribution. Unlikely, yes, possible, also yes. Better not to bother with the hassle.

      I love how disagreeing with you must be trolling though.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    25. Re:A valuable skill by FishWithAHammer · · Score: 1

      Well, since I have been using Linux for 10 years, and enjoying the benefits of the contributions of MANY other programmers, I find NOTHING wrong with GPL'ing any application that I write, and have done so.

      I consider the GPL unethical, and so I would not do so.

      My open source code is BSD-licensed.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    26. Re:A valuable skill by Anonymous Coward · · Score: 0

      Sorry, but you are misinformed: Nobody forces you to use the GPL for your project in the first place. If you are initially unsure about the license just use the BSD license or any other open source license that allows you later on to derive a proprietary solution or a GPLed one.

    27. Re:A valuable skill by skyphyr · · Score: 1

      Actually - his question was if you don't distribute how is it illegal. The answer is it's not. The GPL only comes into force when you distribute the program. Though if you've distributed source and not a binary it's even more of a grey area as the source isn't using Qt libraries at all. It's just text. Though so long as you don't distribute either source or a binary to anybody then you're perfectly legal.

  15. Re:Java by samkass · · Score: 4, Insightful

    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.

    --
    E pluribus unum
  16. Vala by Anonymous Coward · · Score: 1, Informative

    Checked out Vala? Its syntax is similar to C#, but it performs somewhere between C/C++. It uses the gobject system to implement object oriented behavior and has bindings for many core open sournce libraries like gtk.

  17. None. by grapes911 · · Score: 4, Insightful

    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.

    1. Re:None. by david.given · · Score: 2, Insightful

      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.

  18. Whatever language you like... by myzz · · Score: 1

    For example, some of the following: OCaml, Python, Ruby, C++, D.
    But there are really lot of them available. What's best, depends on what you try to do and your taste.

    1. Re:Whatever language you like... by Cultural+Sublimation · · Score: 1

      I second the Ocaml suggestion. In fact, I would consider OCaml to be the best kept "secret" of the Linux community. It's a wonderful language to use, with an extremely powerful type-system, and to top it all it produces extremely fast code, comparable to C++. I often wonder why it's so obscure among the Linux community -- is it because it's French? Come on guys, the French have given us lots of great things, and Ocaml is definitely among them. Do yourself a favour and give Ocaml a try! The only regret you'll have is not having discovered it sooner...

      (Sorry if the paragraph above sounds like a dreamy-eyed sales pitch. But once you grok the power of a functional language like Ocaml you'll understand what I mean...)

  19. C and assembler by larry+bagina · · Score: 1

    You'll be doing yourself a huge service by learning C and some assembly language (x86 is a turd, but ARM is fun). Perl, python, java, c#, javascript, vb, and other higher level languages are nice (excluding vb :-), but it's a good idea to know what's happening at a lower level, where there are no native regular expressions, no native strings.

    Also, try a functional language (haskell, scheme, lisp, erlang) to get a different perspective on programming.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  20. I See Your Problem by Nom+du+Keyboard · · Score: 2, Insightful

    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.

    --
    "It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
    1. Re:I See Your Problem by Joebert · · Score: 1

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

      [rips a fart]

      --
      Wanna fight ? Bend over, stick your head up your ass, and fight for air.
    2. Re:I See Your Problem by Arthur+Grumbine · · Score: 1

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

      I initially read this as a list of items with the first one being "ducks". I was trying to figure out the common theme (I was okay with "ducks" "rocks" "stones" being "things that float"), but got totally thrown for a loop with "Steve Jobs" (at that point my working theme was "things that geeks have an irrational fear of")...

      --
      Now that I think about it, I'm pretty sure everything I just said is completely wrong.
    3. Re:I See Your Problem by Anonymous Coward · · Score: 0

      I see your problem. Instead of C# they should have been teaching you Visual Basic.

      Nope, C# is a better choice than VB. If he knows C# then it is pretty easy to learn Java, C, etc.

      Sure VB is simple and powerful, but that's not really the point of a CS program.

    4. Re:I See Your Problem by Anonymous Coward · · Score: 0

      How the heck does that help with _Linux development_, which is what the original poster asked for?

    5. Re:I See Your Problem by Anonymous Coward · · Score: 0

      I can't tell... is this post a joke? Either it's the driest kind of humor I've ever come across, or it's the worst advice I've ever seen on /.

    6. Re:I See Your Problem by Watson+Ladd · · Score: 2, Funny

      He should learn Algo 68. Then he should implement a compiler for it. That will teach him how to program.

      --
      Inventions have long since reached their limit, and I see no hope for further development.-- Frontinus, 1st cent. AD
    7. Re:I See Your Problem by deanston · · Score: 1

      I think your Python list is missing quotation marks.

    8. Re:I See Your Problem by Anonymous Coward · · Score: 0

      Curse my expired modpoints :-(.

  21. C, Java and Python. by rjh · · Score: 5, Insightful

    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.

    1. Re:C, Java and Python. by the+eric+conspiracy · · Score: 1

      C, Java and Python offers a good core suite of tools that cover most problem sets in a Linux environment. I might add a basic familiarization of Perl just because of the immense package library that will come in handy, and shell can be useful (and it doesn't take much learning). Learning shell programming will also make you a stronger Linux user in general.

    2. Re:C, Java and Python. by TheRaven64 · · Score: 4, Insightful

      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.

      --
      I am TheRaven on Soylent News
    3. Re:C, Java and Python. by nadaou · · Score: 1

      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,

      This advice is so good that it wins a cookie, and is applicable to all areas of life.

      --
      ~.~
      I'm a peripheral visionary.
    4. Re:C, Java and Python. by pjt33 · · Score: 1

      Why do you need to understand UNIX system calls to program for UNIX? Isn't part of the point of libraries that they wrap that kind of thing for you? And surely if knowing the language the OS was written is were necessary to program for it then no-one outside Microsoft would be able to develop for Windows.

    5. Re:C, Java and Python. by Anonymous Coward · · Score: 1, Insightful

      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.

    6. Re:C, Java and Python. by Anonymous Coward · · Score: 0

      BS brother, huge geeky BS...

    7. Re:C, Java and Python. by Anonymous Coward · · Score: 0

      Being a programmer for more then 25 years, I can honestly say that the advice about learning other languages, which leads to learning how to think differently about programs is THE best advice. I didn't learn the other languages by choice, but after the third language this very concept became very apparent. And now, as the next generation of programmers come in, this is one nugget of information I pass on very strongly.

    8. Re:C, Java and Python. by Anonymous Coward · · Score: 0

      I agree use C and C++. People will find that C#, python and the rest of the wannabe languages will never gain the popularity of C and C++. If your programming in anything else your a second tier programmer using a language that is destined to die out. Look to the past and see the myriad of languages that nobody talks about anymore.

  22. English. by KimiDalamori · · Score: 1

    No, Seriously... The programming language you learned at school is worthless, and not just for Linux, either. Soon enough, there will be a new microsoft language, or at least a new version, and everything you now know will be deprecated. All languages are like this, more or less. What makes you a good programmer is your ability to understand computers and break problems down into well-designed systems; knowing a programming language is nigh-worthless, because all you need for any arbitrary language is a week and a manual. Just pick something. It doesn't matter which language. Or which IDE. Hell, you could start with bash shell scripting, it's all the same. Fiddle around with it, and once you got a feel for it, dive right the hell in.

    --
    Lagito ergo expectabo
    1. Re:English. by Chandon+Seldon · · Score: 2, Informative

      There are some languages that legitimately aren't going anywhere any time soon. This is especially true on *nix platforms.

      C, C++, Common Lisp, Java, Perl5, Bash scripts. They were here 10 years ago, and they'll be here 10 years from now.

      --
      -- The act of censorship is always worse than whatever is being censored. Always.
    2. Re:English. by PPH · · Score: 1

      Which means we can rely on them for solving problems. Instead of spending all our time chasing the language du jour.

      --
      Have gnu, will travel.
  23. C. Just C. by TimHunter · · Score: 1, Insightful

    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."

    1. Re:C. Just C. by FlyingGuy · · Score: 1

      have to agree with the parent, C is the language of *nix.. I love programming in Pascal, I use Lazarus/fpc but when it comes time to get down and dirty, to get speed or to get perfect portability, I just open up pico ( don't care for vi or emacs ) and just start coding. I keep Google handy for lib references, create a simple make file and just go.

      --
      Hey KID! Yeah you, get the fuck off my lawn!
    2. Re:C. Just C. by FishWithAHammer · · Score: 1

      Every other (modern) language is a derivative of C.

      Pascal. Fortran (yes, it's modern, still updated and still in use). Haskell.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    3. Re:C. Just C. by mabinogi · · Score: 1

      That's not actually true, Smalltalk is the language you should learn for that reason.
      Every other modern language is a derivative of Smalltalk, but abused to varying degrees depending on how much the author of it wanted it to look like C.

      C is pretty much unique - apart from the general curly brace look and feel, the things that make C, C, are not found in any other languages except those that are directly based on it (like C++ and Objective C), and even in those languages, the C specific stuff is discouraged.

      Whereas the things that make Smalltalk, Smalltalk, are found in many other languages (though not all in any single language). Classes, inheritance, encapsulation, messages, block closures, keyword messages, dynamic typing, reflection, etc.

      Chances are, that when you compare the implementation of any specific algorithm or pattern, you'll find that the Ruby, Perl and Python, and even to some degree the C++, Java and C# implementations will have far more in common with the Smalltalk implementation than the C implementation.

      --
      Advanced users are users too!
  24. Re:Java by tyler_larson · · Score: 1

    Using Java avoids most of the nastiness of Linux while preserving a solid code base.

    What's the "nastiness of Linux"? After years of development, the only difficult thing I've found in Linux (POSIX) development in comparison to Win32 is the fact that you can't wait on both mutexes and file handles in the same call.

    --
    "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea...."
    RFC 1925
  25. How about by smittyoneeach · · Score: 3, Interesting

    "all of the above"
    You really should have a good grasp of the concepts of programming languages, so that you can work with the bulk of projects that come your way.
    A little scripting, a little functional, a little procedural, a little OO, all combine to make Jack a versatile hacker.

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  26. Python is great by pbailey · · Score: 1

    And the indentation will not bother you for long and it also makes the code easy to read and enforces others to indent their code properly too.

    Also, there are lots of batteries included :-)

    Cheers

  27. I would answer to you but ... by Anonymous Coward · · Score: 0

    I'm not too sure of what I think your use of periods to delimit sentences.

  28. There is no such thing as C/C++. by loufoque · · Score: 4, Insightful

    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.

    1. Re:There is no such thing as C/C++. by Anonymous Coward · · Score: 0

      If you know C++ then you know C. You may not know idiomatic C or it's standard library, but you know the syntax at least.

    2. Re:There is no such thing as C/C++. by xzqx · · Score: 1

      This is absolutely true. C is absolutely essential to learn, but you'd do well to learn the basics of C++ as well. I've been a *NIX developer for 13 years (oh my god has it really been that long) and I've done almost exclusively C++. If you want to be employable you need to learn it. Any large-scale, multi-developer projects WILL be using it. That being said, it is such a complicated language as many posters have already pointed out. You will spend the rest of your career developing your skills in it. Here is a great set of books to get you started: http://www.amazon.com/C-Depth-Boxed-Set/dp/0201775816/ref=sr_1_4?ie=UTF8&s=books&qid=1228660512&sr=1-4

    3. Re:There is no such thing as C/C++. by owlstead · · Score: 1, Informative

      "C++ suffers from a rather poor reputation because most people don't really know it"

      As I've seen about 15 serious bugs in an array class generated by a very experienced C++ developer, I would say that it has a rather poor reputation because only Bjarne and possibly a few others really know it.

      Of course, with generics followed up by closures in Java, it might be the case that we need another language that *really* cleans up the C/C++ mess, without introducing too much complexity itself (the downfall of almost all the scripting languages that came after Java).

    4. Re:There is no such thing as C/C++. by loufoque · · Score: 1

      It's not because Bjarne Stroustrup created the language something like 15 years ago that he is some kind of C++ god. Actually I would even recommended to be careful and critical about what he says, and there are quite a few people "better" than him in C++ I would say.
      I don't get why people have a tendency to consider whoever created some programming language as the reference to use that language. Languages, but even more practices, evolve.

      There are quite a few good C++ programmers out there, I assume most posters of comp.lang.c++.moderated on Usenet are decent for example.
      It's just a matter of what the person has learnt, has he kept himself informed on what is going on in the community like the recommended practices nowadays or the latest break-through designs, etc. If he learnt "C with classes" ages ago and never evolved, even 30 years of experience won't turn the person into a very experienced C++ developer.

    5. Re:There is no such thing as C/C++. by mgiuca · · Score: 3, Insightful

      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.

  29. Workbench by symbolset · · Score: 1

    Eclipse is nice. Some people like gedit, others various versions of vi or emacs.

    /asbestos>

    --
    Help stamp out iliturcy.
  30. Oldschool by Anonymous Coward · · Score: 0

    F95 .... Seems an obvious choice.

  31. This is all true however... by Narcocide · · Score: 5, Informative

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

    Since operating system and hardware platform independence are both key factors of code re-usability and really what open source software is all about I personally think this is a strong call.

    However the parent post is correct in that application intent trumps all. If you are just writing shell tools you never intend to use outside of Linux then PERL is likely fast enough and probably much easier/faster (bottom line: cheaper) for the average developer to work with.

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

    1. Re:This is all true however... by tomhudson · · Score: 4, Insightful

      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."

    2. Re:This is all true however... by GreyWolf3000 · · Score: 5, Insightful

      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.

      --
      Slashdot: Where people pretend to be twice as smart as they really are by behaving like children.
    3. Re:This is all true however... by lamapper · · Score: 4, Insightful
      Great post...

      ... it is also pertinent to note here that the GNU standards document, section 3.1: "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

      --
      Is your Internet Throttled? Install DD-Wrt, OpenWRT or Tomato to learn the truth! Google: 1Gbps/1Gbps: 5 Communities
    4. Re:This is all true however... by russotto · · Score: 1

      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.)

      Generally any C++ on embedded devices will be a subset. Forget about the STL...

    5. Re:This is all true however... by nsaneinside · · Score: 3, Informative

      You'll also have to learn to write your own make files - not a hard job.

      It's not hard to write a simple Makefile (or Makefile.am), true. And I'll agree that GNU Make does its job -- executing commands based on dependency hierarchies -- very well.

      But sometimes, I don't want to even think about dependency hierarchies and whatnot. If you want an alternative to e.g., autotools, I'd recommend looking at CMake (http://www.cmake.org/); it can generate build systems (makefiles or IDE project files, for example) for a number of different tools (even Visual Studio!).

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

      Not sure about the perl one (I've managed to get along fine with sed and grep so far), but a good working knowledge of shell scripting and available tools is essential. `man' or `info' can help with that. ;)

    6. Re:This is all true however... by molarmass192 · · Score: 3, Insightful

      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.

      --

      Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws-Plato
    7. Re:This is all true however... by Joce640k · · Score: 1

      > 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?

      It's a function of your compiler, not "C++".

      My compiler can link individual functions, it doesn't pull in whole libraries like some of the the old ones did.

      > 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?

      The ISO standard os over ten years old now. On Windows you have VC++, on Linux g++. Both are highly ISO compliant.

      --
      No sig today...
    8. Re:This is all true however... by Tacvek · · Score: 2, Insightful

      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.)

      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
    9. Re:This is all true however... by GigaplexNZ · · Score: 4, Informative

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

      Sounds like someone needs to read up on the RAII design pattern (not to be confused with RIAA). Sensibly written C++ will automatically release memory when it is no longer used.

    10. Re:This is all true however... by tomhudson · · Score: 2, Interesting

      Not sure about the perl one (I've managed to get along fine with sed and grep so far), but a good working knowledge of shell scripting and available tools is essential. `man' or `info' can help with that. ;)

      WRT "man" - actual conversation from work last week with regard to "man 2 send" - the c function for sending via a socket:

      Me: "Look, instead of asking me all the time, just look it up."

      Co-worker: "What website?"

      Me: Use "man". It's already in the man pages on your machine.

      Co-worker: "How do I do that?"

      Me: "Try man man. Read the result."

      Two weeks ago, it was "ps" and "kill" (though not "kill -9" :-). Next week, I introduce "apropos", and grep to filter out yucky results. ... kids nowadays ... they think "mc" is a "low-level" tool. I shudder at the thought of teaching them how to make a commit to svn from a terminal .... it's like they can't read ... I have to "white-board" every explanation, or threaten to lart them. Or make them drink the coffee.

      Like naming conventions. "I know what UPPERCASE and lowercase are, but what's TitleCase? What's camelCase?" At least they grokked type_name_t for types, UPPER_CASE_IS_FOR_MACROS_AND_CONSTANTS, lower_case_for_functions(), TitleCaseForClasses,camelCaseForMethods() - AFTER I drew a picture of a camel and pointed out the hump (my camel book stays at home). Then gave some more shit over misusing leading underscores (short version - don't).

      Then we got into the whole history of "do you precede a class name with a "C" for "Class" or "T" for "Type", and how Microsoft used "CClass" to avoid naming conflicts with their competitor, who was using "TClass", and it doesn't really matter - use your initials for all I care - just be consistent (also lets us know who to blame, if they're too cowardly to include a \blame comment :-)

    11. Re:This is all true however... by mR.bRiGhTsId3 · · Score: 2, Insightful

      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.

    12. Re:This is all true however... by Anonymous Coward · · Score: 5, Funny

      Everyone programming for Linux should start with machine code! Then after that, they should learn assembly. Only after mastering this can they begin to appreciate the power of Fortran! Finally, once they have mastered Fortran, C will finally make sense. Then, 5 years of steady C development, where they achieve Nirvana-like (the band, not the state of mind) understanding of C if they begin by handwriting the C compiler in Fortran and then transitioning it into C once the compiler is able to self-compile!

      Then, only then, can you even begin to consider Object Oriented Programming. This should be jumped into arm-pit hair-first. Learn Java first -- Sun designed it to be object oriented to a fault. Then slam on the breaks, realize it's crazy, and start taking concerted steps back until you get to C++, which is C with only a modest amount of caffeine added.

      Once all of that is done, you too can begin to program in Ruby or Python, Perl, or Bash scripts. That way, you will have a solid base of high performance programming to throw away when you move into the more heavy duty interpreter languages.

      Or really, lets just damn it all to hell and learn Lisp -- functional languages is the way of the future. We can't all bother to learn what the computer is doing. If I program in a fancy-pants language like C, I might have to bother to learn how to write threads, locks, and all that crap to make my programs run fast. In Lisp, I have so little control over what's actually happening, I can just blame someone else when my program is slow.

      Yeah. Learn Lisp first.

    13. Re:This is all true however... by computational+super · · Score: 5, Insightful
      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.

      --
      Proud neuron in the Slashdot hivemind since 2002.
    14. Re:This is all true however... by Anonymous Coward · · Score: 1, Informative

      ...Object-oriented? I hope you mis-typed. You're confusing C and C++

      C is a well-designed low-level portable language which any other language can bind to.

      C++ is an unholy beast of a language which will mire you in all sorts of errors the fault of which can be placed squarely on the language designer.

    15. Re:This is all true however... by Anonymous Coward · · Score: 0

      Nonsense. Go directly to assembly.

    16. Re:This is all true however... by lamapper · · Score: 1
      russotto, Tacvek, molarmass192, Joce640K - thanks for the feedback;

      You're stoking one hell of a flame war here but here's my $0.02 ...

      I promise I was not trying to do that... Thank you all for the info, another reason to love ./

      It's a function of your compiler, not "C++". My compiler can link individual functions, it doesn't pull in whole libraries like some of the the old ones did.

      I suspected as much, about the linking individual functions, very cool.

      As you can tell from my post its been a few years since I wrote any C code. Heck I will be building a couple of Linux distros from the kernel up just to learn how its done this year for the first time ever. I am hoping I will have some time to volunteer to do some testing just to support open source!

      Perhaps I will find a reason to pick up C programming again, most of my IT jobs over the last 25 years have only required scripting with a few exceptions.

      Given the wealth of tools available now, wow....

      I have programmed in Cobol, Fortran, DB2 and a couple of other legacy languages, but only for a specific project, not for years at a time. On the PC side of the house a little Database Manager, C PM for OS/2, Basic, PHP and a few others. As far as scripting, my first was Exec and Exec 2 (IBM Legacy), than DOS Batch, Rexx, AWK, various Unix/Linux shells, Perl, ASP (I only used it in a few scripts...know its a languaage), SQL and JavaScript. I am far from an expert. However I have always been able to figure out what code was doing and how to fix it. I am just slower than many of you, in some cases, much, much slower, lol.

      Its a far cry from Turbo Pascal, MASM and some of the old PC compilers I used years ago, obviously....again thank you all for your input!

      I have always said that I could program my way out of a wet paper bag...but if its dry....could be dicey, lol!

      --
      Is your Internet Throttled? Install DD-Wrt, OpenWRT or Tomato to learn the truth! Google: 1Gbps/1Gbps: 5 Communities
    17. Re:This is all true however... by BlueCodeWarrior · · Score: 4, Interesting

      ...C++...

      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.

      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.

      The problem with PHP (and I code mostly in it for a living) is that it wasn't 'designed' at all. Originally it was just a pre-processor, and it's grown into a full blown language from there. This is all well and good, except that there's no sort of continuity to it at all. Naming conventions? (isset vs every other 'is' function starting with 'is_', etc) Who needs them? OO? Sure...ish. PHP is great for getting things done, but I certainly feel dirty after coding in it.

      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.

      Always a good way to be.

    18. Re:This is all true however... by jpmec · · Score: 1

      Yes, to the OP, if I was going to learn to program for Linux and you already know how to program in at least a couple of languages, then I would go over to www.waysmall.com and buy a gumstix. Then have a ball developing some embedded apps. You can practice your C/C++. I developed some embedded apps for microcontrollers with C++ and with the speed of the processors compared to the speed of the world around them, the overhead isn't too significant (unless you are dealing with large amounts of data, like vision). We used gcc and with the right optimization settings, you can get a simple Hello World down almost as small as the C version. However, russotto is right, anything with templates (which of course includes STL) will bloat your code (we had more trouble with memory than speed). BUT, with the rapid developments in onboard memory in the microcontrollers, this may be a mute point now and in the future.

    19. Re:This is all true however... by tomhudson · · Score: 2, Informative

      ...Object-oriented? I hope you mis-typed. You're confusing C and C++

      You know, you can write object-oriented assembler or c if you want to ... do a search and you'll find all sorts of stuff - people have been doing it for decades.

      For example, there's no reason why you can't stick function pointers in an ordinary c struct, and then proceed to use it pretty much as you would any conventional class. You just have to remember to explicitly pass "this" - a pointer to the struct - as one of the parameters, rather than have it implicitly passed (or you can have a macro do it for you behind the scenes).

      Actually, on the current c project, you'll find my code littered with stuff like "this->yadda_yadda_yadda." Works fine.

    20. Re:This is all true however... by Jeremi · · Score: 4, Insightful

      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.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    21. Re:This is all true however... by Jeremi · · Score: 4, Insightful

      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)

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    22. Re:This is all true however... by genner · · Score: 1

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

      Not nearly as dirty as activex.

    23. Re:This is all true however... by Anonymous Coward · · Score: 0

      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."

      I agree that C isn't "going away". But I have a question- what computer programming language has _ever_ gone away? I cant think of one.

    24. Re:This is all true however... by setagllib · · Score: 2, Informative

      You probably don't need to create your own refcounting scheme now that Boost shared_ptr is being folded into the official standard. It uses atomic instructions (or optionally, plain old integer) and custom deleters, so it can cover virtually any use-case, or be easily adapted to your own.

      You can partly solve cyclic references using weak references. As long as you have some top-level entry into the cycle, that can be the strong reference, and the pure cycle can be a weak reference, and you're pretty much set.

      --
      Sam ty sig.
    25. Re:This is all true however... by Alex+Belits · · Score: 1

      Sensibly written C++ will automatically release memory when it is no longer used.

      CORRECT program will release memory when it is no longer used. If it desn't do that, especially in C++, then something is terribly wrong with it, and it should not be used until it's fixed.

      However optimization is often about the very opposite of this -- avoiding freeing memory and allocating it again when exactly the same kind of object is created. Or allocating it at all -- in some situations buffers have to be allocated and accounted for using a more sophisticated mechanism than "one object -- one set of buffers" or "free the buffers when reference count reaches zero".

      --
      Contrary to the popular belief, there indeed is no God.
    26. Re:This is all true however... by darkonc · · Score: 1
      The really scarey thing is that that's pretty much the order that I worked on them.... except that Basic was kinda early on in the process. (( consider it a character-building excercise )).

      However, my first programming was done on a TI programmable calculator.

      --
      Sometimes boldness is in fashion. Sometimes only the brave will be bold.
    27. Re:This is all true however... by quenda · · Score: 4, Funny

      Everyone programming for Linux should start with machine code! Then after that, they should learn assembly.

      Thats all very well, but only after they have a thorough grounding in writing microcode. How can you appreciate and optimise machine code, without knowing how it is implemented?

      Anything below microcode is a hardware problem.

    28. Re:This is all true however... by Douglas+Goodall · · Score: 1

      I haven't seen a JOSS compiler for a while.

    29. Re:This is all true however... by Raenex · · Score: 1

      C has this elegant simplicity going for it.

      It is neither elegant nor simple, though compared to C++ I guess it would look that way. You've got C's byzantine declarations, cryptic syntactic symbols, pointer madness, goto, the C-preprocessor, unions, pea soup of signed/unsigned integer and float types, implicit conversions and casting, undefined or platform defined behavior, null-terminated strings, and the hack #include instead of a real module system.

      C has been best described as a portable assembly language.

    30. Re:This is all true however... by Anonymous Coward · · Score: 3, Informative

      True - to some extent...

      The second block structured language I learned (long ago) was Simula. I loved it instantly - it just seemed to make sense (although I understood it was not appropriate for some problems I was solving in microcode or assembly or simple applications I was writing in BASIC). Although I didn't use any languages that had a built-in notion of an "object" or "methods" or the like for another couple of decades, my C code (and code I wrote in other languages) looked much more "object-oriented" than most of the other code around me.

      When I began using C++ it seemed intuitive for the most part - once the quirks were understood - and made writing OO code easier. C++ added more checks and a consistent framework (your ctor, dtor, copy constructor, etc are pretty easy to identify -- we don't even need a shared coding standard beyond the C++ definition!). C++ is of course full of flaws, and some of those errors the compiler spits out on heavily nested template libraries are, to say the least, excessively obtuse. But, C++ is now quite portable with just a bit of care (you don't have to use every feature your current target platform supports - any more than you have to eat every last bit of food at an "all-you-can-eat" buffet -- and will be a lot happier if you don't try!). Performance, with care, is also quite acceptable for almost all purposes. I'm sure there are better languages, but IMHO, few can compete with C++ for a mix of portability, performance, and productivity - although for each of these individual three points there are many languages that can beat C++ (APL, LISP, assembly, Eiffel, SQL, JAVA etc...).

      IMHO, the biggest problem with C is that it doesn't encourage OO - you have to be aware of the wisdom of doing so and arrive at an understandable way of doing so. Therefore, too many C coders who don't care about OO don't utilize it at all in these environments and their code doesn't stand out like a sore thumb. In C++, the messes these coders create would be obvious and the coders would be embarrassed (or bludgeoned) into cleaning up their act.

      Some well known OSS projects written in C are crap at the code level -- of course the source of the problem is not C, it is the coder, but in a culture of C++ I really think the peer pressure would have been stronger to write more concise, more easily debugged, more flexible OO like code.

    31. Re:This is all true however... by bug1 · · Score: 4, Funny

      all of that crazy stuff was added to C++ because it is useful.

      If you want crazy stuff that was put there to be useful then why not use perl ?

      ducks

    32. Re:This is all true however... by johanatan · · Score: 1

      Umm, don't you mean that you use C++'s deterministic (and automatic) destruction to 'free' memory for you? What do templates have to do with it? Templates only make your code generic enough to use with many types--they do *not* help you with freeing memory (destructors do).

    33. Re:This is all true however... by Anonymous Coward · · Score: 0

      My brother works for a company that has many many servers running PHP. PHP's performance is horrible. It's a badly designed language and it's hitting its limits.

      PHP makes it quick and easy to start new projects, but once you start to try to scale up you realize you are trapped.

      Python and Django are a much better way to go. I've used Django and it is frikkin sweet.

    34. Re:This is all true however... by shutdown+-p+now · · Score: 1

      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.

      Today's C++ is actually usually faster for the same line count compared to C. The reason is fairly simple: templates. For example, a C++ std::sort can be reused with different types of containers and different comparison operators, and will be generated and optimized specifically for each combination every time. It will also get the comparison inlined. On the other hand, qsort will have to do an indirect function call for every comparison; or, you have to forgo using it, and write your own sort, and if you want to match C++ performance - you have to do so separately for every type you want to sort. Similar arguments go for containers.

      Also, exception handling with a top-level exception block is actually faster than checking every single return value for error, and returning your own error value (exceptions are slower at the point where you actually need to catch them, and much slower at the point where you need to throw them, but most of the code isn't that).

      In short, speed is absolutely not a difference to use C++ over C today. C can be preferable if you need absolute control over your runtime environment though, and don't want to keep track of all the stuff that's executed implicitly (copy ctors, destructors, conversion operators etc), or use features with unclear runtime costs (heap allocations, exceptions) - which is usually the case in embedded.

      That said, I've worked in a place where device drivers (for Win32 and Linux) were written fully in C++ (with classes, templates and all), and it worked out fine.

    35. Re:This is all true however... by Anonymous Coward · · Score: 0

      Don't forget the unknown giant. TCL/TK. It is cross-platform and have integrated GUI features.

    36. Re:This is all true however... by Wolfbone · · Score: 5, Interesting

      Or really, lets just damn it all to hell and learn Lisp ... I can just blame someone else when my program is slow.

      Nope!

      http://www.lrde.epita.fr/~didier/research/verna.06.ecoop.pdf

      http://portal.acm.org/citation.cfm?doid=1143997.1144168

      http://www.eecs.berkeley.edu/~fateman/papers/lispfloat.ps

      Yeah. Learn Lisp first.

      Good idea. :) I know /you/ were only joking but Lisp has been held back by a ton of widely believed (and massively ironic) mythology and it is very sad. The only thing really wrong with it is the lack of stuff written in/for it because of its grossly undeserved reputation.

    37. Re:This is all true however... by Anonymous Coward · · Score: 0

      So I must be missing some key insight about Objective C's memory management system

      I think you do it is called auto release pool.
      Both gnustep and cocoa do have garbage collection these days.

    38. Re:This is all true however... by jopsen · · Score: 1

      While C is great... I'd not recommend it for GUI development... If what you come from is VS.Net, and you want to make apps with a pretty UI, what you'd want to use is GTK with Python, Java, C# or maybe C++ with Qt...

      C is great for high performance things and system programming, but it was not designed to do GUI applications, while it sure is possible and you'll learn a lot about GNU autotools, it's not a pleasant experience.

      So it most certainly depends on what type of apps you wish to do... Webapps, enduser apps or system tools and backend libraries.

    39. Re:This is all true however... by Anonymous Coward · · Score: 0

      PHP vs. Python?

      Might as well be comparing turds to gold ingots.

    40. Re:This is all true however... by styrotech · · Score: 1

      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?

      You're mixing languages and platforms up a bit, and it is the implementation that usually has a bigger bearing on speed than the language itself. But don't assume PHP is automatically the fastest.

      eg with PHP, a given chunk of PHP code on mod_php is way faster than running the same code as a traditional CGI script which reloads the whole interpreter for every request. And now there are FastCGI implementations etc that can outperform Apache/mod_php a lot of the time. Then you can get into op caches etc. There will be a huge range of performance for that same code depending on how it runs. For the most part though, PHP code gets loaded for each request rather than being processed by a long running process that already has the code in memory ready to run.

      Yeah Rails has a reputation as a slow platform, and the current Ruby implementations are also a bit slower than other languages implementations too. But comparing PHP to Rails is an apples to oranges comparison anyway - you'd need to compare a full stack framework written in PHP (eg Cake or Symphony etc) to Rails for a more meaningful comparison.

      And Python is also all over the place in terms of implementation performance depending on what it runs on/as. You can run a Python script as a CGI, or using mod_python in Apache. You can run it on a Rails like framework (eg Django etc etc) with long running processes etc etc etc.

      Also Ruby and Python have multiple implementations of the language itself - eg IronPython and IronRuby on .NET, Jython and JRuby on Java. These .NET and Java implementations show some promise, and don't have the threading limitations that the native Ruby and Python implementations have. There also seem to be a bunch of other experimental implementations as well.

      And then most web app performance usually ends up being limited by the database anyway.

      And to finish off here's some probably meaningless benchmarks: PHP vs Python Python vs Ruby Ruby vs PHP

    41. Re:This is all true however... by CBravo · · Score: 2, Insightful

      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.

      --
      nosig today
    42. Re:This is all true however... by Anonymous Coward · · Score: 5, Insightful

      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...

    43. Re:This is all true however... by Anonymous Coward · · Score: 0

      Where does C++ fit in

    44. Re:This is all true however... by Anonymous Coward · · Score: 0

      compilation of C into IL, IL into assembler

      So... I guess you're still in the early stages of your mandatory C time?

      C is commonly compiled into native code, not some intermediate language byte code. The intermediate stages stay within the compiler

    45. Re:This is all true however... by Anonymous Coward · · Score: 0

      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.)

      For the embedded question: The bar for embedded cores has risen enormously over the years. Cellphone processors are considered embedded and they run full OSs, with Java and Flash (cringe, just finished a Flash app for cellphones) running smoothly.

      However, for what old-timers still consider embedded (or what hobbyists still can affordably develop for and buy), iostream alone often is as large as your programming space (heck, printf is often too large, look at the reduced stdio options SDCC offers...and you still have to write your own putchar for those to work!). Again, this is changing fast (Assembly is quickly fading away in favor of C), but C is still king, by a wide margin.

      As for performance,

      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?

      You're not accounting for programmer efficiency. In the same number of hours, many programmers would make better code in python than in php. Keep in mind that if your main goal is efficiency, you can write your cgi in C. And Yahoo Stores was originally written in LISP, for programmer efficiency reasons, and the way Paul Graham tells it, that was their winning point.

    46. Re:This is all true however... by Lennie · · Score: 2, Funny

      "[Nicole] Kidman was trying to shake zombies off the bonnet of her Jaguar when the car spun off the road."

      The first time I read this, I thought it said botnet and thought: I didn't know there were botnets with Mac OS X (Jaguar).

      --
      New things are always on the horizon
    47. Re:This is all true however... by Lennie · · Score: 2, Informative

      "there's no reason why you can't stick function pointers in an ordinary c struct" Actually, I think the Linux-kernel does this.

      --
      New things are always on the horizon
    48. Re:This is all true however... by Anonymous Coward · · Score: 0

      Urgh, I'm constantly presented with unreconstructed C programs who's code is littered with #defines and arrays, and self written poorly optimised sort functions. Honestly, if you're doing embedded programming C /might/ be the way to go, and it's is a reasonable language to learn about computer architecture with, but it's not a good fit for modern applications. Learn C++, write object orientated code and use the Standard Template Library, do it right and you'll be writing clean/fast maintainable code and developing a skill that's in demand. I'd recommend starting with "Accelerated C++": http://www.acceleratedcpp.com/

    49. Re:This is all true however... by Adam+Hazzlebank · · Score: 2, Informative

      This is absolutely, Object Orientated programming is not a language feature it's a programming methodology. Certain languages have facilities that help support that methodology that's all.

    50. Re:This is all true however... by alienw · · Score: 1

      Using vanilla C is also a great recipe for shitty programs. It's really far too low-level of a language for day-to-day programming, and most programs written in it tend to reflect that. I can't count how many open-source programs I've seen that were obviously crippled by the choice of C as the language. C was great in 1978, but this is the 21st century, and if you are using C, it's definitely time to move on.

      Figure out how to do object-oriented programming in C++, and use that. Trying to write complex programs in C always results in a horrifying, buggy mess. It's a fact of life for things like kernels, but it's simply the wrong language for normal desktop apps. I want to strangle someone when I see people still using return codes to indicate exceptions, various messes involving void pointers, and other messy, unsafe ways to do simple things.

    51. Re:This is all true however... by Anonymous Coward · · Score: 0

      But this captures only a tiny portion of C++ capabilities such as those which allow effective support of RAII. True, at the kernel level, exceptions (in the C++ sense) make little sense (I think), but at the systems applications level (servers etc), OO C is really a poor-man's C++ and looks like it.

      I can't see using C++ for much of the kernel - that's just too strange. But, for most "applications" (including entities in the class of apache, postgres etc), I'm convinced C++ would result in more stable, more performant systems -- efficiency, in part, comes from how much performance analysis time the programmer has left over after the coding is done.

    52. Re:This is all true however... by alienw · · Score: 1

      C has this elegant simplicity going for it. There's nothing the matter with C++...except that C is (pretty much) perfect.

      You really should learn C++. Yes, C is really simple, but it's not a good language. At all. Unless you are doing low-level programming, C is probably the wrong choice. I mean, how the hell can you write a program these days without OOP, exceptions, generic containers/algorithms, and user-defined data types? I mean hell, C can't even deal with strings in any reasonable way.

    53. Re:This is all true however... by turgid · · Score: 1

      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...

      Once again the AC speaks the truth.

    54. Re:This is all true however... by Anonymous Coward · · Score: 0

      what is your age?

    55. Re:This is all true however... by Anonymous Coward · · Score: 0

      Actually, that's exactly what GCC does. The C front end generates an IL which is then compiled by the backend into assembly, which is then assembled and linked. It's how GCC can support multiple languages (C, C++, Fortran, Java, D etc.) without duplicated all that code generation for multiple CPUs.

    56. Re:This is all true however... by IamTheRealMike · · Score: 1

      For what it's worth, nearly any large, professionally written high performance codebase is done in C++ these days. Consider programs like the Unreal Engine, the Google search engine, Firefox, any 3D video game ... all written in object-oriented modern C++.

      If you want to work on interesting codebases in a job, I'd definitely master C++. It covers a few different ways of programming, but if you know C++, one scripting language (eg Python) and one functional language (no need for lots of depth), you've got a good foundation as a programmer. I'd note that if you learn C++ Java is simply a matter of getting familiar with the libraries - it's largely a subset of C++.

    57. Re:This is all true however... by Anonymous Coward · · Score: 0

      Umm... since when does C compile into IL ?

      Currently that's a trait of Java, C# and a few others, but C is C until it's converted to assembly for the final optimization pass, assembly and linking.

    58. Re:This is all true however... by Anonymous Coward · · Score: 0

      Why do you need to understand this? An application programmer might need this knowledge, but a casual programmer won't. And most application aren't performance critical anymore on modern hardware anyway. For those all this knowledge is totally unnecessary. I'd rather have programmers who write maintainable documented code than programmers who write unreadable undocumented code that lowers the CPU usage from 5% to 4%.

    59. Re:This is all true however... by Micah · · Score: 1

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

      Look at alternatives before using PHP! I'm enjoying mod_python. You can also get this book and just learn to write webapps in C!

      I used to code PHP but now see it as just ... ugly.

    60. Re:This is all true however... by brainnolo · · Score: 3, Informative

      You say that you have only done a bit of Obj-C programming. The problem is that for small programs retain/release is much like malloc/free, but in bigger projects it becomes a life-safer. The conventions are very easy, even if you throw some CoreFoundation object in the equation.

      The main difference between retain/release and malloc/free is that with retain = "I (object calling retain) need this object to stick around" and release = "I (object calling release) don't need this object anymore". Instead malloc = "create this", free = "nobody else in this process needs this". You can see yourself that while is usually trivial to determine if an object needs something it is referencing or not, doing so for the whole process everytime you try to get rid of an object is painful.

      Note that now the Objective-C runtime offers garbage collection (except on the iPhone), which is of course a good step forward.

    61. Re:This is all true however... by Anonymous Coward · · Score: 0

      One "major" issue with C++ is that it is incompatible between compilers. You can not use C++ libraries compiled with gcc inside VisualStudio for example. Look at e.g. the Windows builds of KDE to see the fun. No such problems with C.

    62. Re:This is all true however... by kmsigel · · Score: 1

      >Can you compile C++ down small enough to use
      >in embedded devices?

      I use C++ (GCC) for embedded use. With these compiler flags you get sufficiently small (by x86 embedded standards) code:

      -I. -O2 -fomit-frame-pointer -fno-rtti -fno-exceptions

    63. Re:This is all true however... by Hurricane78 · · Score: 2, Insightful

      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. :)

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
    64. Re:This is all true however... by Anonymous Coward · · Score: 0

      Have you ever ported a C app from a big-endian architecture to a little-endian one? It works on all platforms until you have to move it off of an Intel box...

    65. Re:This is all true however... by wootest · · Score: 1

      Just to clarify (because it's not clear from the parent, which means it's not even clear if the parent had them confused): The autorelease pool is not the same as a garbage collector.

      The autorelease pool is an opt-in way of saying "add this to a pool of objects that can be released and fully deallocated at a later date *unless* it is retained later on". You can create several autorelease pools, and the "closest" pool in terms of scope is always used, so if necessary (which it is in some convoluted scenarios involving object dependencies) you can create a local pool, do your thing and then release the pool, which releases every "autoreleased" object within the time it existed.

      Basically, autorelease just says "do release this, eventually, if nothing else happens". Beyond managing some corner-cases, it provides a GC-like way of writing convenience methods to return objects where neither you nor the callee have to worry about who owns the object.

      The autorelease pool existed before GC, but wasn't around from the start. In Cocoa, it's a no-op when the GC is on, along with retain and release. Which makes sense, since it's not culling the heap for dead objects or anything, it just delays sending the right number of "release" messages.

    66. Re:This is all true however... by gbjbaanb · · Score: 1

      true, in fact the earliest C++ "compiler" was a translator tool that turned C++ into C code to be compiled by a C compiler (ie before there were C++ compilers). Look up cfront for details.

      Personally, I never code C anymore, I always use a C++ compiler with handy stuff like the STL.

      As long as you export functions wrapped with "extern C" no-one using your code will ever need know you've done that. (ok, this assumes you're working with shared libraries/dlls and not re-using code directly).

    67. Re:This is all true however... by gbjbaanb · · Score: 1

      CORRECT program will release memory when it is no longer used. If it desn't do that, especially in C, then something is terribly wrong with it, and it should not be used until it's fixed.

      there, fixed that for you. You can even replace "C" with any language you care to mention, including the ones with garbage collectors and the statement is still true.

    68. Re:This is all true however... by gbjbaanb · · Score: 1

      I'd say there might have been a performance difference in the languages, back when a function pointer lookup was considered something to optimise away.. but I think the biggest problem was the people. The people who suddenly got hold of C++ and decided they must use objects, and did so...

      Reminds me of the Windows Explorer team when they were writing it for Windows 95. Suddenly they were told the platform had threads, so they should use them in explorer. End result was a thousand threads running all the time, one for each little expand button in the tree view, etc etc. They re-wrote large chunks to make it perform badly (ie the previous version didn't, as you'd expect).

      The problem there wasn't that threads are bad, but that overuse and poor design cosiderations are the problem. The same applies to misused features of C++ (and any language), like an object for everything.

    69. Re:This is all true however... by tomhudson · · Score: 1

      Have you ever ported a C app from a big-endian architecture to a little-endian one? It works on all platforms until you have to move it off of an Intel box...

      If you're writing networked apps, you already write things like htonl(), and should be aware of byte-order issues.

    70. Re:This is all true however... by msclrhd · · Score: 2, Informative

      The key thing here is that C has a well-defined stable ABI that you can use to interact between different versions of a compiler, even different compilers. In C++ it is possible to do this on some level (look at COM, for example), but this does not work at the larger level.

      Looking at Qt3 (don't know if they've fixed this in Qt4), but the interfaces don't have virtual destructors. They can't fix this as it will break program ABI, and not having it opens up to bugs (derived destructor not being called when deleting a pointer to a base class).

      And don't get me started on the number of string classes there are, that don't work well with each other that you have to convert back and forth between.

    71. Re:This is all true however... by msclrhd · · Score: 1

      I want to strangle people throwing exceptions over Windows COM boundaries, but hey, you can't have everything!

      Seriously, exception handling in C++ is a good idea, however they can be a problem if they leak over process boundaries (COM, etc.) or are thrown outside a destructor. Also, have you tried giving a sensible error message to an exception that just reports "access denied", and not what was denied access.

    72. Re:This is all true however... by Anonymous Coward · · Score: 0

      Using cmake can even ease the makefile problem...

      And for C++ there's Boost, which let's you be pretty cross-platform.

    73. Re:This is all true however... by mcoon · · Score: 1

      C, C, C... My word. Doesn't anyone actually care that C's standard libraries are a pale shadow of C++'s? And as for any perceived performance hit, you get a ~12% size hit with no speed hit.

      My recommendation is to start in C++, a superset of C, and when necessary, step down to C.

    74. Re:This is all true however... by nobaloney · · Score: 1

      Everyone programming for Linux should start with machine code! Then after that, they should learn assembly. Only after mastering this can they begin to appreciate the power of Fortran! Finally, once they have mastered Fortran, C will finally make sense. Then, 5 years of steady C development, where they achieve Nirvana-like (the band, not the state of mind) understanding of C if they begin by handwriting the C compiler in Fortran and then transitioning it into C once the compiler is able to self-compile!

      Then, only then, can you even begin to consider Object Oriented Programming.

      This sounds like the stages I went through, except that I did a lot of BASIC somewhere between Fortran and C.

      When it was time for me to do Object Oriented Programming I was fairly lucky; at about that time Borland brought out a version of Turbo Pascal that implemented it fairly well.

      The rest is history (or rather, mystory.

    75. Re:This is all true however... by tietokone-olmi · · Score: 1

      You could also just learn to also consider object lifetimes like smart people do. Calling free() or delete or [release] in that case becomes far less of an ordeal, and makes your code's behaviour far more predictable.

    76. Re:This is all true however... by BlueCodeWarrior · · Score: 2, Insightful

      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.

    77. Re:This is all true however... by Anonymous Coward · · Score: 0

      How about Clojure (http://clojure.org/).

    78. Re:This is all true however... by lamapper · · Score: 1

      You know, you can write object-oriented assembler or c if you want to ... people have been doing it for decades.

      This comment is not about asembler or object-oriented but rather, coding something if you want to...read on and I hope a few people are amused...and if you see yourself here, I would think your programming skills are pretty amazing as I probably would never take the time to do this.

      But first a short story...

      A direct report of mine in a college environment (so he was a college student, had the time and was not working, nor had a family yet) had been doing some interesting master - slave programming, using an IBM Model 80 as the Master machine and using a Min/Max algorithm to control a couple of hundred slave machines...using a Novell network running on an Arcnet Token Ring and Ethernet topology...yea it was years ago... He and two others were working on coding the Game Othello to play against other competitors. The rules: use any computer(s) you have access to, to play Othello and win. Make your move in a given time frame.

      Teams would call each other via phone, make their move, tell the other team what the move was and then the other team would have a time limit to make their move and so forth until the end of the game was reached. If you did not make your move in the given time frame it was considered a forfeit. I do not remember what the time frame was.

      I made arrangements for them to have access to either 100 to 200 (memory...) of our lab PCs for use in the competition on game day. They figured that an IBM Model 50z could do 6 times the work of an IBM PC so they sent 6 times the work to the IBM Model 50z. They had access to one IBM Model 80 (386 processor) some IBM Model 50z (286 proc) and a bunch of IBM PCs (4 Mhz, 8088). I do not think there were many IBM Model 70s available to them, but I digress...

      In the first round they got beat by a super computer, a cray, that ended up winning the competition.

      A week later they found an error in their algorithm and believed had they had it fixed they might have had a shot at the Cray...

      End of story, what your comment made me think of:

      Either before or after that event he decide to write the Knights tour in every language he could get his hands on: Pascal, Fortran, Watfiv, Cobol, Assembler, C, Basic, and a few others that I can not recall at the spur of the moment. He had access to IBM PC clones, MacIntoshs and an IBM Mainframe.

      He told me his most challenging attempt was writing it in DOS Batch scripting language. He said he had to cheat (could not do it all in memory, which he was trying to do it all in memory) and write to and read from disk files in order to get it to work. I believe it was the only way he could get DOS Batch to mimick recursion, but am unsure as its been a few years.

      I remember being very impressed, wishing I took the time to gain that knowledge, however at the same time thinking I would probably never be doing that. I was happy to be able to call him friend.

      Years later and the only language I have written the Knights Tour in was PLC and yes that was in college for me, forced me to learn recursion and recursive calls. I remember being blown away and confused about APL code as well...so much in a itty bitty living space. I was using Punch cards back at that date to submit my Knights Tour running in PLC.

      --
      Is your Internet Throttled? Install DD-Wrt, OpenWRT or Tomato to learn the truth! Google: 1Gbps/1Gbps: 5 Communities
    79. Re:This is all true however... by horza · · Score: 1

      Me too. I started with machine code, moved to assembler, then BASIC, C, Java, PHP, Python, etc. Of course I had to learn other languages at University, including ADA, Pascal, and Haskell.

      If you want to learn machine code or assembler I recommend picking up a cheap 8-bit computer from the 80's rather than trying under Linux. They are choc full of tools, including stepping debuggers, and the OS is simple and in ROM so you can't crash the machine and it's easy to track what is happening. I can recommend the BBC Micro, which I learned on.

      If programming for pleasure then I would personally recommend C and Python. As posters have mentioned above, the former is very easy to learn and will force you to learn the principles of any OS (structures, memory allocation, etc). Python is a very productive OO language and simply nice to program in.

      Perl is too messy and Ruby too obscure. Functional languages are rarely used outside of academia so don't bother with Lisp (I know the poster was joking (well I think he was (though you can have fun writing some Eliza type AI apps (but then you can in other languages without having to learn the functional paradigm)))).

      Phillip.

    80. Re:This is all true however... by BCBirdman · · Score: 1

      I first did programming back in the early 1980s in London on a BBC-B Micro and an Apple 2 (Both 6502 based), learning structured Basic and Pascal. After that, I did a lot of 6502 machine code(BBC-B embedded in Basic/AIM65 - on EPROM), also 68008 machine code(Atari 520ST). Around the early-mid 80s, I seem to remember hearing the phrase "Lisp.. is the way of the future", but what happened? It went off like a damp firecracker! I seem to remember something about Polish Logic!, but never took to it, or liked Lisp.

      Since I have forgotten everything, I am going back and learning C, then Borland C++ (Ver. 4.5). Maybe later I'll tackle Visual C++/C#/ASP.net, as jobs are easier to find around here with the later.

      I'm a member of (VANTUG), the MS people keep trying to tell me to go for C#, but I'm not brainwashed by all the MS hype. I still prefer Linux based systems(my 1st PC ran Linux Slackware 3.1, and MS-DOS 6.22), and languages.

      In 1987, I had a Motorola 68000/68020 VME 19" 2U Development system until nine years ago when I emigrated to BC, Canada. I expanded that system with a couple of Force MC68020 and MC68040 processor boards Sadly, I had to leave everything behind in the UK.

      Learning high level structured languages like Basic and Pascal helped me immeasurably, giving me the skill and confidence to tackle more complex programming. Modern Intel processors are way more complex, and assembler on these is not for the faint-hearted. If you are at University it may not be so bad, but good luck what ever you decide.

    81. Re:This is all true however... by rrohbeck · · Score: 1

      Everyone programming for Linux should start with machine code! Then after that, they should learn assembly. Only after mastering this can they begin to appreciate the power of Fortran! Finally, once they have mastered Fortran, C will finally make sense.

      That's pretty much how I learned, except that there was also some BASIC on Commodore machines in there. You can probably leave out FORTRAN these days, but starting on the bare metal isn't wrong at all. I don't know if there's still bare bones single board systems like the KIM-1 or AIM-65 available these days but they'll give you a real understanding of how a microprocessor actually works. Doing this kind of stuff during HS (and, yes, FORTRAN on a mini) gave me a significant head start on all the other CS students who had only a high level view of computers.

    82. Re:This is all true however... by rrohbeck · · Score: 1

      Not all that wrong. Loadable microcode on a Prime 550... yum! Problem was, the machine didn't have enough microcode space to load the COBOL and the C-optimized microcode so when both types of programs were running it had to swap microcode during context switches.

    83. Re:This is all true however... by rrohbeck · · Score: 1

      in a culture of C++ I really think the peer pressure would have been stronger to write more concise, more easily debugged, more flexible OO like code.

      I've seen enough crappy C++ OO code to repudiate that, starting with code that wraps trivial data structures into objects with getters and setters just because the person who wrote it didn't learn anything else (or wanted to show off?), or turning something that would be easy at the char level with a few stdlib calls into a templated list and using STL iterators on it.
      You can write crap in any language and under any programming paradigm. If all you know is a hammer then any programming problem will look like a nail. Having a large repertoire and choosing the right tool for the job is what makes a good programmer. C, C++, sh, Perl and Assembler is what a good Linux programmer needs.

    84. Re:This is all true however... by TheEldest · · Score: 1

      What?

      Are you a self proclaimed phisher of men?

    85. Re:This is all true however... by lamapper · · Score: 1

      My brother works for a company that has many many servers running PHP. PHP's performance is horrible. It's a badly designed language and it's hitting its limits.

      PHP makes it quick and easy to start new projects, but once you start to try to scale up you realize you are trapped.

      Python and Django are a much better way to go. I've used Django and it is frikkin sweet.

      I definitely plan to checkout Python...heard many good things about it and have noted Django also to check out in the future, thank you.

      I probably will regret putting this in, as many will think I am trying to start a flame war, however I am not, I am very interested and curious about improving server performance no matter what is running on them. And I believe given time and money, anything can be made to scale, though you have to consider the cost.... Unfortunately we often do not have enough of either.

      My brother ... company ... many many servers running PHP. PHP's performance is horrible. ... hitting its limits.

      ...but once you start to try to scale up you realize you are trapped

      And we don't have to be just language specific as I have seen replies (here on ./ and other websites) to all most if not all of them...

      I continuously hear that this language, this tool, or this database, etc... will not scale, only to have another person come on and explain how they got it to scale handling multiple millions of requests or with multiple hundreds of terabytes of data... (I really enjoy those posts!)

      So one person was not able to get it to scale, yet another individual did...

      I have seen the impossible made possible too many times in my short career to accept that...

      Because of all the people who can pretty much make anything scale, I tend to be a little skeptical, so please forgive me and please understand that this is NOT a personal attack at all, only a weak attempt to make some observations from personal experience...

      Without knowing if your brother's company dotted all the i's and crossed all the t's can we really be sure. Besides while a system admin, network engineer or systems engineer might want to take the time to look at all the options, the needs of the business (and wants of a Manager, experienced or not) usually come first.

      When I was the sys admin at a telco, if I did not take whatever free time I could scrounge together to do base lining and tweak system performance it was always considered by management to be an extravagance. Definitely always and after thought. While I have never agreed with that perspective, when your boss tells you to drop it, you do that. (and hope when you are the boss you will have budget to do those things, but realize you probably will not...) And in a case like this I admit that time is money. (I still want to use some time, usually my free time, to uncover the truth about performance issues. I just wish it was not always my free time and life outside of the company that had to suffer to do that.)

      Add in that there are multiple bottlenecks to performance that are often not known until some other bottle neck is removed, well it just makes me skeptical.

      Again not a personal attack, but rather an observation based on feedback right here on ./

      I remember one person saying something would not scale, and another person said oh yea it will, sometimes they add a resource or split a resource from one to many, but they always manage to find a way to reduce the load and increase performance, thus it continues to scale just fine - because they figured out a way to do it.

      At least with open source solutions I can throw another server at a problem cheaper than with any other proprietary solution. If I have the hardware already lying around all the better.

      Take any t

      --
      Is your Internet Throttled? Install DD-Wrt, OpenWRT or Tomato to learn the truth! Google: 1Gbps/1Gbps: 5 Communities
    86. Re:This is all true however... by bXTr · · Score: 1

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

      First, the wheel, made out of stone, was invented. Then, it was made out of wood. Then, they added a metal ring around the outside to improve wear. Then, they added a rubber strip around the outside to improve traction. Then, it was made out of metal with an air-filled rubber tire. Then, grooved tread was added to the tire to improve traction. Then, steel belts were added in the manufacture of the tire to improve its life and durability.

      In other words, just because something was made does not mean it cannot be made better.

      --
      It's a very dark ride.
    87. Re:This is all true however... by TERdON · · Score: 1

      Anything below microcode is a hardware problem.

      Why not a bug in the VHDL code?

      --
      I have a really elegant proof for Fermat's last theorem. If this sig was only a bit longer...
    88. Re:This is all true however... by jesterzog · · Score: 1

      ... 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 read that in the GNU coding standards a couple of years ago and thought that it seemed very dated and not well argued. It reads as if it's saying "use C for everything because GNU doesn't want to support anything else and people shouldn't have to install a non-C compiler". The GNU explanation assumes that most users still compile their own software, and it mostly ignores that there are also quite a few compelling reasons to avoid using C, depending on what you might be doing.

      C definitely has it's place. It's an important language to understand, especially for anyone planning to compile and/or use libraries commonly found in Linux-based distros, or most of UNIX for that matter.

      Under various circumstances there are still good reasons to use C, but it's definitely not the only significant language out there today in Open Source development. If the story submitter wanted to write graphical KDE software, it'd be more important to learn about QT and (probably) the C++ interfaces to QT. Personally I think it's reaching a state where for many kinds of Linux and UNIX development, after reaching a certain point, understanding specific languages isn't as important as understanding the libraries and APIs and how they interact.

    89. Re:This is all true however... by Anonymous Coward · · Score: 0

      Thirty-four. No, thirty-fi-- Auuuuuuuugh!

    90. Re:This is all true however... by Anonymous Coward · · Score: 0

      There is nothing wrong with leading underscores.

    91. Re:This is all true however... by Anonymous Coward · · Score: 0

      Writing your own Makefiles? Gah no, we really are over that. autotools, cmake, take your pick, but handwriting is out.

    92. Re:This is all true however... by tomhudson · · Score: 1

      There is nothing wrong with leading underscores.

      Read the standard. Leading underscores have always been reserved for the implementation in ANSI C, so unless you're writing the compiler itself, your code is flat-out wrong.

      From my library: C - A Reference Manual, Harbison, Samuel P., and Steele, Guy L., Jr

      Section 2.5 Identifiers.

      In addition to avoiding the spelling of reserved words, a C programmer must guard against inadvertently duplicating a name used in the standard libraries. ANSI C specifically reserves these identifiers for their indicated uses, and further reserves for implementations all names beginning with an underscore; programmers should avoid creating such identifiers

    93. Re:This is all true however... by vivian · · Score: 1

      I dont know about boost, but I have been using the SDL libraries for a stupid 3d multiplayer asteroid game I have been hacking around with. It's using opengl, threadding and networking, all through the SDL libraries.

      There's exactly one #ifdef used so far, to use getcwd() which is defined in windows instead of .

      The exact same source files compile and run on Windows and Linux. I have yet to try it on a mac, but from what I have seen so far it should be no problem.

      As for IDE, I have been compling it using GCC and the code::blocks gui on Linux, and visual studio on windows, with a separate project file/solution for each.

      Works great so far.

    94. Re:This is all true however... by Hurricane78 · · Score: 1

      I think - to follow your car analogy - what I wanted to say, was:

      I build cars!

      (Not wheels.)

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
    95. Re:This is all true however... by BigGar' · · Score: 1

      Sweet baby Jesus, There's someone else out there in the Slashdot microcosm that's at least heard of Pr1me computers. I learned COBOL on one of those in the late 80's.

      PMED Rules!!!! (The Pr1me text Editor, for those of you that don't know)

      --


      Shop smart, Shop S-Mart.
    96. Re:This is all true however... by andhow · · Score: 1

      Yes, as the experiments clearly show: as long as you write tiny numerical computations and programs that require code-as-data anyway. You know, with a little static analysis and trace-based loop unrolling, even JavaScript could beat C, for tiny programs. I'm not saying LISP hasn't grown by leaps and bounds since when its reputation was forged (if for no other reason than improvements in GC technology), but toy examples aren't going to convince anyone.

    97. Re:This is all true however... by Anonymous Coward · · Score: 0

      Perl also comes with obfuscation built right in to the language.

    98. Re:This is all true however... by Wolfbone · · Score: 2, Interesting

      Yes, as the experiments clearly show: as long as you write tiny numerical computations and programs that require code-as-data anyway.

      Those papers do not show, and their authors do not state, that such a qualification is justified...

      toy examples aren't going to convince anyone.

      ...and if they had, they'd have made laughing stocks of themselves:

      http://www.lispworks.com/success-stories/raytheon-siglab.html
      http://www.franz.com/success/customer_apps/eda/amd.lhtml
      http://www.franz.com/success/customer_apps/data_mining/itastory.php3 (also: http://www.itasoftware.com/careers/l_e_t_lisp.html?catid=8 )

      etc.

    99. Re:This is all true however... by andhow · · Score: 1

      Those papers do not show, and their authors do not state, that such a qualification is justified...

      It is the absence of the qualification that requires justification.

      I am not trying to knock Lisp, just the extrapolation of overall performance from small examples. Your next three examples are delightful examples of Lisp's viability and its positive effects on programmer of efficiency but with excerpts in #3 like:

      "We use Lisp for the high level structure, in conjunction with a variety of other languages such as C and Java throughout the application."

      in a system where it is clearly preferable to use Lisp, I can only guess that in the parts that were written in C or Java, the performance penalty of Lisp must have been significant.

    100. Re:This is all true however... by Wolfbone · · Score: 2, Interesting

      It is the absence of the qualification that requires justification.

      Why would the Lisp compiler do well on 'small' examples, like the C compiler does, but underperform it on 'larger' examples? Perhaps there are reasons to expect such behaviour but rather than answer a comp. sci. illiterate like me, if you really believe the authors of those papers have been making such serious errors I think you should write your own paper. And if you haven't got the time or inclination to do that, perhaps you could at least explain your criticisms to these fellows: http://books.google.com/books?id=8Cf16JkKz30C&pg=PA21&lpg=PA21 They appear to have used similar reasoning - toy examples and extrapolation - and it looks like they're embarking on a major project to make a better performing R-like system with Common Lisp. But if Lisp really doesn't scale up well, that could turn out to be a futile ambition and a horrible waste of time of course.

      but with excerpts in #3 like: ... I can only guess that ... the performance penalty of Lisp must have been significant.

      Our QPX search engine is engineered for speed, speeds that must not be lower than using C and where huge amounts of data must not be bigger than packing them in C structs. Still, QPX is very complicated, and driven by individuals who write large bodies of code. Lisp allows us to define a wide variety of abstractions to manage the complexity, and at the same time we get the speed we want. Once QPX is compiled, one cannot easily tell the machine code from the machine code compiled from C.

      (from the other ITA link)

      Of course you may have guessed right about ITA's case anyway (and undoubtedly there do exist situations in which Lisp is inadequate for performance reasons - even C is sometimes) but whatever the reasons ITA have for using C and Java as well, there are no similar excerpts in #1 or #2 (or in other examples) and it seems to me they are hardly 'toy' examples.

      I am not trying to knock Lisp

      Sure - you're just knocking the papers I linked to - and it seems to me that is just as well considering there are at least some anecdotal 'real world' counter-examples to your Lisp performance worry stemming from your (possibly justified) criticism that extrapolation from those papers' findings is, at least logically, invalid. I have always found Lisp easily adequate performance-wise for my own use - but that's just anecdotal too of course.

    101. Re:This is all true however... by andhow · · Score: 2, Interesting
      Compiler optimization uses static analysis to find program invariants which allow the compiler to remove run-time overhead, thereby achieving efficiency. To do this, the analysis must examine all possible control flow paths. Increasing the size of a program can only add more possible executions to examine so, almost by definition, making a program bigger can only hurt optimization. When a program is small enough, you can express practically any invariant in the world in predicate logic, use weakest preconditions to derive necessary conditions for these invariants to hold, and throw the resulting implication to an automatic theorem prover! But of course this method doesn't quite scale. To see a classic example, look at automatic parallelization. They have had it solved for toy examples for years!

      ... your (possibly justified) criticism that extrapolation from those papers' findings is, at least logically, invalid.

      If you have ever worked with static analysis, my criticism is vacuously true.

    102. Re:This is all true however... by Wolfbone · · Score: 1

      If you have ever worked with static analysis, my criticism is vacuously true.

      Hehe! Indeed I haven't. However, I'm sure the Lisp compiler folk have and though I don't really understand what their compilers are doing even after reading about them (e.g. http://common-lisp.net/project/cmucl/doc/CMUCL-design.pdf (somewhat dated now)), fortunately they do seem to work very well. I see the validity of your criticism now but I don't expect (or find in practice) the modern Lisp compilers to be noticably any less clever than e.g a modern C compiler.

    103. Re:This is all true however... by dubl-u · · Score: 1

      This is an excellent rant.

      However, Java is not actually OO to a fault. A fair number of its faults are where it breaks the OO model either for convenience or through ignorance. But Java's biggest fault is that it wasn't created for the language creators to program in. It was created so that lesser developers could be kept from doing "dangerous" things.

    104. Re:This is all true however... by Anonymous Coward · · Score: 0

      ...but you also need to understand how the hardware works.

      It all comes down to physics, really.

      Learn basic science, dude. And only then, you may consider becoming a programmer.

  32. Re:Java by walshy007 · · Score: 1

    java as a language is decent, but some people hate having to have their code run in a virtual machine, and the performance penalty that entails.

    Yes I know of gcj and that is coming along nicely, but still the predominant thing nowadays is still vm and JIT compilers.

  33. Ruby or Python or C by Roadmaster · · Score: 1

    Don't let Python's weird indentation turn you off. Try it and you'll either like it or hate it. I know the indentation gives me brain cramps, but I also know that I'd learn it quickly should the need arise; and also, I'd rather learn Python from scratch than become proficient in Java.

    Ruby is an awesome language to learn and work with, and is my current favorite; but you'll struggle a bit with the documentation, you'll live under Rails' shadow all the time, and its raw performance is still a bit on the slow side.

    Both Ruby and Python cover a wide range of applications, from command-line scripting (where Perl would usually be the tool of choice) to GUI programming to web programming (think Rails or Django, the usual domain of PHP). I'd be wary of tackling a massively parallel programming project in either one of these two, though.

    Other than those two, your C# and Java background will come in handy should you wish to learn C++ or C, which are powerful, if unforgiving languages that require more elbow grease to get things done than Ruby or Python.

    1. Re:Ruby or Python or C by Anonymous Coward · · Score: 0

      I agree with most of things youre saying, but when it comes to XML Python sucks!

      C#, Java and Ruby all have true XMLBuilders. Creating XML's is a friggin pain in Python :(

  34. Comment removed by account_deleted · · Score: 0

    Comment removed based on user account deletion

  35. Please try to keep up. by John+Hasler · · Score: 2, Funny

    Erlang and Haskell, of course. Just the other day here Intel told us all how only functional programming can save Moore's law.

    --
    Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  36. Python, Ruby, Perl by kabloom · · Score: 1

    Python, Ruby, and Perl all seem to have pretty much the same goals and the same uses, but with very different styles. Pick your favorite, and don't let anybody get you down about your choice. In the long term, you should know your way around all 3, because you need to edit or understand other people's code written in these languages.

    Also, you should definitely know your way around in C, even if you don't enjoy programming in it, even if you don't want to use it for anything big.

  37. recommended languages by hedrick · · Score: 1

    I started to reply, and then realized that I agree with rjh. So I mostly second his remarks.

    Some of it depends upon what kind of work you think you'll be doing. For prospective web applications programmers, I'd put PHP high on my list, and enough Java that you can look for jobs in both the .NET and Java worlds.

    Note that Java is very, very similar to object-oriented .NET programming. If you're doing .NET the right way there's no reason to be scared of Java. .NET is a Java clone, changed just enough that it isn't quite compatible with Java. But in most cases the same facilities are there with the same names. The differences are primarily in the interface to the outside world: GUI programming for desktop and the way it interfaces to the web server for web applications.

    In terms of long-term learning, the disadvantage of tackling Java now is that it's not as different from .NET as some of the other things mentioned, so you won't learn as much. This assumes you're doing good object-oriented .NET. But in terms of practicality, it's one of the important application development languages.

  38. Re:Java by Matheus · · Score: 5, Insightful

    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

  39. C++ / g++ by Anonymous Coward · · Score: 0

    I don't do much practical programming [Just CS homework and the occasional toying with graphics engines] but it seems you can do anything with C++. the g++ compiler is easy to install and compiles c++ from the command line.

    1. Re:C++ / g++ by FishWithAHammer · · Score: 1

      You can do anything with C++.

      The question is whether it is smart to do so, and the answer to that is much more frequently "no" than C++ devotees would like you to think.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  40. Re:Java by binarylarry · · Score: 4, Insightful

    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.

    --
    Mod me down, my New Earth Global Warmingist friends!
  41. It depends by Goonie · · Score: 1
    I suppose it depends where your talents lie, and where you want to end up.

    That said, if you want to be a better programmer, doing some C systems programming is almost certainly a good idea.

    Until you know C - and perhaps try a teeny little bit of assembler - you've not really got any idea what's going on under the hood in higher-level languages.

    And, while you're at it, have a crack at implementing some of the classic data structures and algorithms. Have a crack at implementing a red-black tree, or, if you're feeling very ambitious, some very basic 3D rendering stuff (even 2D can be hard enough...).

    In practice, you won't have to do this out in industry, but you will come across the occasional difficult problem, and the same skills will be very handy when that difficult problem arrives.

    --

    Any sufficiently advanced technology is indistinguishable from a rigged demo
    --Andy Finkel (J. Klass?)
  42. C first, then whatever you want by darkwing_bmf · · Score: 4, Insightful

    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.

    1. Re:C first, then whatever you want by Anonymous Coward · · Score: 1, Insightful

      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.

    2. Re:C first, then whatever you want by Anonymous Coward · · Score: 0

      I totally agree. C is the base. I had the opportunity of learning C while I was starting to learn how to program. This language will open your mind.
      And, after knowing C, most of the other languages are going to be a lot easier to learn...

    3. Re:C first, then whatever you want by stoicio · · Score: 1

      "and I needed a free, as in beer, compiler."

      I keep reading this reference.
      Where the heck are you people finding free beer?
      I look for it and I can never find it, it always costs me where ever I go.
      Yet, every time I come to read slashdot someone is purporting
      the existence of free beer. It's driving me nuts! Where are you getting this
      free beer and how much are you allowed to carry away at a single time?
      Secondly, does that come with salty snacks? Surely *those* must be extra...
      What is the free beer like? Is it just a lager or light beer, or is it a richer hoppy
      blend with a soft dark finish?

      Next, where is the free beer made? I prefer one that is made using pure water
      and only, good, malting barley and flavored with hops that have not been dry for too long.
      Of course, being free, I assume the quality is not going to be perfect, possibly a
      zymurgy work in progress. (Open Source Beer...???)

      I would certainly like to find this fountain of free beer that people mention.
      Let us all in on the secret.

      Tell Richard Stallman too. Then he can give up the pepsi for something that's
      easier on the pancreas and doesn't go to the waistline as much.

    4. Re:C first, then whatever you want by Anonymous Coward · · Score: 0

      Ada!?! I can't believe someone said they actually LIKE Ada.

    5. Re:C first, then whatever you want by PCM2 · · Score: 1

      Where the heck are you people finding free beer? I look for it and I can never find it, it always costs me where ever I go.

      You should tip better. A buck a beer won't really break the bank and in time it will pay off. Also, you people who treat bartenders like vending machines need to get your acts together, too. It's the service industry, true; but in the real world that's a two-way street.

      --
      Breakfast served all day!
  43. Best Tool for the Job by Thangalin · · Score: 1

    Bicycles are poor tools for hammering nails.

    For hardware programming, use C.
    For speedy software, use C.
    For math, try FORTRAN.
    For portable network applications, use Java.
    For web applications, use J2EE, Ruby, Python, or whatever fits the project best.
    For text parsing, use Perl.
    For games, use the native language of a suitable library (Crystal Space, Ogre 3D, SDL, etc.).
    For manipulating files and piping program execution, use BASH.
    For AI, try Prolog.
    For database queries, learn SQL.
    For solving the 8-queens problem, use LISP.
    For enhancing your OO mindset, write in Smalltalk.

    Get it? Got it? Good.

    1. Re:Best Tool for the Job by kabloom · · Score: 1

      Don't spout out a bunch of cliches about programming languages, just to sound smart. Prolog is interesting because it lends itself well to a certain type of AI task. But it hits its limits fast.

      For example Ivan Bratko's "PROLOG Programming for Artificial Intelligence" gives a very simple and intutive solver for inference in Bayesian networks. But in reality, it's just too slow and too limited for the kinds of problems most people are dealing with. Most such problems can't get an exact solution tractably, so approximation is in order. Once there, it's a lot easier to write an efficient algorithm in C or Java, and package it up into its own library with its own domain specific language as the frontend, like JAGS ("Just Another Gibbs Sampler") does for Bayesian networks.

      Also, does Prolog lend itself well to Neural Networks? Or machine learning algorithms? Didn't think so. Every implementation of these things that I've seen is written in Java or C. (One oddball that I happen to find quite useful is written in OCaml.)

      I haven't had any serious use for Prolog since I started my PhD in Natural Language Processing.

      Likewise, Lisp is actually relatively interesting to people using Ruby because they go really far metaprogramming Ruby, and then they want just a little bit more flexibility than Ruby allows.

    2. Re:Best Tool for the Job by OneSmartFellow · · Score: 0, Redundant

      For hardware programming, use C.
      For speedy software, use C.
      For math, try C.
      For portable network applications, use C.
      For web applications, use C.
      For text parsing, use C.
      For games, use C.
      For manipulating files and piping program execution, use C.
      For AI, try C.
      For database queries, learn C.
      For solving the 8-queens problem, use C.
      For enhancing your OO mindset, C.


      Fixed that for you.

    3. Re:Best Tool for the Job by kabloom · · Score: 1

      No, it's not about the best tool for the job. Learning the nooks and crannies of every language (more so today with the size of the libraries available) is a significant investment. Saying "the best tool for the job" is like telling someone to learn French, Japanese, Hebrew, and Hindi in 6 months because their job's going to require them to travel. There's so much vocabulary it can't be done, which is why people perfer to become fluent in one language at a time, and use it for as much as they can.

    4. Re:Best Tool for the Job by kabloom · · Score: 1

      Just to bolster my point, David Welton explains why a toolbox may be a better metaphor.

  44. Fear of Whitespace by bitspotter · · Score: 4, Insightful

    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.

    1. Re:Fear of Whitespace by Anonymous Coward · · Score: 0

      Whitespace sucks. Ruby is a lot better.

    2. Re:Fear of Whitespace by crowds · · Score: 1

      I reccomend the programming language Whitespace. It may not be the most efficient way write code, but it is Turing complete and will certainly help with your fear of whitespace.

  45. C/C++/Python/Perl by Ximok · · Score: 0

    I have found that having a solid understanding of C and C++ works really good for linux.

    For fast development, I turn to Python (I also like doing my GUIs in python with my back ends in C)

    Perl is good to know for general scripting, but pretty much anything you can do in Perl can be done in Python

    Don't forget your Shell scripts like BASH. They aren't much good for programming, but are really good to know.

  46. IndentationError by ksw2 · · Score: 5, Insightful

    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.)

    1. Re:IndentationError by Vexorian · · Score: 1
      Yes, I used to hate it because of indentation, but that floating context less code can be fixed with a good editor like geany or kate that have code collapse and thus add helpful lines to the left of your code...

      Now that I used python so much this year, I hate it only for the fact I often have to wait the whole program execution before finding out a freaking variable is mistyped...

      --

      Copyright infringement is "piracy" in the same way DRM is "consumer rape"
    2. Re:IndentationError by FishWithAHammer · · Score: 1

      I disagree with your post here, sir. Readability, more than anything, is critical in modern programming--you don't know how good the next guy who'll have to bash at the code will be. Python seems to encourage terseness and the whitespace requirements help to make it uncomfortable to read.

      Compared to Java or C# (C# especially, though that's mostly thanks to the fairly hard-nosed Visual Studio editor defaults that almost everybody sticks to), Python feels extremely difficult to just sit down and read.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    3. Re:IndentationError by pembo13 · · Score: 1

      Do people actually that error? Seems like something you have to try to get. I had my little bro try out Python, I'm not sure he ever got that error.

      --
      "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    4. Re:IndentationError by Anonymous Coward · · Score: 0

      In contrast, whitespace is a cosmetic, superficial thing.

      And therein lies the rub. Because in almost every language, whitespace is exactly a cosmetic thing, but in python it's used for flow control.

    5. Re:IndentationError by flajann · · Score: 1

      I disagree with your post here, sir. Readability, more than anything, is critical in modern programming--you don't know how good the next guy who'll have to bash at the code will be. Python seems to encourage terseness and the whitespace requirements help to make it uncomfortable to read.

      Compared to Java or C# (C# especially, though that's mostly thanks to the fairly hard-nosed Visual Studio editor defaults that almost everybody sticks to), Python feels extremely difficult to just sit down and read.

      I would have to disagree on the last point. Python is quite easy to read. Perl, on the other hand, can get quite terse in ways that can make your brain explode. Python's terse constructs -- like list comprehension -- is quite easy to read once you get accustomed to it.

    6. Re:IndentationError by Anonymous Coward · · Score: 0

      Python and whitespace sucks. Ruby is a lot better.

    7. Re:IndentationError by Anonymous Coward · · Score: 0

      Except for the very little detail that identation in Python is *not* a cosmetic thing. It has meaning and determines the program.

    8. Re:IndentationError by Anonymous Coward · · Score: 0

      Quiche eater!

  47. Re:Java by Anonymous Coward · · Score: 0

    What is this "nastiness" you speak of?

  48. Fortran or Assembler by www.sorehands.com · · Score: 3, Funny

    REAL PROGRAMMERS SPEAK IN UPPER CASE.

    Real programmers program in FORTRAN. If it can't be done in FORTRAN, then write in assembler. If it can't be done
    in assembler, it's not worth doing!

    http://www.sorehands.com/humor/real1.htm

    1. Re:Fortran or Assembler by Mr+Z · · Score: 1

      I know you're joking, but coding in assembler is good for learning the machine. Heck, I wrote my game entirely in assembler.

    2. Re:Fortran or Assembler by machine321 · · Score: 1

      Um, if it can't be done in assembler, it can't be done.

    3. Re:Fortran or Assembler by www.sorehands.com · · Score: 1

      You are right. If you understand how the machine works, you can write better code. Also, debugging is better especially w/o source code.

      These young whippersnappers are spoiled. Having more than 640k of ram, source code debugging, damn anyone can program. Hold it, isn't that why Windows code is so bloated, buggy, and slow?

  49. LOLCODE by Anonymous Coward · · Score: 5, Funny

    Develop in LOLCODE:

    http://lolcode.com

    "HAI WORLD" Example:

        HAI
        CAN HAS STDIO?
        VISIBLE "HAI WORLD!"
        KTHXBYE

    I'm doing contract work right now, and won't my client be pleasantly surprised to see the project completed in LOLCODE... ROFLMAO!!! I can haz milestone payment?!?

    1. Re:LOLCODE by Anonymous Coward · · Score: 0

      LOLCODE is too readable, develop in brainfuck

    2. Re:LOLCODE by Anonymous Coward · · Score: 0

      Who would....? Why? Ow. Just, just stop it, please. Someone has some seriously sadistic tendencies o_0

    3. Re:LOLCODE by Anonymous Coward · · Score: 0

      So that's what Visual Basic looks like!

  50. I'd learn Cobol by Anonymous Coward · · Score: 0

    http://www.theregister.co.uk/2008/08/14/cobol_california/

  51. Indenting code by photonic · · Score: 2, Insightful
    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 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
    #}

    --
    karma police: arrest this man, he talks in maths; he buzzes like a fridge, he's like a detuned radio. [radiohead]
    1. Re:Indenting code by kabloom · · Score: 4, Insightful

      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.)

    2. Re:Indenting code by larry+bagina · · Score: 0, Flamebait

      looking through the faq convinced me: python is gay and only suitable for retards.

      Q: Why do/don't you x?

      A: You're an idiot and need to wear a diaper so you don't make a mistake.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    3. Re:Indenting code by photonic · · Score: 2, Insightful

      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.

      --
      karma police: arrest this man, he talks in maths; he buzzes like a fridge, he's like a detuned radio. [radiohead]
    4. Re:Indenting code by lilomar · · Score: 1

      Oh, so THAT's why my python wasn't working on the slashdot interpreter....

      --
      The creator of this post (Jacob Smith) hereby releases it, and all of his other posts, into the public domain.
    5. Re:Indenting code by Tumbleweed · · Score: 0, Flamebait

      I do not understand why people keep bringing up this argument

      Crappy & lazy programmers are the ones who bring up this argument. We've all had to rewrite the kind of code these people produce, right? When these people create HTML, they they things like use table-based layout and don't bother to close their bold tags at the end of cells, because "well, it works in IE, so why bother?"

      Just ignore them.

    6. Re:Indenting code by Chaos+Incarnate · · Score: 1

      The problem is, my "properly indent" probably isn't the same as your "properly indent".

      --
      Benford's Corollary to Clarke's Law: "Any technology distinguishable from magic is insufficiently advanced."
    7. Re:Indenting code by flajann · · Score: 1
      Also, many editors, like Emacs, have a Python mode that makes it a breeze to maintain the indents properly.

      I too grow tired of hearing this complaint about Python year in and year out.

      Then again, many years ago I also used to hear bitches about Lisp's parentheses. Or Forth's RPN syntax. Or...

    8. Re:Indenting code by Coryoth · · Score: 1

      And conveniently python eliminates havign to worry about all those styles: since they are all concerned about exactly where to put the braces, they are all moot in a braceless language like python.

    9. Re:Indenting code by walterbyrd · · Score: 1

      >>Crappy & lazy programmers are the ones who bring up this argument.

      Wrong. Python's indentation problem makes the code *much* less portable. You can not look at code developed by somebody else and determine if that person used tabs or spaces, or some combination - not without a hex dump or something. You can not always used emailed code, or copy and paste code from a newsgroup, or forum, or web-site.

      Python is nice language, but please don't kid yourself. The whitespace issue is a real problem.

    10. Re:Indenting code by Anonymous Coward · · Score: 0

      That link to python.org uses a very weak argument against mandating whitespace as a syntax feature:

      Even experienced C programmers will sometimes stare at it a long time wondering why y is being decremented even for x > y.

      An experienced C programmer wouldn't stare at this ridiculous example for more than a moment. Neither would an even moderately experienced C programmer. Now a Python programmer, I could see why they might be confused by the C example.

    11. Re:Indenting code by cryptoluddite · · Score: 1

      And conveniently misses the point that indenting is a style. It's like writing a web pages without CSS... yeah forcing you to write all the content in order and forcing you into one layout might be considered 'good' to some people. They might even have 'reasons' to 'back up' their argument.

      But, like the space-indenting-is-great Python (and COBOL) crowd what they won't have is facts or figures.

    12. Re:Indenting code by Anonymous Coward · · Score: 0

      So if you build something and your editor does not let you type a character the language needs, it's the *language's* fault?

      Now it's clearer, that explains a lot.

      No seriously, please fix bugs. Don't work around them...

    13. Re:Indenting code by Draek · · Score: 1

      C will work great even in forums that lose their linebreaks.

      Definining "work" as "will compile and run as intended". You'll still have to spend an hour indenting the damn thing if you want to actually *understand* it, which is usually the prime reason one copies code from the web.

      --
      No problem is insoluble in all conceivable circumstances.
    14. Re:Indenting code by kabloom · · Score: 1

      An automatic indenter can make the code readable too, like GNU indent or astyle.

    15. Re:Indenting code by pclminion · · Score: 1

      Because the best reason to choose a particular language is how properly one can paste the code into some random website?

      A tab is no less "explicit" than a brace. Both provide a visual cue in the code. Just admit it: you want the freedom to be sloppy in your indentation, and you don't want to have anything to do with a language that enforces proper indentation.

      There's nothing really wrong with that, but you're really dredging with this particular argument.

    16. Re:Indenting code by Anonymous Coward · · Score: 0

      The rationale of HTML white-space treatment and how different websites treat it; doesn't make an unrelated language superior.

              NOTE: I recommend the person above learns HTML and web-design.

      Typically one should use in HTML:
      <code>
              code goes here including maintained white space
      <code/>

      Above, I just used normal line breaks and spaces, since slashdot converts them anyhow, so no <code> tags were necessary.
      On other sites, you may have to learn WikiEditingRules or some other convention to display code nicely.

      Rationale:
      To prevent XSS attacks many web-sites properly sanitize or limit a subset of the acceptable HTML tags.

      Learning the web is an important part of application design, even if it isn't your primary cup of tea (hasn't been mine for a while).

      Purely REST-ful URLs are necessarily the best practice either, since Cross-Site Request Attacks (the src attribute of an img tag or a style attribute with CSS loading a url() location) should typically have GET param, such as a server-side randomized token, that is checked on each request and cannot be forged on the client-side browser easily.

    17. Re:Indenting code by mgiuca · · Score: 1

      Wait a minute ... we choose programming languages based on how well they display in forums now? WTF?!?

    18. Re:Indenting code by daver00 · · Score: 1

      Should have just used a single space, since you know, python will happily accept that space as your indent :)

    19. Re:Indenting code by Anonymous Coward · · Score: 0

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

      Shush, don't make the Slashdot conspiracy against Python obvious.

    20. Re:Indenting code by Anonymous Coward · · Score: 0

      Python has a thing in common with BASIC (QB/Vb style): not using braces. But BASIC is superior in one point: it does not force a specific indent either unlike Python.

    21. Re:Indenting code by Anonymous Coward · · Score: 0

      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.)

      What a very stupid remark. If a popular piece of forum software started using braces for embedding custom formatting ({b}, {u}, etc.) and complained with a syntax error or something when the bit in braces wasn't valid, would you switch position and tell everyone to start using Python? Of course not - you'd complain that the forum software is deficient.

    22. Re:Indenting code by Anonymous Coward · · Score: 0

      C evilness.

      if (foo != NULL)
          if (foo == 3)
              printf("3\n");
      else
          printf("foo is NULL\n")

      The issue here is that although you want your else block to refer to the first if case, c attaches the scope of the else case to the closest if! Meaning that if foo is 4, it will print "foo is Null."

      Python awesomeness:

      if foo is not None:
          if f == 3:
              print 3
      else:
          print "foo is Null"

      Python always does what you MEAN because the assume that the intelligent coder will always be indenting in a manner consistent with almost all other programming languages.

      A note about line breaks.

      list = ["a",
                      "b",
                      "c",
                      "d"]
      print list

      does exactly what you think it would despite line breaks.

      Also in C:
      char * paragraph = " Man I
                                              wish this could
                                              be a multi line
                                              paragraph"

      would need \n after every line if you wanted it it be multiline.

      Python:
      paragraph = """ Thank goodness
                                    Python is so
                                    Awesome !!!!!!! """

      Again python attaches the appropriate newlines because it does what you mean!

      Don't be scared OP of indentations, it might be the best thing that ever happened to your obfuscated C/C++ code!!

  52. Think APIs and not language by Billly+Gates · · Score: 1

    What will you make out of them? Webpages, client apps, games, or boring work applications?

    THen consider the apis for what you want to do. Python is nice but it lacks severely in many gui apis compared to Java's swing or .NET windows forms.

    If you want to get hired you need to focus on .NET or java as its what most employers want. A few will want experience with php for smaller websites if you want to start using that as many new graduates will not know it as they do not teach it that much yet at universities.

    In regards to your comments on Java I have to say that Java is a rich language if you consider the depth of the javadocs where the apis are very rich. There is an api for everything and there are a ton of third party ones on the net unlike C# which everyone uses the MSDN to get their information.

    1. Re:Think APIs and not language by anon+mouse-cow-aard · · Score: 1

      um... someone does not know about python API's. What is missing in pyQT, pyGTK ? If you're only dealing with linux, then pyKDE? in python 2.5 via ctypes, you can access any C-library you want, or using standard, well documented techniques, you can call C from python, or vice versa. I think the feature set is richer than Java's swing by a country mile.

  53. Makefiles, editors by Anonymous Coward · · Score: 0

    The things that are likely to show up in the *nix world that aren't as common in Windows are Makefiles and various text editors (vi, emacs, ...); those and reading man pages.

    I learned in Java (a pain to set up on *nix), learned fun OS-level stuff in C, and use C++/Python. I develop on Linux for a visual effects company; a lot of that sector uses *nix for software development.

  54. Programming for Linux? by narcberry · · Score: 4, Insightful

    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

    --
    Modding me -1 troll doesn't make me wrong.
    1. Re:Programming for Linux? by A+Pressbutton · · Score: 1

      why is it that your mod points always expire just before you read something you want to mod up?

    2. Re:Programming for Linux? by Anonymous Coward · · Score: 0

      LOL, he said ASP.NET

    3. Re:Programming for Linux? by Anonymous Coward · · Score: 0

      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.

      The problem his trying to solve is to add "linux" to his toolbox.

    4. Re:Programming for Linux? by Myen · · Score: 1

      In that case the correct solution is probably something along the lines of "learn how to install VMWare so you can host a Windows VM".

    5. Re:Programming for Linux? by StormReaver · · Score: 1

      "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."

      That's a fine attitude to have, but it only applies after the separate options have been learned. The original poster wants to learn to do programming in Linux, so his questions about how to proceed under Linux are perfectly fine. He's not looking for advice on which operating system to use. He's already made that decision.

      Having done programming in Linux since 1993, here are my suggestions for getting started:

      1) Start with C and/or C++ (whichever you're comfortable with) if you want to learn how to make use of Linux's POSIX interfaces and the wealth of 3rd-party libraries available. Use either CMake or qmake (the latter comes with Qt, and is usable for non-Qt projects) to generate your make files until/unless you want to manage them manually (which I don't recommend, is totally unnecessary, and is a total pain in the ass).

      2) Use Java and Netbeans if you want the path of least resistance to just get something user-accessible running with minimal effort. Some people will recommend Eclipse, but Netbeans has a far more advanced GUI builder that is standard equipment.

      3) You're not going to cover even a tiny fraction of the options available to you, in a day. The developer options provided by Linux are staggering. Have fun with each step, and don't rush to judgment.

  55. Tabs are EVIL by pem · · Score: 2, Interesting

    If you can't configure your editor to auto-convert tabs to spaces, and you can't find a different editor you can work with and you can't keep your hands of the tab key, then you can't work for me...

    1. Re:Tabs are EVIL by that+this+is+not+und · · Score: 1

      Also, you can't code in Python.

    2. Re:Tabs are EVIL by Tablizer · · Score: 1

      If you can't configure your editor to auto-convert tabs to spaces, and you can't find a different editor you can work with and you can't keep your hands of the tab key, then you can't work for me...

      But why rely on threats and spanking to keep tabs and spaces from being mixed up? Why not just use a language that avoids that problem altogether? I've accidentally messed up indentation in documents because space/tab differences in different editors. It can happen.

      (I've proposed forking Python into a c-style syntax version in another thread.)

    3. Re:Tabs are EVIL by HeronBlademaster · · Score: 1, Insightful

      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.

    4. Re:Tabs are EVIL by nschubach · · Score: 3, Insightful

      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.

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    5. Re:Tabs are EVIL by Anonymous Coward · · Score: 0

      I do believe that VIM has an option to configure how to interpret the tab character as spaces. You set the number of spaces that you would like a tab character to be displayed and voilÃ.

    6. Re:Tabs are EVIL by Anonymous Coward · · Score: 0

      OMG you have to scroll up and down?!?!?

      OMG!!!!!!

      and you call him arrogant.

    7. Re:Tabs are EVIL by b1ad3runn3r · · Score: 1

      The point is that as a developer, it is very imprudent to assume that your formatting preferences are the best way to do it or that you will be the only one working on that piece of software.

      --
      "Reality continues to ruin my life" - Calvin and Hobbes
    8. Re:Tabs are EVIL by Chapter80 · · Score: 1

      I think the real issue with Tabs is the multiple meanings for them. You described some: tab means 2, 3, 4, 8 spaces (but a fixed number of spaces for each tab). But traditionally, Tabs mean "move to the next tab stop". Think old Typewriter. When you pressed the tab key, the spring-loaded carriage was freed to move left on its own, until it hit a stop. So if you had your tab-stops set every 5 characters, then pressing the tab button would insert 1, 2, 3, 4, or 5 spaces depending on the current position of the carriage!

      To me, this style of tab makes a lot more sense. It helps you align columns. It does NOT insert a fixed number of spaces.

      The lack of standardization of editors, plus the lack of standardization of user preferences makes the situation worse!

    9. Re:Tabs are EVIL by horza · · Score: 1

      I do enjoy the way Python's indenting makes other people's code so readable. I used to waste so much time reformatting other people's C source code into some readable indentation format. Anyway after cutting and pasting Python code it seems to work with any format of indenting, tabs/spaces, as long as you are consistent. In fact I've just tried it with 2 spaces and with 6 spaces and it worked fine.

      Phillip.

    10. Re:Tabs are EVIL by Anonymous Coward · · Score: 0

      When I get a source file indented with spaces, I then waste time converting these spaces

      So you're not flexible enough to ajust to the style being used in the code, and introduce changes that show up in version control systems where nothing really has changed? Please don't.

    11. Re:Tabs are EVIL by Dolda2000 · · Score: 1

      I disagree, and very much so. The Tab character has always been defined to forward to the next column which is divisible by eight, and programs breaking that standard are causing lots more trouble for me than many other things.

      Furthermore, the stylistic differences in coding standards go far beyond merely the level of indentation. Arguably even more important are such things as trailing braces, spaces after keywords and between infix operators, and where to indent to begin with (the GNU coding style, for example, uses "half-level" indentation for the braces around code blocks in C). Those things won't change just because you change the tab stops.

      Thus, I must conclude that changing the tab stops to achieve the effect you want is nought more than an ugly hack, and one which definitely causes interoperability problems. You wouldn't even be able to cat a file written like that to a terminal and have it format properly!

      If you want to adopt your own style to a program you're writing on, you should simply use a program like indent.

    12. Re:Tabs are EVIL by daver00 · · Score: 1

      "Source code would not rely on indentation to function properly"

      But that is the whole point of python? If you don't like it then fine but mate, its really not that hard. Really.

      Furthermore the Python foundation recommends using 4 standard spaces as a tab. If your text editor can't be set up to recognise python and automatically use this tabbing convention, then maybe you need to broaden your view just a little.

      Python makes many things dead simple, and if you are rejecting it out of hand simply because you think using a certain style of indentation makes a coder arrogant then sorry mate but you are the one who is missing out here.

      Reading these slashdot arguments about such petty, petty things makes me realise why, at the end of the day, coders are on the bottom of the IT shit heap. You actually care about this shit, and its hilarious.

  56. Check out Ruby! by Anonymous Coward · · Score: 0

    Sweet language, optimized for programmer happiness.

  57. Re:Java by FishWithAHammer · · Score: 5, Insightful

    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?

    --
    "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  58. best... by Anonymous Coward · · Score: 0

    C if you are programming for GTK or GNOME

    C++ if you are developing for Qt or KDE

    Python seems to be popular with both types of developers, but getting pyAwkward installed is usually annoying.

  59. Re:Java by FishWithAHammer · · Score: 3, Insightful

    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.)

    --
    "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  60. Indentation is your friend by beefsack · · Score: 1

    Using GTK+ under Python makes for a very nice, clean easy introduction. You can also use Glade to design an interface which is relatively familiar if you have experience with .NET.

    I also recently started programming under Linux coming from a Microsoft oriented background, and found GTK+ and Glade to be the perfect stepping stone over to Linux development. I started with C, but Python is a fantastic language to learn and works very well with GTK+.

  61. Agreed by CarpetShark · · Score: 1

    I'd say start in Python, Java, C, Ruby, C++, or Perl. In roughly that order of (my!, personal) preference. Just choose a language and go with it. BUT then, focus on reading other people's code, learning algorithms, and design patterns.

  62. C++ all the way by Diablo1399 · · Score: 1

    C++ is my favourite programming language, and it works equally well on Windows and on Linux. I recommend it.

  63. Python by Anonymous Coward · · Score: 0

    Firstly - I would say that an experienced programmer will need to change languages - but a good programmer knows that there is more to programming well in a language than getting the job done.
      Good code should be easy to understand, easy to maintain, efficient and use the facilities of the language.
    On old and fairly outdated book - the UNIX haters handbook - has a lot to say about the faults of C and C++ see http://www.simson.net/ref/ugh.pdf
    And the chapters on C and C++ make points worth noting about languages.
    Whilst its easy to write code in C that does what you want when all goes well - rarely do you see good C code that covers efficient memory use, stops all possibility of buffer overflows, does good memory management and handles all exceptions well.
    People who thing you can pick up a language quickly are either exceptionally good (and they exist but are not common) or they are probably not using a languages strengths but coding to a lowest common denominator.

    Having had my RANT - I suggest Python.
      Its up and coming. It covers windows and Linux and Mac.
        You can do batch and web programming. You can do Open office programming (think VBA)

      No language is perfect

  64. Join the club by CSMatt · · Score: 1

    I too am perusing an IT degree in a college that has a love affair with Microsoft, despite my complete abhorrence for the company and proprietary software in general.

    1. Re:Join the club by Creepy+Crawler · · Score: 0, Troll

      So how do you plan to pay off your student loans if you are unwilling and/or cannot stand to sell software?

      --
    2. Re:Join the club by narcberry · · Score: 1

      Flip burgers by day, put on your opensource pro bono cape and mask and code the worlds troubles away by night.

      --
      Modding me -1 troll doesn't make me wrong.
    3. Re:Join the club by CSMatt · · Score: 1

      I am fortunate enough to not have to worry about student loans, however the issue of making money with free software has been addressed before on Slashdot. There are ways to earn money other than trying to sell something which is not inherently scarce and never will be.

    4. Re:Join the club by Anonymous Coward · · Score: 0

      First of all, he's only "perusing" an IT degree, and you usually don't need to take out student loans just to purchase the course catalog.

      Secondly, if he had student loans he could pay them off by doing, say, sysadmin work. That afterall doesn't inherently want to be free, only software development does, you see.

  65. C to start, and then... by GeodesicGnome · · Score: 1

    In the Linux world you'll want to be familiar with C. But C++ is a perfectly good language for programming on Linux if you're already familiar with it. Since C++ is just an OOP extension of C, writing in C will just be a matter of not using the extensions. You'll also want to become at least a little familiar with bash scripting. Then you'll eventually want to have at least one of the higher level languages in your toolbelt, like Perl or Python. I've been programming professionally for 35 years now and on Linux for the past 10. Personally I prefer working in C++ rather than C, but ever since Microsoft cozied up to C++, that has been an impossible sell to Unix/Linux people. So, I've mostly been using C.

  66. Re:Java by he-sk · · Score: 1

    And then there are people who know that modern VMs may run code actually faster than C, because over time the VM has the opportunity to profile actual usage pattern and can do aggressive optimizations that no C compiler could dream of.

    --
    Free Manning, jail Obama.
  67. Its the problem that matters, not the platform by Dr.+Winston+O'Boogie · · Score: 1

    Choice of language begins with the problem being solved. not the OS you happen to be developing on.

    Are you just looking to tinker in the GNU/Linux world, or do you have a specific problem?

    Simple Web/DB dev? -> php/js
    Heavier Web/Server dev? -> Java
    OS-related dev? -> C/C++
    Heavy string processing? -> perl (or python is speed does not matter)
    System admin-type problems? -> bash/perl

  68. Learn ADA, it's obvious by Danathar · · Score: 1

    Cause after people get serious about security they will realize that only ADA has the stuff to make things right.

    1. Re:Learn ADA, it's obvious by Anonymous Coward · · Score: 0

      ADA = Americans with Disabilities Act.
      Ada = a programming language.

      Do you say PERL also?

    2. Re:Learn ADA, it's obvious by Danathar · · Score: 1

      Oh....you are right. Thanks.

  69. Re:Java by Anonymous Coward · · Score: 0

    So... why would you need OS inside another OS anyway?

  70. Why I hate mono by Curunir_wolf · · Score: 4, Informative

    Try it. You'll be soon warning people away from it, too. C# programming is one thing (it's just a language), but the mono/.NET libraries will have you banging your head against the desk before long.

    I might have a skewed perspective. When I started working with mono, the big selling point was that we could use all the tools and processes on Windows (our development environment is standardized for the whole company's development department and has years of process development work in it), then deploy applications on our Linux servers (we were even using SuSE). Not so fast. Some of the data access libraries work different (tests that pass on .NET fail on mono). Most of those nifty widgets and reporting tools you're using in Visual Studio won't work at all, because they rely on GDI or other native Windows services/APIs.

    We eventually abandoned mono (and .NET for that matter, other than existing production applications), and we are now mainly using Java (it is the COBOL of the 21st century, after all). Deployments on our JBoss servers work exactly the same, whether they are on Windows, or Linux, and so far we have not encountered a single bug that we had to work around because the vendor's response was "Yes, that's a known issue and will be fixed in the next commercial release." (!!)

    --
    "Somebody has to do something. It's just incredibly pathetic it has to be us."
    --- Jerry Garcia
    1. Re:Why I hate mono by Facegarden · · Score: 0

      Try it. You'll be soon warning people away from it, too. C# programming is one thing (it's just a language), but the mono/.NET libraries will have you banging your head against the desk before long.

      I might have a skewed perspective. When I started working with mono, the big selling point was that we could use all the tools and processes on Windows (our development environment is standardized for the whole company's development department and has years of process development work in it), then deploy applications on our Linux servers (we were even using SuSE). Not so fast. Some of the data access libraries work different (tests that pass on .NET fail on mono). Most of those nifty widgets and reporting tools you're using in Visual Studio won't work at all, because they rely on GDI or other native Windows services/APIs.

      We eventually abandoned mono (and .NET for that matter, other than existing production applications), and we are now mainly using Java (it is the COBOL of the 21st century, after all). Deployments on our JBoss servers work exactly the same, whether they are on Windows, or Linux, and so far we have not encountered a single bug that we had to work around because the vendor's response was "Yes, that's a known issue and will be fixed in the next commercial release." (!!)

      Fair enough, i could see how all that would be true. Doesn't make a lot of sense to use a software package that isn't even officially supported by the developer of the language, if it's critical stuff.
      -Taylor

      --
      Worldwide Military budgets: $2100 billion. Worldwide Space Exploration budgets: $38 billion. Really, world? Really?
    2. Re:Why I hate mono by Anonymous Coward · · Score: 1, Funny

      Mono is not to be confused with Mononucleosis. That is an entirely different disease, but both will make you feel like shit.

    3. Re:Why I hate mono by shutdown+-p+now · · Score: 1

      If you try to use Mono to port or develop cross-compiling apps with .NET, then forget about it. But as a development platform in its own right, it's actually pretty good. Just remember to use Gtk# and not WinForms.

  71. Javascript! by Anonymous Coward · · Score: 0

    Come on, be a real programmer. Javascript is where it's at and you don't need Linux to do it.

  72. C and PERL by Anonymous Coward · · Score: 0

    Learn C and PERL. Trust me.

  73. the right tool for the right job. by jonadab · · Score: 1

    The whole Unix philosophy is that you *don't* use the same one tool for everything. You use the right tool for the right job. If you're doing text processing, you almost certainly want Perl; if you're doing extensive GUI work, you might make a different choice. In some cases you might glue two or three languages together in the same project. Evergreen is written in C and Perl. Large parts of the Firefox GUI are done in XUL and Javascript, but the base application is written in C or C++. Emacs is written mostly in Emacs lisp, but the core is done in C.

    Doing everything with the same one tool whether it makes any sense or not is the Microsoft approach. If you're going to do Linux development, you'll do better to unlearn that.

    --
    Cut that out, or I will ship you to Norilsk in a box.
  74. Yup, Python is great by lenski · · Score: 1

    I agree, Python has developed a respectable object model and it has room for some functional programming.

    Python has two^H^H^Hthree additional advantages:

    1) Doesn't stand in the way of refactoring and reorganization as a project grows;

    2) Balances support of exceptionally rapid development ("batteries included" === GREAT library support)

    3) Straightforward mechanisms for binding to C and C++ subsystems: Low level work can be fast where necessary, while still allowing the high level executive integration that Python does so well.

    Python's authors are conservative about introducing "new stuff just because they can", while being unafraid to deprecate and eventually drop suboptimal bits from earlier releases. So the language is both competent and predictable.

  75. Re:Java by modmans2ndcoming · · Score: 2, Insightful

    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.

  76. C then C++ then Java or C# by AlephNaut · · Score: 1

    I worked for severals years as a programmer in the unix world (mainly solaris with the occasional linux development thrown in) then made the transition to the windows world.

    In both worlds C is the common denominator language. I was suprised by how much of the Win32 API is plain old vanilla C. So whatever you've learned about procedural programming, memory management and pointers comes in handy in both worlds.

    Next up is C++. The OO support makes it powerful but its hybrid roots and expansive ambitions make for many pitfalls. In the Win32 world much of the code/library sharing is done via COM. In the unix world you'll accomplish similar reuse via pipes, shared memory and shared bindings (e.g., using the same compiler or a compatible one as everyone else).

    If you can master C and C++ then the world is your oyster - you will rarely encounter a problem that you can't solve better than most because of your understanding of what is really going on.

    Lastly I'd pick up Java and/or C#. Both are excellent languages that incorporate many of the wonderful concepts you studied in your programming languages and constructs class (or whatever it's called at your school). They're both extremely productive languages with rich libraries, excellent documentation, concise syntax and great futures.

    Along the way I'd grab PERL and at least one shell language (I'm partial to bash but ksh and tcsh are others). For many tasks they're more than adequate and mastery of them will make you more productive - you'll quickly automate things that others will waste time doing manually.

    Which brings me to my last point. Be a fan of tools. Tools are your friend. If an IDE is available use it. They don't change the algorithms but they can dramatically increase your productivity by reducing the time it takes to do things that programmers do all the time. Learn keyboard shortcuts/combos. If you're an emacs-er then know your ctrl combos. If you're vi* fan, know your commands. Learn to use the debugger for all of the languages you learn (if they have one). Learn your .rc files and fill them with time saving aliases and settings.

    The more languages you know the better you will be at writing code. You will see patterns emerge. I can't tell you how many times I've seen bad solutions to problems come about because the people involved didn't know about the features of their language or their language's libraries.

    Use your downtime to browse through API documentation. When you're find -exec'ing in a huge directory pull up another xterm and skim through a header file or man page on a library call. Most of the time skimming is more than enough to set you apart from your peers - you'll be able to lookup the details when you need them while they'll be wasting time building it from scratch (and creating all the bugs that have already been fixed in the api you're using).

  77. Why not start with assembly language? by Joce640k · · Score: 5, Funny

    ...it's the only way to be sure.

    --
    No sig today...
    1. Re:Why not start with assembly language? by that+this+is+not+und · · Score: 5, Insightful

      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.

    2. Re:Why not start with assembly language? by johny42 · · Score: 3, Funny

      Right, and don't even start with this computer platform until you've mastered the Turing Machine!

    3. Re:Why not start with assembly language? by Anonymous Coward · · Score: 0

      Well, if you insist.

    4. Re:Why not start with assembly language? by mgblst · · Score: 1

      No matter what language you choose, it all ends up as assembly language. If you want to do debugging, you will have to learn it anyway.

    5. Re:Why not start with assembly language? by Anonymous Coward · · Score: 0

      Yay for the little 8 bitters and even the 4 bitters.

      Don't forget C, and inline assembly. Yay!

    6. Re:Why not start with assembly language? by kmsigel · · Score: 2, Insightful

      >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.)

    7. Re:Why not start with assembly language? by FungosBauux · · Score: 0

      It is amazing. I just fell the same about other one's code and about pointers. ;)

      "painfully obvious" - perfect

    8. Re:Why not start with assembly language? by Lumpy · · Score: 2, Interesting

      assembly is for pussies.

      real programmers fire up a hex editor and enter the hex codes into the file directly.

      No, I'm not kidding. I know of two that work on enbedded hardware that would program a 6802 processor completely in hex on a keypad from memory. they did it so much they never wasted time testing things by writing it down then converting to hex. they just went... "let's try this!" and started typing away..... it was amazing.

      --
      Do not look at laser with remaining good eye.
    9. Re:Why not start with assembly language? by Jeppe+Salvesen · · Score: 2, Insightful

      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.

      --

      Stop the brainwash

    10. Re:Why not start with assembly language? by VGPowerlord · · Score: 2, Insightful

      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?

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    11. Re:Why not start with assembly language? by dgatwood · · Score: 1

      Nah. You should start by learning shell scripting. If you can figure out how to write a complex app in a Bourne shell script, you can figure out how to write it in any language.... :-D

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    12. Re:Why not start with assembly language? by kmsigel · · Score: 1

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

      For embedded work, yes. I have written my own embedded OS which includes my own style of streams, binary and formatted I/O, plus everything that you would build on top of streams (like serial I/O, TCP/IP, disk I/O, pipes, etc).

      The only things I think I haven't written myself for my embedded work are the occasional math function (sqrt, atan, etc). For that, I've used the standard C library implementations.

    13. Re:Why not start with assembly language? by ultranova · · Score: 1

      No matter what language you choose, it all ends up as assembly language. If you want to do debugging, you will have to learn it anyway.

      No you don't. Higher-level languages typically catch and represent errors in a manner relevant to that higher-level code. Even with C, you'll likely end up using a debugger which shows things in terms of C code (variables with their names etc). The only time you'd want to examine the assembly the compiler spat out is when you suspect there's an error in the compiler itself. Besides, even if you do find the error from the assembly code, what are you going to do ? Fix it by hand after every recompile ?

      Besides, my preferred method of debugging is sprinkle the code with the equivalent of "print 'got here'" statements - Real Men don't use debuggers, they debug by reading their code and thinking about it ;). Which is a skill you'll need to learn anyway to debug synchronization problems in multithreaded code.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    14. Re:Why not start with assembly language? by Anonymous Coward · · Score: 0

      For educational purposes you can start at the gate level and work you way up: http://www1.idc.ac.il/tecs/.

    15. Re:Why not start with assembly language? by Nivag064 · · Score: 2, Informative

      Hmm...

      I cut my teeth on 32 bit assembler on an ICL 4/72 mainframe (similar to an IBM 360 in architecture) with a massive one Meg of main memory.

      I think I had most fun with 32 the bit ARM II Risc processor, but I found 8 bit 6502 rather tedious.

      I have also done COBOL, FORTRAN, and C, amongst several other computer languages.

      But my preferred language is now Java, preferably 1.6 or later (1.7 is still in development).

      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.

      My preferred development environment is Linux, and I started programming a couple of years before Unix was invented - yes, I'm over 50.

      -Nivag

    16. Re:Why not start with assembly language? by mathew7 · · Score: 2, Insightful

      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.

    17. Re:Why not start with assembly language? by Anonymous Coward · · Score: 0

      Good programmers write great code, while great programmers just use already written and debugged modules, finishing in 10% of the time.

    18. Re:Why not start with assembly language? by kmsigel · · Score: 2, Insightful

      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.

    19. Re:Why not start with assembly language? by DuckDodgers · · Score: 1

      I think a good analogy would be cars.

      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.

      And ultimately, even though both jobs can be interesting and challenging, creating something new is more interesting and rewarding.

    20. Re:Why not start with assembly language? by kmsigel · · Score: 1

      Nicely said.

    21. Re:Why not start with assembly language? by Anonymous Coward · · Score: 0

      I have a friend who has earnt his salary in the Microsoft world for many years, and now uses C# extensively.

      At home he uses Linux, and is "always" just about to learn Java. While the experience is that C# is quicker to develop in, but he has the impression that Java is more efficient and scales better for enterprize stuff - not to mention more cross platform (even when considering "mono").

      (If I remember, I'll get him to read this thread, and may be comment himself.)

    22. Re:Why not start with assembly language? by Nivag064 · · Score: 1

      Eeek! (to quote a famous Librarian)

      That "Anonymous Coward" was me, forgot I was not logged in as me when I posted the immediate parent!

      I have just asked my friend to have a look.

      -Nivag

    23. Re:Why not start with assembly language? by Hognoxious · · Score: 2, Insightful

      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.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  78. Re:Java by Zan+Lynx · · Score: 2, Informative

    This is generally only true if you let the Java VM use *FIVE TIMES* as much RAM as a C program. Java needs that much RAM to do efficient garbage collection. Using less than that causes more collection cycles to run, slowing everything down.

    The other bad thing about Java is that if your program ever needs to use 300 MB, it will *always* use 300 MB forever after.

  79. APL by cpscotti · · Score: 2, Funny

    APL for sure... its easy to learn, fast and extremely useful!

  80. On a different note by Anonymous Coward · · Score: 0

    It's a little off topic, but make sure you learn how to make man pages, Makefiles, deb files, et cetera...

  81. Common Lisp by Anonymous Coward · · Score: 0

    Learn Common Lisp.

    One of the oldest, but still far ahead in terms of language features than any other language.

    But really, its a matter of what features YOU want in a in a language. Personally I have a hard time programming in a language w/o closures without going mad.

  82. My professional opinion is... by Anonymous Coward · · Score: 0

    Since you already have the M$ stuff, I would say:

    C, then Perl, then C++, then Java. You should also pick up Bash and Csh scripting. Make sure you read and absorb "Effective C++", "More Effective C++", and "Design Patterns".

    For Web, learn PHP and some J2EE. I would get really familiar with CSS and Javascript, though. Try the different frameworks and common libraries as well.

    Finally, learn some Lisp and Prolog. They will come in handy in the future. Also get familiar with Functional Programming. It looks like it's going to be all the rage.

  83. Seriously? by Anonymous Coward · · Score: 0

    "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."

    Seriously? You might be in the wrong field.

  84. Durrr by Anonymous Coward · · Score: 0

    Why bother with a higher-level language?

    Assembly: Accept No Substitute

  85. Don't bother - learn project management instead by Anonymous Coward · · Score: 0

    I sometimes code for fun, or when forced to.
    But for 20 years now I've been a program/project manager instead. Lots - repeat LOTS - more dough.
    And don't believe the shit that some guys wll say about 'yes, but contract pgmrs earns tons...' - the project manager always earns more, because he controls the budget.

    Downside is you have to deal with managing..well, read an average /. thread and you'll understand...

  86. REAL Programmers Don't Ask by open+swords · · Score: 1

    THEY JUST DO THE RESEARCH. If this quality of cluelessness is typical of you, then you're one or both of 1) mommy's little dumpling; 2) somebody who should be on a different career path.

  87. Are C and C++ really fast? by golodh · · Score: 1
    Well ... it all depends. And you are quite right to ask for proof and benchmarks (the usual opinionated-but-lacking-in-solid facts Slashdot comments notwithstanding) because performance issues are typically quite complicated (se e.g. http://en.wikipedia.org/wiki/Benchmark_(computing)#Challenges).

    One thing needs to be understood however: the speed of a library like Gtk has nothing whatsoever to do with the speed of an application coded in a particular language (like C or C++). Don't confuse the efficiency of a language (implementation) with that of a popular graphics library coded in that language.

    Have a look here for some benchmarks: http://shootout.alioth.debian.org/

    On these benchmarks (and on Sometimes C and C++ end up as the fastest of the pack, sometimes they don't (contrary to the usual opinion of Slashdot commenters). Fortran wins several times. However, C and C++ always tend to be in the top-10%.

    A rule of thumb I use:

    (1) If it's floating-point centred, and especially linear-algebra centred (Linpack, LAPACK, Eispack), Fortran is likely to be fastest, certainly not C or C++. However ... Matlab, Octave, Scilab etc. tend to be quite competitive when the work can be formulated in terms of high-level matrix operations (so that the overhead caused by the interpreter can be made up for by the excellence of hand-optimized assembler libraries). Besides they get the job done in one tenth of the time it takes to code from scratch in Fortran, and you get a far better chance of getting things right the first time.

    (2) If it's centred on manipulating data-structures (trees, heaps, allocation. eallocation, moving, traversing, counting, coding) which relies mostly on pointer juggling, then C and C++ tend to be fastest.

    (3) For everything else ... try to find real-world examples.

    1. Re:Are C and C++ really fast? by grumbel · · Score: 1

      Have a look here for some benchmarks: http://shootout.alioth.debian.org/

      Speaking about language speed, how does it come that Lisp always comes out rather high in those rankings, while newer languages like Ruby and Python and up deep down at the bottom? In terms of expressiveness they all are very similar, yet nobody seems to have bothered to write a proper native code compiler for the newer languages, even so the popular interest in them is much larger then that for Lisp. Is there any fundamental reason for this?

    2. Re:Are C and C++ really fast? by mechsoph · · Score: 1

      how does it come that Lisp always comes out rather high in those rankings, while newer languages like Ruby and Python and up deep down at the bottom?

      Because Lisps have real compilers.

      In terms of expressiveness they all are very similar, yet nobody seems to have bothered to write a proper native code compiler for the newer languages, even so the popular interest in them is much larger then that for Lisp. Is there any fundamental reason for this?

      No

  88. Re:Java by Anonymous Coward · · Score: 0

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

    In theory yes, in practice, you pay a significant performance and resource penalty. Not that it matters if you're writing some utility that is seldom used, or know that your users are going to have plenty of hardware to run your programs (Eclipse comes to mind).

    >> 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.

    C++/Qt is just as productive as Java or C#, without any of the disadvantages (resource use, performance, interface with C code, etc).

  89. Weeks? Really? by xant · · Score: 1

    More like hours? I was used to it before the end of the tutorial. It's not something you think about, really.

    Any useful Python IDE does it automatically (see my list of IDEs later in this thread); if you use vim you want :set sts=4 ts=4 et sw=4

    (and vim already comes with a fine indenting/syntax highlighting module for Python).

    --
    It's rare that you're presented with a knob whose only two positions are Make History and Flee Your Glorious Destiny.
  90. Re:Java by alanwj · · Score: 4, Insightful

    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.

  91. Python and C by weaver4 · · Score: 1

    Learn C for when you code needs to be fast. Learn Python for when you need to be productive. Then you can learn how to write the code that needs to be fast in C and have it run within a Python app.

  92. Re:Java by smenor · · Score: 1

    lack of automatic boxing of primitive types anyone

    I'd agree with you but those were both fixed in Java 5.

    About the only thing I'm aware of that Java is really missing relative to C# is LINQ (not that that's by any means a small thing)

  93. Build environment, not languages by Anonymous Coward · · Score: 0

    I'm going to be radical here: you've got a good set of tools under your belt, but need a toolbox to put them in. Now is a good time to learn bout make, autoconf, libtool, and package managers to bundle your software. Or the CPAN Perl module build systems, or Ant. But learning a large scale capable build system may stand you in better stead in the long term than learning yet another language, because you will have to package your toolkits. Learning a good one will prevent you from inventing yet another.

    If I see one more "let's replace 'make' with our own in-house system that only one person understands and never will work right", I'm going to line them up interlaced with the "let's do source control with our own in-house system" idiots and give them snorkels so their brains can get some oxygen from here they stuck their heads up their asses.

  94. Re:Java by Anonymous Coward · · Score: 0

    I'd like to hear more of his healthy fears of Java. I've some experience with a lot of java frameworks and I know a lot of things are really anoyeing but as a whole, the java platform is very vast and works. If I were to make a desktop application, I'd try something blazing new (in the productiveness front) like griffon + javafx.

  95. Don't write off the Java *platform* by ChrisWong · · Score: 2, Insightful

    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.

    1. Re:Don't write off the Java *platform* by try_anything · · Score: 1

      I second this post. The Java platform has tons of tools, amenities, and libraries. All you need is a decent language: take your pick! Java the language is now the C of the Java world: it's the lowest common denominator, the systems programming language, and the application language of choice for conservative no-nonsense types.

      Scala is the C++ of Java-land: a sophisticated multiparadigm programming language that does everything Java does and more. On the other hand when you compare Scala against C++'s weaknesses, Scala is the anti-C++: terseness through type inference, excellent support for functional programming, small and clean language core, and able to be described in a twenty-page white paper. Suck that, C++!

    2. Re:Don't write off the Java *platform* by Anonymous Coward · · Score: 0

      Um, really?

      You just named two high-level business-application web languages. Neither does scientific computing well, neither does OS, driver, process-control, embedded.

      Vast majority of the universe of software jobs, indeed. I think you meant 'vast majority of the soulsucking business I/T code.'

      There is a world outside of business, and we're quite happy that you nimrods are distracted by the shiny lights and automated garbage collection. The *fun* stuff happens all around you, meanwhile.

  96. This question isn't about Linux. by SanityInAnarchy · · Score: 2, Insightful

    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.

    --
    Don't thank God, thank a doctor!
  97. Re:Java by snowgirl · · Score: 2, Interesting

    On top of that, it doesn't take much juggling to get your app to run on multiple platforms.

    One would think, right? But it's actually NOT that much easier to get your app running on multiple platforms. I shall describe to you three projects that I wrote in C, Java, and ObjC respectively.

    The first app was written in C, it was a webserver. It actually was really easy to port, because I used basic C libraries. About the only problem was that on Solaris, I had to include some libraries that I didn't on the other *nixes. The other *nixes? Linux, OpenBSD, and Mac OSX. It all worked like a charm, no cross platform issues. I have no doubt it would have run just as fine on SFU (services for Unix) on Windows, or if one had the right compiler, like djgpp, it would work just fine as well.

    I wrote a raytracer in Java for a graphics course. I already had the vector class, which took care of most of the code, so most of was super easy to write. Just make a vector, cast the ray, just a bunch of math that I had already written into Vector and Matrix libraries. There was just one problem. How do you draw a pixel in Java? Oh yeah, that's right, there is no way to do it. Some implementations allow you to do a drawRect() of size 0,0, but others interpret that as a "draw nothing"... thus in order to actually draw my image correctly across Linux, OSX, Solaris, and OpenBSD, I had to draw 4 times as many pixels as I had to, by doing a drawRect large enough that it would actually draw something on each one of the OSes. And these are all POSIX systems? WTF?

    Last, I got sick of the performance of my Java raytracer, as well as the inconsistent undefined behavior of drawRect() with a height/width of 0,0. So, I ported my raytracer to ObjC. I started with the vector library, things went fast, and easy. It also worked perfectly on OSX, Linux, OpenBSD and Solaris. It used SDL for the graphics (which actually has a defined behavior that allows one to draw one and only one pixel). And the standard POSIX thread library to make it multithreaded to draw even faster.

    Point of all of this: The LIBRARY SPECIFICATIONS are the most important thing to be defined across the board. Any unspecified behavior in your library results in being able to write code that won't work on a different implementation of that same library. Also, without a Java VM, the java raytracer wouldn't run on that system, which means it is no better than requiring the ObjC library, and SDL library.

    --
    WARNING! This girl exceeds the MAXIMUM SAFE standards established by the FDA for BRATTINESS
  98. Methodologies by eulernet · · Score: 1

    What I discovered after all my coding years is that you need to learn a lot of different languages, since some are suitable for given problems and not for other ones.

    Learn ASM, C, C++, Java, HTML+Javascript, Python, etc...
    The more languages you master, the more jobs you can pretend.

    Also, learn the eXtreme Programming concepts:
      - TDD (Test Driven Development) = write your tests before your code. It's really important !!!
      - use source control for each of your projects
      - practice pair programming, you'll progress faster

    Once you'll master this methodology, you'll be in the 10% of the good coders.

  99. Tools by solid_liq · · Score: 1

    As others have said, language isn't so important. That said, I can only recommend the tools I'm happy with: the Ganymede version of Eclipse for C++ with the Subclipse plugin (for Subversion). Gcc/G++ works well for me, though you can also use icc if you like. Other developers have told me that the Python version of the Ganymede Eclipse package is very nice as well, but I stick with C++, so that's only what I've heard. Find tools you like to use for development, and learn the libraries. You may want to take projects you developed for Windows in school and port them to Linux. That should give you an easy start.

  100. Another $.02 by tuxgeek · · Score: 1

    Depends what you want to contribute. Most languages are used in the Gnu/Linux environment depending on application.

    That said, I am not a professional programmer and don't program for money, I have a day job that pays very well. I do enjoy programming though and am currently constructing an accounting/business management app for KDE and using QT4 programming in C++.
    My test bed will be my own company and will eliminate my reliance on QuickBooks and winblows altogether. Once in a useful and productive state I will release it to the community for others to use most likely through sourceforge.

    This is just my way of also contributing to the cause along with all the other programmers out there that have contributed many top notch applications I use everyday such as K3B, soundjuicer, xine, firefox, & KDE.

    Good luck and welcome to the good side of the force.

    --
    "Suppose you were an idiot...and suppose you were a member of Congress...but I repeat myself." Mark Twain
  101. Use the best language for the job by Anonymous Coward · · Score: 0

    Look at the project and figure out which language is best suited. Procedural or OO? Compiled or scripted? If you don't feel comfortable enough with the language best for the job, practice it.

  102. Re:Java by Anonymous Coward · · Score: 0

    I agree.

    My automatic answer to the the question would have been Java and Perl.

    Because that's what I use.

    Knowledge of C and, even better, assembly is a serious plus.

    Then again it largely depend on what you're doing...

    Desktop/KDE: C++
    Desktop/Gnome: C
    Server side: Java
    Anything real-time: C (or C++, maybe)

    If it wasn't for KDE, I would advise steering clear of C++. IMHO, it's a steaming POC that is neither as easy as Java, nor as close to the metal as C, or, for what matters, Java (Java remains a seriously *simple* language, in that the mapping from code to assembly is extremely straightforward).

    I would personally avoid doing any long term development in Perl (which I love), Python (which I don't like), Ruby (which nobody had as much as heard of until RoR came up, which for some reason was based on the most obscure language this side of functional programming), or any other "scripting language" as some call them. The reason for that is that while they'll allow you to get something up and running quickly, the absence of strong typing make it a pain to maintain.

    Having said that, knowing *one*, say Perl or Python, is an absolute requirement for all those short term tasks.

    Oh, yeah, and this being Linux means Bash, the bane of my life, is also of course a necessity.

    Off topic, but still, my wishlist:
    - C is in dire need of a face lift; we don't need header files anymore (my box can compile a 1M LOC Java project in 2 minutes), classes (and just classes - I like to encapsulate things), no pointer arithmetic (get on with it, compilers do it better than you, showing off is not a reason), arrays that have a length (the whole strncmp thing should be a hint: functions need it anyway).
    - a command line language that doesn't suck and has no pretense of becoming an app one. I vote TCL (I have fond memories of that one). With syntax expansion, too.

  103. Re:Java by iamwahoo2 · · Score: 1
    I also cannot understand the "fear" of Java. As far as languages go, it is pretty good. Nothing is perfect. In fact, I think that the similarity in development tools would make for an easier transition between the operating system, as opposed to C/C++ where you will have to get used to all the different libraries, IDEs, build tools, etc...

    I have seen a lot of people recommending C/C++, but I that would not be my recommendation. If you want to be able to dive in and see quick results, I would choose a language that you are familiar with that has as little change as possible when switching between windows and Linux. Some of my preferences would be Java, Python, or C# (with Mono). Also, I think it is a great idea to choose some cross development libraries like Qt or Gtk and begin your development in your familiar Windows environment, and then attempt to build and run in Linux.

  104. C# is like Java... I recommend Perl by DanTheLewis · · Score: 1

    On the spectrum of languages, C# and Java are really pretty close together...

    Don't think of this question like "I want to learn the uber-development platform again, only on Unix instead of Windows this time." For one thing, it doesn't exist (except in Eclipse-land maybe). Unix is all about combining tools and using what is to hand. There's more than one way to do it. In fact, your choices are basically combinatorial as far as what pieces you put together. Don't think of that as a paralyzing decision point, just pick something and start ripping.

    For another thing, you will get a lot more out of programming even in the C# environment if you broaden your perspective. Learn some dynamic languages like Scheme or Ruby, learn some new programming philosophies like functional or declarative programming. Learn vim or emacs (I'm an Emacs person, but to each his own), typing text into files, programming without a net.

    Just like you can see the von Neumann architecture poking out through C, you can see the Unix way poking out through Perl. You might consider starting with Perl on Unix. You will be able to write powerful programs quickly, you'll have an excuse to get started learning regular expressions (Mastering Regular Expressions is a classic), and the Unix system calls are practically written into the language and docs. Learning Perl, from O'Reilly, would be a good place to start.

    I would also strongly recommend learning the command line and bash scripting, not necessarily for the syntax, but for pipes and the core utilities. Classic Shell Scripting, again from O'Reilly, is a terrific introduction.

    --

    Q: What did the comedian say to the crowd?
    A: If I knew, this joke would be funny.
  105. Lern LOGO! by ArcadeNut · · Score: 4, Funny

    I hear it's going to make a comeback as soon as they add support for DirectX 10!

    PEN DOWN
    FORWARD 10
    TURN RIGHT
    FORWARD 10
    TURN RIGHT
    FORWARD 10
    TURN RIGHT
    FORWARD 10

    --
    Visit the Arcade Restoration Workshop @ http://www.arcaderestoration.com
    1. Re:Lern LOGO! by Anonymous Coward · · Score: 0

      I made this exact same mistake in 2nd grade. The assignment was to copy some code onto the Apple IIe and run it. Thinking that the language only understood direct instructions, I mentally expanded the for-loop, so this:


      PENDOWN
      REPEAT 4 [FORWARD 10; RIGHT 90]
      PENUP

      was (incorrectly) entered as this:


      PENDOWN
      FORWARD 10
      RIGHT 90
      FORWARD 10
      RIGHT 90
      FORWARD 10
      RIGHT 90
      FORWARD 10
      RIGHT 90
      PENUP

      Sadly I was never allowed to use the little robot with a magic marker to run my code. :(

    2. Re:Lern LOGO! by Anonymous Coward · · Score: 0

      Oh god, flashback to elementary school...

  106. LOL! Stupid Slashdot Mods by Anonymous Coward · · Score: 0

    reSonans joke about the dead Mono fiasco flew right over the idiots with mod point heads...

  107. Re:Java by binarylarry · · Score: 3, Insightful

    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.

    --
    Mod me down, my New Earth Global Warmingist friends!
  108. Linux has all you need by Anonymous Coward · · Score: 0

    Install the latest Ubuntu, you can then install your favorite text editor, I prefer "kate"

    Create a custom Makefile, don't use variables and macros, just keep it simple,

    target: dependencies

    Language of choice is C/C++. Haven't tried all the plethora of fourth generation languages yet.

    If you want to check for memory leaks, valgrind is a great tool. You can use valgrind and kcachegrind to get a nice gui view of which parts of your program is using the most CPU time.

    A great debugger is "kdbg", setting breakpoints, watches, single step etc.

    That's all that I've found so far. No sense using Microsoft bloatware.

  109. Re:Java by anon+mouse-cow-aard · · Score: 3, Informative

    The other bad thing about Java is that if your program ever needs to use 300 MB, it will *always* use 300 MB forever after.

    I am far from being a Java fan, but... if you use 300 MB in a C program, it will *always* user 300MB forever after too. free just returns storage to the process heap, for eventual re-use by malloc within the same process.

  110. That "Healthy Fear" by Seraphim_72 · · Score: 1

    That "Healthy Fear" is not very healthy. You were taught that fear because Java is the main competitor to .NET. Just to be clear here, I make my kip as a C# developer and if I could I would trade up to Java. The deeper parts of Java are muddy and nasty, but on the other hand C#'s ability to never name a function properly bothers me every day. Go learn Java.

    --
    Slashdot, where armchair scientists get shouted down and armchair theologians get modded up.
  111. Does it matter, though? by Gazzonyx · · Score: 2, Insightful

    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.

    --

    If I mod you up, it doesn't necessarily mean I agree with what you've said, sorry.

  112. The Browser is the new OS... by Anonymous Coward · · Score: 0

    ...so learn JavaScript (and HTML and CSS). This is a highly useful and marketable skillset,

  113. PERL? by actionbastard · · Score: 1
    --
    Sig this!
  114. Programming Environments by jetpack · · Score: 1

    Asking a software developer what programming language he uses is like asking a fiction writer what kind of typewriter he uses.

    1. Re:Programming Environments by sbluen · · Score: 1

      That is not always true. Different programming languages can be written faster, ran faster, or debugged faster. Almost every typewriter types as fast as the author types, is read as fast as your brain can understand, and cannot be debugged except with a flyswatter.

  115. Me... by Anonymous Coward · · Score: 0

    I personally like the idea of using .NET with mono. Even though there are some (ligit, and some useless) arguments against it, I would suggest you try it until you are comfortable moving onto something else.

    It would be wise since you are coming from that very background.

  116. Pennmush by thirdpoliceman · · Score: 1

    Spend all your freetime learning how to use MUSH code. If you dislike Python's identation now, you may develope a strong need to explore it after dealing with the lack of whitespace that is MUSH code.

  117. Learn SQL by Anonymous Coward · · Score: 0

    If I could go back 15+ years, I would have spent more time learning about relational databases and SQL specifically. Back when I was in school, we wore an onion on our belt because that was the style. We also cut our teeth on Pascal, then C, and eventually a little C++.

    My first job was writing business applications for SunOS (yeah, pre Solaris days) using Oracle as the back end. I knew C well enough, but had virtually no experience with relational databases.

    The VAST majority of the developers I know (including myself) write business applications. You know - billing systems, A/R, A/P, G/L, etc. I have written very few systems that did not use a database.

    You may end up writing kernels or device drivers or something else, but the chances are that you will end up working in the IT department of some company and will need to know SQL, T-SQL, P/L SQL, etc. And trust me, MS Access doesn't count.

    So yeah, pick a language, C or C++ - it doesn't really matter. But I would be inclined to say that you should also pick a database and try to write some basic applications that read and write data to a relational database. You'll be glad that you did later.

    Just my 2 cents.

  118. Gnocl by Anonymous Coward · · Score: 0

    Tcl + Gnome/GTK+

    It is very nice.

  119. Blitz max by Anonymous Coward · · Score: 0

    nuff said

  120. Re:Java by Anonymous Coward · · Score: 0

    There are, frankly, a LOT of extremely mediocre programmers on the market, and a common attribute they share is that they only know Java.

    Hear hear. Another common love of the run-of-the-mill Java crank-turner is Eclipse and Maven. These folks are the Wal-Mart greeters of the software development world. Java as a language is okay enough, but the ecosystem that has settled around it is just so Velveeta-on-Wonderbread *average*!

  121. Learn Fortran by jstott · · Score: 1

    Start with Fortran. After all, you can write bad Fortran code in any language!

    The GNU compiler suite includes a compiler (gfortran) that supports F90/F95 as well as the older F77 that everyone loves to hate (even though most everyone who screams about it has never actually strong used it, and F90 is far nicer and more modern language than F66. Computed GOTO's are still fun though...). Furthermore, with the OpenMP extensions that gfortran includes, you'll be running parallel code in no time, and OpenMP actually works now with multi-core CPU's, unlike those functional-language evangelists' favorite languages...

    -JS

    --
    Vanity of vanities, all is vanity...
  122. Dont program for Linux, program for everything by drolli · · Score: 1

    I am not a programmer for my job, but a physicist. In the last 8 Years sice i started researching, i have writen tons of programs, and none was restricted to a single platform. For me structuring your toolset in a way that it is easy to change between Windows and UNIX-like OSes gives you the the biggest freedom to change something you dont like.

    The cross-platform scripting languages which i used sucessfully:
    Jython, tcl, matlab/octave

    Windowing Toolkits:
    Java AWT/Swing, tk, matlab (i dont recoommend to use matlab for guis, but it *is* cross platform)

    Medium/low layer
    Java, C (that is ANSI-C)

    The stacks i used most successful are:
    -Jython-Java-C (most elegant solution)
    -Matlab-(C) (C was not necessary to use often, just to fix their DAQ driver)
    -tcl-c (quick solution, but calling to octave as external program to do some mathematical tasks)

    What i deprecated:
    -Perl-Java-C

  123. What language depends on what you want to do. by flajann · · Score: 1
    As one who has used just about every major language under the sun at one point or another, I will state that the language you choose depends on what your goals are, what the project demands, and in many cases what your employer wants.

    Many opinions abound about languages, but here's my take:

    • Perl -- great scripting language whose strengths lie in text processing. Lousy support for OOP programming, but doable after a fashion, as long as you bless your routines.
    • PHP -- While very popular for Web programming, has a poor implementation of OOP and lacks name spaces. PHP 5 is much better than PHP 4, but still needs a way to go.
    • C -- great for writing drivers and other kernel-level stuff for Linux. Great for pure performance real-time applications. A pain to debug and very easy to hang yourself. You must remember to explicitly free any memory or other resources you use, which can be a pain in the butt. No language-level support for exception handling and OOP. But then, that's what C++ is for.
    • C++ -- cool language for OOP, performance, and the like, but too complex in my view. Like C, you must remember to free your resources; however you can create constructs to do this for you after a fashion. Or you can use the STL. Pain in the butt to debug, and it's very strongly typed.
    • Java -- Has language constructs similar to C++, but is in a completely different universe. C and C++ are compiled; Java is interpreted, even though with the JIT technology it can approach C++ speeds. Java has a rich set of libraries and strong support for threaded programming, but I think the learning curve for all those class libraries is steep and Java Threads encourage abuse of threaded programming in the same way Basic encourages abuse of GOTO. Java used to be used client-side for web programming, but today it's use client side has fallen out of favor, though it is used very heavily server-side in many shops.
    • Python -- very cool OOP scripting language used quite a bit for web programming, batch programming, lots of utilities and applications in Linux. I would say this language is a "must know" if you plan to do applications, tools, and web development on Linux. Python, like many other languages, have evolved over time in the OOP department, but has done so in a MUCH nicer fashion than PHP. However, one of Python's bugaboos is it's dual object model; holding on to the earlier brain-damaged one to support legacy code, though the old model is going away soon.
    • Ruby -- A true delight of a OOP scripting language. It takes the best from Lisp, Python, Java, C++, and others, and give you a very slick, flexible, extensible language paradigm to sink your teeth into. Rails has done wonders for Ruby's popularity for Web programming, but in my view Ruby is not the best choice for high-performance sites. Python or even PHP would make better choices in that department. Where Ruby shines is in its concise syntax and its ability to allow you to do rapid application development. Ruby allows you to leverage various levels of abstraction, do functional programming, use iterators, and other nice modern programing paradigms are supported by Ruby.
    • Lisp -- If you are doing AI work, Lisp represents the traditional approach. It's a sweetly simple language that has a lot of inherent power; yet currently has poor support on the Linux platform. I would not recommend it for anything outside of academe.
  124. Java + Netbeans by Anonymous Coward · · Score: 0

    Considering your background the easiest migration path is to use Java as the language and Netbeans as a development IDE. Migrating from Java to C# is easy since C# learn a lot from Java. Netbeans is a great IDE that you can download from www.netbeans.org. It has many of the things you are used to in VS. That IDE supports many languages so it will help you develop C/C++, Ruby, Python, JSP, SQL, XML, HTML, XHTML, JavaScript, ... since those and other languages are supported.

    I went the other direction. I went from a company that was pure UNIX/Linux to a MS shop. I had to learn C# and VS basing it on my Java + Netbeans knowledge. The transition is pretty easy and I continue to use both platforms.

  125. It's not the language, it's the fundamentals by punker · · Score: 1

    I've hired quite a few people for developer jobs (which I would assume is your goal). When I'm interviewing a candidate I want to hear them say that "programming is programming". Syntaxt changes, but the fundamentals remain. You need to be able to adapt to the languages used in your projects, and adopt the new ones that evolve.

  126. Re:Java by Anonymous Coward · · Score: 0

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

    Hahaha! Oh you're funny. Show me an H.264 decoder written in Java and let's do some benchmarks.

  127. If you know Microsoft languages... by icepick72 · · Score: 1

    Java should be a relatively easy step if you've learned the details of C# or VB.NET on any .NET Framework because similar concepts carry across both. The inverse is true too.

    Sun Microsystems Microsoft Corporation
    Java syntax C# syntax
    Virtual Machine Common Language Runtime/JIT Compiler
    Java Byte Code Microsoft Intermediate Language
    Java Foundation Classes Framework Class Library

    1. Re:If you know Microsoft languages... by icepick72 · · Score: 1

      Oops...Easier to understand with separator...
      Sun Microsystems -- Microsoft Corporation
      Java syntax -- C# syntax
      Virtual Machine -- Common Language Runtime/JIT Compiler
      Java Byte Code -- Microsoft Intermediate Language
      Java Foundation Classes -- Framework Class Library

  128. Re:I'm old-fashioned, so I still program in C++... by snikulin · · Score: 1

    C++ kiddo became old-fashioned?! I'm getting old :(

  129. The question is irreleveant if you are 'comfortabl by Anonymous Coward · · Score: 0

    Seriously...if you have spent any time at all in a Linux environment then you know that you just use whatever tool is easiest/best for the job at hand.

    The very fact that you are asking the question shows you just need to strip Windows from your box and run Linux for a year or so until you really _get it_.

    Or maybe you just like asking questions in 'slashdot style'...

  130. Join the club? by flajann · · Score: 1
    I'm a bit turned off by what the crowd likes going for, if for no other reason that many -- including those in India and China -- will compete for the same set of jobs requiring those languages/platforms.

    One argument is that "that's what employers are looking for". If there is a glut in the supply market for that skill, you can guarantee that

    1. Pay rates will be lower.
    2. You will face fierce competition.

    So paradoxicially, it may not be the best choice to be to heavily invested in the "mainstream" choices.

  131. Job percentages by tonycatman · · Score: 1

    From my local online service: java : 52% c++ : 26% perl : 6% php : 9% python: 4% others: didn't look. So your choices are: Java, even though it is an clumsy, slow and non-portable language. c++, particularly if you are using Linux because it compiles cleanly and is built in.

    1. Re:Job percentages by Anonymous Coward · · Score: 0

      Java has a lot of the market (and has for a while) ... but it doesn't mean that it is the language to use just because a lot of people write Java code.

  132. Roll your own by wikinerd · · Score: 1

    Why not invent your own language? It's easy (every CS student can do it, albeit I'm not so sure about IT students). You can invest your time in learning about compiler design rather than about a particular language, and then go forward and build your very own programming language.

    This experience will introduce you to the most important difference between the GNU/Linux and Windows worlds: the GNU/Linux people are creative, but the Windows people expect everything to be provided by their vendor ready for consumption.

  133. Factor factorcode.org by Anonymous Coward · · Score: 0

    Learn Factor and you can write cross-platform programs in Linux, *BSD, Windows, Mac OSX with the exact same code.

  134. The winning combo: Python, Erlang, D, C by Requiem18th · · Score: 1

    Python for anything where speed or concurrency aren't absolutely critical, Erlang for anything where speed or concurrency ARE absolutely critical, D for low level stuff like graphics or writing python acceleration extensions, C for maximum portability.

    --
    But... the future refused to change.
  135. pascal by barv · · Score: 1

    Someone above said a pro programmer can use any language. That is true. It is what you do if employed by the hour. For stuff you want to do, you should choose your own favourite language.

    I also endorse someone's comment above that you should have experience programming in a mnemonic machine code, (aka assembly). Personally, if I couldn't find a Pascal compiler for the job, I wouldn't bother thinking about the algorithm.

  136. Re:Java by skeeto · · Score: 2, Informative

    Almost, but not quite. The GNU C library, for example, will use mmap to allocate larger requests, and, when freed, will give that memory back to the system and allow the process to shrink.

  137. Easy by Anonymous Coward · · Score: 0

    Consider RealBasic.
    It compiles to Linux, Windows and Mac.

  138. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  139. it's IT folks by recharged95 · · Score: 1
    "IT university student"

    .

    Face it, if you stay in the IT realm, you'll be programming app servers and some web dev.

    8 out of 10 *enterprise* situations the language used is Java. I doubt you'll see much PHP/Python unless you *don't* want to make money.

    .

    Unless you want to do h/w drivers, kernel dev, full integrated KDE/Gnome apps, or use all FOSS, then C is the way to go.

  140. Why look backwards? by chaeron · · Score: 1

    The key question is why do you want to learn to program on Linux?

    If it's to further career goals, then it would be best to look forwards and not back. And almost all of the suggestions are looking back at the past.

    The future? XRX - XQuery/REST/XForms (and XSLT).

    Master that and you'll be able to deliver apps faster than the most rabid Rubyites and will be much in demand if a career is what you are after.

    Fact is, if you don't know XRX, then you won't be working for my firm. ;-)

    Commonly used languages never seem to die. COBOL is a good example, and a lucrative one, though probably not a lot of fun these days. C is partly there as well, though is good for foundation knowledge or if you have a hankering to work on Linux internals. But it's all past history. Look to new technologies, functional languages, concurrent languages (Erlang comes to mind) and stuff that makes XML easy and productive to use.

    It'll be more fun, and more lucrative too, I'll bet.

    My 2 cents worth.

    --
    .....Andrzej

    Chaeron Corporation
  141. try Groovy by A12m0v · · Score: 1

    j/k C the way it is

    --
    GENERATION 25: The first time you see this, copy it into your sig on any forum and add 1 to the generation.
  142. Re:Java by Nicopa · · Score: 1

    You should have just create a BufferedImage, you can then call setPixel on the "WritableRaster" you get from it. Then you render the whole image to the screen at once.

  143. Re:Java by QuasiEvil · · Score: 2, Interesting

    I don't define myself as "hesitant" to use manage code, I define myself as "where's my pointer?" You're right, I'm generally skeptical at best of new trends. My job isn't to be trendy or try new stuff - it's to solve problems in something standard, efficient, and sustainable. C has proven a language capable of nearly every practical task thrown at it for the last 30 years. It is easily the most portable ever created. Why would I want to switch?

    Yes, there are those that say I shouldn't be tied to a programming language, because they come and go. That's absolutely true, but I see no reason to use new tools if they offer no substantial advantages to my problems over the old toolsets.

    I'm sorry, I can manage memory and manage pointers. I do not need to incur the penalty and nuisance of using java. C very closely resembles how the underlying machine works (at least for Von Neumann architectures), and I think that's a very good thing for programmers.

  144. Re:Java by mechsoph · · Score: 1

    Java needs that much RAM to do efficient garbage collection.

    Actually, it probably has more to do with braindamaged design decisions like giving every single object an extra word in case somebody ever wants to take a lock on it. There's no way a decent garbage collector would have that much overhead.

  145. Re:Java by mechsoph · · Score: 1

    Nothing is perfect.

    You've obviously never used Lisp.

  146. You used Visual Studio without VC++? by andreyvul · · Score: 1

    Honestly, all the Windows code I've written is either C or C++. Including object-oriented stuff like stacks, queues, vectors, lists, etc.

    Granted, VC++ (as of VC8) lacks C99, it still compiles ANSI C89 code well enough. But I honestly am going to write a script to convert cl.exe options into gcc/mingw options as gcc/g++ pwns VC++.

    You are limited to ANSI C though. And C89 at that.

    While on the topic of Windows, I hate how *everything* that requires a reference in Windows is basically a void *. What happened to type-safety, Microsoft? THen again, I wouldn't be surprised.
    It's sort of like Java in that I fucking hate it (no pointers, gotos, templates (not generics), multiple inheritence, the other fun stuff in C++) but I find ways to work with it. I get the familiar PHP dirtiness feeling when even *looking* at it though.

    Anyways, program in C/C++. For simple things I use C. When I'm too lazy to implement half of STL in C, I use C++.
    In programming contests, I use both.

    Be careful though. Pointers and STL spoil you :P

    --
    proud caffeine whore
  147. If you're interested in writing games... by cavac · · Score: 1

    ...i hereby invite you to join our Jump'n'Run game project "BlinkenSisters". I think, participating in an already working project makes quite a lot of sense, because there's already a team that can help you out when you're stuck.

    We do the core engine in C/C++ with the SDL library, use CMake as our *nix build system and also have (a few) Perl scripts around.

    As for writing portable code: The game is supposed to run everywhere, my team and i can show you many pittfalls of non-portable programming (yeah, we done them all). We have a wide range of sub-projects: From enhancing the engine to scripting to writing new, small tools.

    If you're interested, email us at:
    team AT blinkensisters DOT org

    --
    Look, this thing is totally safe! Built it myself, you know. You just press that button like this and then turn that lev
  148. Spong Bro by Anonymous Coward · · Score: 0

    This is not hard. C++. Do some investigation and play around a bit. There is no superior.

  149. Re:Java by LDoggg_ · · Score: 1

    (lack of automatic boxing of primitive types anyone!).

    The autoboxing/unboxing was included when Java 5 was released over 4 years ago.

    And that particular syntactical sugar is nice, but was never a show stopper.

    --

    "If they have both, tell them we use Linux. And if they have that, tell them the computers are down." -Dave Chapelle
  150. Re:Java by binarylarry · · Score: 1

    Haha, you so funny!

    Ever heard of... bluray?

    Look it up, newbie.

    --
    Mod me down, my New Earth Global Warmingist friends!
  151. Re:Java by binarylarry · · Score: 1

    By your logic, why not just use assembly?

    I mean, I know how to manage registers, allocate memory, call interrupts, etc.

    I'm sorry, but these high level languages abstract a lot of power away.

    Assembly is actually how the underlying machine works and I think that's a very good thing for programmers.

    --
    Mod me down, my New Earth Global Warmingist friends!
  152. Re:Java by SanityInAnarchy · · Score: 1

    Using Java avoids most of the nastiness of Linux

    I wonder how that's "insightful", and not "flamebait" -- I consider Java to be the nastier of that pair. A quote I've always liked: "Saying Java is great because it works on all platforms is like saying anal sex is great because it works on all genders."

    That said, Java is cross-platform, and has had a lot more practice at it than C#. It seems to be trying to make it difficult to not be cross-platform. But I don't think that's a huge concern, these days -- Python and Ruby have decent Windows versions, and there's plenty of cross-platform toolkits for C/C++.

    As a user, I only really appreciate Java programs when they're developed by people who didn't care about portability, so it's really fun to find out that they just work on Linux -- but if you're designing something to be portable, that works well.

    --
    Don't thank God, thank a doctor!
  153. Not just language, but all the tools by Anonymous Coward · · Score: 0

    Like others have said, learn C/C++ and how to use the compilers (gcc / g++). Don't bother with Fortran -- that is more or less a dead end. Learn make. Learn how to use libraries supplied by others. Then learn how to make libraries of your own to complete the circle. Once you have mastery of the *nix tools that allow you to do what you want then you should explore other languages and you will have a better understanding of where each language lies in the bigger picture. If you want to do HPC you might stick with low level compiled languages perhaps together with MPI or some other IPC glue, but if you are interested in GUI programming that decision may be reversed abd python or similar my be best. It is better to first learn the landscape than the details. I would argue that learning a language is second to learning the environment. For example, once you learn how to program sockets to communicate between programs, that skill is language neutral. One thing is certain -- there is no substitute for experience. No matter what you decide to do, keep at it. The more code you write, and the more code from others that you work with, the better you will be at coding.

  154. yay for religious reasoning by Anonymous Coward · · Score: 0

    Too bad for your rant that opinions are like assholes, and so are you.

  155. Re:Java by SanityInAnarchy · · Score: 1

    I genuinely feel that we need something better than X.

    I agree -- although X itself is trying to become "better than X" as well.

    However, I'm not convinced that Windows has got this right, either. The closest seems to be OS X.

    Trivial example: I have two monitors. My laptop's monitor is 1920x1200. My external monitor is 1920x1080. On Linux, this is all I have to know -- if I want a game to run on my external monitor (which is quite a bit bigger), I simply set it to 1920x1080. If I want it to run on my laptop's monitor (say, at a LAN party), I set it to 1920x1200.

    On Windows, if I set a game to 1920x1080, it will run on the "primary" monitor -- by default, it will be stretched strangely on my internal monitor. I have to make the external monitor the "primary", thus putting the taskbar there. Which is stupid -- I have more vertical space on the internal, and that's where the taskbar lives on Linux.

    One more, while I'm at it -- on Linux, I simply installed. I don't think I had to do anything to enable the drivers -- if I did, it was a few commands which are identical on all nvidia systems. By contrast, on Windows, nvidia was not allowed to distribute drivers for that particular model, and Dell only had Vista drivers on their website -- I had to actually have a Dell tech feed me links via chat.

    Also, I consider the dozens of available UI API's, to be a bit of a mess, do I use GTK/QT/*insert random API here*

    I don't know. Do I use Swing/SWT/*insert random API here*

    Use whatever you want -- it's called a choice, and as a developer, you have even less of an excuse for complaining than an end-user does when presented with the GNOME/KDE question.

    As a KDE user, I have a little setting I can set -- enabled by default -- which applies my QT themes to GTK+ apps. I'm sure there's something which does the reverse. So end-users don't have to care what toolkit an app is written in -- it will likely just work, and look like it's supposed to look.

    Further, trying to maintain library compatibility requires intense efforts by developers and users alike. Upgrade one lib, you may break a build.

    This work is also mostly done by distros.

    I consider this to be a much better situation than Windows or OS X. On Windows, everything is statically linked, so if there's a critical bug in a given library, you have to wait for each application to update. On OS X, libraries are either distributed by Apple (so you have to convince Apple to force an upgrade, and you've got the same problem as on Linux), or they're bundled inside the .app folder, meaning that while you probably can update them all, it's not going to be fun.

    Both the Windows way and the OS X way also waste disk space and bandwidth -- sometimes insignificant, sometimes not. Just look at the OS X download of vlc, and compare it with the Ubuntu vlc packages.

    Compare this to Linux. Critical vulnerability in openssl? One apt-get command and it's fixed. For everything.

    I'm sure I'll be modded offtopic as well, but especially for development work, I am much more comfortable on Linux.

    --
    Don't thank God, thank a doctor!
  156. Re:Java by cryptoluddite · · Score: 1

    Only if the memory you allocate is in large chunks. If it's in small chunks, but a lot of them, they you're screwed. Also, you memory will most likely get fragmented so that you waste a lot of it in odd-sized chunks that don't quite fit your allocations. This will also slow down your allocations and frees so they are far slower than GC performance.

    Which is why you use garbage collection and 'memory hungry' environments like JVM for long-running server programs. Or you really, really carefully write your code to really carefully make memory allocations.

  157. Re:Java by SanityInAnarchy · · Score: 1

    I would say, yes, Java is particularly nasty, and it's good to have a healthy fear of it.

    It is the COBOL of this decade, just as PHP is the COBOL of the Web. I am sure my brain would be better off not knowing it.

    I'll admit that this is an opinion, not a fact. It is, however, a strong opinion, and I'll continue to tell everyone who will listen. And it is a fact that it is better to learn more than one language, even if your day job demands exactly one.

    --
    Don't thank God, thank a doctor!
  158. Re:Java by dacut · · Score: 2, Informative

    if you use 300 MB in a C program, it will *always* use 300MB forever after too.

    Depends on what you mean by "use." If you mean it will have mapped that much into its memory space, that's usually true if the allocator is sbrk() based. mmap() based allocators, on the other hand, can return the memory to the OS.

    However, "use" even in the sbrk() case doesn't mean you've used 300MB of RAM. If you never touch it again, it'll be paged out to swap or, if the allocator is written in this way, not have any memory backed to it whatsoever (one can use mprotect() to indicate a range of memory has no access permissions, for example). Yes, those 300MB will be in your address space, but address space != memory.

  159. You as bad question- you get wrong answers by Gverig · · Score: 1

    "I've been cooking pastry- now I would like to do main dishes- what ingredients should I use?"

    What exactly do you mean by "developing for Linux"? Writing drivers? Expanding kernel? Writing desktop apps? Web sites? Command line tools? Distributed programming on Linux cluster? Other, whatever that might be?
    Until you answer this question you will get answers all over the map.
    Desktop applications- you'll likely use C++ (with some C where APIs isn't properly wrapped by a miriad of OO wrappers for Gnome, KDE or cross-toolkit), however there are great apps in Python and other scripting languages. For lighter weight web site (not necessarily in size, but in functionality) you'll likely use PHP or Ruby. For something more substantive on the Web you'll use Java (and don't be afraid, performance-wise it got quite decent, probably at least ~80% of good C++ app speed).
    Ultimately, your choice is limited if you are planning to work in the guts of the system (C with some elements of C++) but beyond that you can use whatever, so you better rephrase the question.

  160. Re:Java by cryptoluddite · · Score: 1

    Rampant bullshit. You'll get somewhat better performance out of HotSpot than the Microsoft or Mono CLRs--not that much better, but definitely better

    First, Mono performance is abysmal compared to JVM. Second, wake me up when CLR can inline a method more than 32 instructions long, or with control flow (if, for, while, etc)... which won't happen because the combination of 'real' generics and a bytecode that forces the VM to track exact types throughout means CLR will always be stuck with poor performance compared to better designed systems.

  161. Re:Java by wtarreau · · Score: 3, Interesting

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

    Ahah ? You should tell that to people who develop applications delivering only 1000 pages per second on a 8-core machine where equivalent plain-old C easily delivers more than 10000 pages per second on a single core of the same machine. Surely the GC is at fault, everything related to object management is at fault, the memory footprint voiding all cache efficiency is at fault, in summary, the language is at fault.

    An yes, that's what I see in enterprises.

    I think the real problem with Java developers is that they have been told that what they did was fast, and they believe it. But let's face it : when processing an HTTP request burns ONE JOULE there is definitely a problem. No wonder why datacenters are filling that fast...

    Everytime a Java developer tried to prove me wrong, he showed me he was able to reach performance levels I was able to reach 10 years ago on an obsolete machine. "Look: 500 pages per second on this small 4-core xeon !". Well, I do 2000 on my 2.5W, battery-powered Geode computer, and that is small.

    So please stop spreading bullshit about efficiency of such things, there are people who believe you and now we find their crap sucking all the power of datacenters.

  162. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  163. Read "The Art of UNIX Programming" by astro-hillbilly · · Score: 2, Informative

    Read "The Art of UNIX Programming" by Eric S. Raymond (Addison Wesley). Then you will know.

    1. Re:Read "The Art of UNIX Programming" by JamesWayne · · Score: 1

      Thanks for this url. Very good book. Looks like it is still very useful, although it was published in 2003. I wonder if someone knows of similar efforts in the last 5 years.

    2. Re:Read "The Art of UNIX Programming" by astro-hillbilly · · Score: 1

      There may be similar books, but this is the best. Even after 5 years, it describes the complete UNIX architecture and development philosophy in way no other book can touch. The architecture hasn't changed all that much since the 1970s (when I started writing code,) so I doubt this book will go out of date soon.

  164. Why does this even need mentioning? by Anonymous Coward · · Score: 0

    INTERCAL is as timeless now as ever. And "timeless" is a namestate for the ever present non-function call to any thread where the process commits to the secondary state, of course.

  165. Re:Java by dacut · · Score: 2, Insightful

    "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.

  166. If you want to truly understand Linux... by maxchaote · · Score: 1

    C! C! A thousand times C!

  167. Learn C and Java by syousef · · Score: 1

    If you "fear" Java but not C, you don't know enough about the two languages.

    Java has huge marketshare in business programming at the moment. Java is object orientated and the memory is managed. If you know C# you'll find Java similar in certain aspects. If you know .NET and Java you've got most of the business market covered.

    C is the foundation of Linux/Unix and teaches you about memory management. C might not be going anywhere but businesses are steering clear of non managed environments. Not knowing how they work however is a mistake. If you work on embedded systems or games, you'll want to know C. If you do go down this path far enough you'll also want to learn C++ eventually but learn one step at a time.

    --
    These posts express my own personal views, not those of my employer
    1. Re:Learn C and Java by Anonymous Coward · · Score: 0

      I'm not so sure I agree with this. I have written quite a bit of Java and found it to be painful. I picked up C after Java and find it much nicer to work in. It is true that Java is popular with huge companies especially since there are so many fresh outs who can write (bad) Java as well as companies (accenture) who can come in and write your Java for you.

      Learn C and a good high level language like Ruby and you've covered through high end to low end programming.

  168. Language choices by Fuzzy+Eric · · Score: 1
    I recommend C or C++ as a first Linux programming language, not for the reasons given above, but because there is a large ecosystem of tools to act on C/C++ source, object files, libraries, headers, and executables. There is nothing wrong with learning the *rest* of the GNU toolchain as well.

    In addition and outside the scope of your question, develop a preference for two languages -- the "guts" implementation language and the "pretty" UI language. They *can* be the same language, but I haven't found that this is a workable situation. The tools that you've used on Windows make it possible to write UIs and nuts and bolts in the same language, but even there it's somewhat easier to write "big", "complicated", and/or "performance" code in VC++ and then paste up an UI in VB. I would strongly recommend developing this separation -- always having a text-only interface and additional interfaces that interact with the core through the command line and/or over a network socket. This is one of the few aha/gotcha issues that I was very happy to figure out and sad that no one mentioned it previously.

    Finally, learn some "odd" languages: Lojban, Malbolge, Scheme, Erlang, Prolog, m4, INTERCAL, and so Forth, for many reasons, including becoming familiar with some of the other tools potentially in the toolchest.

  169. Re: You have no credibility by Douglas+Goodall · · Score: 1

    I see that you have one month of experience in a single sourced proprietary language. You seem to have successfully stumbled through your first program which you have already released to customers, and now you feel confident enough to recommend this language to others. WOW. All I can say is that your program must have been so simple that it took little more than a few lines of code added to the hello world program to make you a success. Your story is just in line with what I hate about Microsoft's approach to programming. It is so Zen, programming without the need to know about programming. If you reduce the problem until it is pathetically simple, then it is not surprising you can write a pathetically simple program to solve it. But here is my question... Did you check any return codes (or enable exceptions)? Did you consider any of the possible things that could go wrong with your program and check for them all? What if the customer's machine is resource challenged? Did you code up the first design that came to mind? If writing code this way is so easy, where is your job security? The next person that comes along with a month to spare can replace you. After what I have said you may think I am an asshole. Maybe I am. You said c# showed no signs of being limited in anything you intended to do... As far as I can tell, c# is good at accessing .net components. The problem is (and this is true of most Microsoft programing) that in the end when you want to actually do something interesting, like accessing hardware, things will become extremely difficult and you will hate everything about managed code. Trusted computing is the bane of existence to real programmers. The day you have two years of experience in .NET you will become overqualified and may never be allowed to work again. I think I have said enough.

  170. Depends... by Dralnu · · Score: 1

    Figure out what you want to do/help with, and see what they are using. Personally, I would start with C/C++ and move from there, but it depends on what you want to do.

  171. RUBY ruby RUBY ruby RUBY!!! by fluido · · Score: 2

    I completely share your disappointment at Python's usage of indentation as syntax. I gave python a deep review when it appeared, around '97 or '98. I was fascinated by the concepts, I could see there was some important element of progress in it. But I concluded that I could never use the language because of the indentation problem. It was (and is) unacceptable that I would end up changing the logic of a program by inadvertently deleting an invisible tab. It is the duty of the editor to fix the right indentation of my code, and it is an invaluable debugging tool to press tab in my Emacs screen and find out what the right indentation should be. This is obviously impossible if it is the change of indentation itself that marks the end of a loop or of an if clause. Really really really impossible to adopt.

    I had hopes that the Python developers would eventually give in and allow the (maybe facultative) usage of a reserved word for closing loops and clauses. This has not happened. Worse: it has become a matter of pride, a distinctive aspect of the language.

    I went on with my mostly C with limited Java usage. Until in 2005 I decided to give Ruby a try. From that moment, all my projects have been written in Ruby, with substantial C inserts. After writing almost 100.000 lines of Ruby code, I am more awed than ever about the qualities of the language. It goes without saying that you use keywords to close loops and clauses in Ruby (either the end keyword, or C-like curly brackets, at your choice.)

    A few reasons for giving Ruby a try:

    • Ruby is from the same generation of Python, only newer. Same zeitgeist, better implementation.
    • Ruby comes from Japan, where it is developed with typical pragmatic attitude. The language contains what is useful, often with more than one possible alternative (you can create your own distinctive style).
    • Ruby implements the object-oriented paradigm in a full, no-compromise way, which is at last capable to deliver the results (in terms of ease of coding and adherence to thought processes) that were promised by the theoreticians.
    • Ruby has a lean, very efficient way of including C code. it is really possible to have the best of both worlds. If you need to use a C library, it is easy to write your own bindings, provided they have not already been written by someone else.
    • Ruby is very net-aware. Generic tasks can be implemented in a few lines of code.

    You should take great care to distinguish between Ruby and Ruby on Rails. The first one is the language. The second one is an application based on the language. While it is obviously good that RoR gained such a notable momentum, it must be remembered that Ruby is a language as of itself, with great qualities that can be harvested even if one does not use RoR. I, for one, do not use RoR.

    1. Re:RUBY ruby RUBY ruby RUBY!!! by Anonymous Coward · · Score: 0

      Great thoughts, I love Ruby too and I share your same ideas.

  172. Yes... and? by warrax_666 · · Score: 1

    RAII doesn't force you to use direct heap allocation, you know. It is quite common to use memory pools and use RAII to ensure that pool element are accounted for correctly.

    --
    HAND.
    1. Re:Yes... and? by Alex+Belits · · Score: 1

      No. I am talking about situations when allocated memory may often have to live longer than objects that use it, and be shared between objects. Total opposite of RAII.

      --
      Contrary to the popular belief, there indeed is no God.
  173. The task remains the same? by pdfalcon · · Score: 1

    C++ is "slower" than C because all those fancy object constructs tend to compile into *lots* of C
    If your goal is blinding speed of execution then the close you can get to machine registers the better. C can get closer than anything except assemblers and is portable.
    If your goal is blinding speed of development, then you're in IDE territory. Maintainability? Well, there you start to come down to architecture.
    And, once you start down that track it's hard to stop before you get to XML documents delivered by XForms and processed by XQuery.
    Mind you, if you don't stop before you get there you'll never get anything done.

  174. Re:Java by Anonymous Coward · · Score: 1, Insightful

    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.

  175. Develop for a paying customer by SpaghettiPattern · · Score: 1

    Try developing for a paying customer (employers included.) They'll tell you what they want and that's what you'll need.

    I myself have decided long ago NOT to meddle with GUIs and to become proficient in stuff that matters to most of my customers. Nowadays as a rule I program Java. System specific stuff I try to isolate and to solve in Perl or -in extreme cases- in C.

    --

    I hadn't the slightest objection to his spending his time planning massacres for the bourgeoisie... (P.G. Wodehouse)
  176. The perfect programming language by Anonymous Coward · · Score: 0

    I second you design your own language. Then we would have yet another choice for programming language, which would attract fans from all over the world which absolute reject any other language.

    Keep in mind: programming is just a tool. nothing more and nothing less. as long as you can generate a bug-free-five-start application, nobody cares what language you used.

    Linux: most languages are supported. Now it's your turn to pick :)

  177. A part of the point is... by warrax_666 · · Score: 1

    that you can do this generically -- so you don't have to have the refcounting logic repeated all over the place.

    --
    HAND.
    1. Re:A part of the point is... by johanatan · · Score: 1

      Yea, but templates without deterministic destruction would *not* let you do this. The OP only mentioned templates as if they were the *sole* mechanism supporting this. That demonstrates a fundamental misunderstanding in my opinion.

  178. Re:Java by nschubach · · Score: 1

    Because we live in a world where multiple OSes exist? Because there are more than just one kind of processor? Because there are 32-bit, 64-bit, 128 ...? Because programmers make assumptions ...

    --
    Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
  179. That's what he said! by pjt33 · · Score: 3, Funny

    What is C other than a slightly higher level assembly language than nasm?

    1. Re:That's what he said! by turgid · · Score: 1

      What is C other than a slightly higher level assembly language than nasm?

      Indeed. And with ubiquitous free PeeCee emulators (bochs, qemu etc.) portability is not an issue.

    2. Re:That's what he said! by eneville · · Score: 2, Informative

      C is a means of actually controlling what your application is doing and knowing how it's doing that. With interpreters its not so easy to tune things. To a large extent the Java/Perl interpreters often bottle neck when dealing with extremely large hashes, some times the interpreters can do good things with memory managers, but then again, the APR has one of these to use also.

    3. Re:That's what he said! by Luke-Jr · · Score: 1

      C introduces types. Assembly (MIPS, at least, which is all I know) only has 32-bit integers.

      --
      Luke-Jr
  180. Re: Quality of generated code by Douglas+Goodall · · Score: 2, Insightful

    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.

  181. Re:Java by Anonymous Coward · · Score: 0

    wow, bluray players do their h264 decoding via java bytecode huh? maybe you should re-educate yourself on what exactly java is used for by bluray players :)

  182. Re:Java by shutdown+-p+now · · Score: 1

    About the only thing I'm aware of that Java is really missing relative to C# is LINQ (not that that's by any means a small thing)

    Notable things that are in C# that are missing from Java:

    • Syntactic sugar for RAII:
        using (Stream fs = new FileStream("foo")) { ... }
    • True multidimensional arrays:
        int[,] a = new int[10, 20]
    • User-defined value types (stack or inline allocation, structural equality by default, no referential identity)
    • Nullable value types:
        int? x = null
    • Syntactic sugar for iterators / lazy sequences:
        foreach (int x in xs) yield return x*x;
    • Generics for value types:
        IList<int> l = new List<int>()
    • Reified generics (the lack of this means that in Java, you can't have a class implement both IComparable<Foo> and IComparable<Bar>, and you can't check for instanceof IComparable<Foo>)
    • Full-fledged closures with mutable variable capture (anonymous delegates in C# 2.0) and type inference (lambdas in C# 3.0)
  183. FSF says that because they wrote GCC by sentientbrendan · · Score: 1

    >e 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.

    FSF software is largely written in C, and they were the guys who published that document. It made sense in the 90's because C was one of the few cross platoform and highly efficient languages available at the time. Also, the C compiler GCC was and is the flag ship product of the FSF so of course they are going to push C.

    That some people still push C for application programming is mostly because there are still a lot of old timers who aren't familiar with modern programming languages.

    Anyway, if you need a standardized cross platform language these days you have many better choices. Python springs to mind. Java works as well, although I find the language design somewhat poorly thought out.

    If you still need the performance benefits of C, you should use C++, which is actually faster than C due to the performance benefits of template programming. C++ provides higher level abstractions like object orientation, virtual functions, and templates.

    Many people still use C over C++ due to the simplicity of the C syntax. C is easily learned compared to C++. This is a benefit; however, if you are a serious developer, you should just bite the bullet and learn C++, as it will make you more productive and allow you to write safer code by using smart pointers and stl containers.

    That said, you should learn C as well, as it is still a useful language, especially when doing kernel space programming. There's no reason to write a non-embedded user space application in any language lower level than C++ though.

  184. Java, C++, Python - not Mono by shutdown+-p+now · · Score: 1

    Java is actually good enough, especially for a .NET developer.

    Otherwise, learn C++ for low-level stuff (and, as many others have recommended, look into Qt - its rich library will likely remind you of what you got used to on .NET more than once), and Python for high-level & prototyping. Note that knowing C++ means knowing all of it, which means you will learn all the C bits in it as well - after that, you will likely be easily able to at least read & understand C code, and if you ever want to write your own C code, you'll only need to glance through the spec to see what C++ bits are also in C, and mind the few minor incompatible differences.

    I wouldn't advise to go for Mono first or second. For one thing, you say you want something different, which it isn't. For another, it's rather slow compared to what you might expect from a .NET clone (it doesn't even use a compacting GC, which means that you run into a pretty real possibility to fragment your heap to the point you can't do an allocation!). Its visual development tools (e.g. MonoDevelop) are extremely unstable. Finally, its future is not very clear - I don't see it growing much in the last year or two, and there is strong opposition to it among the F/OSS crowd. Especially now that Java is fully open sourced.

    That said, it's still worth looking at just to know what's there and to learn its limitations.

  185. What about C# by Anonymous Coward · · Score: 0

    If you're just looking at application development, with Mono ( using Monodevelop IDE ), C# with Winforms is supported, so you don't really need to change your mindset. Personally, C++ is a preference ( with Qt for GUI if i have to ) but Mono has really made life much simpler for those coming from a .net background.

  186. Re:Java by Anonymous Coward · · Score: 0

    yawn, yes yes java vms are very good at optimizing memcpy, and adding numbers together in tight loops. wow.

    what happens when you try something complicated? something that users ACTUALLY spend a fair bit of processor time on? like say, compression/decompression?

    oh dear me. looks like java is LESS THAN HALF THE SPEED of C when used for data compression (http://molhanec.net/old/lzma_speed.php), and my own repeated benchmark runs of the jorbis ogg-vorbis decoder shows it as running at only ONE THIRD THE SPEED of ffmpeg's C decoder, and that's after optimization from the author. the author of jgz is proud of his java deflate library that's only 2.2 to 2.7 times slower than zlib (http://www.bolet.org/jgz/goals-en.html).

    that's just awful. i mean, really really sad.

    so anyway, until this pathetic joke is remedied, i'll stick to using, well, anything compiled apparently, since java is still the joke i remember it as being. some people actually have to write maintainable, fast code for a living you know.

    and for some reason my users don't sit around all day calculating fibonacci sequences. where can i get some of your users?

  187. Re:Java by Anonymous Coward · · Score: 0

    i would say that even for a competent programmer, it is difficult to write a program in assembly that is portable between intel, arm and power architectures. some would even say you'd need to rewrite said assembly in its entirety! hardly economical.

    in my experience, c code can often be ported to new architectures quite easily, so long as endian issues and library availability were addressed during the planning stages.

    i hear c can execute quite fast when compiled too, almost as fast as assembly!

  188. Maximum exposure means C/C++ by Anonymous Coward · · Score: 0

    For maximum compatibility and exposure go with ANSI-C or C++ and try to choose popular GUI toolkits (QT or GTK).

    Don't try to use funny libraries or funny language with special bindings what currently seems to be overly en vogue.

    The sysadmins will thank you :)

  189. Re:Java by Luke+has+no+name · · Score: 1

    And Accessors... and some cleaner stream implementation.

  190. Ruby vs Python? by Clarious · · Score: 1

    So between Ruby and Python, which should I choose? Though I heard a lot of great things about Ruby, I haven't tried it yet, what is its strong point over Pyhon? (let not talk about perl here)

    1. Re:Ruby vs Python? by kabloom · · Score: 1

      I don't know. I haven't used Python.

      You might look at this comparison, or just have a look at some sample code.

  191. No one mentioned shell or Tcl? by deanston · · Score: 1

    I don't understand why if you know C# you would be put off by Java, since they have lots of similarities. If you know ASP.NET/VS you probably been exposed to VB too, so the white-space/indent in Python should be no biggie. Once you start playing with command line Python scripting might as well touch on all 3 Ps in LAMPPP - Perl/PHP/Python - which powers half of the web and can be used more dynamically than C# for anything from desktop scripting to web dev. If the Ps got you excited you would almost want to go lower and learn more about the Cs - C/C++ which are their foundation.

  192. How to learn a new language by Anonymous Coward · · Score: 0

    It was frequently mentioned that you should never stop learning new languages. (e.g. one a year)

    I totally agree.

    But how to do it effectively? To my mind effectively means having at least a bit of fun.
    Writing hello world and testing some language specific things is rather unspectacular.

    Personally I have got a lack of creativity when it is about to start a new project.
    Nowadays there are bitbucket.org, github.com and others. Browsing it for good may result in a interesting project to participate and dive into the new language.
    But it is rather rare to find something interesting there.

    How do you do it?

  193. Re:Java by IkeTo · · Score: 3, Insightful

    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. } } }

  194. Re:Java by Mr+Thinly+Sliced · · Score: 1

    Some pet hates about Java:

    * True polymorphism for generic types (look to ML)
    * Real templates (a la C++) with anonymous strict typed compiled instances
    * Better interaction with native C libraries - JNI stinks - look how perl processes headers, maybe do something like this
    * Only one superclass - bah, that is a pain
    * Annotations - whose idea was this crap? Make it a real part of the language so it can be enforced

    Don't get me wrong, I make my bread and butter from Java, but lets not kid ourselves that it has issues.

  195. Re:Java by Jurily · · Score: 1

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

    Yes. At runtime.

  196. Use Python and WxPython by JamesWayne · · Score: 1

    Some 5 years ago I migrated all my programs to Linux, using the software generator Modgen, written in C.

    At that time I was creating a lot of programs in Visual Studio using VB, calling PL/Sql packages procedures for Oracle.

    Nowadays I use Python (easier than Java; just use a set of import statements for the classes you want to use in your py-file and all classes are available for use), where the GUI aspect is replaced by WxPython (The WxPython demo provides a wealth on code examples, that can be tried out from a navigation tree) and the Database aspect by Mysql (I use Phpmyadmin as the administrative interface to all my databases).

    For Web-applications I still use Php + Mysql.

    To see examples of both a Windows app and the equivalent Linux app, check the JW-CPO-WIN and JW-CPO app on http://members.home.nl/wijnenjl/index7o.html; for an example of a Php web app see JW-RES-LAMP-PHP.

    I turns out that these applications also work on windows, although I try to avoid it as much as possible.

    I also tried to check if a development framework like Eclipse, Netbeans, Jbuilder was feasible. I like their beauty, although the learning curve is rather steep. (Eclipse is good for Java development, Netbeans has some nice tutorials for Web Applications. Jbuilder has a feature, where changing code is changing your graphical diagrams).

    The major reason for me to use Linux is, that all the languages (including the functional languages such a LISP, Prolog) can be learned for free, the drawback is that the intuitiveness of the development GUI is lagging a few years behind on Windows.

    So. In summary: learn C (and also a bit of CPP), Python and WxPython (You probably won't need Java anymore).

  197. Re:Java by shutdown+-p+now · · Score: 1

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

    Not only it isn't far off, we've been here already. For example, all Unreal games are built on top of UnrealScript, which is largely a Java-like, bytecode-interpreted (not even JITted!) language. Of course the 3D rendering parts and such are still written in C++ (not C, by the way) and marked as "native" classes and methods in UnrealScript.

    On a side note, Unreal Engine 3 uses mark & sweep garbage collection, as well.

  198. fear of Java? Java is OOP, C# is not. by Anonymous Coward · · Score: 0

    The 'architects' of C# did not even read an object oriented book. Some guys read a few java tutorials and came up with the idea of adding renamed Java keywords to C++, thus the birth of C#.

    Go to wikipedia and look for MVC (model view controller) programming, then you'll see that Java Swing is the only MVC oriented real world GUI framework. Then try using a C# DataGridView with one million rows on virtual mode. It's crap!

    1. Re:fear of Java? Java is OOP, C# is not. by Moochman · · Score: 1

      What are you talking about? Swing is no more MVC than any other toolkit out there. It's just as easy to mix presentation logic and business logic with Swing as it is with any other framework, if not easier--since in Swing there is no such thing as a "layout definition"--the layout is all done directly in code.

      Whether or not you build an app using the MVC pattern has nothing to do with whether or not you use Swing.

      What Swing absolutely *does* have going for it, however, is that it's event-driven through and through. And that does provide a distinct advantage. :)

    2. Re:fear of Java? Java is OOP, C# is not. by JamesWayne · · Score: 1

      I am afraid you connected your reply to the wrong comment. Please reconnect it. James.

  199. Languages aren't OS-specific by chaoschimera · · Score: 1

    Something no one has pointed out yet explicitly (though narcberry alluded to it) is that each of these languages runs on both Windows and Linux (and other operating systems as well). Some languages may be better supported on some platforms, but the differences are generally small beyond the library differences you run into mostly with C/C++. While the various .NET languages are certainly Windows-centric, and Perl/Python/Ruby/etc. were mostly born and bred on *NIX systems and favor them still, for the most part it doesn't matter. As many have pointed out, Mono exists for *NIX systems. C/C++ obviously work in both worlds, the only substantive difference is in the libraries you might use to get things done (C++ keeps coming up as a *NIX language, but between VC++ and other C++-related projects at MS, Microsoft takes C++ very seriously). But I've worked at Windows shops who had all of their scripting done in Perl and Python - running on Windows. A better focus for your question might be to learn about the different classes of languages. If you've never seen much other than C# and ASP.NET, you're limited by the narrowness of your knowledge of abstractions more than by your inexperience with Linux. Learn about managed versus unmanaged languages (C/C++ versus C#). Learn about static versus dynamic type systems versus the in-betweens (for you, perhaps IronPython and F# compared to C#?). Learn about different ways of building concurrent systems (shared state vs. message passing, most things vs. Erlang or E). The most substantial difference from a programmer's perspective between Windows and *NIX is really the difference in the native threading APIs (which you generally see only from C/C++). Most of the rest is just learning a variety of libraries, and you'll probably learn and forget more of those over the course of your career than you care to think about, regardless of what platform you're on.

    --
    #!/bin/bash
    :(){:|:&};:
  200. Re:Java by shutdown+-p+now · · Score: 1

    java as a language is decent, but some people hate having to have their code run in a virtual machine, and the performance penalty that entails.

    The performance penalty for VMs (the ones with JIT) is often exaggerated, though it depends on the way you write code for it.

    For Java, some things are unavoidable as it lacks any means of explicitly doing non-heap allocations, or circumventing array-bound and null checks; and the JIT can only be so good at optimizing those.

    .NET/C# is a whole different kettle of fish. CLR type system is actually "unsafe" - it includes proper unchecked data pointers complete with pointer arithmetic and dynamic stack allocation (i.e. alloca), true C-style function pointers, explicit non-heap allocation for values of user types (structs) with full control over layout, including the ability to define C-style unions (LayoutKind.Explicit + FieldOffset). Together, all this allows to directly map every C construct, with no extra runtime checks. At that point, the only difference in performance between C# and C/C++ will be because of the different quality of optimizers, and even there it's not as clear-cut as you think; for example, a JIT can inline method calls between dynamic libraries, while a C++ compiler obviously can't.

    Note that this doesn't mean that your typical idiomatic C# program runs as fast as an idiomatic C program. It just means that you can, if needed, code at a much lower level in C#, sacrificing convenience and safety for speed, for spot optimization, without having to resort to C/C++.

  201. Healthy fear of Java by Moochman · · Score: 1

    Over the years I've developed a healthy fear of everything Java

    Why?

    Coming from C# I would think Java is the most natural transition...

  202. Mono will get your CV routed to /dev/null by Anonymous Coward · · Score: 0

    Mono, C# and other horseshit may get you past the bean counters who cannot tell any language from another. However, once they pass that CV on to the engineers and technical staff they will see that big C# (cocktothorpe) and immediately doubt your qualifications, especially in regards to programming.

    If you want to learn programming on Linux, stay far away from any thing that even hints of M$. As everyone else has mentioned, become proficient in C and you will always have a job.

  203. Healthy fear...? by Moochman · · Score: 1

    Over the years I've developed a healthy fear of everything Java

    Why?

    Coming from C# I would think Java is the most natural transition...

  204. The language is irrelavant but the Art is not by horli · · Score: 3, Informative

    Learn the Art of Unix Programming, because the programming culture is very different to Windows: http://www.faqs.org/docs/artu/ Programming languages are not so different to Windows.

  205. Re:Java by Anonymous Coward · · Score: 0

    Check out Groovy! It has some neat features which is on par with LINQ

    Here it's done in Groovy: http://permalink.gmane.org/gmane.comp.lang.groovy.user/5526

    Here it's done in LINQ: http://weblog.infoworld.com/udell/2005/09/28.html#a1310

  206. man pages - essential reading by turgid · · Score: 1

    C. And don't forget the man pages.

    I've found that people from a Windows background overlook the man pages. They are absolutely essential for effective C programming on Linux or other unixes such as Solaris or BSD.

    man 3 printf and away you go!

    I'd also argue that shell scripting should be a higher priority than PERL at first. Although shell scripts look ugly and confusing to a novice, after a couple of hours with some good references, and some practice on the command line, their power and simplicity become apparent. tldp.org has some excellent sh/bash resources for beginners and experienced coders.

    For PERL, you really need the camel book. PERL is a nightmare, but it's a rite of passage, like C++ only worse.

  207. Re:Java by MichaelSmith · · Score: 1

    How do you draw a pixel in Java? Oh yeah, that's right, there is no way to do it.

    You can't have looked very hard.

  208. Re:Java by FishWithAHammer · · Score: 1

    I'm pretty sure you can AOT your code for faster startup with most VMs, no?

    --
    "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  209. Re:Java by FishWithAHammer · · Score: 1

    So AOT your code to remove the first JIT step and let your optimizing VM (HotSpot or whatever) only JIT when it's doing dynamic recompilation.

    --
    "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  210. Re:Java by FishWithAHammer · · Score: 1

    I don't recall saying JSP was a well-built technology. I don't use it.

    I use ASP.NET instead, which is quite fast, quite featureful, and very scalable, as opposed to (hurp!) PHP or the like.

    --
    "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  211. Re:Java by Bill+Dog · · Score: 1

    That said, Java is cross-platform,...

    Java is not cross-platform, Java is a platform. Take threading as an example. If you know Java threading and only Java threading, then you don't know Win32 threading, or POSIX threading. I think that's what GP meant by Java avoiding the "nastiness" of Linux -- if you opt to use the Java platform on Linux, you can avoid having to learn the system calls or whatever that comprise the "Linux (programmer) platform".

    --
    Attention zealots and haters: 00100 00100
  212. Re:Java by swilver · · Score: 1

    Eclipse is usually quoted as being a big "resource hog", but few people realize really why it is using all those resources. You, like many, probably think it is "wasting" all that memory and is just being an inefficient dog. However, in reality, most of the memory eclipse uses is to make it work faster, and being able to provide you with fast code completion, error analysis as you type, fast searching and compilation. Eclipse will use more memory generally when you have more source files to work with, causing it to have to index more data for almost instant use (code completion especially needs to be fast to be useful). It will also do a lot caching of files for performance reasons.

    For smaller projects, containing say 200-300 source files, Eclipse happily runs with 40 MB of RAM, and won't exceed that unless really needed. If you feel it is wasting too much resources, then turn off some of the useful features... you may find that wasting resources for very handy features is not that bad a trade-off.

  213. Re:Java by dkf · · Score: 1

    If it's in small chunks, but a lot of them, they you're screwed.

    No, but you might need to use a custom allocator, and writing those to be performant is a fairly black art on any OS. (Yes, I've written such things for an application that had a non-standard memory usage pattern. The default "high-water mark" allocation strategy used by malloc() is much easier to work with!)

    --
    "Little does he know, but there is no 'I' in 'Idiot'!"
  214. Re:Java by dacut · · Score: 1

    Heh... assuming AOT == ahead of time compilation, I find it funny that they have a term to describe what the rest of the world just calls "compilation." :-)

    Yes, AOT can be much faster. Case in point is gcj, which compiles Java code to normal ELF objects -- and, of course, no VM required, so a JVM doesn't even come into the equation. You will lose validation checks (e.g., the code can segfault if it's tweaked), but from my perspective: who cares? Obviously, this isn't something I would want playing in my browser (but, then, who uses browser Java applets anymore?), but for something like Eclipse it's wonderful.

    There are some runtime security checks which might go missing, too. As far as I'm concerned, that is the domain of the OS, not a VM I'm starting up myself.

    Anyway, yes: I'm keen on seeing Java compiled to native platform binaries. Sadly, this is still a niche rather than the dominant model. I don't see my workplace getting off of Sun JVMs anytime in the near future, for example.

  215. On Gnome add Java and Perl! by Anonymous Coward · · Score: 0

    Huh. There are great language bindings for java and perl (and other languages) for gnome. These are first class languages for the gnome platform:

    http://www.gtk.org/language-bindings.html

    I use gtk-perl a lot (with GUI design in glade) and it's great!

  216. C++ or Java by Aerospike · · Score: 1

    I have developed for Windows since Windows 3.0. Starting with MSVC 5.0 Visual C++ I have used all Developer Studio's. One and a half year ago I researched our options for a X-platform basis for our software clients. I looked at Mono for 2 hours before discarding it. I finally chose Java SE, and it took me very little time to get used to the fabulous NetBeans IDE (looked at Eclipse too, but NetBeans takes much more care of things that aren't very obvious to Java newbies) I am now porting our MSVC/MFC C++ codebase to GCC with the C++ standard lib and the impressive Boost library. I had to refresh my C++ skills, regarding templates mainly, but it was well worth the effort. After a lot of evaluations I decided to opt for CodeBlocks as my IDE. It's not comparable to Visual Studio, but certainly good enough! So I'd recommend standard C++ for software that has to be fast (our software manipulates 1 bit TIFF G4 compressed files, quite CPU intensive), and Java for the rest. You aren't working directly with Linux with any of these suggestions, but it will run very well on Linux, as on most other OSes,

  217. Yep, RAII is where it's at by Joce640k · · Score: 1

    RAII is the reason you shouldn't be using C any more (ie. C can't do it).

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

    This is RAII...

    Obj-C is Ok, but locks you into Mac-only development.

    C++ is a better bet in the long term. It has ugly syntax, sure, but you get used to that.

    --
    No sig today...
    1. Re:Yep, RAII is where it's at by brainnolo · · Score: 2, Interesting

      Actually he is mentioning Linux. GNUstep is a really good platform for experimenting with Objective-C. It should be stable and full-featured enough for the needs of learning. I started coding Objective-C on that about 6 years ago. Over time I switched to Mac, which of course provides me with a more stable environment for Objective-C programming, yet GNUstep was very useful and I guess it evolved since I last used it.

    2. Re:Yep, RAII is where it's at by Curtman · · Score: 2, Informative

      Obj-C is Ok, but locks you into Mac-only development.

      Why, did gcc drop objc? It seemed to work well when I played with it a while ago.

    3. Re:Yep, RAII is where it's at by Anonymous Coward · · Score: 0

      C is a turing complete language, so of course you can simulate it. Don't be retarded.

  218. Re:Java by swilver · · Score: 1

    I don't define myself as "hesitant" to use manage code, I define myself as "where's my pointer?"

    You are right there are no pointers in Java. The closest thing are Object references. The big difference between pointers and Object references though are that Object references are a completely separate type that does not derive from a basic type like int or long depending on your platform. This means that certain operations, especially calculations, are simply not allowed as they make no sense (pointers in Java make no sense as there's no address space, which also happens to make Java virtually immune to some security issues like buffer overflow exploits).

    Still, object references can be thought of as pointers, but more abstract. You can still do the important stuff with them, like putting them in lists, dereferencing them, double indirect lists, etc.. with the big advantage that everything you can do can be closely and accurately scrutinized by the compiler.

    One of the biggest design goals for Java was to eliminate large sources of potential (programming) problems by making it possible for a compiler to make sense out of your code. Java, and perhaps C#, are currently probably the most strict programming languages there are, providing more compile time checks then ever before. It also makes Java very refactorable and is the reason why Java IDE's can provide so much automated refactorings and fixes, with quite a high degree of confidence that these will not affect the intent of the code.

  219. Re:Java by swilver · · Score: 1

    what happens when you try something complicated? something that users ACTUALLY spend a fair bit of processor time on? like say, compression/decompression?

    You mean writing something that already exists? I guess you already missed a big point of why Java is being used then. For such things we just use the existing libraries (which donot necessarily have to be Java based), or more likely, the built-in zip style compression, which may or may not be optimized for your platform depending on where you actually run the code.

  220. Re:Java by Anonymous Coward · · Score: 0

    "Java is slow" is a stupid old myth.

    Perhaps you can write fast code in java but I'd say that it's much harder than in other languages since the compilers are so retarded. You can find interesting examples on J2ME forums where mobile game developers try to squeeze everything out of it (and quite generously share their findings with each other despite actually being competitors). Did you know that

    for (i = 0; i < whatever; i++) {
        int value = 1234;
        System.out.println("the value is:" + );
    }

    is much slower than

    int value;
    for (i = 0; i < whatever; i++) {
        value = 1234;
        System.out.println("whatever");
    }

    The compiler is so fucking retarded that it hurts - I don't think it even tries to optimize anything.

    IMHO it isn't fair to say that java isn't slow if the requirement is that you first make many optimizations that other compilers do automagically. One should compare average quality code in Java with the same in some other language because most code is of average quality.

  221. Re:Java by swilver · · Score: 1

    So.. what was the cause of those crashes then? Cause I don't even remember the last time I had a crash with a Java program or JVM.

  222. I made a mistake in parent! Mod it down & this by Anonymous Coward · · Score: 0

    "Java is slow" is a stupid old myth.

    Perhaps you can write fast code in java but I'd say that it's much harder than in other languages since the compilers are so retarded. You can find interesting examples on J2ME forums where mobile game developers try to squeeze everything out of it (and quite generously share their findings with each other despite actually being competitors). Did you know that

    for (i = 0; i < whatever; i++) {
            int value = 1234;
            System.out.println("the value is:" + value);
    }

    is much slower than

    int value;
    for (i = 0; i < whatever; i++) {
            value = 1234;
            System.out.println("the value is:" + value);
    }

    The compiler is so fucking retarded that it hurts - I don't think it even tries to optimize anything.

    IMHO it isn't fair to say that java isn't slow if the requirement is that you first make many optimizations that other compilers do automagically. One should compare average quality code in Java with the same in some other language because most code is of average quality.

  223. QED: Java is dreadfully slow by Anonymous Coward · · Score: 0

    So AOT your code to remove the first JIT step and let your optimizing VM (HotSpot or whatever) only JIT when it's doing dynamic recompilation.

    All that crap is meant to be done by the compiler, not by the programmer.

    C runs like blue light out of the box, without the tedium you describe. The day that Java does likewise, you'll finally be able to say it's fast.

    Meanwhile, it's over a hundred times slower than C.

  224. Re:Java by samkass · · Score: 1

    Good list, except #3 is a bit specific, I think. There are a lot of other CS fields besides language parsing that teach these skills, and requiring that one in particular is a bit of over-specialization unless that's what you're hiring for.

    I'd also still disagree that fearing Java-- or any particular technology- is a good thing. As you say, the language that the applicant spends their workday in doesn't matter all that much, so why not Java? It's easily the best intersection of pleasant to develop in vs. can build something substantial that I've ever used. It's also a harder language to make errors in. It's no ML where "it compiles so it probably runs correctly", but it's a far sight better than C, C++, or Objective-C. (Not sure about C#-- don't have much experience there.)

    --
    E pluribus unum
  225. Re:Java by Anonymous Coward · · Score: 0

    Heli-X(.net) is written in Java and runs ok on my 1,7GHz Sempron. So 3D games shouldn't pose a real problem.

    So I second Java.

  226. C is King by Anonymous Coward · · Score: 0

    As a programmer since 1982, I have leanrt many languages. The only language so far that has given me indepth insight into Unix/Linux is C.

    In my personal opinion, procedural languages outstrip objective languages in both maintainability and speed of development (but only if you have a skilled team).

    Learn C.

  227. Web Software... by g4b · · Score: 2, Insightful

    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...

  228. Platforms where C does not work by tepples · · Score: 3, Insightful

    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.

    1. Re:Platforms where C does not work by tomhudson · · Score: 1

      And what do you think the runtimes on all those platforms are written in? c/c++.

      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.

      Since when? Last time I checked (showed my boss how much quicker a c binary can be executed than a long php script by running both on my hosts' web servers) my hosting provider supported cgi binaries written in c ...

      My guess is it depends on your hosting provider, but in the early days of the net, c code frequently ran on web servers, which is where the "bin" in cgi-bin came from :-)

    2. Re:Platforms where C does not work by VGPowerlord · · Score: 1

      In my experience, in the 90s, if you said "CGI script," people assumed you were talking about Perl.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    3. Re:Platforms where C does not work by BitZtream · · Score: 1

      Wow, someones full of FUD today aren't we?

      C Works just fine on the XBox, the XBOX 360, the PS3, the Wii, and on smart phones. The Javascript and Actionscript engines you are refering too are written in C. I have many C cgi apps that run in a shared hosting enviroment. In short, you are wrong on pretty much all counts.

      In the first two cases, just because YOU don't have access to the development enviroments that allow you to use C on those platforms, doesn't mean it doesn't work, it means you can't make it work. Pretty much every major browser has a way to run a C plugin, even those on smart phones including mobile IE and mobile Safari, it just isn't something that will run from within a web page without the user installing it, granted. Plenty of places let you run C cgis in a shared enviroment.

      I'm sorry you are not comptent or confident enough to use C as your language, and I'll be the first to say that there are probably better languages to use in many cases for a new developer, but saying the you can't use C in those enviroments is just ignorant and misinformation that doesn't need to be spread.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    4. Re:Platforms where C does not work by horza · · Score: 1

      C does work on the server side of web applications, in fact many of the first server side apps were written in C running via CGI. No reason it won't work on shared hosting either, last time I looked my shared hosting provider had a CGI directory. You have have to compile on another machine and copy across. No problems with using C in Python or PHP (I've done the latter and it's very easy).

      All in all I think you're completely wrong.

      Phillip.

    5. Re:Platforms where C does not work by tepples · · Score: 1
      For the sake of argument, I'll grant the availability of shared web hosting plans that allow unmanaged code. But one part of your comment doesn't follow:

      All in all I think you're completely wrong.

      If I'm so wrong, then what steps should I take to negotiate with game console makers, mobile network operators, and Internet cafes to get my software deployed?

  229. Children these days... by Hurricane78 · · Score: 2, Funny

    I input the data straight into the bus, by using eight Morse keys at 4 Hz.

    Now get off my lawn!

    --
    Any sufficiently advanced intelligence is indistinguishable from stupidity.
    1. Re:Children these days... by rrohbeck · · Score: 2, Interesting

      A buddy of mine in university had to toggle the boot loader back into an old HP machine's core (yes, real core) after he blew it away through a programming error (no memory protection of course.)
      It took him well over an hour. Everybody was much more careful about single stepping through potentially hazardous area of their code first after that. Good times... uncontrolled access to the lab building so we had pizza and beer in there.

    2. Re:Children these days... by Master+of+Transhuman · · Score: 2, Interesting

      I once worked on a machine with 40K of core - REAL magnetic cores! - where you had to toggle the machine code - which was in ASCII! - into the machine from a front panel. This was an RCA 301 from back in the '60's that an idiot friend of mine had installed in the late '70's to run his father's department store. The box was THIRTY THOUSAND POUNDS of hardware. The flooring had to be reinforced to hold it. The wiring was a rat's nest. It used nine tape drives and actually had a COBOL compiler that required hours of multipass compilation to compile a program with a couple thousand lines in it.

      There was a hard drive that never worked - it held 10MB, the disk was about three feet wide, and it took a 30HP motor to spin it.

      Data input was via punch cards, until we got a card-to-tape input device.

      My advice: don't try any of this at home.

      --
      Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
  230. In the end by captaindata · · Score: 1

    There are a couple of posts which express the philosophy that the particular tool does not matter. I agree 100%. Be adaptable to a given instance.

    IMHO, if you have learned how to learn, then I suggest the following exercise:

    1) pick a simple app, like a console or web-based address book (the UI does not matter in this exercise)
    2) implement in language of choice ( I would recommend C, the reason will be clear shortly )
    3) given a set of other interests {C++, Perl, Python, Java, C#, etc}, repeat #2 a couple of times
    4) reflect on the experience of porting between languages

    What you should be looking to do is to build confidence in yourself. Knowing how to do something as hard as possible, even though you may not need to do it in real life is a real confidence builder.

    So, if you know how to make apps in C and can build an appreciation what higher level languages are doing for you, you will be able to speak intelligently and confidently with anyone regardless of the language or environment.

  231. Choose languages for you, not the platform by James+Youngman · · Score: 2, Informative

    Other people have expressed this in different ways, but:

    If you want to achieve a level of excellence beyond the average programmer, learn a number of languages well. If you are developing on Unix, learn at least:

    1. Shell programming (not just how to type Unix commands)
    2. A proper scripting language (Python or Perl or, perhaps, Ruby) to use when that shell script would otherwise be reaching 100 or so lines
    3. A systems programming language (C is the best choice here, though you can probably get by with C++)
    4. An object-oriented language (e.g. Java or Python or C++)
    5. LISP or Scheme
    6. Any functional language (there are a number of candidates, pick something a friend uses if you need help learning one).

    If you had asked about developing on any other system than Unix, I'd have dropped the requirement for shell script programming.

    The benefit of learning more than one language is that it leaves you with the ability to consider a problem from more than one point of view, gives you insights into effective and powerful methods, and lets you choose the right tool for the job.

    There is nothing more painful than a multi-hundred-line C program that should really be a 20 line shell script or a 300 line shell script that should really be a 500 line Python program. Especially when it comes to maintenance.

    Once you have started learning the languages, take care to get to know the associated tools; the profilers, the debuggers, tools like ltrace, strace, valgrind, lint checkers, and so forth. Then research the available libraries for those languages (CPAN for Perl, Boost for C++, etc.)

    Oh, and when I say learn a language, I mean use it to write a non-trivial, useful program that you intend to use regularly.

  232. The kernel is written in C by Anonymous Coward · · Score: 0

    say no more.

  233. For system stuff use C, for GNOME apps use Vala by formal_entity · · Score: 1

    I have a long C# background and I found that the Vala programming language has been a great learning experience for me. It's not a rock solid platform yet and there is also very few tools for it but if you look at the code for the Vala compiler itself, it's just an awesome project! It allows you to write comfortably in a syntax similar to C# but you still have 100% interop with C (you can use all the normal Linux libraries like GTK, libpng etc etc) and it compiles to native code. Since Vala is growing very fast right now, it's also an opportunity to be part of a new revolution. To be in it from the beginning. You have a chance to make a difference and impact this terrific new platform. If you don't feel comfortable working without mature IDE tools you should just stick with C# for now and use Mono and MonoDevelop for instance. Long term you will not be able to make significant contributions to the open source community using Mono though because many users will reject the apps just based on the platform (which is silly in a way but it's a fact unfortunately). Java rocks for server side but has been reject on the desktop due to the bloatiness of apps like Eclipse. Python is great for scripting and small utilities.

  234. java by Anonymous Coward · · Score: 0

    java you moron.

    Develop for everything. Are you gonna be a kernel maintainer? Or develop something useful for someone?

    1. Re:Java by Anonymous Coward · · Score: 0

      Don't get angry at me, but I just had to think "that describes very well what a lot of people consider wrong with Java". Note that I consider the Win32 (and raw X11) API about as horrible in that respect, but C/GTK or C++/Qt or C# etc. all do a much better job of making it easy to know "the right way" to do something (the right way may or may not actually be worse than in Java, but at least you find it easily).

    2. Re:Java by anon+mouse-cow-aard · · Score: 1
      There is nothing preventing the OS from paging out 300 MB of unused space in a Java program. So there is still no difference.

      On the case of mmap is interesting, but none of the normal user tools (malloc and free) normally make use of it. To do that so that space can be reclaimed, one would have to have garbage collection in place to re-arrange memory blocks in use and permit munmapping. Possible, but certainly not common, and most people claim the lack of GC as one of the principle advantages of using C in the first place. So I don't think that stands up either.

    3. Re:Java by gbjbaanb · · Score: 1

      Amen. Java is killing the planet, find a Java (or a .net) developer and set the ecowarriors on him.

      I find the reasons managed code is gaining traction can be mostly down to the advances in computing power, if we had the same CPUs we had 5 years ago, no-one in their right mind would be coding in them. Now we have super-fast CPUs and more RAM than could be imagined, managed languages have found their level. The shame is that just masks the fact that they are so inefficient.

      And I don't think the productivity gains are that large either, we just have more of the less-competent developers pretending they can code.

    4. Re:Java by Anonymous Coward · · Score: 0

      i was responding to the ridiculous notion of java's speed being up to that of C, and so pointed out cases of meaningful size where speed matters, the code exists NOW, and how miserably java fails.

      for new projects that have no desire to execute quickly, and will never have their speed compared to and lambasted against market competition, java makes sense. it's maintainable, almost automatically portable and well known. i'm just sick to death of people saying it's "almost native C speed omgthistimeforsure!!!!!"

    5. Re:Java by gbjbaanb · · Score: 1

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

      so does Visual Basic 6, are you saying that's just as good a language as Java?

      The 'compile to native' is meaningless. That code is still full of metadata and assorted crud that slows it down, and the optimisations are limited (as the JIT doesn't have much time to work on them). Its also stupid (as all software is) so can never know how to generate code as efficiently as I can - this is why threading is poor on Java, it has to cater for the worst case nearly all the time to make 100% sure your code will work without making any assumptions on its part.

      eg. I have a little benchmark app concerning C# singletons. It was comparing locks v static initialisation, but the interesting thing was when I ran the fast 'no lock' version on my single core laptop it took 1.5 seconds to complete. When I tried it on the powerful multi-cpu server it took 20 seconds. That's the same time as the locking version took (which in turn was faster on the laptop). Same program binaries, same .net frameworks and versions. Now tell me that 'it compiles to native code so its ok' is still valid.

      There are reasons to use java (and .net), performance and low resource usage are not any of them.

    6. Re:Java by SanityInAnarchy · · Score: 1

      if you opt to use the Java platform on Linux, you can avoid having to learn the system calls or whatever that comprise the "Linux (programmer) platform".

      Which isn't unique to Java -- just about any sufficiently high-level language will abstract these, and even C will have some libraries to abstract them for you.

      --
      Don't thank God, thank a doctor!
    7. Re:Java by Alpha830RulZ · · Score: 1

      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.

      As well as being too lazy to code up a relevant benchmark. For real world applications that are concerned with I/O of some sort, the language used doesn't matter near as much as the design of the data structures and the program.

      If you're writing for device level/kernel/embedded stuff, C/C++ maybe makes sense. But if the OP were doing that kind of work, he'd already know what he needs. For anything else, like business or web applications, Java/Python/Ruby/Perl/C# are going to be more productive, with no practical drawbacks to speak of.

      To the OP, I'd start with Java, and add a sprinkling of Python/Jython.

      --
      I was taught to respect my elders. The trouble is, it's getting harder and harder to find some.
    8. Re:Java by binarylarry · · Score: 1

      Wow, it sounds like Java!

      --
      Mod me down, my New Earth Global Warmingist friends!
    9. Re:Java by wideBlueSkies · · Score: 1

      >>Using Java avoids most of the nastiness of Linux while preserving a solid code base

      And what would that 'nastiness' be exactly?

      Myself, I'd rather (and do) dig into the so called 'nastiness' and learn about the structure that all those really smart LINUX developers put together.

      --
      Huh?
    10. Re:Java by Anonymous Coward · · Score: 0

      the faulty logic was yours: 'i want portability and power' .. 'use assembly hurr durr'

      portabilty + power != java, that's not what it was designed for, just deal with it already. if it included simd primitives and data types and other compiler hinting it would have gone a long way towards making it almost bearable, but sun decided it was above being fast. can't have anything that might make programmers think too hard, that'd confuse some people that would never use it anyway. let's just hold back all java programmers instead, and jam jni down the skilled-coders throats.

    11. Re:Java by Nicopa · · Score: 1

      Uhm... but... I looked it up in the docs and found out how to do that in less than a minute! =)

    12. Re:Java by FishWithAHammer · · Score: 1

      That's not AOT, though. AOT code is a first pass compilation of the bytecode to native code. The application still runs in the JVM, but the slow startup is alleviated because that first pass JIT never happens. An optimizing JVM can still work its magic.

      Compiling Java to unchecked native code takes away all the point of using Java. "As far as you are concerned" doesn't mean a lot when the OS doesn't actually do what you want it to anyway.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    13. Re:Java by FishWithAHammer · · Score: 1

      The 'compile to native' is meaningless. That code is still full of metadata and assorted crud that slows it down, and the optimisations are limited (as the JIT doesn't have much time to work on them).

      Go tell that to JRockit or any of the other performance VMs. Take a gander at their benchmarks against C.

      Its also stupid (as all software is) so can never know how to generate code as efficiently as I can

      So you don't use gcc -O, right?

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    14. Re:Java by jonaskoelker · · Score: 1

      Using Java avoids most of the nastiness of Linux while preserving a solid code base.

      Using C avoids most of the nastiness of Java while preserving a solid Linux base :)

    15. Re:Java by jonaskoelker · · Score: 1

      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.

      Vast community? From anything developed by Sun? I guess there's really news on /. :)

    16. Re:Java by dacut · · Score: 1

      Right. I'm not trying to claim that C is more or less efficient; I'm just saying that measuring memory usage is a tricky game (regardless of language). This makes trying to determine why, for example, an Oracle database (which has a pool of shared memory mapped into the address space of a ton of processes) is paging incessantly is always a curious game...

      I know that implementations of mmap()-based malloc/free exist, but these aren't part of any libc that I'm aware of. However, if you've written a custom allocator, this is a question you face. This is something I saw a lot back when I worked on chip design (EDA) code: when you're dealing with a data set which doesn't fit in memory, memory fragmentation becomes a big deal...

    17. Re:Java by dacut · · Score: 1

      That's not AOT, though. AOT code is a first pass compilation of the bytecode to native code. The application still runs in the JVM, but the slow startup is alleviated because that first pass JIT never happens. An optimizing JVM can still work its magic.

      Ah, then I misunderstood. I don't see how this would alleviate the slow startup; aren't you still taking the time to compile when the JVM starts? Or does this first pass happen outside of the JVM? If the latter, how does the JVM verify that the generated native code matches the Java bytecode (and hasn't been tampered with)?

      Compiling Java to unchecked native code takes away all the point of using Java. "As far as you are concerned" doesn't mean a lot when the OS doesn't actually do what you want it to anyway.

      We might be using different meanings of "unchecked" here. I don't mean that you would remove the normal runtime checks that Java performs (index bounds, etc.) intentionally. I want those. Those prevent my bugs from becoming catastrophes.

      The checks I don't need: having the JVM go in beforehand and look for malicious code (which it normally does for bytecode). For my servers, I already know the origin of the code. This is the code that I compiled myself (and either wrote myself or used an open source library like Jakarta). Thanks to SOX controls we had to write, we have a high degree of confidence that what was deployed to the server matches what's in our build repository (secure hashes match).

      Granted, this doesn't work when you're downloading the compiled native code from some untrusted source. I wouldn't do that for C code; I certainly won't do it for Java code.

    18. Re:Java by FishWithAHammer · · Score: 1

      My code. ;-) Unlike some folks around here, I fully acknowledge that I don't write perfect code.

      (I consider an uncaught exception to be a "crash," such as variable set to null. If it abnormally and abruptly ends the program, it crashed.)

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    19. Re:Java by FishWithAHammer · · Score: 1

      The new IL engine for Mono is a considerable increase in speed. It's not in release, yet.

      That said, I am amused that you would consider tracking exact types to be a worse design than Java, which can accidentially shed generic data quite easily...

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    20. Re:Java by binarylarry · · Score: 1

      What??

      LOL, your post is so retarded, it's comical... hurr durr.

      --
      Mod me down, my New Earth Global Warmingist friends!
    21. Re:Java by Anonymous Coward · · Score: 0

      I would disagree with this. I think C# is definitely a more "mature" language than java. The latest versions have all the language improvements that I wish java had but doesn't.
      C#'s main downfall is probably that it's not as portable as java but that's changing. And portability is only a concern (with C#) if you need to port to non-Windows machines. If I'm developing solely for Windows, I wouldn't choose java.

    22. Re:Java by Bill+Dog · · Score: 1

      But what has been unique to Java and its kind is for the language platform to duplicate (I'm not sure how much "abstracting", i.e. in the sense of really being made "higher-level", is being done for you) almost everything of native platforms. And in that sense it's a good choice if you don't want to mess natively with the platform(s) you're targeting.

      With languages like Java you're meant to stay within the platform the language runs in. So the platform duplicates almost every OS service one typically would need. Languages like C are chiefly bindings to a native platform. For example Win32 is a C API, so C on that platform essentially serves to give you access to the API and declarative, iterative, and conditional statements in support of using that API. C's standard library is not large enough and full-featured enough to call a "platform". It's a "library" -- you code to your chosen platform's API, and like language constructs, the library routines support you in that endeavor.

      --
      Attention zealots and haters: 00100 00100
    23. Re:Java by anon+mouse-cow-aard · · Score: 1

      I was kind of conflicted in the original answer. I agree with what you're saying, memory management is tricky, and Java will use much more of it in general. The only part that tripped things up was the point you used to support it was factually dubious. It isn't that C programs return memory when not in use, it's that one tends to be far more careful about allocating memory in C, because the cost is obvious. In Java, it is abstracted away, and assumed to be infinite. the results are predictable.

    24. Re:Java by snowgirl · · Score: 1

      Right, by why have a ton of draw___ but not drawPixel in the java.awt.Graphics class? Hm?

      What was I thinking... you know, assuming that their libraries would actually be in the right place.

      Also, how much do you use Java? If I just walked into Java, or the professor of my class just walked into Java, or the graphics guru TA for the course just walked into Java... would any of them have any idea of how to do it?

      --
      WARNING! This girl exceeds the MAXIMUM SAFE standards established by the FDA for BRATTINESS
    25. Re:Java by snowgirl · · Score: 1

      Apples to oranges. raytracer v webserver. Further compounded by the fact that when OS X was running on G3 I ended up abandoning my mcrypt port due to endianess issues.

      A webserver in Java is ridiculously easy.

      If you weren't accounting for endianness in your code to begin with, then you were shooting yourself in the foot for portability in the first place.

      Don't wine about portability, when you can't be bothered to take it into account.

      --
      WARNING! This girl exceeds the MAXIMUM SAFE standards established by the FDA for BRATTINESS
    26. Re:Java by snowgirl · · Score: 1

      The fact that the function is in a different library/class/whatever than drawRect() is precisely the problem. I expect my libraries and APIs to be more or less complete.

      --
      WARNING! This girl exceeds the MAXIMUM SAFE standards established by the FDA for BRATTINESS
    27. Re:Java by dacut · · Score: 1

      One tends to be far more careful about allocating memory in C, because the cost is obvious.

      Well, I'd replace that with "one hopes that C coders tend to be more careful..." :-) Sadly, I've had to deal with C++ code which was extremely sloppy about who-owned-what. A hefty 250 kloc project at the time which bloated to just under a million lines before it shipped, with special code to swallow segfaults so the user never saw a core dump message. It was a nightmare. (And, yes, "lines of code" was a point that management liked to brag about to potential customers... <sigh>)

    28. Re:Java by Anonymous Coward · · Score: 0

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

      The problem is, it does it at runtime when it's supposed to be running your application. It also doesn't save that compiled code so the next time you run your application it compiles it again, and again, and again, and again...
      Even Python makes an attempt at that (with .pyc files).

      This is why traditional compilers are good.

      With Java, in this respect, you get all the disadvantages of a compiled language (ie. you have to compile it) with all the disadvatages of an interpreted language (you have to optimise for speed at runtime).

    29. Re:Java by anon+mouse-cow-aard · · Score: 1

      I like to brag about klocs too... spent five years with a team replacing a 700 kloc application with another one that is 22 klocs, and has more functionality. klocs are important... If it's too big, it's very likely wrong.

    30. Re:Java by Zan+Lynx · · Score: 1

      Except that the constant GC cycles prevent this, and if a Java heap does get paged out, it kills performance because it will periodically get paged in by GC even if it really isn't used for anything.

    31. Re:Java by Zan+Lynx · · Score: 1

      Yes, and if you combine this with a memory pool strategy like Apache uses, it works very well because when you drop a pool, that memory is reclaimed.

    32. Re:Java by jadbalja · · Score: 1

      En Vogue? Seriously?

      "Free your mind and your ass will follow."
      P Funk

    33. Re:Java by Perky_Goth · · Score: 1

      Also, how much do you use Java? If I just walked into Java, or the professor of my class just walked into Java, or the graphics guru TA for the course just walked into Java... would any of them have any idea of how to do it?

      They'd use google, ffs. Apparently, a graphics is not tied to a resolution, so it just doesn't make sense.
      Learning is so hard...

    34. Re:Java by anon+mouse-cow-aard · · Score: 1

      that makes sense, but it sounds like an implementation issue with the GC. It should be fixable. defragmentation and compaction ought to be part of what GC does once in a while, which ought to address this sort of thing.

    35. Re:Java by snowgirl · · Score: 1

      Ok again... if fillRect(x, y, 1, 1) works to draw a single pixel, then there has to be a correct/expected behavior for a single pixel drawing.

      This is as retarded as why the C++ stl string library doesn't have a case-insensitive compare. Their reason why? "Because different locales handle capitalization differently" The correct answer? "Because we can't be bothered to make the correct behavior the correct behavior by default, so we're going to push that back to the coder themselves, which is the whole reason why these people are using high-level languages in the first place so that they don't get this stupid push back from libraries of 'oh, to do that, you just do this defined algorithm, which we didn't code into the library even though it would never change.'"

      Code reusability and high-level languages are supposed to provide libraries with as much static usability as possible. If there is a single correct way to handle drawing a pixel, or testing two strings for equality with case-insensitivity, even taking into account locale, THAT'S WHAT THE LIBRARY SHOULD DO.

      Think of how many bugs would be avoided with i18n if my app just automatically knew that "école" and "ECOLE" were the same case-insensitive, rather than requiring _me_ to account for locale bullshit?

      --
      WARNING! This girl exceeds the MAXIMUM SAFE standards established by the FDA for BRATTINESS
    36. Re:Java by cryptoluddite · · Score: 1

      You say you are amused, but CLR still can't effectively inline methods. And it never will.

    37. Re:Java by FishWithAHammer · · Score: 1

      AOT your code. Problem solved, and you still get further on-the-fly speed optimizations via the JVM.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    38. Re:Java by modmans2ndcoming · · Score: 1

      Who said show stopper? It is just proper design IMHO.

  235. Learn a proper scripting language. by jotaeleemeese · · Score: 1

    ksh, bash and sh. As for your "healthy fear of Java" please, behave like an adult, that is something pretty childish to say.

    --
    IANAL but write like a drunk one.
  236. 100% Pure Sandbox by tepples · · Score: 1

    But are there any usable PeeCee emulators written in 100% Pure Java, 100% Pure C#, 100% Pure JavaScript, or 100% Pure ActionScript? A lot of times, your application will run in a sandbox that allows only one language or allows only one bytecode which in turn is dominated by one language.

  237. just by Chutulu · · Score: 1

    just use .NET and you'll be happy for ever.

    THE END

  238. Poor man's language on poor man's computer by tepples · · Score: 1

    But this captures only a tiny portion of C++ capabilities such as those which allow effective support of RAII.

    Do we even want to support the RAII, whose members sue their own customers?

    No wait, that's the RIAA.

    OO C is really a poor-man's C++ and looks like it.

    But when you have to deploy on a poor man's handheld computer, a poor man's language starts to look attractive. Yes, C++ can be made to run in sub-megabyte environments, such as by ditching iostream for cstdio, overriding every class's operator new, and even rewriting all of libstdc++ as was done in uClibc++. But the "learn C++" books tend not to teach space optimization.

  239. Performance is how many runs per recharge by tepples · · Score: 1

    And most application aren't performance critical anymore on modern hardware anyway.

    Are netbooks and PDAs not "modern hardware"? They ditch raw CPU power in favor of size and battery life.

    I'd rather have programmers who write maintainable documented code than programmers who write unreadable undocumented code that lowers the CPU usage from 5% to 4%.

    What about readable documented code that increases the battery life from 7 hours to 9, avoiding the need for a mid-workday battery swap?

    1. Re:Performance is how many runs per recharge by MillionthMonkey · · Score: 1

      "What about readable documented code that increases the battery life from 7 hours to 9, avoiding the need for a mid-workday battery swap?"

      I always document my code well. The CPU executes all the long well-written comment sections very quickly and efficiently, especially in terms of watt-hours per line of source code.

      Sometimes I comment out all my source files to get more life out of my battery.

  240. My 2 cents by motang · · Score: 1

    Well at my college we are all Linux, they start you off with C++, but IMO I think they should start off with Python to ease in the freshmen. I would suggest Django/Python for web programming (I am in the process of learning), also PHP (which I love and currently do all my side projects in) as for non web programming I would go with C/C++, and dare I say Java.

    You can find Python book online, and Django book as well.

    For a good IDE I really like Geany, it works well with a Linux system, and it's light weight. It looks for installed compilers so you don't have install anything on top it as long as you have all the stuff you needs like GCC, OpenJDK, etc.

  241. Languages, libraries, and GUI libraries by dorfsmay · · Score: 1

    For most things, standard libraries are almost cross platform. You say you use C++, use the "standard" and you'll find everything that you are already used to.

    Ah, but what about GUI ? Those are definitely not cross platform. Well, you can pick, there's GTK, there's GTK, etc... Or, go for a real cross platform toolkit such as wxWidgets. you apps will run on pretty much any platform after a recompile...

    or if you use a cross platform language, say python (wxWidgets + python = wxPython), then you don't even need to recompile.

    wxWidgets was originally created for C++ but it has binding to other languages, so what you learn with one language can be re-used with another language if you have a different need that dictates that.

  242. I would say ... by quo_vadis · · Score: 1

    I suggest C/C++ and Tcl/Tk. Together, they are quite powerful and Tk GUIs also work in Windows. I know Python tends to be the scripting language of choice here on /. but Tcl is quite widely used and if you are working in a field which has Tcl legacy systems (like EDA tools) then learning Tcl will give you a huge boost. Other than that, Perl for command line scripting might also be handy.

    --
    Legally obligatory sig : My opinions are my own... etc etc
  243. Code signing discriminates against unmanaged codee by tepples · · Score: 1

    And what do you think the runtimes on all those platforms are written in? c/c++.

    They're written in C++, but then the executables are signed with a private key that the user doesn't know. The console makers control the private key for unmanaged code on video game consoles, and the network operators do the same on North American mobile phones.[1] On web clients, we can't always assume that the user owns the machine to install an unmanaged-code plug-in; the machine could belong to the parents, the employer, the school, or the library.

    Last time I checked (showed my boss how much quicker a c binary can be executed than a long php script by running both on my hosts' web servers) my hosting provider supported cgi binaries written in c

    But then don't you have to run the same architecture and the same distribution on the development machine on your desktop that the server runs?

    but in the early days of the net, c code frequently ran on web servers, which is where the "bin" in cgi-bin came from :-)

    In the early days of the net, there wasn't any name-based virtual hosting (that came in 1999 with HTTP/1.1), and web site maintainers often had shell accounts on their web servers so that they could compile, test, and deploy on one box.

    [1] North America is relevant because it's the largest single-language market in the developed world, because Slashdot is in North America, and because I am stuck in North America.

  244. Judgement Call by Rambo+Tribble · · Score: 1

    C if you want to earn a living; Python if you want to keep your mind.

  245. Re:Code signing discriminates against unmanaged co by tomhudson · · Score: 1

    You can get phones that were never locked (just not from your local phone company, who subsidizes your phone purchase by "locking you in") or by paying someone $25 to $40 to unlock your current phone. Or you can search certain places on the web and find the programs ...

    As for web servers, you don't need the same architecture - just a cross-compiler, and there are lots of free ones out there.

    Local machines? Last week I saw 16-gig usb keys for $50. Just boot a copy of your OS off that (okay, not really much of an option for Windows users, but that's a FEATURE, not a bug :-). Or boot off a dvd and use a usb key as your data store.

  246. Let me see if I understand by Anonymous Coward · · Score: 0

    I've been programming for 25 years (I'm 34), and I have a favorite. (For the record, it's Python.) All languages are certainly NOT created equal. You clearly have a favorite -- Perl. The irony is that you "wouldnt' particularly recommend more modern and high-level languages." A good high-level language does NOT hide too much of Linux from you.

    In fact, most high-level languages handle low-level operations in almost the same way. I.e., open a file, write something to the file, close the file. Listen on a socket, accept bytes over the socket, etc.

    So, this poster is simply wrong. Learn a lot of languages, as many as you can. I recommend Python, Perl, PHP, Ruby, C, C++, Java, at a minimum. Pick a couple of favorites (for me, Python and C) and learn that one to perfection, but try to keep up with important developments with the others, too.

    Finally, this is definitely NOT a Windows world, unless you are only focused on desktops! In fact, UNIX/Linux dominates the number of servers connected to the Internet. Thus, unless you are only ever going to write Windows GUI applications (you aren't, and if that's your job, you better start looking for a life preserver), your school is certainly doing you a disservice by focusing exclusively on Windows. It is a very smart move for you to be focusing on other platforms -- actually, it's a matter of survival.

  247. What a stupid reason to hate Python by lewp · · Score: 1

    As someone who has no particular love for Python, I'm not encouraging you to use it. Still, of the possible criticisms of the language, the whole "using indentation to delimit blocks" is probably the worst. It just works, people. I went into it skeptical too, but Python's parser is smart enough to handle just about any style of indentation you throw at it, so long as you're at least somewhat consistent in its usage.

    If you want "Python without mandatory indentation", Ruby is probably about as close as you'll get, though they're significantly different. Still, if that's your gripe about Python, you owe it to yourself to at least give it a try before you write it off.

    --
    Game... blouses.
  248. Get started with c... by Rikiji7 · · Score: 1

    ..or get away from *nix

    --
    slashwhat?
  249. Before You Ask "What Tool", ask "What Job"? by Anonymous Coward · · Score: 0

    >"Recently I've been thinking about developing (or learning to develop) for Linux."

    What does "develop for Linux" mean for you? If your goal is to build working software quickly, use something like Python or Ruby that gets out of your way; the skills you build there will port nicely back to other platforms, as will the software itself.

    If, on the other hand, an intimate acquaintance with the platform itself is what you're after, the C advocates have the right of it. The APIs are really what distinguish Windows from Linux at this level, and your most straightforward access to them is through C (just as .NET is really Windows' native tongue these days).

    Since Linux has achieved vastly better penetration in the datacenter than the desktop, most of the market for "Linux programmers" these days is really in hacking the server stuff that happens to run atop Linux -- Web apps, that sort of thing. If you're looking for a resume bullet point, most people aren't looking for Linux programmers per se, they're looking for people who can work with one of the stacks that run best on Linux -- LAMP, Rails, Spring, etc..

  250. There's several for various tasks by Todd+Knarr · · Score: 1

    Depending on the task:

    • C/C++ for heavy-duty programming. C's the lingua franca of Unix development, and C++ (if you don't go overboard) offers some useful extensions.
    • Shell for light-duty scripting. You'll be using it a lot for small, quick scripts to automate minor tasks that don't need a more powerful scripting language. There's two variants, Bourne and C Shell. Learn Bourne first, and the Bash shell, it's the most commonly used and available one on Linux. I also group the pipeline-based tools (cut, paste, grep, awk, sed, tr, etc. etc.) here, they tend to be used by scripts a lot to manipulate data into a convenient form.
    • Perl's showing it's age, but it's one of the most common scripting languages for more complicated work, particularly for Web jobs.
    • Java's fairly closely related to C++ in syntax, and gets used a lot in Web applications and for cross-platform work in the Unix world.
    • Python or Ruby have significant niches too, again particularly for Web work. Personally I'd pick up Python, it's also used as an extension language by several major tools.
    • Regular expressions. As complex as they are, I consider them a specialized language. You'll find them incredibly useful for pattern-matching tasks.
    • If you use Emacs you'll also want to learn at least the basics of the Elisp language it's written in. You'll need it for customization and, once you've gotten a bit of it, you can write some really useful programs to automate common tasks.
  251. Depends by Anonymous Coward · · Score: 0

    What do you want to do with it?
    If you're planning in doing IT automation, I suggests you Perl. It has TONS of available modules ready to use.
    Otherwise, by all means, learn C and C++ the best you can.
    Very good C/C++ developers are really hard to find these days, and we always struggle when we have to hire some.

  252. Language Choice and OS hooks by smcdow · · Score: 1

    Make sure the language you choose gives you access to the OS via system calls. If you can't make a direct call to every function described in section 2 of the manual (without twisting your code into multi-language knots), then you should not choose that language.

    You may never actually use system calls, but one day you'll be grateful that you can.

    --
    In the course of every project, it will become necessary to shoot the scientists and begin production.
  253. Re:Code signing discriminates against unmanaged co by tepples · · Score: 1
    You didn't address video game consoles at all.

    You can get phones that were never locked (just not from your local phone company, who subsidizes your phone purchase by "locking you in")

    I can, but my customers either don't know this or aren't willing to pay hundreds extra up front for the privilege of running unsigned apps. Therefore, I must write software in Java if I want to deploy it on customers' phones.

    As for web servers, you don't need the same architecture - just a cross-compiler

    You also need 1. a lot of patience for the edit-build-upload-run cycle, and 2. an upgrade to a hosting plan that allows such untrusted binaries, often for an additional monthly fee.

    Local machines? Last week I saw 16-gig usb keys for $50. Just boot a copy of your OS off that

    I don't know the password to select an external boot device, and staff is unwilling to help me out. Or the library may have deployed dumb terminals such as those made by NComputing, and I don't have physical access to the terminal server. Besides, when the USB ports on the front of the PC are filled with epoxy, fooling around with the ports on the back might look suspicious enough to get me kick-banned from the library.

  254. Lazarus/FPC by Corson · · Score: 1
  255. Do like the Linux guys by synthespian · · Score: 1

    ...do it like most Linux developers do - ignore all the cool and advanced stuff available for Linux - and stick to the 1970s, programming in C.

    It will guarantee you a life of fixing bugs.

    --
    Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
  256. Horses for courses by WindShadow · · Score: 1

    The important thing is to pick a language which is well suited to what you want to do! Anyone who tells you that "the language to learn is something" is wrong. There are too many languages to consider any one as the language. Modern languages which fit certain tasks include C for system tasks, C++ for applications where overlays and objects are useful, javascript for things which need to run on the client system, perl for things which benefit from string handling and associative arrays, etc. Note that the list of languages is not complete, nor are the areas of usefulness mentioned anything more than hints, many problems solve equally well using the features of any of several languages.

    Having programmed for a living for decades, I have found that a language which includes features relevant to the task will result in much less effort in writing and maintaining the code. So pick a problem which interests you, and pick a language which helps solve that problem (not one you think you should learn which isn't a good fit). Embrace the strengths of the language you choose, don't be one of those people we used to say "can write FORTRAN in any language."

    Good luck with your learning!

  257. Re:QED: Java is dreadfully slow by FishWithAHammer · · Score: 1

    All that crap is meant to be done by the compiler, not by the programmer.

    C runs like blue light out of the box, without the tedium you describe. The day that Java does likewise, you'll finally be able to say it's fast.

    You AOT your code by passing a flag to javac. Thanks for playing, we have some lovely parting gifts for you.

    Meanwhile, it's over a hundred times slower than C.

    And it actually has the conveniences and features of a modern language to boot! Holy shit, a tradeoff between features and speed, who'd have thunk it?

    Newsflash: speed is no longer everything. It is very much possible to get "good enough" given modern hardware. And save us all your holier-than-thou "YOU ARE ACCEPTING INFERIOR PERFORMANCE YOU CRETIN"--performance doesn't mean much when you've hit that "good enough" plateau and the benefits of writing code in a modern language (runtime checking, exceptions, cross-platform operation) outweigh the extremely minor "MY BENCHMARKS ARE SO OH MY GOD DAMN FAST!" benefit of C.

    --
    "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  258. CS MSc degree without touching Windows by Anonymous Coward · · Score: 0

    Sometimes I think my perception of reality is distorted when I hear about CS programs which require working with proprietary software like Windows. At least in some german universities, it's easily possible to avoid Windows completely, from semester #1 up to your PhD. An estimated 90% of all machines in our CS & mathematics departments run Linux.

    Microsoft offers almost all of their software for free to students. Still, every single course that I've attended required the use of GCC, Eclipse or other free (as in speech) tools. You _could_ use Visual Studio, as long as your code compiles with gcc in the end.

    I'm very, very happy with this situation :-)

  259. whatever happened to functional languages by Anonymous Coward · · Score: 0

    I know right now there is no significant importance given to functional languages, however they give a very good "Programming" experience when learned.

    1. Re:whatever happened to functional languages by Anonymous Coward · · Score: 0

      I can't agree more. After years of working with various imperative and object-oriented languages, I picked up SICP to learn Scheme. Even though I will probably never need Scheme in the real life, learning it helped me a lot to refine my programming style with conventional (imperative & OO) languages.

      Also, it's fun to try something new from time to time :)

  260. C, dumbass. Just C. by Anonymous Coward · · Score: 0

    n/t

  261. Re:Java - A healthy fear by BitZtream · · Score: 5, Insightful

    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?

    --
    Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
  262. GNU C library by prollifik · · Score: 1

    The GNU C library and its manual are a good introduction to Linux programming.

  263. A damning comment on your university by streepje · · Score: 1

    You wrote, "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."

    That is a really damning comment on your university.

    If I were selecting an IT course at a university, this would be one of the first filters I would apply.

  264. Advantageous to NOT learn Perl by horza · · Score: 1

    The problem with learning Perl is that you may walk into a future workplace and management will ask everybody if someone knows Perl. Being the honest person you are you'll instinctively raise your hand, not noticing everyone else is resolutely sitting on theirs. I've seen enough Perl code in the real world to convince me not to even look at the index page of a Perl book for that fear alone.

    Phillip.

    1. Re:Advantageous to NOT learn Perl by acid06 · · Score: 1

      You clearly never worked with any *decent* Perl programmers.
      You can write bad code in any language. In Perl, bad code looks bad. That's a *feature*.

  265. Re: You have no credibility by Facegarden · · Score: 1

    I see that you have one month of experience in a single sourced proprietary language. You seem to have successfully stumbled through your first program which you have already released to customers, and now you feel confident enough to recommend this language to others. WOW. All I can say is that your program must have been so simple that it took little more than a few lines of code added to the hello world program to make you a success. Your story is just in line with what I hate about Microsoft's approach to programming. It is so Zen, programming without the need to know about programming. If you reduce the problem until it is pathetically simple, then it is not surprising you can write a pathetically simple program to solve it. But here is my question... Did you check any return codes (or enable exceptions)? Did you consider any of the possible things that could go wrong with your program and check for them all? What if the customer's machine is resource challenged? Did you code up the first design that came to mind? If writing code this way is so easy, where is your job security? The next person that comes along with a month to spare can replace you. After what I have said you may think I am an asshole. Maybe I am. You said c# showed no signs of being limited in anything you intended to do... As far as I can tell, c# is good at accessing .net components. The problem is (and this is true of most Microsoft programing) that in the end when you want to actually do something interesting, like accessing hardware, things will become extremely difficult and you will hate everything about managed code. Trusted computing is the bane of existence to real programmers. The day you have two years of experience in .NET you will become overqualified and may never be allowed to work again. I think I have said enough.

    Yes, i DO in fact think you are an asshole, as i made it very clear i am inexperienced, on purpose, so as not to lead anyone astray. You seem to think that i don't realize how inexperienced i am but i think i made that very clear. If someone sees that i have one moth programming experience, yet somehow decides to base all their decisions on my recommendation, that would be their fault, not mine, i simply wanted to share my experience.

      And my program is, in fact, quite simple, as it is supposed to be a very simple utility. I have no doubt there will be bugs, but I did include some simple error handling, like when the serial port opens, if it fails, it tells the user rather than flipping out. There isn't much else i am doing that would fail, but it's fine, my program does one simple task but it does it very well and it will be incredibly useful to our customers. It is not a "pathetically simple" program, however.

    And job security? No shit, if i were hired as a programmer and i started one month ago, i would have very little job security, but why do you even think that is a reasonable explanation? Who would hire someone like that? I'm a mechanical engineer at a company that has only 8 employees. I do all of our mechanical design and CNC machine programming, and my job is extremely secure as i have brought a very good set of talents to our company. I'm only writing software because it turns out i can, and the only other software we have is terrible and old and not very useful.

    You say that accessing hardware is difficult, but it's not, it's quite simple. My program interfaces with the serial port to connect with our product, and that can be accomplished in about 3 lines of setup, and then just one line to read or write to it, or a few more if you include error handling. Are you sure you know anything about C#? It's actually a pretty capable language - at least compared to what you seem to think of it. Maybe you should try LOOKING at it?

    And anyway, you seem to have assumed a bunch of things that make no sense, and ignored the facts i did put out there only so that you could make some poor and misguided attempt at tearing me down. So yes, i do think you are an asshole, at least you got one thing right.
    -Taylor

    --
    Worldwide Military budgets: $2100 billion. Worldwide Space Exploration budgets: $38 billion. Really, world? Really?
  266. Python First by ZeroNullVoid · · Score: 1

    I am personally a fan of Python and WX (wxGlade in particular)

    But C/C++ and WX and Java are also fine depending on the projects.

    Lisp and Perl are among my first loves though.

  267. The syntax is not the solution. by bbarber · · Score: 1

    Guys - while the business problem goes unsolved the squabbling over syntax continues. Programming languages allow patterns of knowledge to be documented and automated so the debate if C++ or Java or C# it "better" seems a bit well...Slash bloody dot.

  268. Re:Code signing discriminates against unmanaged co by tomhudson · · Score: 1

    I don't know the password to select an external boot device, and staff is unwilling to help me out. Or the library may have deployed dumb terminals such as those made by NComputing, and I don't have physical access to the terminal server. Besides, when the USB ports on the front of the PC are filled with epoxy, fooling around with the ports on the back might look suspicious enough to get me kick-banned from the library

    Sometimes freedom comes with a price - like buying your own hardware. If you want to use other people's hardware, you have to respect their terms and conditions, same as if you borrow a shovel or a drill from someone, you're expected to return it cleaned up and in good working order.

    As for the console stuff, this is the same bitching and whining that people do over Tivo - sometimes, to be free means giving up something. In other words, don't buy a Tivo. Ditto for the consoles.

    As for this:

    You can get phones that were never locked (just not from your local phone company, who subsidizes your phone purchase by "locking you in")

    I can, but my customers either don't know this or aren't willing to pay hundreds extra up front for the privilege of running unsigned apps. Therefore, I must write software in Java if I want to deploy it on customers' phones.

    ... freedom doesn't mean free. All freedom comes with a cost, just as giving up freedom also comes with a cost. As for the "I must write software in Java if I want to deploy it on customers' phones" - Java isn't that hard to learn. Heck, you can implement most java code using a bunch of c preprocessor macros and a perl script if you really want to - but that also would require you to learn the language, so why not just learn it?

  269. Try As Many As You Can by Ashcrow · · Score: 1

    Really. I mean that ... and remember that whatever you decide you like now may not be what you like 5 years from now.

    For me, I like Python quite a bit. As someone who use to write Java back when it was the hot language Python let me do what I wanted to do without having to define lots of boilerplate or worry about VM implementation differences, etc... It also was portable ... VERY portable (no more System.gc tricks to avoid VM bugs on some platforms).

    I also think C is a great language to know even if you don't have much reason to use it right now. Seems like a lot of languages themselves use C (Python is written in C, so is Java ... I think). If you know C you'll have a good basis for programming and a good understanding of memory management (which most higher level languages take care of for you).

    If your looking for specifics here is my $0.02 (not in any order):

    Web (Open Source or Small-Medium Company): Ruby, Python, PHP, Mono
    Web (Open Source/Closed Source or Large Company): Java, C++, Mono, Python
    Desktop (Open Source or Small-Medium Company): C, C++, Ruby, Python, Mono
    Desktop (Open Source/Closed Source or Large Company): Java, C, C++, Ruby, Python, Mono

  270. Parallel versions of a program's business logic by tepples · · Score: 1

    As for the "I must write software in Java if I want to deploy it on customers' phones" - Java isn't that hard to learn.

    I know Java, but maintaining four versions of a program's business logic in parallel (C++, C#, Java, ActionScript) can introduce inconsistencies. Or can one of those languages easily be compiled into the others?

    1. Re:Parallel versions of a program's business logic by tomhudson · · Score: 1

      ... or you can drop at least two of them ... for example, ActionScript and C#. java runs on pretty much everything you'd be running business logic on.

  271. The question by Anonymous Coward · · Score: 0

    The moment you realize how dumb asking that question is the moment in which you can answer that question grasshopper.

  272. My Suggestions by OverflowingBitBucket · · Score: 1

    Must-learns, even if you don't stick with them: C and Java. Yes, Java can be extremely unpleasant to deal with at times, but it is worth knowing. C is very useful to know, but honestly, I'd learn it last.

    If whitespace-is-syntax bugs you (it bugs me) and you want a good scripting language, then try Ruby. It's not as mature as Python, but I can highly recommend it.

    Perl is ubiquitous, but it's really a write-only language. ;) *ducks multiple flamethrowers*

    Knowing shell scripting (ie. sh) is of course nice, but for anything non-trivial, you should be learning one of: Perl, Python, or Ruby.

  273. How to gain access to develoment environment? by tepples · · Score: 1

    C Works just fine on the XBox

    With a developer agreement, which as far as I know isn't readily available to small businesses.

    the XBOX 360

    With a developer agreement, which as far as I know isn't readily available to small businesses.

    the PS3

    With a developer agreement, which as far as I know isn't readily available to small businesses.

    the Wii

    With a developer agreement, which warioworld.com states isn't available to businesses without a prior published commercial title and leased office space.

    and on smart phones.

    With a developer agreement, which likewise has a high cost of entry

    .

    The Javascript and Actionscript engines you are refering too are written in C.

    But you can't install a new Javascript or Actionscript engine on a computer you don't own.

    In the first two cases, just because YOU don't have access to the development enviroments that allow you to use C on those platforms, doesn't mean it doesn't work, it means you can't make it work.

    What should I learn and then do in order to gain access to the development environments?

    Pretty much every major browser has a way to run a C plugin, even those on smart phones including mobile IE and mobile Safari, it just isn't something that will run from within a web page without the user installing it, granted.

    Did you mean "the user installing it", or "the owner of the facility installing it"?

    I'm sorry you are not comptent or confident enough to use C as your language

    I have used C on a PC running Windows and on a PC running Ubuntu. I just don't know where to start in order to negotiate the agreements needed to use C on anything but a desktop or laptop computer.

  274. Bash by Anonymous Coward · · Score: 0

    Get familiar with the (usual) Linux shell, bash. Learn to be productive with it, and it will help immensely. You should know some shell-scripting, as well as all the basic GNU utils, and the various keyboard shortcuts.

  275. My personal opinion by bgibby9 · · Score: 1

    is that Perl would handle almost every generic programming problem you have. Then if you wanted to venture into GUI land you could either use Perl/Tk or start with Mono and Gtk+.

    This will give you the broadest range of deployment options as you don't have to worry about compiler specific issues.

    http://www.gibby.net.au/

    --
    http://www.gibby.net.au
  276. One word by Anonymous Coward · · Score: 0

    Lisp.

  277. Easy by Anonymous Coward · · Score: 0

    Language: C++
    Tools: Emacs, GCC/g++, gdb, gmake

  278. Re: You have no credibility (about programming) by Douglas+Goodall · · Score: 1
    I got involved with .NET right away when it started. I had been an MSDN universal licensee for two decades. I bought hundreds of dollars of books on .NET programming in Visual Basic, C#, C++, and Microsoft's Java. I Read them all, including everything I could find on IL, and the security implications of it all, including signing certificates. I spent years learning it, but despite all that, I think it's junk. You see I am a low-level kind of guy. I spent decades writing hardware control code and much of it was in assembly. You say accessing hardware was easy, but opening a serial port was not what I meant. Build a new board, with some interesting parts on it at a non-standard I/O address, that happens to use interrupts and DMA. Something unusual enough that you cannot simply subclass an existing device framework, not just another HID or SCSI chip. Then tell me about accessing hardware. You see, .NET works fine if all you want to do is throw up a dialog box, handle a few buttons, and access some Microsoft supplied database or API, but as soon as you get outside a very narrow box, you are on your own with little or no debug support in a complex world of ring transitions and virtual hardware drivers. What I don't like about .NET starts with the fact that you have to trust Microsoft to do the right job with the CLR. If your program doesn't work right, was it your hardware, your code, or some deep dark subtle problem in the Microsoft supplied proprietary runtime, part of the trusted computing environment, except that we are not trusted. Microsoft thinks they are the only ones who should be able to talk to the hardware, and we should float around in this happy .NET world were we only knit together modules they supply. They also have said publicly that Visual Basic is the best language for .NET and Windows programming. The way they have things set up these days, for most purposes that may be right (on Windows).

    This is nothing like what programming is to me though. I am the kind of guy that sits down with the processor documentation and learns every instruction. I can visualize the states of the CPU, and can often guess what is wrong in situations where there is little or no debugging software or hardware available. This is the result of decades of low level programming on new processors for which in-circuit emulators aren't available yet for the speed of chips being used. I started writing embedded software when the EPROM in used with the 2716 and the processor was the 8085. I write calibration software for gaseous flowmeters and optical refractometers. I write applications that control laboratory instruments that purify proteins. I write encrypted communications software used by the military and the finance industry. My design for the SCSI interface become the industry standard. I have traveled the world customizing multitasking operating systems for Sony, IBM, Fujitsu, Siemens, ACT, Microdata, NEC, Compupro, Motorola, Shared Financial, Rite-aid... I program in assembler, Forth, Fortran, C/C++, Pascal, Modula, Python, and some languages weirder than those. Now ask me what good .NET can do for me. Unless I want to write the same old code one more time to bring up a dialog box and call a Microsoft database routine, .NET won't help me do anything that is cutting edge.

    I am used to work ing with electrical engineers. They show me their schematics, then I help them write diagnostic software to help them prove the hardware is working right. I look at the schematics and figure out what the I/O addresses are and what bits need to be set to get interrupts to fire, and what is going wrong with the DMA. If Microsoft had their way, we would not be allowed to execute code written in assembler. In fact they already have operating system support to keep us from doing that very thing. Over my career, my job security came from my knowledge of the x86 processors and all the peripheral chips a

  279. C portability by EdelFactor19 · · Score: 1

    C works on all platforms in the same way that a universal remote works on all tv's. Did you pay attention at all in any Op Sys classes? Have you heard of System Calls? Shared Objects?

    Heck even integers vary by platform. Try using int64_t on windows... etc.

    It is able to be made cross platform if you insert the needed pre-processor ifdef's, find all the libraries you need etc.

    I don't care what GNU might say; the problem stems from their definition of cross-platform compatibility. It also stems from the fact that they aren't going to advocate a language that they can't control that some other company can.

    I'm not saying Java is the answer, and its performance leaves plenty be desired. But Java is far more suited for cross-platform suitability then C is. Try taking C code for anything related to anything file related, network related, or THREAD related and simply 'using' it on linux (from windows). It won't compile. Now do the same with java.

    I'm sorry claiming C has the absolute maximum cross-platform compatibility is a statement I find to be absurdly false unless you twist your definition of compatible to the point where it doesn't mean anything at all.

    --
    "Jazz isn't dead, it just smells funny" ~Frank Zappa
    EdelFactor
    1. Re:C portability by EdelFactor19 · · Score: 1

      Sorry to double post but i forgot my closing statement... that despite all this C and C++ are still the best choice :-)

      --
      "Jazz isn't dead, it just smells funny" ~Frank Zappa
      EdelFactor
  280. Difference is not that narrow by gillbates · · Score: 1

    C and C++ may have comparable running speeds, but there are still large differences in certain areas.

    1. The constructor is the bane of the C++ programmer. A simple assignment statement, which in C can be optimized down to a few assembly instructions, can invoke a *few* functions in C++. Often times the problem is not that a C++ compiler generates less efficient code statement-for-statement, but that the object oriented structure of C++ means that programmers often create dozens or even hundreds of objects unnecessarily. Identical coded loops are probably no different between C++ and C, but the problem is that C++ programmers will not write code in the same manner as their C counterparts. They'll create a class and instantiate an object just to compare strings. They'll allocate-and-copy strings instead of parsing them in place. They won't create generic, standalone, reusable functions; instead, they'll subclass whatever class they think they need and add another method.
    2. C does not have the baggage of design patterns and the corresponding anti-patterns. It is a relatively mature language which makes an inefficient program largely a function of poor algorithm selection. While you personally may write efficient C++, on any substantial project you risk inheriting a framework with brain-dead design and awful implementation from which you cannot escape. It is even worse if your organization uses tools like Rational Rose, which allow architects to create large designs with no thought of the amount of code generated or its impact on system performance.
    3. Getting good performance from a C application is largely a matter of choosing the right algorithm and knowing which compiler switches to use.
    4. Getting good performance from a C++ application requires that both the architect and the programmer are cognizant of how the C++ compiler translates statements into machine code. A novice C++ programmer can create very inefficient code simply because they may not be aware of how the underlying classes are implemented. In fact, C++ encourages ignorance of the details, which only further exacerbates the problem.
    5. C can often be optimized well after the fact, where to get good performance from C++ requires that good architectural decisions be made early on. Trust me, you don't want to be the one replacing every String object with a C-style string just before the ship date because the code doesn't run fast enough.

    The differences matter more on the embedded side, of course, but generally speaking, only timing critical applications require C. C++ is probably fast enough on today's desktop, and is virtually required for any type of GUI programming these days. It's not a bad language, but it does allow a novice programmer plenty of rope with which to hang himself.

    --
    The society for a thought-free internet welcomes you.
  281. which basket? by mikew909 · · Score: 1

    on the other hand if all you want to do is pay down your mortgage, take a few holidays a yea, buy your chick a ring and yourself a few toys - join the MS crew - we get company mugs and t-shirts!

  282. Look in the job postings by Anonymous Coward · · Score: 0

    if you want a paycheck, see what kills companies are looking for.

  283. From the sound of your question... by ghighi · · Score: 1

    ... I get it you want to do actual *nix user-space programming. C and C++ is what you are looking for. If, however, you want to be able to solve problem on a Linux platform, the language you chose must be aimed at the problem you have. Java is probably the most robust and powerfull platform around. It is not exactly best suited for desktop programming, although great desktop softwares comes out of it, in a perfectly portable fashion (think of the Eclipse platform). It has some drawback: non object primitive that is not totally solved by the autoboxing system, and some other i can't remember of. I still use Java for every other things i have to do, even sometime when a script could do, since i'm considerably faster writing java. Python is way-cool too, its an extremely powerfull platform with conceptually rich features. It is no way near as robust as java tho, and i developped an allergy after having used a Zope based product for a while.

  284. GCC + a simple text editor by Anonymous Coward · · Score: 0

    The way to feel Linux (or UNIX) programming is to use a simple text editor with syntax highlighting and gcc/make.

    It takes time to get used to these after Windows, but if you master them, you'll be able to dig into any open source code you find on any machine that you can log in to. Choose an IDE - and you could just as well have stayed on Windows.

    Another must-do is learning Perl. Perl may not be the best language there is, but Linux is Perl.

  285. learn a few by TechBCEternity · · Score: 1

    You should try and learn a language a year to see the differences.

    I'm using c# and the mono project to build apps for linux. I'm also building apps in java and I find the mono project to be a better experience.

    of course not many people will stray from what they know, so its often hard to get an accurate comparison unless you try it yourself.

  286. Chinese! by blip · · Score: 1

    Definitely learn about 20000 of Standard Mandarin characters first. Then move on to APL, which then is quite easy to digest. Then you might have just enough background to move on to C.

  287. Don't worry by devilpainteth · · Score: 1

    I think that you can keep the simplicity. Look, the language it's just the tool, so, you can choose the tool more comprehensive and specialize yourself as u need. For example: C and C++ are two good comprehensive languages that can give to you the bases of programming and let's you to get familiarized with important concepts that are applicable to the other languages. Concepts like OOP (with C++) can be used with other OO languages like Java and C#. The C language it's universal, syntax and other features are used by almost other all languages (python, perl, php)... and the particularities you will discover by yourself.

    --
    -- Fernando F. Linux User #263682 http://desconstruindo.eng.br
  288. Only one language by ccc31807 · · Score: 1

    First, read "Advanced Unix Programming" by Marc J. Rochkind. This is perhaps THE one source book for learning to program Unix. Then, become proficient in C. C was developed to write Unix, and Unix was written in C. After that, read the source. You can't write for any application (OSes included) until you can read the source ... which in this case is in C.

  289. What University? by Anonymous Coward · · Score: 0

    I am just curious about what University you attend. We've found that most programs are Java oriented.

  290. Ruby! by Anonymous Coward · · Score: 0

    Why not Ruby?
    More powerful than Python, without the brain-damaged syntax. (And I'm not just talking about the indentation.)

  291. Any suggestions for a RAD tool? by Troberg · · Score: 1

    I've done a lot of development in VB on Windows. Yeah, I know a lot of people don't like it, but if you, like me, have worked with assembler, C, C++, Pascal, PHP and most other languages under the sun and understands what's going on under the hood, it's an excellent tool to quickly whip up a useful little program with a nice GUI in almost no time. For instance, it took me eight hours to whip up a tool for batch renaming of files based on about 40 parameters, complete with a script engine for customization (it was for my own use, so I cut a few corners on documentation, validation and all that stuff).

    So far, I've not seen any tools for Linux with similar capabilities. Most are to slow to work in (for instance, C variants), the few that I've seen that comes close lack too many features. Examples I've tried: RealBasic, MonoBasic, Gambas, Lazarus, KBasic.

    If I'll make a device driver, a file system, a game or something like that, I'll use C, but for high level stuff, I want a tool that is efficient with my time, even if it's at the expence of CPU time. CPU time is cheap, my spare time is not.

    Suggestions?

  292. Healthy? I'm not so sure... by shaneo · · Score: 1
    Your fear of Java is likely more irrational than healthy. But other replies have covered the important of knowing Java as well as other languages.

    Java is a step above VB in terms of having low barriers to entry, which means the market is full of people that can code in Java, but not necessarily create good software in it.

    That said, if you're moving to Linux, the right answer is C. Once you know and are adept at C in a Linux environment, every other language is a small matter of syntax and semantics.

    Well, maybe not small, but you get the idea...

  293. Invest in a sustainable career instead... by daschlag · · Score: 1

    While it's important to understand different programming languages, their advantages and disadvantages, at this stage of your career (and the state of our global market and economy) you may wish to examine your career direction.

    As an IT student, you weren't educated to be a programmer. You've been given some basic instruction on programming and could reinforce that, regardless of your role in IT it doesn't hurt to know what you're talking about, although you'll see early in your career (and by reading slashdot) that isn't always the case.

    However, as a programmer you are in direct competition with the best in the world who work for, at best, 70 cents on your dollar. As you map your career, focus on sustainability. IT is the business of providing solutions to enable a core competency. Writing code is not typically (with many exceptions of course) a value-add activity for most businesses (Microsoft, Sun, Amazon, Google all great exceptions to this rule).

    So what IT roles are sustainable? Those that DO provide business value - project managers work closely with the business to ensure cost effectiveness and quality to requirements; architects work with the business to define strategy and long-term technology direction; analysts work closely with business to write specifications for developers; the list goes on.

    Business is still 'deciding' which roles are critical to keep in close engagement. They often misjudge and have to correct. One role that continues to move out of the US is that of developer.

    Before all the highly paid, extremely talented, and often underemployed developers in this forum get up in arms, I should point out that there will always be a need for experienced technical leadership within the US IT workforce. But these people start out as CompSci or CompEng majors, not IT majors. They move on to technical masters degrees or even PhDs. If that's what you want it's not too late, but you didn't choose the right undergrad for that. Yours positions you between those folks and the business, which is a role that is *less* likely to be outsourced.

    Learn to take recommendations from these technical people. Learn to trust their experience (and know enough to question it when appropriate). Spend time reading about technology and learning the business. Take on some side projects to exercise your development skills and learn new tools.

    The point is, find your niche based on long-term career sustainability, not flavor-of-the-month programming languages.

  294. anything by Cajun+Hell · · Score: 1

    Use anything, but if you use C at the bottom (where you need speed, or for tiny projects where the extra amount of your time that it'll use won't matter much) and python at the top, you'll be fine, and ready for 99% of the world's problems.

    As for python's whitespace issue: get over it. If this is distasteful enough to you that you have a problem with the language, then you're going to have some sort of aesthetic issue somewhere, with another language. Whether you choose python or something else, you're going to need to learn how to "just deal." It sounds like you (in particular, this is no longer generic advice) ought to go with python just so you can get over that mental block. Once you're over it, then maybe you can switch to whatever (although you probably won't want to).

    --
    "Believe me!" -- Donald Trump
  295. Too C-centric -- What about Pascal? by tgrigsby · · Score: 1

    No mention here of Kylix, Lazarus, or any of the other Pascal variations. Anyone care to comment on those?

    --
    *** *** You're just jealous 'cause the voices talk to me... ***
  296. Seriously? by jasko · · Score: 1

    Seriously? You're asking this question without any reference as to what sort of application you'd like to develop? And if you're afraid of Python's indentation, I shudder to think of what your code in any language. I read once a comment that summed up the indentation issue pretty well and I paraphrase it here:

    Python's indentation is like lobster. Most people who've tried it, like it. But it can be hard to believe that you'll like it until you try it.

    I would pick some task I wanted to accomplish and then go looking for a language that I thought would be suitable for that task by all measures, including being a language I was interested in learning.

  297. It doesn't really matter. by Anonymous Coward · · Score: 0

    Aside from very few examples, I can't really name a programming language that is platform specific in itself. The libraries and APIs make them platform specific.

    Whenever I had projects, I used C or C++, VS to compile for windows, gcc for unix. Use some build flags to isolate your platform specific APIs, or just avoid them altogether if the project permits.

    Real world programming is C and C++. If you want to fake it without sacrificing too much, go with Java. Any popular scripting language has platform independent VMs.

    Obviously if you are using an MFC derived scripting language, you will be stuck with microsoft ... but even some of those have been made available to linux systems.

    If you line up your ducks correctly, any programming language can do anything specified on any platform.

  298. Change schools? by Anonymous Coward · · Score: 0

    Seriously. Change schools. I have to question the credentials of an academic institution that focuses learning primarily with closed standard tools. It's generally anathema to

  299. The more the better. by Anonymous Coward · · Score: 0

    Languages are like ice cream flavors; you can try many of them, but you will end up liking maybe one or two or three of them eventually. The great thing about Linux and its distant BSD cousins is that they were designed for programmers from the ground up. You can't argue with C's versatility and heritage to *nix in general. You can't call yourself a true *nix programmer until you give yourself a real chance with C. Nonetheless, many, many languages are suitable for day-to-day deployment. Personally, I will take csh/bash/Python over Perl any day, and C++ when writing for Qt in addition to C. Java seems quite interesting to me for cross compatibility and scalability, but I didn't grow up on it as much as C.

  300. Visual Basic by Anonymous Coward · · Score: 0

    I'm a fairly hard core C/C++ programmer, who has developed embedded device drivers to codecs to doom editors.

    It seems nobody has mentioned VB, for rapid application development, concentrating on making the user interface as user friendly as possible, as well as developing the fast bits in C was hugely pleasurable.

    I usually hate everything microsoft, however I think VB might be one of the best things they ever made...

    MFC was an abomination however.

    Right I might go code VB for linux....

  301. The Right Tool for The Job! by aloh · · Score: 1

    It is very important to use a language as highlevel as it requires to be. It doesn't make sense to develop a KDE application that reads RSS Feeds in Assembler. In other words it doesn't matter which programming language you choose. you will soon find another language that will fill your needs better. If you are studying Computer Science your should be comfortable to learn a new language in a couple of days. Most of the API's will be unfamiliar but that changes as soon as you get hands on experience.

  302. What are you doing? by Secret+Rabbit · · Score: 2, Insightful

    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.

  303. BrainFuck by Anonymous Coward · · Score: 0

    http://www.muppetlabs.com/~breadbox/bf/

  304. Get over your fear by cuzz · · Score: 1

    If you want to make the big bucks in Information Technology get over your fear of Java. There is not one fortune 500 company that does not have Java some where on their enterprise. Well maybe not Microsoft, but I would not be surprised if they did.

  305. Choices, choices by Christopher+B.+Brown · · Score: 1
    Be very clear on your intent...
    • If your goal is to create a "production system" of some sort, then you should pick pretty carefully from one of the following lists:
      • A scripting language, with Bash, being really ubiquitously available, being a good first choice, and fallback options being Perl, Python, PHP, Ruby
      • A "compiles-to-native" language, either C or C++
      • If you favor dynamic frameworks, then Java.

        (Or perhaps Mono...)

    • If you are trying to learn, are in a position to consider the results "throwaway code," and are interested in learning programming concepts, then you should look quite a bit more widely:
      • For heavy concurrency, consider Erlang

        And it would be well worth taking a side-trip to do something non-trivial in Prolog to see how backtracking works.

      • If you want something that compiles down to pretty fast object code that might be a bit stricter than C or C++, then it would be well worth taking a peek at Modula-3, Ada, or Eiffel.
      • It would be well worth taking a look at Common Lisp and/or Scheme, as they offer considerably different object models from what is "traditional" in C++/Java, and, as long as you don't merely play the academic game of "just doing list processing" or "just doing recursion", you can learn some very different approaches to programming.
      • Icon was the string processing language from the makers of SNOBOL that looks quite a lot like C (which SNOBOL doesn't!), and which introduced, to computer languages, having generators (which Ruby & Python have since adopted, and which you can also find in the Common Lisp SERIES package), as well as coroutines, which are a more event-driven-ish way of handling concurrency (probably nicer than threads).
      • Haskell or OCAML provide more "conventional" (e.g. - somewhat more Algol/C-shaped) views on functional programming than do Lisp or Prolog, and have interesting bits to them.

    There are a lot of interesting computer languages out there!

    --
    If you're not part of the solution, you're part of the precipitate.
  306. Um? by pjt33 · · Score: 1

    Why would I check in whitespace changes I didn't want the editor to make in the first place?

    1. Re:Um? by Blakey+Rat · · Score: 1

      Then use an editor that doesn't make them! Sheesh. This whole thread is a lot of people justifying being OCD and assholes to co-workers because they use shitty code editors. If you can't make "your" editor do what you want, you need to find another editor.

  307. Linux Language by Nerdameister · · Score: 1

    I do mine in English, I've tried spanish but could never find a good interpreter.