• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.

What Programming Languages do you use?

What Programming Languages do you currently code in?


  • Total voters
    96
I vaguely remember Forth (a version for the Commodore VIC-20). As a near-novice at the time, it struck me that without a pre-packaged library of words, you had to build the whole language from scratch before you could program in it.

At the time, the only real difference between BASIC and Forth in term of capability is a built in string package.

The other would be cassette/disk I/O. Forth had it, naturally, (the BLOCK and SCREEN system), but it wasn't as sophisticated as what BASIC had to offer, notably because Forth lacked a formal file system.

In truth is was quite simple to work with disk records in Forth on structured data, but if you wanted use the equivalent of BASIC PRINT statement to a file, that was a different beast.
 
I vaguely remember Forth (a version for the Commodore VIC-20). As a near-novice at the time, it struck me that without a pre-packaged library of words, you had to build the whole language from scratch before you could program in it.

Maybe I missed something.

Currently the only programming I do is in BASIC, and very little of that.

The basic commands existed. What you did was build routines (sentences) which you saved and were reusable. It really wasn't designed for creating "office" applications. BASIC was far better for simple and slow apps like that. Where FORTH was unparalleled at was for real-time processing. Like signal processing. Stuff where before you'd use assembler for speed and compact executables, you could now use Forth

I haven't programmed in forever. Doesn't match my temperament. I prefer working with people as a manager or executive. Although I am retired mostly
now.
 
I vaguely remember Forth (a version for the Commodore VIC-20). As a near-novice at the time, it struck me that without a pre-packaged library of words, you had to build the whole language from scratch before you could program in it.

Maybe I missed something.

Probably the community. FIG (FORTH Interest Group) shared a lot of dictionaries you could incorporate into your own. It sped things up a bit.

FORTH has its uses in the world. Just not anywhere near me at the moment.
 
It's worth noting that C# hasn't been exclusively for Windows for a long time now, and that Mono brings most of .Net to Linux and Mac.

I use it extensively as a multiplatform development system. I do most of my development on Linux, then create bundles (executable packages) for Mac and Windows. About 5-10% of my development with it happens on Windows.
 
It's worth noting that C# hasn't been exclusively for Windows for a long time now, and that Mono brings most of .Net to Linux and Mac.

I use it extensively as a multiplatform development system. I do most of my development on Linux, then create bundles (executable packages) for Mac and Windows. About 5-10% of my development with it happens on Windows.

How much of this is basic command line stuff or server/web service stuff vs GUI interactive stuff?

How portable is a .Net GUI today?
 
How much of this is basic command line stuff or server/web service stuff vs GUI interactive stuff?

How portable is a .Net GUI today?

I am only a hobbyist that still use ASM6502, Z80-ASM, Commodore basic, Go, Perl, Tcl, C and Arduino programming language.

Yet I think the most common route to use the .net framework is to use .NET CORE; however, this is really for only CLI based applications. But I have seen NET CORE used with the GTK package for linux/window based GUIs. I have not seen to many new Mono projects. Would be really epic if someone made a NET CORE Tk binding.

Been doing some C and Go programming recently myself, and I have looked at Lua programming for some game stuff and robot stuff, since I mainly focus on building items for TI calculators and interfacing with external sensors or actuators. It is cool to have Alexa, but even better to have stuff controlled by your TI-Nspire

In my industry, we mostly use Tcl and some new hardware is starting to use Lua. This is due to being able to embed Tcl and Lua into a C program that only takes kB of space or to have it part of an embedded operating system.

However, recently I have been porting my tools from Python over to Go. Coming from a Perl background, Python just always seemed 'meh...' to me, since Perl did it first. Sometimes I am not sure I want batteries included, and if the library used in batteries included is not updated, it could be further out of date then a external module, which in the the end defeats the purpose of having batteries included.
 
I recently moved over to Cython for doing iterations much faster.

I enjoy your Youtube Videos if you are the same person.

I thought Cython was the same as Python; however, I could be very wrong, since I am not very well versed in Python or the Python ecosystem.

I think Eve uses Cython.
 
Cython is Python code that is compiled into C code. It does simple things like convert dynamic type variables into strong type variables. The compiled code can be called by Python apps. Cython code can be be embedded into C code. C code can by embedded into Python code, etc. Back and forth usage, basically.
 
Cython is Python code that is compiled into C code. It does simple things like convert dynamic type variables into strong type variables. The compiled code can be called by Python apps. Cython code can be be embedded into C code. C code can by embedded into Python code, etc. Back and forth usage, basically.

That sounds very portable and very similar to why I use Tcl and recently started to look into Lua. When you say 'Python code that is compiled into C code', does that mean you can generate C code/files with GCC or Clang?

I remember recently (not very recent, but recently) that I was trying to use an external module/library in a Python 3.6 and I downloaded the compiler via pip. Seemed like after compiling to native code, when some sections of the module would be called the compiled code would barf. Due to the latter, rushed around to find a similar Cpan module, and compiled via Perl. The end target machine was not going to have Python, nor would policy allow for Python to be installed. However, I could sign my own executable, to have a 'in-house' developed solution installed. ++wink++ don't ask.

It is events like that, which made me start looking at Go. Not many folks coming fresh out of university today want to code in C. Or create create Lua libraries to be called.

On another trek, I had great hopes for Objective-C and the replacement Swift. Not being a MAC/Apple supporter since the loss of MOS chips then PowerPC, but with IBM backing of Swift on mainframes it was refreshing to see something of the sort, yet it looks like IBM stopped funding or openly supporting Swift.

To be honest, I never learned how to think in Object Oriented Programming (OOP) models. And still to this day I struggle with OOP concepts. I would love to say I can use C++ and Qt; however, that is not the case. I know they are very similar to structures, but cannot get the old 6502 running at 1 Mhz to compute. ++deep laugh++, could you imagine how long it would take a 6502 to build a SSL/SSH handshake negotiation, or generate a sha512sum key....

If you know of any good OOP books for C++, C# or even .NET Basic I would be interested. Not looking for GUI design books, all my stuff lives in CLI or embedded hardware. However, at the end of the day, I still have STRUCTURES in my C.
 
Once I started dealing with objects and messages, things became a lot clearer. Just like Go objects, a Python or Perl object is usually a mix of data and methods. Of course, Go doesn't have inheritance, but it does have polymorphism via interfaces.

Here's a Perl example, fresh from this morning's work. A section of text will have a "reading grade level", often based on the Flesch-Kincaid scale. Naturally, I make a "Section" object that has a test to see what the grade level is. However, sections don't actually store the data, they get it from a Report object.

Being able to mentally isolate things like that really helps me focus on small bits at a time. The Section gives the Report a copy of the text, and asks for an evaluation. I can change how the work is done and as long as the tests pass, life is good. The Book object will ask each section for their grade levels, and average them out for a total.

The flip side, of course, is trying to talk to someone about objects and they start going into 27,315 levels of indirection. It can be over done, but a little bit goes a long way to make life simpler and code easier to comprehend.
 
When you say 'Python code that is compiled into C code', does that mean you can generate C code/files with GCC or Clang?
Yes. I use GCC.
I remember recently (not very recent, but recently) that I was trying to use an external module/library in a Python 3.6 and I downloaded the compiler via pip. Seemed like after compiling to native code, when some sections of the module would be called the compiled code would barf. Due to the latter, rushed around to find a similar Cpan module, and compiled via Perl. The end target machine was not going to have Python, nor would policy allow for Python to be installed. However, I could sign my own executable, to have a 'in-house' developed solution installed. ++wink++ don't ask.
If you are compiling a C program for Python to run (a .pyd file), you will need to use a C compiler that matches the one used for that version of Python you're running. Pretty much every other version of Python was created with a different version of Microsoft Visual Studio.
If you know of any good OOP books for C++, C# or even .NET Basic I would be interested. Not looking for GUI design books, all my stuff lives in CLI or embedded hardware. However, at the end of the day, I still have STRUCTURES in my C.
Only 1% of the programming I do needs OOP features. I do programming like in the '70s. Top-down structural procedural programming. No one talks like that anymore, even though they are using languages from the '70s. They call it coding now. Or app development, etc.

Amazon has all the O'Reilly books. Just get the OOP book for the language you are programming in.
 
If you know of any good OOP books for C++, C# or even .NET Basic I would be interested.

I enjoyed the first edition of Head First Design Patterns, and that might help you see how objects can be used. Having a "useful why" often helps motivate more than just a passing interest. The concepts are presented easily, so you will likely be able to mentally translate that to whatever language you prefer.
 
Only 1% of the programming I do needs OOP features. I do programming like in the '70s. Top-down structural procedural programming. No one talks like that anymore, even though they are using languages from the '70s. They call it coding now. Or app development, etc.

I am the same way - I started in the 80s, so a lot of my code, no matter what language looks like code from Byte or Commodore/Amiga of the same time.

I will look into Cython, since you can compile with GCC that might help me be able to deploy code. Thank you
 
I enjoyed the first edition of Head First Design Patterns, and that might help you see how objects can be used. Having a "useful why" often helps motivate more than just a passing interest. The concepts are presented easily, so you will likely be able to mentally translate that to whatever language you prefer.

I agree... Thank you for the book recommendation.
 
To be honest, I never learned how to think in Object Oriented Programming (OOP) models.

Simply, your programs aren't big enough, or you're not sharing the code amongst independent programs much.

If you were, you'd find the OOP stuff much more intuitive as it solves these needs readily and easily.

The simplest example, especially for a C developer, is probably standard file I/O, ye old FILE *fp.

In C, you pass the context to all of the stdio IO routines (fread, fwrite, fopen, fclose). In a (typical) OOP system, rather than passing the context to the function, you call the function on the context. The context has code attached to the instance of the object.

You also have the stdio routines in your global namespace. Which is why we have fread, fwrite etc, because read and write were already taken by low level I/O.

Consider this simple routine (apologies if this is imperfect it's representative, rather than normative)
Code:
    int count(FILE* fp) {
        char ch;
        int cnt;
        ch = getc(fp);
        while(ch != EOF) {
            cnt++;
            ch = getc(fp);
        }
        return cnt;
    }
Given a file pointer, you can count the number of characters in the file.

The issue here is, as is, this is as far as you can go.

Here's two use cases:
Code:
    FILE *fp = fopen("file.dat", "r");
    printf("file had %d characters", count(fp));

and

Code:
    printf("stdin has %d characters", count(STDIN));

STDIN is predefined FILE pointer to represent standard input.

But that's as far as you can go.

Now let's consider Java.

Code:
    public int count(InputStream is) {
        int cnt = 0;
        int b;
        b = is.read();
        while(b != -1) {
            cnt++;
            b = is.read();
        }
        return cnt;
    }

Very similar to the C code. The key difference is we're using InputStream vs a FILE *.

Here's how it comes in to play as a difference:
Code:
    FileInputStream fis = new FileInputStream("file.dat");
    int cnt = count(fis);
    System.out.println ("file has " + cnt + " bytes");

    cnt = count(System.in); // System.in is the STDIN as an InputStream
    System.out.println ("stdin has " + cnt + " bytes");

    String str = "This is a test";
    StringBuffer sb = new StringBuffer(str);
    StringInputStream sis = new StringBufferInputStream(s);
    cnt = count(sis);
    System.out.println("StringBuffer has " + cnt + " bytes");

    ByteArray ba = str.toByteArray();
    ByteArrayInputStream bis = new ByteArrayInputStream();
    cnt = count(bis);
    // This number may be different than the previous example, 
    // for reasons out of scope in this discussion
    System.out.println("String byte array has " + cnt + " bytes");

    ServerSocket server = new ServerSocket(8888);
    Socket socket = server.accept();
    cnt = count(socket.getInputStream());
    System.out.println ("socket client sent " + cnt + " bytes");

Here you can see InputStream as the universal abstraction across all of these different higher level concepts. Files, buffers, sockets, etc. The actual code is the same. This "count" code can be shared readily across programs in these different domains.

But an important concept is that the "read" method from InputStream, while named the same across all of the constructs, all do different things. Any byte level data structure can have expose an InputStream. An image, a sound, etc. Anything that's worth iterating over at a byte level can be made manifest as an InputStream. But the namespace is tied to the implementation class, rather than the entire of the file.

C++ solved these kind of problems two different ways. One was through standard OOP inheritance and method dispatch, much like Java. The other is through generic programming via Templates.

Whereas in standard OOP, that "count" method would be written once and rely on dispatch via the implementation class to do the work, C++ Templates would have essentially re-written the "count" method for each use case. It's a different mechanism of abstraction.

Now, in practice, most applications themselves do very little OOP. They rely a lot on OOP frameworks (such as the java.io system mentioned here), but rarely have to implement their own. Most folks are just writing code to do work: process a file, handle some input, do some math. This is typically very rote work. Input -> Magic -> Output.

The utility space is where you'll see OOP more in action. I/O frameworks, data structures, GUIs. Common code used by lot of programs where re-use and extensibility are key long term values.

In all of my work over the years, in Java, I've created very few base classes or interfaces for our own work. There's certainly been some, and they were re-used heavily. But when 90% of your work is pushing stuff in to and pulling stuff out of SQL data bases, which is what the majority of back office work is nowadays, there's just not a lot of code sharing. The Person table isn't like the Invoice table at all when the rubber meets the road, and that's the code that I write. Someone else did the interface to the database, in a nice generic way so I could swap that out to most any database I like.

In C the Postgres C library is completely different from the MySQL C library. If you wanted to switch databases, you would you have to rewrite good chunks of your code. In Java, there's a generic layer that handles that for you, so if you wanted to switch, most of your code would not have to be rewritten.

You could write a generic layer in C, but C doesn't make that easy. It just relies on idioms (structs of function pointers, essentially). The technique is there, it's just not a first class citizen.

But most folks enjoy the benefits of OOP without necessarily writing OOP style code themselves. In fact they get themselves in to trouble trying to force it on their application that doesn't need it. OOP is great for infrastructure, most folks don't write infrastructure.

As systems get larger and more complex, when more code wants to be reused, then concepts like OOP make things easier. Obviously there are large systems in C, nothing is impossible, but OOP structure can make these systems easier. OOP rose out of frustrations with baser languages like C.
 
I am the same way - I started in the 80s, so a lot of my code, no matter what language looks like code from Byte or Commodore/Amiga of the same time.

I will look into Cython, since you can compile with GCC that might help me be able to deploy code. Thank you

I broke from that "spaghetti code" mode in the late 1990's.
C will break one of it. But it only forces one to function-based programming.
I've never successfully made the conceptual leap to proper OOP...

As for programming, python 3+ has a standalone maker while it's not compiled, it's just the needed parts of the python interpreter to run the object code .pyo.

Pretty nifty. pyinstaller
 
I broke from that "spaghetti code" mode in the late 1990's.
C will break one of it. But it only forces one to function-based programming.
I've never successfully made the conceptual leap to proper OOP...

As for programming, python 3+ has a standalone maker while it's not compiled, it's just the needed parts of the python interpreter to run the object code .pyo.

Pretty nifty. pyinstaller

I am glad you recommended 'pyinstaller'. I believe some on another team have used it already for 'matplotlib'. I see these item have been tested already according to the website, which is reassuring. When I have to build a gui, I am still stuck in Tkinter land, but I suspect due to coming from Tcl/Tk and Perl/Tk.
 
Back
Top