[HN Gopher] The Consequences of One's First Programming Language
       ___________________________________________________________________
        
       The Consequences of One's First Programming Language
        
       Author : BerislavLopac
       Score  : 16 points
       Date   : 2024-05-29 09:09 UTC (13 hours ago)
        
 (HTM) web link (fermatslibrary.com)
 (TXT) w3m dump (fermatslibrary.com)
        
       | einpoklum wrote:
       | This is a paper regarding a survey taken in 1978, with the super-
       | biased sample of people who answer the survey solicitation via a
       | magazine, sample size of ~50, everything self-reported/self-
       | assessed.
       | 
       | So, a historical curiosity and some possibly-interesting
       | ruminations by the author, not more. IMHO.
        
         | Animats wrote:
         | Yes.
         | 
         | I haven't heard UNIVAC's facility in Blue Bell, PA, mentioned
         | in a very long time.
         | 
         | Original BASIC had neither data structures nor scope. So
         | programmers who started with BASIC lacked some key concepts.
         | There was thus a problem at one time with programmers who
         | started in BASIC.
        
           | PaulHoule wrote:
           | I started in BASIC but I'm long past it. I got this pretty
           | quick in a ROM cartridge
           | 
           | https://www.cocopedia.com/wiki/index.php/EDTASM%2B
           | 
           | when I was still saving programs on tape. Assembly lacks many
           | of the things BASIC lacks though. Wrote my own program that
           | would take BASIC source code without line numbers and with
           | structured control structures and compile to BASIC. Also got
           | PASCAL and C compilers, wrote a lot of Turbo Pascal for the
           | PC in the late 1980s, got into the C habit when I went to
           | college, picked up Java in my PhD program and I've been
           | coding it ever since.
        
           | readthenotes1 wrote:
           | "There was thus a problem at one time with programmers who
           | started in BASIC" and who never bothered to learn the
           | affordances, constraints, and idioms of their new language.
        
         | PaulHoule wrote:
         | I've always taken a particular joy in "Writing code like
         | Language A in Language B"
         | 
         | I like Java as a host language to do things like:
         | 
         | Write numerical codes in FORTRAN style, allocating a few big
         | arrays at the beginning and not pressuring the garbage
         | collector. This is how I'd write an FFT, matrix inversion, or
         | something like that.
         | 
         | Write programs with very few class definitions but a large
         | number of static methods. (Like any non-OO languages, but
         | static methods can go nicely with a few well chosen classes you
         | make instances of)
         | 
         | Write static methods that take instances of "Object" as a
         | parameter that are inspired by an algebra like that for a
         | language like Python (of course a Collection is treated
         | special, etc...)
         | 
         | Use static methods to build up structures like LISP's
         | S-expressions.
         | 
         | These tactics can be used, for better or worse, to write Java
         | DSLs that appear to describe "business rules" in plain English
         | with the caveat that things like that are never as easy for
         | muggles to maintain as you wish they were.
        
           | devin wrote:
           | I also find that it's a nice exercise on the way to learning
           | a new language. I spend a lot of time in Clojure, so I'll ask
           | and answer "okay where are the lambda-like things, how do I
           | apply them over collections" and then write up something I
           | know is not at all what the language designer intended for
           | kicks.
           | 
           | As an added bonus, it is fun to show your work to a coworker
           | proficient in the target language and watch the blood drain
           | from their face.
        
       | kazinator wrote:
       | Age? Was your first language at age 6? 12? 24?
       | 
       | I used line-numbered BASIC. It's unimaginable that I've not
       | erased its influence by now.
       | 
       | Even when I knew nothing, I knew that BASIC sucked. Line numbers
       | sucked, GOTO and GOSUB sucked.
       | 
       | When I first used a freely formatted language with actual
       | parameters and local variables, it was like ascension into
       | heaven.
       | 
       | Actually the moment for me was before that. In the book
       | _Programming The 6502_ by Rodnay Zaks, there is a presentation of
       | a module with recursion. I think, binary search tree or something
       | like that. The assembly language source is given, as well as some
       | Pascal-like pseudocode for the search routine. (I knew it was
       | Pascal because I had read about it in magazines like Byte and
       | Creative Computing.)
       | 
       | Seeing those two things together hit home for me: BASIC is
       | garbage even compared to assembly language for an 8 bit
       | microprocessor. Look at this beautiful Pascal program, with no
       | GOTO or line numbers --- and it can be translated into a clean
       | assembly language program also. I became eager to try Pascal
       | somewhere, somehow.
       | 
       | A possible consequence of one's first programming language could
       | in fact be not a tainting by its methods, but, on the contrary, a
       | persistent hatred for anything of its kind.
        
         | Supermancho wrote:
         | I share these experiences.
        
         | whartung wrote:
         | We're from the same era, but I have decent respect for BASIC.
         | Pounding the square peg of my applications into the round hole
         | that is BASIC.
         | 
         | BASIC has everything assembly does. At a high level, Assembly
         | offers GOTO and GOSUB. Obviously, you can have pointers to
         | anything, indirect jumps, etc. but, to be honest, unless you're
         | writing your own malloc (and it a lot of assembly cases, you're
         | not), you're dealing with static allocations of memory for
         | data. A pointer can be no different from an offset into an
         | array in BASIC (or set of arrays -- array of ints, array of
         | strings).
         | 
         | You can recurse with BASIC, you just need to maintain your own
         | stack for the data (the BASIC will handle the stack for the
         | GOSUBs, if you continue to use them). You may well maintaining
         | your own stack in assembly (ye old Forth-ish data stack v
         | return stack). I've seen several different compilers written in
         | BASIC. You can have "Structures" in BASIC. PNAME$, PADDR$,
         | PZIP$, PBDATE. Turn those all into arrays, and you have arrays
         | of structures. With a Pointer! (P!)
         | 
         | It's inelegant, but so is assembly. It's too primitive to not
         | be. Outside of macros, there's no real abstractions. At best
         | you can offset a memory reference to get something akin to a
         | structure, and use constants for that offset. But, in the end,
         | unlike todays legos, you're still stuck 2, 4, and 8 pin bricks
         | to build everything. Plus all the fun register juggling.
         | 
         | Assembly lets you have better identifier names. Six letters! I
         | remember a lady who wrote much of here companies core business
         | software in BASIC. She was particularly proud of the fact that
         | Z9 was the universal error/status variable used in the system.
         | Similarly, I recall my father lamenting that he could only have
         | variables such as A, and AA, but not AAA in BASIC (since at the
         | time, MS-BASIC only distinguished on the first 2 characters).
         | 
         | BASIC is high level assembly, that just so happens to have some
         | of the best string processing, and some pretty good I/O, in the
         | business. (Garbage collected string processing in MS-BASIC, no
         | small feat. Who knew you had a garbage collector in that 8K
         | BASIC?)
         | 
         | I was not scarred by my BASIC experience. Nor my FORTRAN (it
         | was FORTRAN back then) experience. (Very BASIC-ish, without the
         | as many line numbers). I was grateful to have learned
         | FORTRAN-77 and not -66. I would not want to go back to dealing
         | with BASIC, particularly not 8-Bit level micro BASICs of yore,
         | not if I didn't have to. That said, one of my favorite
         | languages was a 4GL with in built SQL, screen forms, and
         | reporting. It was limited in many ways that BASIC is, but, boy
         | howdy, could I pound out usable, effective software that helped
         | the company and its people with it, which is, in the end, what
         | this is all about most of the time anyway.
         | 
         | About as far as I'd want to go back is QBASIC. It's lack of
         | line numbers, and full screen editor send it over the top. Line
         | numbers are what they are, but the biggest problem with them,
         | particularly in MS-BASIC, is you can't renumber sections of
         | lines. Like, you can't renumber lines 1000-2000 to 3000-4000.
         | So, you can't easily re-organize and move code around.
         | 
         | But you make do.
         | 
         | Beats clicking binary into the front panel.
        
         | dkarl wrote:
         | > A possible consequence of one's first programming language
         | could in fact be not a tainting by its methods, but, on the
         | contrary, a persistent hatred for anything of its kind
         | 
         | Java was not my first programming language, but it was the one
         | I used at my first job, so it was the one in which I first read
         | widely about the best ways to do things. I was immersed in the
         | Java OOP culture. I lived through the days when it was normal
         | to review the names of a couple dozen design patterns before a
         | coding interview. Now I feel like a witness to history, and
         | also like someone who was raised in a cult and then left and
         | now tells people what it was like.
        
       | bee_rider wrote:
       | It is an interesting idea, although limited (as noted in the
       | paper) by the small sample and various confounding variables.
       | They did mention:
       | 
       | > A FORTRAN programmer who has successfully designed a payroll
       | system may not see any value in the ability to combine numeric
       | and alphabetic information into a single data structure.
       | 
       | A confounding factor they forgot to note--a possible confounding
       | variable here is that, while the first language might influence
       | the programmer, there could also be come correlation between
       | language picked and potential... which is to say FORTRAN
       | programmers are just smarter than everybody else (also, better
       | looking, so we'll have to make sure the judges of the programming
       | styles don't end up falling for them).
       | 
       | The only data structure you need is a big block of numbers. How
       | could your data get more structured than that? Also don't believe
       | the charlatans who say Fortran has OO capabilities now, they are
       | just trying to pull you from the true path. What do you want, a
       | graph, a linked list? Nodes are what your code runs on!
        
       | utensil4778 wrote:
       | My real, true first exposure to programming was Qbasic on a
       | Windows XP machine, followed by real BASIC on a Commodore 64,
       | then Java. But I don't count any of that, I never really built
       | anything, just plugged in examples. I consider my true native
       | language to be C#. It was the first language I ever built
       | anything real with, and my first taste of what being a Real
       | Programmer was.
       | 
       | It absolutely has flavored my programming in any language. The
       | way I name and structure things is ""bad"" C++ programming, but
       | I'm fluent in C# concepts in a way I'm not with other languages.
       | 
       | I've also developed a _deep_ distaste for non-C languages. Or
       | maybe I 'm just getting old and curmudgeonly.
        
       | WalterBright wrote:
       | One consequence of BASIC being my first pl is the D programming
       | language has great string handling, as opposed to C string
       | handling which is an endless fountain of bugs.
       | 
       | (When I review C code, the first thing I look at is the string
       | handling code, because there's always a bug in it.)
        
       | ojbyrne wrote:
       | Should probably include (1981) in the title.
        
       | marcod wrote:
       | That explains why I'm always thinking about turtles ...
       | 
       | OK, not true, I'm thinking of a hedgehog, because the German
       | version of Logo we used in the late 80s used an "Igel."
        
       ___________________________________________________________________
       (page generated 2024-05-29 23:03 UTC)