java or python or php? - Page 1
Forum section: electronics / projects

author: ansonbao
author_rank: Regular Contributor
timestamp: November 04, 2016, 08:32:46 am
content: I have the basic knowledge of C language,but now it is internet era,so i learn java by myself these weeks.But a few days ago,my friend suggest me to learn python or php,now i am a little confused.Java is still very powerful,should i also need to learn python or php?

author: StuUK
author_rank: Frequent Contributor
timestamp: November 04, 2016, 08:59:43 am
content: All depends on the use case or if you're looking to make your skills marketable. If it's the latter then I'd pick Java as there are more jobs available than the other two. C# is also a good option skills wise.But if it's just for knocking up a quick low volume website then Java is a major overhead so just stick with PHP.

author: Kalvin
author_rank: Super Contributor
timestamp: November 04, 2016, 09:24:14 am
content: Python is very handy scripting language with a huge number of available libraries. I have used Python for digital signal processing, data plotting, real-time video analysis, test automation, text processing, simple databases etc. and it complements Java pretty well. The PHP is more suitable for the web development.

author: ansonbao
author_rank: Regular Contributor
timestamp: November 04, 2016, 09:52:12 am
content: Quote from: blueskull on November 04, 2016, 08:42:29 amthanks,you are in US?I am pcbway manager,but not for the website code,i know our page is written by C#.But in china the java,php is more popular.Now i want to build a blog by myself,need background language,so i think may learn java first.

author: ansonbao
author_rank: Regular Contributor
timestamp: November 04, 2016, 09:53:52 am
content: Quote from: StuUK on November 04, 2016, 08:59:43 ambut my friend said to me that java is easy to learn,i want to build a blog by myself,include background.

author: StuUK
author_rank: Frequent Contributor
timestamp: November 04, 2016, 09:54:17 am
content: Quote from: ansonbao on November 04, 2016, 09:52:12 amIf a blog is your objective stick with PHP, you're going to give yourself more work using Java for this.... hence my comment on use cases

author: ansonbao
author_rank: Regular Contributor
timestamp: November 04, 2016, 09:55:19 am
content: Quote from: Kalvin on November 04, 2016, 09:24:14 amin my circle,none of my friends use python.most of them use java,php also not so much.

author: StuUK
author_rank: Frequent Contributor
timestamp: November 04, 2016, 09:55:57 am
content: Quote from: ansonbao on November 04, 2016, 09:53:52 amIt's not that Java is necessarily hard but you'll soon run into the inevitable dependency/compile/test/edit cycle which will slow you down...

author: ansonbao
author_rank: Regular Contributor
timestamp: November 04, 2016, 09:58:20 am
content: Quote from: StuUK on November 04, 2016, 09:54:17 ami want to build a website with background,with java more complicated?but according to my friend,he also use java build his company background.

author: ansonbao
author_rank: Regular Contributor
timestamp: November 04, 2016, 10:03:32 am
content: Quote from: StuUK on November 04, 2016, 09:55:57 amthanks for the information,i ever be a hardware engineer,NDT,hope you ever heard about it.Now want to learn some new tech.code is an interesting thing.if i also want to build an easy software,java is more convenient?

author: tszaboo
author_rank: Super Contributor
timestamp: November 04, 2016, 10:12:07 am
content: If you want to program an awful mobile app or an awful desktop program, learn java. If you want a website, learn php or maybe HTML5. If you want back-end application, automation, IoT stuff, learn Python.But in any case, you can learn python in a week.

author: hans
author_rank: Super Contributor
timestamp: November 04, 2016, 10:29:45 am
content: PHP is my definition of kindergarten programming languages. It's get the job done, but that's all that can be said about it. However it wouldn't be my language of choice for a backend.Nonetheless still very popular though. If you want to build your own blog I would recommended not programming from scratch. Just install Wordpress and be done with it. You don't have to touch a single line of code.Python is a very productive scripting language. You can build and distribute applications with it, but I don't think many companies besides Dropbox have bothered. OTOH it's nice for writing your own tools and stuff though. For Python there is also a fantastic set of libraries available. If you want to write a back-end you probably need some of those to set up a webserver.Java could probably do that all is well, but IMO it's a bloated language. I personally don't use it.

author: StuUK
author_rank: Frequent Contributor
timestamp: November 04, 2016, 10:35:14 am
content: Quote from: hans on November 04, 2016, 10:29:45 amAgree with both those points with caveats, don't use PHP for medium/high volume backend. Java is better for backend but be prepared for challenges. Frankly, if you're new to programming websites with front/backend separation i.e. the traditional MVC approach then avoid JAVA to start as you'll struggle.

author: madires
author_rank: Super Contributor
timestamp: November 04, 2016, 10:57:20 am
content: Are you talking about Java or JavaScript? From a security point of view Java and PHP are nightmares. For managing some older network stuff with Java based UIs I need dedicated web browsers with old insecure Java versions.

author: sleemanj
author_rank: Super Contributor
timestamp: November 04, 2016, 12:55:59 pm
content: Quote from: madires on November 04, 2016, 10:57:20 amIn terms of PHP, no, that's not true. It is perfectly possible to write gopd secure maintaimable well structured systems in PHP. It's also possible to copypasta hack and slash your way to having a horrible ball of insecure unmaintainable spaghetti code. Programmers make security bugs in php systems, not the fact it is php.

author: nfmax
author_rank: Super Contributor
timestamp: November 04, 2016, 01:09:00 pm
content: If we are all, in fact, living inside a simulation - it's written in PHP!

author: linux-works
author_rank: Super Contributor
timestamp: November 04, 2016, 02:56:50 pm
content: php is crap. no one I know respects it.java is overly verbose and very formal. folks from india seem to favor java for some reason. I'm seeing a lot more python in the US and my current job is almost all python.I don't agree that you can learn python quickly. simple loops that you write like you'd write in java or c, sure. but REAL python that follows the concept and style of python, that's hard. I'm struggling to learn it as well as my peers at work - and I've been writing software for over 40 years. its not that python is hard but it has a lot of new concepts and the syntax can be confusing until you are used to it.java seems to be for those who can't manage memory (lol). it has been said that business programming is done a lot in java since it can be farmed out to overseas folks and they do tend to write code in java more than anything else. they can allocate memory all they want and 'forget' to free it and java takes care of them. java programmers rarely make good c programmers because of this laziness.python has taken over where perl used to own. now, all sysadmin and other utility/tools code seems to be written in either C (still) or python.there is even a micropython for embedded (arduino). no such thing (never will be) for java and microcontrollers. a jvm simply won't work on such small systems.learn python. its far more of a future than most other languages. personally, I hate java and am glad I don't have to write it for a living. I don't mind doing python, though. I know that its where the future is, for scripting and even whole (large) projects.

author: StuUK
author_rank: Frequent Contributor
timestamp: November 04, 2016, 03:16:41 pm
content: Quote from: linux-works on November 04, 2016, 02:56:50 pmoh dear

author: Kalvin
author_rank: Super Contributor
timestamp: November 04, 2016, 03:25:14 pm
content: Quote from: linux-works on November 04, 2016, 02:56:50 pmYou should try APL. You would love it as it is not too verbose.I haven not heard that any programmer's productivity would be limited because of they cannot type fast enough due to the verbose language syntax. You may be the first one.Java has a decent type system and helps catching typical programming errors. Python has a very poor type system, almost non-existent.

author: StuUK
author_rank: Frequent Contributor
timestamp: November 04, 2016, 03:34:57 pm
content: Quote from: blueskull on November 04, 2016, 08:42:29 amYep, I guess it was a predictable outcome....As someone who has direct real commercial experience of every single language mentioned so far in this thread I can honestly state there are always arguments for and against every language in existence....Nevertheless, the important questions are, what are you trying to achieve, how much time do you have? i.e. the use case... it's not about which one is best "because that's what I know" but about the fundamental use case. Ever language has it's benefits and drawbacks and it's evangelists and it's detractors but that is NOT important.The OP asked a specific question about Java, Python and PHP, his elaboration on further posts pointed towards a specific use case, in which case there are obvious choices to get him there quickly....

author: rstofer
author_rank: Super Contributor
timestamp: November 04, 2016, 04:13:26 pm
content: Anybody still using JavaScript for web pages? I used it for an internal web page where I worked but that was 15 years ago. It's probably a dead issue...As I recall, I used Microsoft Front Page for the theme and structure.As discussed above, Java is a fairly simple language when you are doing fairly simple things; loops and conditionals. It is a very BIG language and truly learning it will take a long time. I doubt that 10k lines of code writing will be enough to explore the edges.Just about any language can throw out HTML and image files. I'll bet I could write a web page in FORTRAN and I know I can do it in C.If I were a system administrator, I would learn Python. I have also played with it for writing an assembler; it's a fun language! If I wanted to write a 'code once, run anywhere' application (web or not), I would probably use Java.In any event, it is worth playing with all of the languages even if only at a superficial level. You never know when you'll run across some legacy code.

author: nfmax
author_rank: Super Contributor
timestamp: November 04, 2016, 04:24:22 pm
content: Quote from: rstofer on November 04, 2016, 04:13:26 pmFar from it! Server-side JavaScript, using the NodeJS environmenthttps://nodejs.org/en/is thriving: there are hundreds of thousands of packages on npmhttps://www.npmjs.com/to use. Client-side JavaScript is also very much alive, again with many thousands of libraries available (though I don't use it as much).The language itself has changed quite a bit in the last 15 years, too. Cleaner syntax, useful extensions (and better standardisation). And the bad parts are now better known and more easily avoided. There are also languages like Coffee Script which compile to JS, though again I haven't used any.

author: rstofer
author_rank: Super Contributor
timestamp: November 04, 2016, 04:50:25 pm
content: Quote from: nfmax on November 04, 2016, 04:24:22 pmSee? That's what happens when you retire! The world moves on and leaves you in the dust.I guess if I were doing a web page, I would be looking at Node.js and JavaScript (server side, I suppose).There is even a COBOL bridge to Node.js - how cool is that?

author: ez24
author_rank: Super Contributor
timestamp: November 04, 2016, 05:18:31 pm
content: Quote from: hans on November 04, 2016, 10:29:45 amI wasn't going to say it but since WP has been mentioned, another suggestion (if getting a website up is the goal) is Joomla. Once step up the ladder and many down from the top like everyone is talking about. Then you can learn some PHP to tweak things around if you want. At least you would get a site (blog) up faster.

author: nctnico
author_rank: Super Contributor
timestamp: November 04, 2016, 05:22:07 pm
content: Quote from: ansonbao on November 04, 2016, 08:32:46 amIf you are into webdesign then knowing PHP, Javascript ( and the use of JQuery) and SQL will be an asset.For application programming I'm not sure what would be a good choice. C++ and C# seem to be the major ones because it is easy to deploy a binary package which can include the required runtime libraries. Java, Python, etc all need third party runtime environments which may not be compatible with the ones already installed or released in the future.

author: daybyter
author_rank: Frequent Contributor
timestamp: November 05, 2016, 12:18:05 am
content: For webstuff, PHP might be a better choice. OTOH, I think knowing java makes my PHP code a lot better. If you learn OOP practices and some UML, your PHP code should be a lot easier to maintain in my eyes.

author: jwhitmore
author_rank: Regular Contributor
timestamp: November 05, 2016, 02:40:19 am
content: I guess most points have been made by this stage, but I would throw in an additional one. PHP and security have been mentioned and yes you can write insecure code in any language. Too many programmers get all religious about language, there is no best one it depends on what you're trying to do.Having said all that I would highly recommend people take a look at the first few chapters ofhttp://djangobook.com/and read through it. Yes it's a CMS system written in Python but I've found it so easy to generate web apps with it. I only mention this as many people have NOT suggested python for back end work. I've used django for numerous projects, large and small. One of my favourite ones, and perhaps relevant to eevblog people is one I run locally on my laptop and has a record of all my electronic component stocks. In Python and Django it's very basic but it's invaluable as I don't have to organise my components. If I'm looking for a P-FET I can look at a list of ones I have in my stocks. It tells me foot prints and most importantly where I put the dammed thing. I can even give it a kicad DOM and it'll tell me the price of the components.That's just my itch and I scratched it, but python has the advantage of being both powerful and readable and thus far more maintainable then many other languages. And given Django's built in security I don't have to worry about the code I'm writing. Django takes care of all that stuff. IMHO ;-)

author: ivaylo
author_rank: Frequent Contributor
timestamp: November 05, 2016, 05:34:43 am
content: Go with Python. Good for electronics (assuming from where you are asking), perfect for web development (ignore uninformed opinions) and pretty much everything else. If you are just learning web development tryhttp://www.web2py.com, book here -http://www.web2py.com/book.

author: ansonbao
author_rank: Regular Contributor
timestamp: November 07, 2016, 02:02:20 am
content: Quote from: NANDBlog on November 04, 2016, 10:12:07 amjust a week can learn phthon?but maybe i will learn java first,i didn't ever write complex code

author: ansonbao
author_rank: Regular Contributor
timestamp: November 07, 2016, 02:06:27 am
content: Quote from: blueskull on November 04, 2016, 10:21:04 amthanks,i ever read <head first html&css> and build a website,just a page,the website is great

author: tszaboo
author_rank: Super Contributor
timestamp: November 10, 2016, 10:57:54 am
content: Quote from: ansonbao on November 07, 2016, 02:02:20 amThe basics of python are very simple. If you ever wrote C code, you can pick up python very fast. Afeter that, you just need to look around for some libraries, and some example code.

author: tombi
author_rank: Regular Contributor
timestamp: November 10, 2016, 02:38:14 pm
content: https://toggl.com/programming-princess

author: ansonbao
author_rank: Regular Contributor
timestamp: November 14, 2016, 03:43:09 am
content: Quote from: NANDBlog on November 10, 2016, 10:57:54 amthanks very much,i will do that