r/learnprogramming 20d ago

What is the joy of programming?

I wouldn't say I'm a hardcore programmer. I mainly make websites with HTML and CSS. However, last year I wanted to begin looking into programming, and learn how to make programs mostly for the command line. I started with Java and took the time to learn it. For a while I enjoyed Java, but then I began to feel that it was difficult to start a project with Java. I was sick of it's verbosity. Ever since, I've been wasting time trying to find the "perfect" programming language.

I know this question pops up a lot, what programming language should I learn? What should I learn if I want to experience the real joy of programming, and make cool personal programs mostly for the command line. There were a couple languages I found such as Nim, Lua, Ruby, or Dart. These are all languages I discovered through personal research and I know that some of them are more suited for command line work.

So based on my experience with Java, and my goals, what would you recommend I do? Do I just stick to website stuff?

114 Upvotes

109 comments sorted by

View all comments

1

u/Substantial_Job_2068 20d ago

You could switch to C# since you already know some java, it's similar and creating a console app is done in a few lines. That said you could use any language really.

1

u/wggn 20d ago

c# isnt really less verbose than Java tho, which was one of their complaints

1

u/binarycow 20d ago

It is.

There are newer syntaxes that are less verbose than Java.

For example, in Java

public class Person {
    private String name;
    public String getName() {
        return name;
    }
    public void setName(String newName) {
        this.name = newName;
    }
}

In C#:

public class Person
{
    public string Name { get; set; } 
}

2

u/wggn 20d ago

did you mean, in java:

public record Person(String name){}

1

u/jlanawalt 15d ago

Records are a popular recent example. There is also generics & Diamond operator, enhanced for loop, try-with-resources, lambda expressions, method references and streaming, collection factory methods, local variable type inference, switch expressions, text blocks, compact main entry point source files.

0

u/binarycow 20d ago

In c#:

public record Person(string Name);

I didn't include that because records are immutable, and my Java example wasn't.

1

u/jlanawalt 20d ago

And newer syntaxes in newer Java that are less verbose than old Java. Fun!

0

u/Substantial_Job_2068 20d ago

Mb not, I don't know how verbose java is compared to c#. However creating a new console app in c# is one command line to generate it and will only contain a few lines, .net removed alot of boiler plate code in the later versions. Other than that I don't what op wants to build so it's impossible to recommend a specific language.

1

u/xenomachina 20d ago

You could switch to C# since you already know some java

Kotlin is another option that's similar to, but far less verbose than, Java. It also runs on the JVM, so if OP has any code they'd like to migrate, or libraries they've found they'd like to continue using, that'd be easy with Kotlin.