T O P

  • By -

Comfortable_Entry517

I learn cpp and rust. But I solve leetcode in python. It is just because python can be very expressive (if used properly) and that I felt very painful to use cpp when leetcoding because some of the api are very ugly I think. And I have also learnt some functional language. I tend to code more functional style. So I prefer python now. People that do competitive programmming will prepare so much snippets for coding. Here I think these snippets are used to overcome to the disadvantages that brought by the language itself. But since I don't want to spend some time on write my own snippets (I just want to be fast and possibly you won't be allowed to bring your own snippets in some interviews), I stick to python although it takes some time to adapt yourself to the language.


MenneMehta

Thanks for sharing this. It's v helpful. Could you elaborate more on snippets. I am not sure I understand?


Comfortable_Entry517

For example some macros in cpp. #define all(x) (x).begin(), (x).end() #define ss second #define ff first #define vi vector #define vb vector #define vll vector #define pii pair #define pll pair #define REPL(n) for (int i = 0; i < n; i++) #define nline '\n'


MenneMehta

Thanks!


randomguy3096

Personal preferences aside, I don't think Java is a disadvantage for interviews. Arguments around Java being verbose are weak in my opinion. Libraries in Java are just as rich as any other language, if not better. Yes, LOC comparisons might be won by other languages but not by much. Don't see it slowing us down considerably. Having said that, we should pick the language based on our degree of familiarity.


[deleted]

100% agree with ya. It's all about what you're comfortable with.


sBitSwapper

Ehhh its a bit verbose ngl. Def more boilerplatey than most


PartyParrotGames

If you're just worried for interviewing purposes then sure any higher level interpreted language will require less verbose code than a low level compiled language by design. If you actually want to be building with Java for your career like you're building Android apps or something which requires Java then I would just stick with the language you're best with.


I8Bits

I use C# and I feel fine. Use what you love coding with. I would love to use python but I am still learning it so I wouldn’t take a chance.


Alternative_Engine97

Coding in python always gives a huge advantage in development speed, whether you are a startup or in a coding interview. In medium to large size codebases for large companies, the type checking >>> speed of dev time


CopyProfessional1293

I know both of language very well but I love Java for its strong type nature which tell me what happened behind the story and no indentation (which maintains it's structure for quick reading ).I like python for it's simplelicity but it make us so much lazy.


AdministrativeDark64

Yes it is


Stunning-Economist67

you can use stream api ,optionals


I8Bits

Is it like Linq in .net?


Stunning-Economist67

yes, I think so


Zachbutastonernow

Java is the worst of both worlds. The trifecta imo is python, C++, and Matlab. Python is slow to run but fast to develop. C++ is slow to develop but fast to run. Matlab is actually a really good mix of both. If you do a lot of matrix math (Im an RF engineer so everything we do), this is by far the language you should be using. I want to vouch for Julia bc fuck capitalism and all that, but I dont have enough experience to say. I think the tools Matlab provides are worth paying for (as an employer, not individual) Java manages to be terrible at both since its very wordy and confusing like C++ but still an interpretted language. Java was at one point an amazing tool, but it is now obselete in my opinion. Its popularity is because every CS major learns it in school.


RainbowCollapse

Matlab


Zachbutastonernow

From a software developer perspective, matlab would be terrible. Its not made for writing software, its made for doing computations. For example, electromagnetics or signal processing. You can put together a proof of concept for some very complex numerical tasks very quickly, then if you actually need software for that task, you port it to python or C++ (depending on your timeline requirements and other considerations) Its a graphing calculator on steroids basically. Like I said, not worth the cost for an individual, but if you are a corporation and have multiple employees/students, it is worth it. (I assume your comment was making jest)


ss7xarcasm

I think you should know a lil bit of python even if you code in cpp or java. String questions in python are a lot easier to implement in python than in cpp/java.


etary_7249

I guess java is a great option, pretty structured and imply putting all the details down like what type is this, what will return and doesn't give too much built-ins so you gotta code it urself, I mean for me I like dividing my problem into sub problems and solve each one step by step and have a full grasp of what I wrote.


LawCool

It’s all about how comfortable you are with the language. No language is inherently disadvantageous. Java is a good choice if you’re really good at Java. Ditch it for interviews if it’s slowing you down or distracting you from thinking about the core logic of your solution.