Beefy Boxes and Bandwidth Generously Provided by pair Networks BBQ
XP is just a number
 
PerlMonks  

Jumping ship from C++

by morelenmir (Sexton)
on Jan 08, 2014 at 05:44 UTC ( #1069725=perlmeditation: print w/ replies, xml ) Need Help??

I taught myself C++ and have used it off and on as the interest took me - as an amateur mind you, no damned professionalism here - for the last 18 years. And then I decided perl was a good idea!

I wondered how many of you other chaps had made the same change over the years and what pushed you? For me I can identify the three primary factors - (lack of) strings, (the inherent complexities of) templates and the proliferation of commercial sub-dialects like MFC or (absolutely worst of all) .NET.

Comment on Jumping ship from C++
Re: Jumping ship from C++
by basiliscos (Beadle) on Jan 08, 2014 at 09:12 UTC

    My professional skills was Java and PHP, and I professionally switched myself to perl about year ago.

    I'm dissatisfied with Java, because it tend to be "bloatware", and hence, slow (the JVM itself is rather fast, except slow start up). And java-world is only formally open-source, because nobody interesting in examining sources, and (from my experiece) it is impossible to re-build java project from sources in most of cases (because build-environment is not shared).

    In PHP I'm tired to deal with low-quality code and quick-n-dirty approach because of various-CMS domination, although by itself PHP is not so bad.

Re: Jumping ship from C++
by roboticus (Canon) on Jan 08, 2014 at 13:18 UTC

    morelenmir:

    Interesting, I didn't jump ship from C++ to perl. Instead, I added perl to my toolbox. I still enjoy programming in C++. I can still code in other languages too (most of which aren't as fun as C++ and perl).

    What made me add perl to my toolbox? A few things: money, hashes, and CPAN. I had a contract where I had to support a perl application. Until then, I considered perl an uninteresting ugly language. After working with it, I've learned that in fact it's a very interesting ugly language. Hashes were the first feature that made me realize how easy it is to do one-off jobs without worrying so much about the details of a data structure. But CPAN clinched the deal. Database whackery with DBI is *much* simpler than using OCI or ODBC in C++. Generating spreadsheets is possible in perl on a Unix box--even better, it's easy. I'm sure it's possible in C++, but it sure isn't easy. (Well, at least last time I tried. I haven't looked for any libraries for the last 10 years, though, as I already have Spreadsheet::WriteExcel.)

    Update: Fixed broken <i> tag.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      I am absolutely ROTFLMAO about that posting, roboticus, and shaking my head vigorously in agreement ... as are, I am quite sure, the many people who will up-vote your comment.   You said it perfectly.

Re: Jumping ship from C++
by davido (Archbishop) on Jan 09, 2014 at 05:46 UTC

    Perl was about the fifth language I took on, but in the years since we met my use of Perl has surpassed that of all other languages I've used to date combined. I attribute my love for learning and using Perl to several things:

    • It takes the fuss out of many things that other languages spend all their time fussing over.
    • Most of the books I've found on Perl have a wit, enjoyment, and enthusiasm to them not encountered in the 1200 page doorstop books on other programming languages. (Have you ever read Programming Windows with MFC? If you have, you know what I mean.)
    • The community seems to share the passion, as well as sharing many of the ideals (such as testing, code re-use --CPAN--, the quest for improvement, and "get the job done") that I value.
    • CPAN: The language is CPAN, the syntax for using CPAN is Perl.
    • Did I mention the testing culture?
    • PerlMonks, Perl Mongers
    • Immense flexibility through simple means: Our OO system(s) and the power of blessed refs, higher-order functions, regexps as syntax rather than as bolt-on routines, nitty-gritty symbol table magic, XS for those occasions where it's useful, TIMTOWTDI (without shame), and so on.

    I do enjoy C++. I guess I would consider it my next favorite. I find it fascinating, though, that C++11 has made major strides toward acquiring language features that Perl has had for 20 years.


    Dave

Re: Jumping ship from C++
by sundialsvc4 (Monsignor) on Jan 09, 2014 at 16:51 UTC

    To be fair, you typically pick-up a copy of C++ and use it for very different purposes than you might choose to use Perl.   It’s a pure-compiled language, for one thing, thus extremely optimized and so-forth.   But, now that computers are so damm fast and capacious, it doesn’t matter nearly so much as it once did.   You literally have horsepower to burn, whereas the true most-serious costs of a project remain the same as ever they were:   labor costs!   The “80/20 rule” applies strongly to matters of execution-speed efficiency, such that they can be greased by “XS,” whereas 100% of the source-code to any system must be expensively and continuously maintained.

    If you’ve ever taken a brave peek into perlguts, you’ll see that you have instant access to some mighty-serious C-programming voodoo, just by deciding to use ths powerful and well-implemented language.   But the real power of Perl, I think, comes straight from CPAN:   99501 Uploads, 28958 Distributions, 128843 Modules, 11158 Uploaders as of today.   All Most of this being stuff that you don’t have to write/debug in order to get-done what you need to do.   And, that’s huge.   In short, it is both possible, practical, and compelling to work at a much higher level than C/C++ is designed to do, a great deal of the time.

    That being said ... don’t throw away your C/C++ knowledge because from time to time you will use it, and you will know when that time has come.   You will never actually “jump” ship.   Instead, you’ll learn about the variety of ships that are afloat in the same seas, when to select and board each one, and when to tie them together.

Re: Jumping ship from C++
by morelenmir (Sexton) on Jan 09, 2014 at 23:10 UTC

    In a less divisive mood, I agree entirely. I doubt I will ever cease to be a C++ programmer. I probably shouldn't even try.

    My experience is formed by the way I came to modern programming - and it influences my thoughts towards perl entirely.

    When I was very young I was bought an Atari 400 (second hand) for christmas! As any of you interested in vintage hardware will know that was a fairly powerful and versatile machine in its day - or at least its big brother the 800 was. There were plenty of languages available for the Atari 8-bits but the real 'choice' came down to a BASIC cartridge (that in the later XL's was built-in). I did a lot of playing with BASIC to make 'print your name' type affairs or even more ambitious text adventures. All sorts of things were possible including rudimentary vector'ish graphics in 14 different resolutions and colour counts. I eventually became fairly proficient at A8 BASIC, but all the time I was a child the real holy grail of programming your computer was to use ASM... I don't know, maybe that aspiration was just in the A8 world.

    Sadly for a few years in the late eighties/early ninties I lost interest in computers. I was one of those weird kids who threw away computer games to read books instead! Aside from a life-long obsession with Tolkien, that period lead to an immense culture-shock when I was introduced to modern GUI programming with the various Acorn ARM-powered sub-PC's that appeared in British high schools around 1992-1994. Oddly, I found the GUI desktop concept immediately accessible and spent most of my lower and upper sixth-years in the computer 'labs' rather than actually going to lessons! After finally getting kicked out - with mediocre at best A-levels - I was just able to afford my own PC and critically an entry in to the Windows world, which itself was quite a lurch from the excellent (for its day) ROM-based RISCOS to the plodding Windows 3.x/95.

    I had not done any programming for seven or eight years and of course Win95 comes with no built-in language. For some reason though I found I had quite a thirst for it and oddly my only access was through the macro language that came inside Word 7 and onwards!!! You can actually do quite a bit of work with that, even system programming away from the word processor. For about a year I limped on making ridiculous Word macros that carried out command-line tasks before I FINALLY managed to get hold of a 'Microsoft Languages for Students' package. This was 1996 and very, very few people in Britain had access to the internet - myself no exception. The only way to get software was to - shock, horror - PAY for it at the extortionate rates that places like 'Watford Electronics' asked. For some reason programming languages were especially expensive in those days and a subscription to MSDN well over 1000. To be given a copy of the newest Visual C++ Professional (v4) and Visual Basic for Enterprize(v-unsure) for 80 was an amazing bargain.

    I was not a computer-sciences student and the only tutoring I had access to were the help files that came with C++ itself or those endless 'Learn Visual C++ in 21 days' type books that O'Reilly or whoever churned out (and may still do for all I know). The problem with those books is they don't actually teach you C++ - just how to use the macros and 'wizards' in the VS IDE to produce slightly customized MFC object library based boilerplate apps. I absolutely HATE them. Therefore I was on my own... And going from BASIC style strings to C++ character arrays was not easy. I literally spent years scrabbling my way forwards - critically using my own individual 'style' of C++ windows programming that I developed in isolation. Finally in 2000 I got access to a telephone line and a 56k modem and... The world opened up!!!

    Oddly I also stopped programming.

    I think it was the comparison between my own highly arcane, certainly 'bad form' way of writing apps and what was considered the 'right way' by the rest of the new eWorld. I was not interested in the least with templates - yet every damn piece of example code seemed fundamentally based on them. I also had grown to DETEST using MFC, much less .NET and wrote exclusively for the windows platform - therefore my apps were formed from the ground up each time. However the overwhelming, avalanche of example snippets and work-throughs are TOTALLY dependent on MFC or the other. What is more, THAT problem has only gotten worse over the last 15 years - to the extent the SINGLE book I have ever found that teaches how to use REAL C++ to program for Windows without the clutter of forcing MFC/.NET down your throt is a tome called "C++ in Action" by Bartoz Milewski. It is a very good book, but not without its own maddening typographical errors and idiosyncrasies of style.

    So... At that point I stopped. I wanted nothing whatsoever to do with templates - I hate them with a burning passion, while C/C++ was still the primary language of Windows it was spoken exclusively through the muddy dialect of corporate class libraries and worst of all the spectre of 'CLI' (not the GOOD CLI of console windows...) and the mealy-mouthed horror of 'managed code' was starting to fall over the entire windows programming world.

    And then last year, growing frustrated beyond belief with 'DOS' style batch files to encode my ripped CDs I tripped over perl... Perl with its dynamic strings, garbage collection and sublime regular expressions. Although I only really got to grips with it all over the last couple of months, I just wish I had come across the language ten years ago when it was still the toast of the town.

    And in truth I will never turn my back on C++. The initial glamour of 'fully compiled' code that lead me to C++ over every other language in the nineties has faded to almost nothing given the umph of new processors. Strings are still just as tedious to allocate and free. Worst of all I am the last man on earth who does not use templates or .NET. Yet... Yet there really aren't any other choices if I want to make full GUI apps. Also over the summer I FINALLY achieved the lifelong dream of learning ASM - at least ASM for the old Atari 8-Bit, these days as reincarnated through the amazing 'Altirra' emulator. So in all fairness I suppose like everyone else has said here - perl is really just another string to my bow. But its a damn nice one!!!

      at the extortionate rates that places like 'Watford Electronics' asked.

      Damn! We must have been near neighbours.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        They were certainly NOT cheap for software!!! However, the chaps I spoke to always seemed happy to chat for a few minutes or offer some unsubsidized advice.

        Latterly they were also one of the very few places you could get new A4/5/7000/'RiscPC' stuff and in fairness you could pocket some amazing bargains. I once got a hardware 'PC Emulator' - that was a real 486 with 8mb ram on a daughterboard! - for an A4000 from them at 5! The previous prices were written in felt-tip on the box and had initially started at 500 before being successively crossed out and marked down... That was in the days before ARM went to the darkside and joined the mobile-phone industry.

        Sadly Watford bit the dust back in '07 I think...

        "Aure Entuluva!" - Hurin Thalion at the Nirnaeth Arnoediad.
Re: Jumping ship from C++
by trippledubs (Scribe) on Jan 14, 2014 at 13:51 UTC
    yes I'm back in School and I am going the opposite direction. I know a fair amount of Perl and am learning C++. It is frustrating to spend hours on homework that could be done in 5 minutes using Perl. Also, there is no equivalent "C++ monks" or C-Monks for me to learn C as efficiently as I feel like I did Perl.

    Huge advantage to learn both, I think. Things make much more sense (to me) when you figure out where some things in Perl are derived from or why they are needed. Like, referencing and pointers! The difference between heap and stack.

      FWIW, I often find answers to my questions regarding the non-perl languages on stackoverflow.com

Re: Jumping ship from C++
by Jenda (Abbot) on Jan 20, 2014 at 17:19 UTC

    I don't think the complexities are inherent, I'd rather consider them implementation caused. I'd be rather interested to hear what, apart from groupthink, makes you consider .Net the "absolutely worst of all" though. I can't really comment on the C++ part of .Net, but that was provided just for backwards compatibility. There is still some cruft in the framework from back when C# was just a Microsoft's rewrite of Java, but the current version learned (stole) quite a bit from other languages in the best Perl tradition. Generics, lambdas, type inference, anonymous types, dynamic, ...

    What, apart from being from - horrrors - Microsoft, makes you consider .NET worst of all?

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      I, for one, never thought that dot-Net had a bad design.   I certainly would not call it “worst of all,” except in the good-humored jest that I recently used in reference to Java.   The dot-Net framework is a very good design for the “single-vendor centric environment that is Microsoft Windows.”   There are millions of deployed copies of just such an environment.   Its biggest problem is, admittedly, a conscious design decision:   it is made for Windows, for Internet Explorer, and it depends quite heavily upon client-side functionality that is also built-in to Windows (and/or to the “Silverlight®” plug-in which Microsoft provides).   Therefore, if you are deploying within a company’s internal network, you can do amazing things ... but the moment you wish to go out, you have a problem.

      And where, exactly, do people (within the company ...) “wish to go out?”   You guessed it ... mobile devices.   Whether they like it or not, Microsoft lost that battle.   So, to a lesser extent, did Blackberry.   Windows-CE et al is simply not on the radar at all.   Microsoft never will own that environment, nor will they own the deployment avenues leading to it.   Never.   “Game Over.™”   What the Executive Vice-President is carrying in his jacket pocket might be an iPhone, but it is just as likely to be an Android-driven device that does essentially the same thing for hundreds of dollars less.   Your challenge now happens to be an extremely big one:   to bring the functionality of that internal application securely to the EVP’s jacket pocket, and to make it robust and reliable, without access to the dollars needed to re-do the whole thing in a sensible language, such as Perl.   ;-)

      But we can’t blame that on dot-Net, nor should we count-out Microsoft’s very capable development team (which has produced many miracles in the past).   They simply based their system on the assumption that they could control both the server and the client side ... and, in many still-existing cases, they can.   It wasn’t a “flawed” design.   In many ways, IMHO, it was a brilliant one.   (And is the game really “over?”   Heh, in this business, “never say ‘never.’”)

        I don't have any personal experience with it but ... I believe Xamarin changes that quite a bit.

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

      My problem with .NET is exactly the same as MFC or the Delphi OWL - that you are just using boilerplates. You are not really programming, you are just learning how to use specific pre-made chunks of code. In a professional setting that is supposed to make sense as you can rapidly throw together an application. However that application is bloated beyond all decency and plods along like a pregnant Hippo... I am a hobbyist. I take pride not in producing a final product but in doing things the 'right way', or the most optimal way or a way that uses some cleverness in the fundamental architecture of C++. If your going to use MFC or .NET and CLI then in my onion you might as well just use C#, or go the whole 9 yards and flop it out in visual basic!

      Additionally it is all heading towards 100% 'managed code'. With the combination of the 'trusted computing' platform in modern EFI BIOS's and the CLI infrastructure we are just one step away from having to beg our corporate masters for the right to run our own programs on our own machines. Way back in 1999 people were starting to talk about getting licences to allow programmes to run - and hobbyists being granted the amazing privilege of a 'free' licence so long as they did not want to sell their code. This is on top of paying through the arse for the development environments themselves. Back then the idea was universally condemned. Now nearly 20 years later no one seems to care. THIS has already happened if you want to write device drivers. Your driver code has to be approved of by Microsoft and signed before it will run - unless you want to boot to some jury-rigged bullshit 'compatibility mode' every time you start up windows.

      I really don't care about MS specifically. I am against corporate parochialism in any form, whether the shiny woo of Apple or the jack-boot thuggery of SCO. Even the supposed shining castle on the hill of Linux is not without its petty childishnesses.

      That is why I have become so enamoured of perl. It takes all the supposed goodness from RAD, but makes it REAL without simultaneously stabbing you in the kidneys while you go to shake its hand. And best of all it is free like William Wallace AND Beer.

      "Aure Entuluva!" - Hurin Thalion at the Nirnaeth Arnoediad.

        Just using boilerplates? You'd better go back to assembler then! Perl and it's plethora of modules are just as boilerplaty and by no means smaller or quicker.

        Of course you should go to C# and forget C++ except in case you need to integrate with some old code written in C++.

        The end is nigh!

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

Re: Jumping ship from C++
by Laurent_R (Priest) on Jan 24, 2014 at 23:03 UTC

    Quite an interesting thread. I will not talk too much about C++, the last time I used it really (I mean with a real object orientation) for a serious purpose was about 18 years ago. I don't remember so much about it, and I was never an expert in the area anyway. I have continued to use C++ compilers more recently, but more as an implementation of C with additional features that simplified or solved some of the malloc/free/Null_pointer/SegFault/CoreDump etc. memory allocation problems in pure C. And even that subset of C++, I haven't done any of it since 2005 or 2006, I guess (to a certain extent because I had discovered Perl in between and found that it did fit the bill of what I needed far better). Therefore, I am not (or at least no longer) qualified to seriously talk about C++.

    But I moved from another OO language (Python) to Perl about 11 years ago, so you might have some interest in what I wrote about two months ago on the subject: Re: Migrating from Perl to other language? Why would someone do that?. Just in case this is not clear, I should say that I am not criticizing OO programming in any way here, I mentioned OO just because it is a common top feature of both C++ and Python.

      Absolutely fascinating post!!! Not least because as part of my move away from C++ I have determined to be at least proficient in all the popular interpreted languages such as perl (obviously), python and ruby. The problem is after becoming at least comfortable in perl, whenever I try to give python a try I end up asking myself 'why bother?'. I run smack in to that wall of utterly rigid programming paradigm you mention and bounce clean off.

      Not to deride python too much of course. In some ways that kind of absolute pattern is good and helpful - and in the right mood I would even support it. I only wish C++ was a harshly defined as it would solve a lot of problems - accessor/mutator functions inside the same class hierarchy OR direct access to protected inherited data members and so on. However... perl is just so... seductive. I really think I can do absolutely ANYTHING I could ever want to do at the command line in perl, faster, clearer and enjoy doing it more too dammit!

      Currently I do draw the line at the console though. I do not think I would try a GUI app in perl and default back there to C++. But even that may come in time.

      "Aure Entuluva!" - Hurin Thalion at the Nirnaeth Arnoediad.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://1069725]
Approved by Athanasius
Front-paged by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-04-17 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (439 votes), past polls