Click to See Complete Forum and Search --> : Java is similar to html
august
11-19-2005, 11:19 AM
Would you say that in a way Java isn't that different from html? Sounds absurd, well, at least when it comes to GUI. The thing is that in Java, as in html, you just type some short statment or tag and all the scratch work is already taken care of. For example JFrame j=new JFrame is in a way similar to <textarea cols="23" rows="20"></textarea> since you just type a short statment but actually do nothing in terms of creating anything; others do for you.
I'm wondering wether in other languages, such as in C, you need to actually know what's going on when programming, as opposed to just typing in statments with all the dirty work already done behind the scenes?
In a way it doesn't feel like programming when you have no clue why things work like they do, or why they even work at all. I mean Java is great, but what if you're curious about how GUI's and other things are created on a more lower level?
It's also that if you have more lowlevel control over whats drawn on the screen, and not just having someone determining it all for you behind the scenes, won't you have much more control of what you can do?
:cool:
also, sorry if this post is misplaced but figured since this is about java, so.
JPnyc
11-19-2005, 12:09 PM
Peronally, no, I wouldn't say that. I would say they're about as different as can be. Java is loosely based on C, C++ syntax. The big difference from the coding end is it does it's own garbage collection, which C and C++ don't. Of course the API is different and some of the methods and a couple operators are different. But fairly minor differences.
Khalid Ali
11-19-2005, 12:38 PM
To be honest with you I am not sure what to say...I guess my 2 cents will be that in principal you are right becaue every programming language is interpreted at some level and converts the text(src code) into hardware centric instructions..
HTML and Java are similar only in prinicpal as mentioned above. The difference is that java text(src code) is converted for the underlying OS, where as HTML code interpreted by an application(a browser) which is in the framwork of an OS..
august
11-19-2005, 12:57 PM
Right, I knew that html is interpreted by the browser while Java is a standalone language. I was just a bit surprised that to create a GUI in Java, which is a programming language, isn't that different from trivial html. I'd thought it would involve extremely complex stuff to create a window with all the close/minimize etc, buttons located in the right places and more, in a 'real' programming language but it's almost as easy as html.
What if you wanted to create a blue window with jagged corners and zig zagged borders for example, now you can't really do that in Java can you, since all styles and calculations are preset? In terms of at least GUIs, and possibly other things as well, the jump from html to Java (which is the only prog-language I'm somewhat familiar with) isn't really that exiting, don't you think? You don't have much more creative freedom visually in Java GUI than you do with html and css, isn't that correct? That was a bit dissapointing to me. I'm not questioning the creative possibilities in Java, only the boundaries of detailed control.
thanks anyway, for even reading.
felgall
11-19-2005, 02:50 PM
HTML is not a programming language while Java is a programming language. Beyond this they are as similar as chalk and cheese.
Exactly, a programming language must include logic. HTML has no logic. It is a "Mark Up" language not a programming language.
I dont know how you could find Java similar to HTML... Sacrilege.
august
11-20-2005, 10:45 AM
I meant that they're similar with respect to GUI creation in the sense that both have predefined statements that are alredy programmed to do certain things. I meant that in Java you don't really talk to the computer directly, but rather interact with a bunch of combos of pre-programmed functions. In That sense it's similar to HTML.
In other words, in Java you can get pretty far without knowing anything about how computers work, and same thing in html, you just need to learn the statements and all the rest is already done by someone else, in this case Sun microsystems. For example, when you create a JFrame you don't need to know and often don't, why & how a frame is drawn on the screen. In html it's the same thing, you don't know why; you just know how.
... :| meh.
True but of little use to anyone. :)
august
11-20-2005, 11:35 AM
And so is there any way you can get a more low-level control without having to learn assembler?
I'm just curious, because I've not been into Java and programming for that long and still have some transition issues. I was expecting programming to give full control over things, but well, I guess there Is assembler to shut me up, eh.
yeah, thats fair enough august. I felt the same when I went from C to Java but you really get used to APIs and code resuse and really there is no other way to go. It is just the evolution of programming.
Java is a very high level language. If you want more control then you may like to use C as you can use pointers to actual memory addresses (explicitly) and the code is compiled to run directly on the computer rather than a VM.
I think the only real reason to learn assembly language these days would be for a theoretical foundation. I mean you wont be able to do anything very useful with it.
And really just because you are using an API doesnt mean you dont have full control over things. I mean your program only does what you tell it to do and even assembly language must be converted into binary eventually :P
All the best.
august
11-20-2005, 01:06 PM
Nice answer. Thanks.
Khalid Ali
11-20-2005, 05:55 PM
.....I mean your program only does what you tell it to do and even assembly language must be converted into binary eventually :P
All the best.
lol..now you are getting there where I said Java or any other programming language is simmilar because it all ends up with the conversion of textual instructions to bin instructions for a machine.... :D
Anyways..interesting chat it was
Waylander
11-20-2005, 10:26 PM
Even if you compare the in-built GUI building components like the components in the java API and the elements that control the browser look and feel in HTML they arent even close to bieng similiar.
You can do almost anything you want in java as it is a fully object orientated programming language baring the primitve datatypes of course.
Including building your own frame and panel components.
If you want to get right into it look up the components in the specification and make a class that sub classes the components and then overwrite the methods to customize the components into looking how you want them to.
Simply using the java API and then saying the java programming language is simple or easy even by saying its like HTML which is very simple and easy is and no offence intended is quite silly, look into the language and its capabilities, they extend far beyond the inbuild components.
Waylander.
august
11-21-2005, 05:44 AM
Right. But I also think it depends on how you see it. In both Java and html you use short statments to create GUIs, and that html is limited to only GUI can easily be changed in theory. As Kahled said, all languages are interpreted at some level so in that sense both Java and html are similar in some way. The're both very high-level, interpreted, and, then, have to do with the computer.
You might say that the purposes of Java an html are vastly different, but as far as creating a GUI goes, they're strikingly similar. Both are very trivial things to do. I mean what's the big difference between the following 2, really:
<table bgcolor="blue">
or
setBackground(Color.blue);
They're really not that different.
I guess this is a rather philosophical issue. (note though that I said only in some "sense" are they similiar).
So you can build your own customized panels in Java? How, pardon?