[RUBY] Why I'm a Java shop and start Python

About this article

On the other hand, if you say Python! Python! At a study session, I was asked to talk about Python because it doesn't matter, and I summarized the material. It's my first time to write a long blog, so I'm sorry for the connection of sentences.

What made you want to do Python

I've been doing Java for about 15 years, and I've been worried that it will take time in terms of Java environment and build method. Also, since I want to develop on a contract basis with a small company, I need to make it quickly and with a low budget, I felt that it was not efficient to just prepare a build environment and use a reasonable cost.

There is no point in writing everything in Java

We engineers try to deal with the problem at hand using the methods we can. It will have a big impact on your choice of programming language. We try to implement not only large-scale system construction but also simple functions in the existing development environment and languages we know. Certainly, it is rational, and now that Java engineers are overflowing, it is easy to procure engineers and it is easy to maintain due to unified technology. Also, static typing may reduce run-time errors as much as possible, which may be one reason why it is used in large systems. But what about choosing Java just because you can write it now? Should your system be built in Java because you can write it?

Should I still write in Java? (What I hate Java)

Development environment is complicated

There are ant, maven, gradle and other build aids, but the larger the system, the more complicated it becomes with esoteric definition files. I understand the mechanism for loose coupling, but the looser the coupling, the more complicated it becomes. I've been doing it for over a dozen years and I can see that it's more convenient now than the heyday of Struts. But it's not easy for everyone in the project to understand.

heavy

For web applications When deploying to an application server such as Tomcat or Weblogic, the dependent libraries are all jars and wars that are in memory. When implementing a batch that runs in parallel in Java, it is difficult to run it as a single process. If you use gigabytes of memory for each process, you will need to put it on the application server even in batch. In a large-scale system that executes in parallel, it would be difficult in reality to save memory by considering the dependencies for each batch and reducing the jar dependency by executing.

It takes time to check the operation

It takes time to build and deploy just by modifying one place. Many engineers repeatedly build and check the operation when implementing the function, It is a lot of man-hours to accumulate build and deploy for several seconds to several tens of seconds. It is very unfortunate that man-hours are required due to waiting time. It is also stressful for engineers to take time. Deployment Deployment can be done a little faster, but it's not in the same state as when it was released, so another problem is waiting.

Expectations for a scripting language

I remembered that when I developed a system with PHP, I could debug at high speed. I wish I could develop a scripting language more smoothly. That was the reason I thought so.

Therefore, I narrowed down the languages to be compared to the following.

Features of each programming language (from a Java shop perspective)

Java

PHP

It's not bad. But. .. It is an image of an extension of a web page. I don't want to use it for anything other than HTML generation. PHP: It's a Hypertext Preprocessor, isn't it? It's not bad. ..

<?php
//This enclosure looks like a premise of mixing HTML and logic, and it causes a slight rejection.
?>

(Bonus) Why PHP is doing well

There is a strongest library in the CMS world called WordPress

JavaScript

At first it was the most promising candidate. Is it a web system curse? It's JavaScript, but if you can master it, you can finally create a Web system in one language. However, I don't want to write or read.

Python

It's my favorite right now. I like how easy it is to read. Programs are overwhelmingly read rather than written. Other than that, I like the fact that it is strong in machine learning, which is now popular.

Ruby

I was considering Ruby as a candidate equivalent to Python, The more I investigated, the more subtle it seemed.

=begin
This would be Nai ...
I thought
Is it possible to do it with one shortcut key in IDE?
=end
list.times{|num|
  p "test"
}
list.times do |num|
  p "This way of writing is also OK"
end
puts "hello"
puts "You can add a semicolon";
for i in 0..4 do
  puts "for statement"
end
for i in 0..4
  puts "can be omitted"
end

Language comparison (from a Python perspective)

Language ranking

Let's take a look at the language ranking.

Language comparison

Disadvantages of using Python

What I did with Python

micro web-framework (RESTful framework)

Web application using bottle. DB uses SQLite. The front end was implemented in vue.js.

** Typing game **

pluplu.png

Click here for Puru Puru Typing

game

I created a game using pygame. I first made it to teach children how to make games. I made it according to the following article.

** Invaders game **

invader.png

Excel output

I tried to output the invoice in Excel using xlsxwriter.

Invoice

seikyu.png

Thinking about industry trends

Java shop may decrease in the future?

(By the way) Many beginners do Ruby

Image of using Ruby because Rails is good.

Future of Web system (personal thinking)

Language technology

~~ Sorry for the lack of information on PHP and Ruby. ~~ I added the information provided in the comments. Thank you everyone.

- PHP Python Ruby Java
CMS WordPress,Drupal Mezzanine,django-cms,Wagtail Refinery,ShimanePrefectureCMS,Joruri,Zomeki,Egret Liferay
Web Framework Laravel,CakePHP django,Bottle,Flask Rails,Sinatra Play,Jersey,Spring
package manager composer pip, Pipenv gem maven, gradle
IDE PhpStorm PyCharm Whichisfamous? Eclipse
code checker PHPStan pycodestyle,autopep8 Whichisfamous? CheckStyle(inEclipse)

I'm still new to Python, so what about Python? What to think

I'm just getting started with Python, so I don't know much about it.

Other languages of concern

Go

Score table without permission (out of 5 points)

- Python Ruby PHP Java Go Remarks
speed 3 3 3 5 5 GoのspeedはJava並み?
Easy to read code 5 4 1 3 3 Python is easy to see and I don't want to maintain PHP
Easy to learn 5 4 4 3 2 Go is a little difficult
Object-orientation 3 5 4 5 2 純Object-orientationならRuby。Goでは構造体。
Machine learning 5 2 2 3 2 R language except Python
World popularity ranking 5 2 4 5 3 Go is skyrocketing.
Domestic popularity ranking 2 4 5 5 1 It seems that Japan is still going to make it with PHP.
annual income 4 3 1 4 5 High for machine learning projects. Python and Go have few Web projects.
area Only in Tokyo Only in Tokyo Also in Osaka Also in Osaka Only in Tokyo Osaka new motivation.
Simple score total 32 27 24 33 23 It is not something that can be judged simply by totaling, but as a guide.

Summary

  1. Python is definitely the next choice for Java vendors in terms of popularity
  1. Using Python live is not fast enough
  1. Ruby is popular in Japan now, but without Rails, its value is halved, so it's subtle.
  1. Can CMS beat WordPress?
  1. Ruby also has "Yes" as an option considering the development speed
  2. In the end, should we be able to choose technology according to requirements rather than choosing from technology?

Recommended Posts

Why I'm a Java shop and start Python
I wrote a class in Python3 and Java
[Python] Start a batch file from Python and pass variables.
Solving with Ruby, Perl, Java and Python AtCoder ATC 002 A
Python a + = b and a = a + b are different
Difference between java and python (memo)
Java and Python basic grammar comparison
[Python] return A [or / and] B
[Python] I'm a green coder ~ [AtCoder]
A little more about references ~ Using Python and Java as examples ~
Overlapping regular expressions in Python and Java
Differences in syntax between Python and Java
Solving with Ruby, Perl, Java, and Python AtCoder AGC 033 A Breadth-first search
Connect a lot of Python or and and
Start python
A story about Python pop and append
I'm using tox and Python 3.3 with Travis-CI
Create a Django project and application in a Python virtual environment and start the server
Why Python slicing is represented by a colon (:)
Organize python modules and packages in a mess
MessagePack-Try to link Java and Python with RPC
Building a python environment with virtualenv and direnv
A Java programmer studied Python. (About the decorator)
A nice nimporter that connects nim and python
ffmpeg-Build a python environment and split the video
Start a simple Python web server with Docker
Create a web map using Python and GDAL
[Updating] Python Syntax cheat sheet for Java shop
Why does Python have to write a colon?
Launch a web server with Python and Flask
Let's write a Python program and run it
python memo-"if not A and B" was "if (not A) and B"
Create a Mac app using py2app and Python3! !!
A story about modifying Python and adding functions
[Python] A rough understanding of iterators, iterators, and generators
A discussion of the strengths and weaknesses of Python
Python quick start
[Python] Start studying
Try running a Schedule to start and stop an instance on AWS Lambda (Python)
Python: Creating a virtual environment (venv), starting and stopping
Try creating a compressed file using Python and zlib
Building a Docker working environment for R and Python
Build a python virtual environment with virtualenv and virtualenvwrapper
Benchmark for C, Java and Python with prime factorization
Why not create a stylish table easily with Python?
Let's make a simple game with Python 3 and iPhone
A quick comparison of Python and node.js test libraries
Implementing a generator using Python> link> yield and next ()> yield
I made a LINE BOT with Python and Heroku
Building and enabling a python virtual environment, etc. (venv)
Build a python virtual environment with virtualenv and virtualenvwrapper
Start numerical calculation in Python (with Homebrew and pip)
Investigate Java and python data exchange with Apache Arrow
A Java programmer studied Python. (for, if, while statement)
Tasks at the start of a new python project
Create a decent shell and python environment on Windows
Install django on python + anaconda and start the server
Python: I tried a liar and an honest tribe
How to start a simple WEB server that can execute cgi of php and python
How to start the PC at a fixed time every morning and execute the python program