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
(This might be the wrong place to ask the question, please let me know).
Should I name my method isStaticallyImported or isStaticlyImported?
(They'd be pronounced pretty much the same way, I believe)
Of course they should be in good english. Even if the human brain will likely have no problems reading garbled up words, compilers do not enjoy the same luxury.
How many times have you miswritten a variable name, then later on used the correct spelling, only to find out that the program crashed at run/compile time?
This problem is only amplified when working on code that was not written by you, because we think of things as, well, things, and having to specially remember that the thing had to be spelled in a special way is just an unneeded break to your workflow.
Yes, your variables should be clear to the developer. You can name it whatever you want and it will work because the compiler doesn't care. When you name the variable in a human readable manner then developers after you will be able to read and understand your code much easier. You should name it "isStaticallyImported".
They should be in the most easily understandable language for those using and maintaining it in my opinion.
I'm also pretty sure the compiler doesn't care about the quality of spelling.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
From what I know about stacks, it seems like this method goes against the whole point of a stack- if you need to know where in your stack a specific element is then why are you using a stack at all?
Edit: I'm not trying to waste anyone's time or ask dumb questions, I'm a student who's honestly just trying to figure out the rationale behind this function so that I can become a better programmer
I would put it like that:
Java has its inconsistencies and this is one of them.
If you take a deeper look you will find that Stack is a subclass of Vector and inherits its mehtods which also seem to make not that much of a sense.
Programming languages are living and growing things made by people and I think you can always find things that don't make sense or things that you wish would have been made in a better way (whatever 'better' means).
In some you will find more in some you will find less flaws.
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
Please explain me the differences over time and space complexities in java for user defined and predefined functions in java. examples like, linked list, list, stack class. please explain this with valid example.
thank you.
There is nothing special in predefined function over user defined. The only thing is predefined has been written by somebody else for you. It depends on algorithm.
Crap code/implementation runs in a crap way. Doesn't matter if its user created or system/API provided. example at a high level is EJBs vs Spring.
Good written code runs pretty and sleek. Again doesn't matter who the hell wrote it.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am doing a project on social media slang identifier.I have to identify abbreviations from different comments.But the problem is that, suppose in a particular comment it's written GM (means Good Morning) and at the same time in some other comment it's written again GM (means General Manager).
So I need to differentiate between these two, although it shows same in both case (i.e. GM).
I am really confused in this problem.I am not getting any idea for this.
Can any one help me to overcome from this?
This is a hard problem. You need some semantic algorithm to make this distinction.
You cannot infer the meaning just from the syntax or just from the textual representation.
Google "disambiguation natural language processing". You will see lots of resources.
This is just to give you a hint. As said the problem is broad and complex.
This sounds like a very complex issue.
From my understanding of it you would need a quite large dictionary of these abbreviations and also, the lexical field (a.k.a. semantic field) in which they are used.
In order to detect the lexical field you could also group the speakers into "work related" or "colleagues from university" or "drinking buddies", and maybe have a standard for these groups, so that data from other users is also used. In order to understand this, maybe you can understand a sort of synonym of slang, which is argot.
So for instance, if someone says "the GM's feedback was actually pretty good" not only do you understand that it is a usual noun but feedback is also from the "business" lexical field.
An actual time frame, and data you'd work with would be useful, and I will edit this answer accordingly.
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
This is kind of unusual question for developers but for some reason i want to post it here and hope to get adequate answer.
Here is a simple example:
I wrote a java function that calculates distance between two geo points. The function is not more than 50 lines of code. I decided to download a source code from ibm that does the same thing but when i opened it i saw that it looks very complicated and is almost thousand lines of code.
What kind of people write such source code? Are they just very good programmers? Should i use their source code or my own?
I have noticed this kind of thing lots of times and i from time to time i start to wonder if it is just me who do not know how exactly to program or maybe i am wrong?
Do you guys have the same kind of feeling when you browse throught some other peoples source code?
The code you found, does it do the exact same calculation? Perhaps it takes into account some edge cases you didn't think of, or uses an algorithm that has better numerical stability, lower asymptotic complexity, or is written to take advantage of branch prediction or CPU caches. Or it could be just over-engineered.
Remember the saying: "For every complex problem there is a solution that is simple, elegant, and wrong." If you are dealing with numerical software, even the most basic problems like adding a bunch of numbers can turn out to be surprisingly complex.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm TAing for an introductory course in Java for freshmen. So, far we've learnt most of Java except the OOPS part. Like we can do methods, loops, control stuctures, arrays, strings, recursion etc..
Since this is their first programming course, they are not aware of fancy datastructures yet.
I have dont most of the regular programs like factorial, fibonacci, primes etc..
I'm looking for some interesting problems in the space without using complex datastructures. Any ideas would be super helpful.
thanks, Vinbot
Project Euler has some problems that you can solve without additional data structures, and all the problems have the nice property of being mathematically interesting. Not all the problems will work for your course, but I bet you can find enough that do, especially among the first few.