-3
votes
0answers
8 views

incorrect output for set input [migrated]

So I almost have this code correct but it's not giving me the correct output for some reason and I can't figure out why. This is what I have. That is what I have so far but I need the output to be ...
0
votes
0answers
12 views

Java for loop: why can't I declare two variables in the for loop 'header'? [migrated]

I always wondered, why doesn't this compile? for(int i=0, int q=0; i<a.length; i++){ ... } Why doesn't Java allow me to declare more than one variable in the for loop 'header'? Is there a ...
1
vote
2answers
154 views

If there's no problem treating a statement as an expression, why was there a distinction in the first place in some programming languages? [duplicate]

Why do we have the distinction between statements and expressions in most programming languages? For example, in Java, assuming f and g return ints, this still won't compile because it's a statement ...
-3
votes
1answer
302 views

Why is the JavaScript-language different in different programs/sites? [closed]

I'm kind of new to programming and i have a question that's been bothering me for awhile. Why is the JavaScript-language different in different programs/sites. I've used Codecademy to practice and ...
0
votes
3answers
170 views

How to get an image or rectangle to detect collision with another image

Can someone please explain to me how to detect collision with another image? The tutorial I was watching explained how to detect if a collision occurs between two rectangles but I would like to use ...
11
votes
4answers
4k views

Why were default and static methods added to interfaces in Java 8 when we already had abstract classes?

In Java 8, interfaces can contain implemented methods, static methods, and the so-called "default" methods (which the implementing classes do not need to override). In my (probably naive) view, there ...
0
votes
1answer
267 views

Creating a very basic compiler using Java

I want to try and create my own very basic language, with it's very basic compiler. All using Java. For now, it will only need to enable to 'programmer' to print things to the screen. I had an idea ...
1
vote
1answer
165 views

Pythonic version of Java interfaces

I fully acknowledge that Python and Java are different programming languages and should be used differently. That said, "Program to an interface, not to an implementation" is good language-agnostic ...
0
votes
3answers
134 views

High-Level SQL Interoperability

In a server -> client scenario, wouldn't it be simpler and faster to grant a public user access to a Stored Procedure rather than using web services (XML, REST, SOAP, etc) and other interoperable ...
5
votes
4answers
683 views

What's the reason exceptions are heavily used in managed (C# and Java) languages but not in C++? [closed]

AFAIK, a lot of C++ projects don't allow exceptions and deny them in coding guidelines. I have a lot of reasons, for example, exception is hard to handle correctly if your binary needs to be compiled ...
-2
votes
2answers
4k views

how to write good programming logic? [duplicate]

recently I got job as a java developer, and now I have assigned project too. I want to know what is a good logic? when I check in the code my team lead is saying that its a good code. But when it ...
0
votes
1answer
8k views

Why would one prefer C# (ASP.NET MVC) or Java (JSP) instead of PHP for web applications/projects [closed]

I'm wondering, why would one (consider it not just a single developer, but a company) prefer C# or Java for web applications? What's their considerations regarding the question. I mean, a company, has ...
6
votes
3answers
399 views

From an execution perspective is an interpreter the same as the JVM / or the .net Framework

I've recently started two introductory level courses - one using Python, the other Java. I've read the answers to this Question but still have difficulty understanding how each ends up with machine ...
1
vote
2answers
252 views

Access JSON object in different Languages

I have a Java code which is writing some data in string format to Messaging queue. Now any one can subscribe to this queue and fetch this data. Here the client fetching this data can be written in any ...
0
votes
1answer
2k views

Is Java still king of cross-platform compatibility? Is the answer still Swing? [closed]

So basically, my company is looking to create an app that can be distributed on Linux, Mac OS X, and Windows. We are hoping for a cross platform solution. I have experience working with Java Swing ...
4
votes
2answers
749 views

Java naming conventions vs. C++/C naming conventions

I am a Java developer who is starting to pick up more and more C++/C (yes I know they're different, bear with me). One thing that struck me as odd was the different naming conventions used by these ...
13
votes
5answers
992 views

What makes JVM so much versatile to support so many JVM languages?

JVM supports so many languages other than Java like Groovy,Clojure,Scala etc which are functional languages unlike Java(I am referring to Java before Version 8 where Lambda's are not supported) that ...
23
votes
4answers
2k views

Why do C# and Java use reference equality as the default for '=='?

I've been pondering for a while why Java and C# (and I'm sure other languages) default to reference equality for ==. In the programming I do (which certainly is only a small subset of programming ...
2
votes
3answers
237 views

MVC seems to create dependencies that just “don't feel right”

I might be misunderstanding MVC, so forgive me if that is the case. This is my program structure (Java/Swing): I have a JTable (View) that is pointed to by a custom linked list (Model). When the user ...
1
vote
1answer
819 views

Matrix Pattern Recognition Algorithm for a 2D space

I have a picture that I elaborate with my program to obtain a list of coordinates. There is a matrix represented in the image. In an ideal test I would get only the sixteen central points of each ...
3
votes
3answers
375 views

Is there a way to use a higher level language in a competition that only has C, C++ and Java by default? [closed]

On that competition, you gain access to a system with gcc, vim, emacs and Java. You can't take any file with you and there's no internet access, but you can do whatever you want inside that system. ...
38
votes
9answers
12k views

Why is String immutable in Java?

I couldn't understand the reason of it. I always use String class like other developers, but when I modify the value of it, I need to create new instance of String. What might be the reason of ...
10
votes
4answers
3k views

Is a lambda expression something more than an anonymous inner class with a single method?

There is a new hype with the long awaited lambda expressions in Java 8; every 3 day another article appears with them about how cool they are. As far as I have understood they a lambda expression is ...
41
votes
6answers
5k views

Why didn't == operator string value comparison make it to Java?

Every competent Java programmer knows that you need to use String.equals() to compare a string, rather than == because == checks for reference equality. When I'm dealing with strings, most of the ...
0
votes
2answers
4k views

What is the maximum value of index of an ArrayList?

I was thinking about it. You may have access to endless memory (one computer with lot of RAM) so that you can keep on adding more and more elements to your ArrayList. But, I think that you can only ...
34
votes
8answers
3k views

Is memory management in programming becoming an irrelevant concern?

Background I revisited an old (but great) site I had not been to for ages - the Alioth Language Shootout (http://benchmarksgame.alioth.debian.org/). I started out programming in C/C++ several years ...
17
votes
4answers
3k views

Why does Java not do type inference?

I have always wondered why Java does not do type inference given that the language is what it is, and its VM is very mature. Google's Go is an example of a language with excellent type inference and ...
5
votes
2answers
854 views

Asking people to disable Java for security - what's next for developer?

I don't know what best to give as title to this so pardon me if it sounds weird. I saw this question asked on IT Security and another site asking people to disable Java from their system or browser ...
9
votes
8answers
597 views

Past If statements Arrays, loops… Now what?

I gave up on programming a little over a year ago when I kept hitting this wall. I am revisiting the subject because I want to create basic Android application. But I feel that my limited knowledge ...
3
votes
2answers
4k views

How to execute a Ruby file in Java, capable of calling functions from the Java program and receiving primitive-type results?

I do not fully understand what am I asking (lol!), well, in the sense of if it is even possible, that is. If it isn't, sorry. Suppose I have a Java program. It has a Main and a JavaCalculator class. ...
13
votes
2answers
1k views

Advantages and disadvantages of structuring all code via classes and compiling to classes (like Java)

Edit: my language allows for multiple inheritance, unlike Java. I've started designing and developing my own programming language for educational, recreational, and potentially useful purposes. At ...
1
vote
1answer
536 views

How can you become a real programming polyglot? [closed]

I work as a Java programmer, but C and C++ were always my favourite languages during studies. Unfortunatelly I don't have an opportunity to work with them as often as I would like to. As a result I ...
5
votes
1answer
514 views

Can Scala be considered a functional superset of Java?

Apart from the differences in syntax, can Scala be considered a superset of Java that adds the functional paradigm to the object-oriented paradigm? Or are there any major features in Java for which ...
7
votes
4answers
371 views

How would a new language look if it was designed from scratch to be easy to TDD?

With the some most common languages (Java, C#, Java, etc) it sometimes seems that you are working at odds with the language when you want to fully TDD your code. For example, in Java and C# you will ...
8
votes
5answers
3k views

What are the advantages of Ceylon over Java? [closed]

Looking for the recent and powerful upcoming programming languages over net, I came across Ceylon. I dropped in at ceylon-lang.org and it says: Ceylon is deeply influenced by Java. You see, we're ...
9
votes
6answers
695 views

Is there an infinite amount of knowledge in a programming language?

I can program in Java, C#, C, Scala, and Javascript fluently. I'm comfortable with Objective-C, but I don't remember the conventions used for memory management. I can read Python and Ruby and I've ...
3
votes
3answers
9k views

Is C# more superior than Java as a programming language, objectively speaking? [closed]

A colleague (a .NET fan) argued that (in context to Java vs .NET comparison), while there are different arguments for Java and for .NET, and to determine which one is the better choice is a business ...
5
votes
5answers
543 views

Do I have to deliver my utility and helper code to clients?

Over the years I've created a bunch of Java utility and helper libraries which I just attach to new projects. Then, when I deliver code to my clients, I send all the code except for the libraries ...
1
vote
4answers
518 views

Should a novice programmer learn several languages at once? [duplicate]

Possible Duplicate: Is it worth being computer languages polyglot? I am half way through my first year at university studying computer science. I have been learning Java on the course and ...
48
votes
11answers
59k views

For what reasons should I choose C# over Java and C++?

C# seems to be popular these days. I heard that syntactically it is almost the same as Java. Java and C++ have existed for a longer time. For what reasons should I choose C# over Java and C++?
9
votes
5answers
777 views

Does Java promote a separation between class definitions and implementations, as is C++?

I have a homework assignment and I need to evaluate which approach is better according to GRASP "Protected Variation". I found a question on Stack Overflow about the separation of header and code ...
11
votes
5answers
516 views

Analyzing a programming language

In SICP, the authors state (Section 1.1) that there are three basic "mechanisms" of programming languages: primitive expressions, which represent the simplest entities the language is concerned ...
8
votes
4answers
506 views

What can and can't the Garbage Collector do?

Will the GC take care of all memory management issues (memory leaks) ? Is there any case where you don't want the GC to take control of some part of your code ?
69
votes
16answers
10k views

Do the young minds need to learn the pointer concepts?

Why did the C master Dennis Ritchie introduce pointers in C? And why did the other programming languages like VB.NET or Java or C# eliminate them? I have found some points in Google, and I want to ...
54
votes
11answers
9k views

A modern review of Java [closed]

I've been programming for a few years and I began in Java, and in my time I've found many different sources claiming Java to be an inferior language in some way or another. I'm well aware that each ...
7
votes
5answers
5k views

What skills are needed for machine learning jobs?

I posted this question on Quora, but didn't get enough responses. reposting it here. I am a learner sitting at home and learning linear algebra, very interested on working in Machine Learning ...
7
votes
5answers
622 views

Does language endorsement by different platforms (Android, iOS) hurt app development?

Developing iOS or OSX based applications typically requires knowledge of Objective C, since XCode is highly tailored to this language. Android, on the other hand, has chosen Java as it's preferred ...
7
votes
8answers
2k views

Python : how can I impress people coming from Ruby/Java?

I am preparing a presentation about Python for my company, and would like to show Python's awesomeness to developers using Java or Ruby ! I guess it will be very simple to write shorter and cleaner ...
23
votes
5answers
6k views

Is programming in Python faster than in C, C++ or Java?

There's a widespread belief among programmers that the more dynamic and loosely typed the language, the more productive the programmer will be in it. Guido van Rossum wrote about programming ...
5
votes
6answers
2k views

Programming languages differences and efficiency, does it matter?

I am fairly new to programming, I have studied in computer science for 3 years at college, but as you know, school is only 2% of what really makes one a fully-fledged programmer. I have a lot of ...