Python编程与Java编程 [英] Programming in Python vs. programming in Java

查看:127
本文介绍了Python编程与Java编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在过去几年里一直在编写Java,现在我已经开始用python编写了(另外)。

I've been writing Java for the last couple of years , and now I've started to write in python (in addition).

问题在于,当我查看我的Python代码时,看起来有人试图将Java代码编成python格式,而且它很糟糕,因为 - 好吧,python不是Java。

The problem is that when I look at my Python code it looks like someone tried to hammer Java code into a python format , and it comes out crappy because - well , python ain't Java.

有关如何摆脱用Python编写Java模式的任何提示?

Any tips on how to escape this pattern of "Writing Java in Python"?

谢谢!

推荐答案

你可能会考虑让自己沉浸在Python中范式。最好的方法是先了解它们是什么,然后通过阅读一些文献和审查一些代码示例来探索最佳实践。我建议Mark Lutz 学习Python ;非常适合初学者和高级用户。

You might consider immersing yourself in the Python paradigms. The best way is to first know what they are then explore the best practices by reading some literature and reviewing some code samples. I recommend Learning Python by Mark Lutz; great for beginners and advanced users.

如果你使用Python编程并且无法利用所有内置的,开发人员友好的,那么你自己会非常不公平。 Pythonic语法。

You'll do yourself a great injustice if you program with Python and fail to leverage all of the built-in, developer-friendly, Pythonic syntax.

正如我的法语老师曾经说过的那样,法语不仅仅是英语,还有不同的词语。

As my French teacher used to say, "French isn't just English with different words."

这篇关于Python编程与Java编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆