Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
For some reason, I absolutely HAVE to use paths like src/main/kotlin/com/martmists/... etc, why can I not just use src/...? This annoyance is the only thing keeping me from studying jvm languages, and I have yet to find a way to simplify these paths.
Look, I just created a Kotlin project with the default settings:
There were no forces compelling me to create the structure you describe.
Neither long package names, nor the src/main/kotlin/ structure are mandatory, but you'll fight an uphill battle if you avoid them. The reason is that JVM languages target large-scale projects, where organization into meaningful subunits (packages), as well as the division between production code and test code, is beneficial and not detrimental to its success.
In some other languages you get a cozy feeling of a lightweight start, but as your project grows towards 10,000 lines of code and beyond, you realize that you've been reinventing this structure all along to keep you afloat.
I can attest from personal experience that the IDEs take away most/all the pain of dealing with nested directory structures and allow your project to scale up gracefully, with no need to reinvent best practices.
On the other hand, if your use case for a programming language is writing one or two screenfuls of script code, then the JVM ecosystem is probably not a good fit for you.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I don't know much about concurrency in Java such as Fork/Join Framework, Locks, Threads(comprehensively), Executors etc.
I just have little basic knowledge & theoretical about it.
Since Clojure runs on JVM, I thought that I must know Java's concurrency model really well before jump into Clojure(concurrency)?
I write Java but never needed concurrency at work.
Now I write Clojure and want to do some concurrency/parallelism stuff with it.
Should I know Java's Concurrency model or Can I learn while practicing with Clojure?
No, you don't nead to learn such things to use Clojure's concurrency and parallelism features.
I'm never going to advocate not learning something, though in this case if you are learning these things at the same time you may be tempted to reach for locks in Clojure, which is almost always unnecessary, rather then doing it the idiomatic Clojure way.
What you certainly do need to learn is the fundamental ideas of concurrent programming and parallel programming. Things like how to intelligently split work, and how to combine the results so you get correct answers.
Also how to avoid crating so many threads that you cause resource starvation. These things can be learned in (almost) any language, though learning them in Clojure is more fun than some others.
One possible danger is that when working without the Clojure features you may find less satisfaction when going back to the more traditional OO approach in Java.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am using JSP/Serverlets for my upcoming web application project. It is high traffic concurrent users web site. There has been many discussion about performance issues of Java 8 and especially in Streams.
Anyone having specific knowledge about performance of streams and whether its advisable to use in High traffic Web Applications so as to not compromise on latency and response time ?
As a general statement, outside of Java 8 Streams, it is pretty much impossible to answer your question as stated because it depends.
If you've got a method that is called hundreds of times per second then you would need to be very careful about performance. You'd want to tune it the best you could. Conversely, if you've got a method that gets called once a day then you likely wouldn't spend too much time optimizing it.
Streams are a useful tool when used correctly and they are easy to abuse. I've seen developers who thought it was a great idea to read an entire database table and use filtering with streams to effectively do a SQL "where" clause. That's a bad design but it honestly wouldn't be seen in the once-a-day method call.
Don't try to make these blanket "this is good or this is bad" statements. Do a good design and use the tools where they are appropriate. Optimize the parts of your application that need it but don't do pre-mature optimizations - you'll never finish the project.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a question for you concerning Java. I am basically a Java user and did most of my work with it. However, in the machine learning classes I took in college, we used mostly python with the scikit-learn and numpy packages.
Now I want to do a project where I crawl data from the web, store it in SQL databases, and then do machine learning on this data. Maybe some of you have experience with those things and share some of it? I mean, of course it is possible to do these things with java, but maybe you have had some particular experiences on why I should use something else or what to consider?
I am happy for all your thoughts :-)
Have a great weekend!
It turns out that programming language and database implementation are secondary problems. Think first about the machine learning you want to do. Review the existing packages (in any language) and pick one according to how well it fits the needs of the business problem you are trying to solve. Then work with whatever language is most convenient for that package. You will probably find that no single language is suitable for all parts of the problem; you will end up gluing together Java, Python, R, shell scripts, etc, to make a complete solution, and there's nothing wrong with that. Consider that your job is problem solving instead of programming in a specific language and go from there.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am a java programmer for 2 years.
My programs usually uses a database (mysql) (Java SE).
Should i use classically command line environment or use GUI tools, mysql administrator for example?
Is it necessary to be a database administrator? Or not?
I want to be a java programmer.
Sorry for this question!
Use of GUI tools, IDE's is very common in IT industry also makes life easier as they have very good features to detect bad usage of the programming language, bad syntaxis, illegal uses of the language and pretty cool stuff as refactor options just to said one of them.
I encourage for people that are starting or want to achieve an IT certification (SCJP) not use in their training lesson, sometimes people know the error only because IDE's is complaining about something and does not really know what is the root cause, so remove GUI or IDE will help you a lot in really know the root cause of the problems and give you really good troubleshooting skills.
Talking about SQL language, although you want to become java programmer, SQL need to be one of your skills, I'm strongly suggest learn it without use of GUI or SQL creators, also is not bad to know by memory some really most frequently used commands and know the solutions just using command line. I know a lot of people in IT that does not how to create an insert statement in sql and its variants as they always use MySQL to add records.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I got this Java webapp (JSP+Struts+Hibernate+MySQL+tomcat6) in which there are like 20000 users right now and the number is growing up rapidly. I have to rank all the users periodically. The ranking process involves lots of objects and hibernate actions and it's fairly heavy. Talking java, unfortunately I must iterate on all of the users and apply this procedure in them one by one. this method sucks out lots of the server's resources.
on the other hand I might be able to run all these actions in a stored procedure on the MySQL side. I'm pretty sure the code there will be a complete mess and troublesome to modify later on. although the performance would be much more better this way but software engineering principles wouldn't take this solution nicely.
what do you suggest?
This is obviously much more efficient in SQL. The real problem is that you are using hibernate and so have lost control over your schema which is why a solution like iBatis, although less popular, makes more sense - because it allows you to switch to SQL when that is the more appropriate tool for the job.
Given that you have chosen hibernate, are you sure that you can't push the API it provides into doing this? Have you looked in detail at the criteria API? That includes associations - it might be possible to shoe-horn what you want in there and so keep the logic more closely associated with the classes. http://docs.jboss.org/hibernate/stable/core/reference/en-US/html/querycriteria.html