Fuck, programming is hard

Fuck, programming is hard.
In Computer Engineering right now and looking at Java for the first time, this shit gets complicated.

What programming language(s) do you know and how much time did it take you to learn?

Java here around a year slowly getting better but still kind of suck dick at it

the only thing that's hard in the entire universe is my dick

> java
> hard

are u even trying

YES, I'm trying. It's fucking hard. Trying to convert a string into a sorted int right now like if I have a string "9123" I want to get an int with the value 9321

Been hours now, can't do it with a for loop

this, try haskell or for the real autism-feel whitespace

isnt it just using parseInt?

Java, C, C++, JavaScript, Python, Scheme

Didn't take me long, couple of weeks to months.

modula-2
java
Ruby
PHP
c++
scheme
JavaScript

took about 5-6 years. Also I know some BASIC from when I was a little babby

yes you can, use string.lenght()

Can't use those methods so I'm stuck with fors and whiles

I'll try it tomorrow, tired af now

note the sorted part

That's why people who want to get serious in programming should start with C

+1

Hahaha why didnt you find this method? just google your question dude

You know how to get a single char? You know how to get the value of a char? Then you should be able to solve this problem with some simple math.

int getDigit(char c) {
switch (c) {
case '0':
return 0;
case '1':
return 1;
// ...
case '9':
return 9;
}
}

String str = "9123";
char[] cha = str.toCharArray(cha);
java.util.Arrays.sort(cha);
int num = 0;

for (int i = 0, factor = 1; i < cha.length; ++i, factor *= 10) {
num += getDigit(cha[i]) * factor;
}

breddy gud

...

Good, except
str.toCharArray(cha)
should be
str.toCharArray()

That nice switch statement can be written in one line faggot

if you find java hard just wait to have fun with SQL recursive queries and DLX assembler

I'm a Comp E major, too, and my first two introductory classes were in Java as well. EE majors have to take the same two classes as well.
Is Java really relevant to engineering applications? All the job openings I see are for C/C++.

int hur(char[] s) {
int duh = 0;
for (int i = 0; i < s.length; ++i) {
duh += Math.pow(10, i) * (s[i] - '0');
}
return duh;
}

keep on keepin' on, Pajeet :')

Java, took me like a year but that's because I spent like zero time out of class learning it other than doing homework.

I thought it was kind of easy, but that's probably just because I enjoy it and think it's fun

Learned C# in less than a week because it's literally Microsoft Java and I prefer it because muh Visual Studio (always a pleasure to use even though I hate IDE's)

Is bash a programming language? I like writing shell scripts on my Linux desktop to automate tasks, add custom tweaks, and just dick around for fun. Though I guess writing shell scripts isn't really programming

A number char is just +48 over its int counterpart. Can't you just go through each value like an array and subtract 48?

int getDigit(char c) {
return c - '0';
}

Learning your first language may be very difficult, but after that, it becomes easier since all languages share similarities in syntax and the way you use them to solve problems.

Except for Haskell, that thing shit is atrociously complicated.

So much this.

If you truly want a career in engineering software you have better start with C.

My first language was R ^……^
It took forever, because R is ugly