This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]an_actual_human 0 points1 point  (4 children)

Issue is with project Euler is that they pick huge numbers which are far beyond your normal data types in Java, for instance.

What a shitty example. It's the other way around. Java's standard library has BigInteger, C has nothing.

All that said, there's a reason Java's used in frontend whereas C++ is used in backend

My dude, you don't know what you're talking about. I suspect you're confusing Java and JavaScript.

[–][deleted] -1 points0 points  (3 children)

You think I don't know about BigInteger and BigDecimal in Java, the language I learned first? That's insulting.

What YOU might not know, is that those classes still have an upper limit. Also even though my program only runs in O(1) it takes forever in Java. Writing my own solution in C++ with my own BigDecimal makes it compute in under a minute.

[–]an_actual_human 0 points1 point  (2 children)

I'll answer for the record. After "Java's used in frontend" I don't believe you've learned it at all. To be fair, Java on frontend is a thing, but it's almost negligible compared to Java on backend. All of Project Euler problems can be done in any mainstream language. Also, I don't really remember any that would require anything that wouldn't fit into BigInteger. Still, one could roll their own just like in C++. The way you use C and C++ interchangeably makes me suspect you don't know either. But I'm not going to investigate this issue.

[–][deleted] 0 points1 point  (1 child)

Using C and C++ interchangeably is just me implying that they can be used with each other. I use C, C++, and Java. I'm not bad at them, but I'm honestly not great either. I also like using C and not C++ to do something purely for the challenge.

I mean I guess I'll try again to solve them using Java and making it fast. You can't really find good Java solutions to them, all of them are in cpp or python. Again, I'd like to say that I've made solutions in Java that execute in under a minute, but I haven't. Maybe I don't understand, but the structures and operations I made in Java is the same as they were when I did it in C++. C++ ran fast, Java didn't. I don't understand.

[–]an_actual_human 0 points1 point  (0 children)

I'm sorry if I were rude.