Any coders in here?

edited December 2022 in General

I decided to jump in and learn the basics of programming in C++. It's not part of my school curriculum. I'm learning this on my free time. I have some programming experience with Basic and Java. C++ is one of the most complicated, but also the most powerful.

http://www.hackerrank.com is a good website to go to practice your coding skills.

«1

Comments

  • C++ is mostly what I wrote for a living. Yep, much more low level, but if the product I'm working on was written in java (even if it were compiled byte code), there just wouldn't be a product. Performance is critical for some applications, and C++ is king in that domain.

  • I have a good handle on C++, though I really don't like it compared to regular C. When I have a choice, my favorite language is Common Lisp.

  • Oh come on, would you have more fun with QBasic!

  • @Mike403 - wrote in Fortran, Basic, Visual Basic, C, and a bit of both C++ and Assembly. I found Assembly to be the most complicated, as well as the most powerful.

  • @GreatHornedOwl - I don't count Assembly because it isn't portable like the other languages. You're writing for a very specific architecture and your code won't run on other CPUs. Most people use C++ if they want high performance and are not limited on what they can run it on.

  • edited December 2022

    I learned and used C++ and Java years ago, used Java a bit more between them, but also did some Cobol, Multibase, AutoHotKey, VB6, VB.NET, and C# until moving into automation scripting and now mostly use PowerShell and Python while also using Python for doing A.I., machine learning, and data science. Recently started learning Terraform and that's been a new experience to say the least.
    Good luck with C++! There are some great resources out there for learning it.

  • As a software engineer started my career as a programmer but now for past many years work as an presales architect for enterprise solutions within the telecom domain. C++ and java based frameworks like Spring boot, Spark are good for microservices based architecture which is where everyone is or heading.
    Good luck!!

  • I just had a funny thought. I would guess at lest 90% of the cuddlers who drop into this thread won't understand a word.

    Saying that, just reminded me that I also coded in APL (A Programming Language), on an old IBM 5110. For those normal people, who have never heard of it, it was very efficient to write. It had a collection of weird looking symbols, each of which could replace several lines of code in any other language. Writhing in APL required having a keyboard with all of the odd symbols.

    APL coders were fond of writing out a string of several symbols, and then handing it to another AOL coder, with the challenge "I bet you vant figure out what tis does."

  • @GreatHornedOwl - I started coding in an old MS-DOS based Basic interpreter when I was a child. I remember my first computer had most of the Basic language on a ROM chip in the machine and you ran a small file on the disk to call that ROM.

  • @Mike403 - When I was coding, it was mostly to be firmware, to be embedded in a specific device. Portability wasn't an issue.

  • I've been professionally programming for about the past 20 years. A mix of C, Python, PHP, and (sadly) TCL. Thankfully no Perl now. I also have some familiarity with C++ and Java, though I haven't done much with those. And a little Javascript, but I can't keep up with all the frameworks.

    I started with BASIC on a C64. When we got a 386 with DOS, QBASIC was the niftiest thing ever. No more line numbers!

  • “Hello World”

    The journey starting from writing machine level language for 8085/8086 microprocessors to using interpreters and compilers to writing our own libraries to pulling/pushing it to git while moving compiled code from floppy disk as an executable to seamlessly deploying it as an artifacts on cloud.

    @Mike403 thank you for taking us down the memory lane.

  • edited December 2022

    @Mike403 - The IBM 5110 was a very primitive machine. The Basic interpreter, and an optional APL interpreter were embedded firmware. It had a single 8" floppy drive, with a second one being optional. In Basic, variable names were limited to a single letter, and a single numeral. That coupled with the fact that comments were used very sparingly, made it horribly difficult to understand anybody else's code. A month after writing it, I even had trouble understanding my own code.

    There was a good reason for avoiding comments. My machine had a whopping 32K of memory. Comments used up memory. Comments used up memory just like the rest of the code. Some times, the code took up so much memory, that there wasn't enough room for data. When that happened, it was time to free up some memory by stripping out a few more comments. When that happened (and it usually did), it became necessary to constantly swap sections of data on and off the floppy. That slowed everything down terribly. It also wasn't as effective at conserving memory as you might think, because it needed more code to manage the swapping, and the extra code used up more memory.

    Whenever I needed to run a sort on the data, I started it when I left at night, and hoped it would be done by the time I came in the following morning. Usually, it wasn't.

  • @GreatHornedOwl - My first computer was an IBM XT with 640k of RAM, a CGA display, and a single 5.25 inch floppy drive.

  • I've only written in LOLCode, Rockstar, and Brainfuck.

    Also...on serious note...Advent of Code started.
    25 days of Christmas challenges.
    Only the best programming challenge out there, if haven't heard of it.
    New 2 part challenges release every night Dec 1st - 25th.
    And can go back and do all the years of past too.
    Any language, just submit answers, not code.

    Really incorporates, data IO, algos, and performance.
    And fun Christmas theme story lines.

    https://adventofcode.com/

  • Would you say C++ or Python is better to start with for a beginner?

  • FORTRAN in college using IBM 80-column cards. These days the closest I get to coding—and it's not close at all—is writing GREP expressions while working on InDesign projects.

  • @rainy_girl Python is definitely better to start with for a beginner. Partly because it's an interpreted language with a shell, so it's very easy to give something a quick try. It also doesn't have the finicky bits that C++ has, like strict typing or having to do your own memory management. Just be careful not to pick up bad habits. Readable code is debuggable code, and all code has bugs.

  • What’s a coder???

  • @LauraBehr36 - Programmer. Somebody who writes code for a computer.

  • Been a developer for many years. Learned C/Unix way back when an intern job and took it back to senior year of college. Masters at Johns Hopkins, C/C++/C# for many many years. Many years also in VB and VB.Net, JavaScript, Even iOS in the iOS 6 days. Ready to put my coding skills on the shelf.

  • @_cuddlerAlan At my employer, the only other option than coding is management, and it's way too mentally exhausting to manage morale and emotions with a bunch of people. The straight-line simplicity of 1s and 0s is a breath of fresh air in comparison.

  • I wrote an algorithm to check if I should cuddle with someone. It's the first version so there may be bugs! ;-)

    public Boolean shouldICuddleWithHer(Profile herProfile, Profile myProfile, List<String> herMessagesToMe) {
    
        // start with the important stuff
        if (herProfile.getSmokes().equals("420")) {
            return true; // she's the bomb 
        }
    
        // how much does she charge?
        if (!herProfile.getCost() > 100) {
            return false;  // oh well, too much for my blood.
        }
    
        // check if she's within driving distance
        if (!herProfile.getDistance() > 30) {
            return false;  // too far away
        }
    
        // does she mention the proper keywords to spark my attention?
        String aboutMe = herProfile.getAboutMe().toLowerCase();
        if (!aboutMe.contains("coffee") || !aboutMe.contains("food") ||
            !aboutMe.contains("hiking") || !aboutMe.contains("biking") || 
            !aboutMe.contains("outdoors") || !aboutMe.contains("cooking") || 
            !aboutMe.contains("soccer") || !aboutMe.contains("world cup")) {
            return false;  // nothing to talk about
        }
    
        // does she have at least 3 karma?
        if (herProfile.getKarma().getCount() < 3) {
            return false;
        }
    
        // she is ignoring me.  
        if (herMessagesToMe == null) {
            return false;
        }
    
        // she sent me some messages, did she say the right things?
        for (int i=0; i<herMessagesToMe.size(); i++) {
            String message = herMessagesToMe.get(i).toLowerCase();
    
            if (message.contains("terrible person")) {
                return false;
            } else if (message.contains("you're a turkey")) {
                return false;
            } else if (message.contains("too old")) {
                return false;
            }
    
            if (!message.contains("handsome") || 
                !message.contains("good looking") ||
                !message.contains("smarty")) {
                return false;
            }
    
        }
    
        return true;  // she's my cuddlebuddy
    
    }
    
  • Being a software developer is 5% coding, 15% debugging, and 80% pasting error messages into Google.

  • @Unscented_Lemon - The way I remember it is "All code should be assumed to contain bugs until proven otherwise, which is impossible."

  • @GreatHornedOwl The research community is getting closer to being able to prove that some code is bug-free. For example, someone demonstrated that you can specify and prove an implementation of memcpy as bug-free. Unfortunately at least 33 percent of bugs are caused by faulty requirements, so we'll have bugs as long as people don't precisely know what they want.

  • I've been coding in Python since January

  • I’ve been coding for 33 years in C++, UNIX, and Informix SQL and 4GL.

Sign In or Register to comment.