低级程序员可以学习OOP吗? [英] Can a low-level programmer learn OOP?

查看:64
本文介绍了低级程序员可以学习OOP吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨:


从我读过的OOP中,我得不到它。我还发现了一些对OOP有深刻批评的

文章。我倾向于与这些文章联系起来。


然而,这些文章并不比我在撰写案例时读过的那些文件更客观。

OOP 。也就是说,什么目标

数据/研究/研究表明程序员可以更快地解决特定问题,或者解决方案更有效
通过OOP实现执行时间/内存使用时
与程序相比

编程?


对我来说问题是我有在C和.asm中广泛编程,然后在1988年回到PC $ DOS.然后,在OOP普及的时候,没有编程好近10年。

。从1999年开始我回到了

编程,但是PC编程的高级别和OOP的完全外语的

击退了我。我的工作是模拟和数字电子硬件设计,所以很自然地我开始使用.asm和C中的微控制器工作
。我的大部分工作都涉及低级别的工作。 />
信号调节和实时控制算法,所以C大约是高水平的,因为人们可以在不严重失去效率的情况下前进。

接近C的机器在这里是理想的。这是一个我真正喜欢并且很舒服的领域。


因此,作为硬件设计师而不是计算机科学家,我是

的条件是像机器一样思考。我认为这是主要的原因

为什么OOP总是击退我。


也许唯一可能点击OOP的是

某些情况我可能更喜欢使用更高级别的方法处理任务,而b $ b涉及动态内存分配。如果我不需要执行C的效率,那么OOP可能会更快地产生工作结果,而不是担心内存管理的细节,指针,


但是我想知道OOP程序员是否花费了太多时间创建类

并尝试将所有内容组织到OOP范例中作为C

程序员花在写代码上吗?


最后我不在乎*名字*对于我的编程方式是什么。我只需要
需要产生结果。这样就可以回到客观性。我有一个

的问题要解决,我想找到一个可以学习和实施的快速解决方案。


问题:


1.如何最轻松地学习编写简单的PC GUI程序,这将通过串行通信将数据发送到远程嵌入式设备,或许

包含一些基本的(x,y)类型的图形显示和操作

(简单的绘图程序)。数据可能来自用户GUI输入,或来自解析文本配置文件的
。解决方案无需在机器中有效利用资源利用率。重点是程序员可以快速学习并实施解决方案。


2.必须跨平台:Linux + Windows。这个因素对于是否有必要学习新语言或坚持使用

C会产生很大的影响。如果我的平台只是Linux,我可以学习GTK并用它完成

。在这种情况下,我不会在这里。


可能的解决方案:


表格1:使用C并选择一个将启用的库跨平台的GUI

开发。


Pro:不必学习新的语言。

Con:可能会跨平台实施有困难

串口通信。这可能需要完成两次。这将是
浪费时间。


表格2:使用Python和PySerial以及TkInter或wxWidgets。


Pro :跨平台目标可能会完全实现。附近有一个

的程序员,有丰富的经验,可以提供帮助。

Con:必须学习新的语言和图书馆。必须学习一种全新的思维方式(OOP)而不仅仅是一种新的语言语法。

这可能很难。


表格3:使用LabVIEW


Pro:我认为可以满足跨平台目标。

Con:昂贵。我更喜欢使用开源解决方案。但

并不像$$$那么重要。我还经常发现G的2D

图解编程语言。像OOP一样排斥。我怀疑学习LabVIEW和Python一样多的时间。在

这种情况​​下花在Python上的时间可能会花费更多,因为我会学习基础知识,而不是基本上只是学习

如何谈判某人的专有环境和司机。

评论赞赏。

-

美好的一天!

________________________________________

Christopher R. Carlen

首席激光与电子技师

美国加州桑迪亚国家实验室
CR *************** @ BOGUSsandia.gov

注意,删除文本:RemoveThis和

" BOGUS"从电子邮件地址到回复。

Hi:

From what I''ve read of OOP, I don''t get it. I have also found some
articles profoundly critical of OOP. I tend to relate to these articles.

However, those articles were no more objective than the descriptions of
OOP I''ve read in making a case. Ie., what objective
data/studies/research indicates that a particular problem can be solved
more quickly by the programmer, or that the solution is more efficient
in execution time/memory usage when implemented via OOP vs. procedural
programming?

The problem for me is that I''ve programmed extensively in C and .asm on
PC DOS way back in 1988. Then didn''t program for nearly 10 years during
which time OOP was popularized. Starting in 1999 I got back into
programming, but the high-level-ness of PC programming and the
completely foreign language of OOP repelled me. My work was in analog
and digital electronics hardware design, so naturally I started working
with microcontrollers in .asm and C. Most of my work involves low-level
signal conditioning and real-time control algorithms, so C is about as
high-level as one can go without seriously loosing efficiency. The
close-to-the-machine-ness of C is ideal here. This is a realm that I
truly enjoy and am comfortable with.

Hence, being a hardware designer rather than a computer scientist, I am
conditioned to think like a machine. I think this is the main reason
why OOP has always repelled me.

Perhaps the only thing that may have clicked regarding OOP is that in
certain cases I might prefer a higher-level approach to tasks which
involve dynamic memory allocation. If I don''t need the execution
efficiency of C, then OOP might produce working results faster by not
having to worry about the details of memory management, pointers, etc.

But I wonder if the OOP programmers spend as much time creating classes
and trying to organize everything into the OOP paradigm as the C
programmer spends just writing the code?

Ultimately I don''t care what the *name* is for how I program. I just
need to produce results. So that leads back to objectivity. I have a
problem to solve, and I want to find a solution that is as quick as
possible to learn and implement.

Problem:

1. How to most easily learn to write simple PC GUI programs that will
send data to remote embedded devices via serial comms, and perhaps
incorporate some basic (x,y) type graphics display and manipulation
(simple drawing program). Data may result from user GUI input, or from
parsing a text config file. Solution need not be efficient in machine
resource utilization. Emphasis is on quickness with which programmer
can learn and implement solution.

2. Must be cross-platform: Linux + Windows. This factor can have a big
impact on whether it is necessary to learn a new language, or stick with
C. If my platform was only Linux I could just learn GTK and be done
with it. I wouldn''t be here in that case.

Possible solutions:

Form 1: Use C and choose a library that will enable cross-platform GUI
development.

Pro: Don''t have to learn new language.
Con: Probably will have difficulty with cross-platform implementation
of serial comms. This will probably need to be done twice. This will
waste time.

Form 2: Use Python and PySerial and TkInter or wxWidgets.

Pro: Cross-platform goal will likely be achieved fully. Have a
programmer nearby with extensive experience who can help.
Con: Must learn new language and library. Must possibly learn a
completely new way of thinking (OOP) not just a new language syntax.
This might be difficult.

Form 3: Use LabVIEW

Pro: I think that the cross-platform goal can be met.
Con: Expensive. I would prefer to use an Open Source solution. But
that isn''t as important as the $$$. I have also generally found the 2D
diagrammatical programming language of "G" as repelling as OOP. I
suspect that it may take as much time to learn LabVIEW as Python. In
that case the time spent on Python might be better spent since I would
be learning something foundational as opposed to basically just learning
how to negotiate someone''s proprietary environment and drivers.
Comments appreciated.
--
Good day!

________________________________________
Christopher R. Carlen
Principal Laser&Electronics Technologist
Sandia National Laboratories CA USA
cr***************@BOGUSsandia.gov
NOTE, delete texts: "RemoveThis" and
"BOGUS" from email address to reply.

推荐答案

。我还经常发现G的2D

图解编程语言。像OOP一样排斥。我怀疑学习LabVIEW和Python一样多的时间。在

这种情况​​下花在Python上的时间可能会花费更多,因为我会学习基础知识,而不是基本上只是学习

如何谈判某人的专有环境和司机。

评论赞赏。

-

美好的一天!

________________________________________

Christopher R. Carlen

首席激光与电子技师

美国加州桑迪亚国家实验室
CR *************** @ BOGUSsandia.gov

注意,删除文本:RemoveThis和

" BOGUS"从电子邮件地址到回复。
. I have also generally found the 2D
diagrammatical programming language of "G" as repelling as OOP. I
suspect that it may take as much time to learn LabVIEW as Python. In
that case the time spent on Python might be better spent since I would
be learning something foundational as opposed to basically just learning
how to negotiate someone''s proprietary environment and drivers.
Comments appreciated.
--
Good day!

________________________________________
Christopher R. Carlen
Principal Laser&Electronics Technologist
Sandia National Laboratories CA USA
cr***************@BOGUSsandia.gov
NOTE, delete texts: "RemoveThis" and
"BOGUS" from email address to reply.


星期五,2007年7月13日09:06:44 -0700,Chris Carlen写道:
On Fri, 13 Jul 2007 09:06:44 -0700, Chris Carlen wrote:

也许唯一可能点击OOP的是在

某些情况下我可能更喜欢更高级别的方法来处理动态内存的
分配。如果我不需要执行C的效率,那么OOP可能会更快地产生工作结果,而不是担心内存管理的细节,指针,等等。
Perhaps the only thing that may have clicked regarding OOP is that in
certain cases I might prefer a higher-level approach to tasks which
involve dynamic memory allocation. If I don''t need the execution
efficiency of C, then OOP might produce working results faster by not
having to worry about the details of memory management, pointers, etc.



这不是与OOP有关的东西。使用过程语言也可以实现自动内存管理。

That''s not something tied to OOP. Automatic memory management is also
possible with procedural languages.


但是我想知道OOP程序员是否花费了很多时间来创建类

并尝试将所有内容组织到OOP范例中,因为C $ / $
程序员只花费编写代码?
But I wonder if the OOP programmers spend as much time creating classes
and trying to organize everything into the OOP paradigm as the C
programmer spends just writing the code?



使用OOP语言创建类和组织程序与创建结构和在C中组织程序不同。 br />

一方面,Python是一种非常OOP的语言,因为一切都是对象。在

另一方面,可以用程序

甚至功能样式编写程序的一部分。 Python不是Java,你不必强迫

所有内容都进入类。


根据我的经验,Python可以很容易地只写代码" ;.比C更容易

因为我不需要处理这么多机器细节,不要
必须管理内存,不需要额外的索引用于循环列表和

等等。并且崩溃更温和,告诉我错误是什么?
而不是简单的段错误或完全搞砸了结果。


Ciao,

Marc''BlackJack''Rintsch

Creating classes and organizing the program in an OOP language isn''t
different from creating structs and organizing the program in C.

On one side Python is a very OOP language as everything is an object. On
the other side it is possible to write parts of the program in procedural
or even functional style. Python is not Java, you don''t have to force
everything into classes.

From my experience Python makes it easy to "just write the code". Easier
than C because I don''t have to deal with so much machine details, don''t
have to manage memory, don''t need extra indexes for looping over lists and
so on. And the "crashes" are much gentler, telling me what the error is
and where instead of a simple "segfault" or totally messed up results.

Ciao,
Marc ''BlackJack'' Rintsch


克里斯卡伦写道:
Chris Carlen wrote:

嗨:


从我读过的OOP,我得不到它。我还发现了一些对OOP有深刻批评的

文章。我倾向于与这些文章联系起来。


然而,这些文章并不比我在撰写案例时读过的那些文件更客观。

OOP 。也就是说,什么目标

数据/研究/研究表明程序员可以更快地解决特定问题,或者解决方案更有效
通过OOP实现执行时间/内存使用时
与程序相比

编程?


对我来说问题是我有在C和.asm中广泛编程,然后在1988年回到PC $ DOS.然后,在OOP普及的时候,没有编程好近10年。

。从1999年开始我回到了

编程,但是PC编程的高级别和OOP的完全外语的

击退了我。我的工作是模拟和数字电子硬件设计,所以很自然地我开始使用.asm和C中的微控制器工作
。我的大部分工作都涉及低级别的工作。 />
信号调节和实时控制算法,所以C大约是高水平的,因为人们可以在不严重失去效率的情况下前进。

接近C的机器在这里是理想的。这是一个我真正喜欢并且很舒服的领域。


因此,作为硬件设计师而不是计算机科学家,我是

的条件是像机器一样思考。我认为这是主要的原因

为什么OOP总是击退我。
Hi:

From what I''ve read of OOP, I don''t get it. I have also found some
articles profoundly critical of OOP. I tend to relate to these articles.

However, those articles were no more objective than the descriptions of
OOP I''ve read in making a case. Ie., what objective
data/studies/research indicates that a particular problem can be solved
more quickly by the programmer, or that the solution is more efficient
in execution time/memory usage when implemented via OOP vs. procedural
programming?

The problem for me is that I''ve programmed extensively in C and .asm on
PC DOS way back in 1988. Then didn''t program for nearly 10 years during
which time OOP was popularized. Starting in 1999 I got back into
programming, but the high-level-ness of PC programming and the
completely foreign language of OOP repelled me. My work was in analog
and digital electronics hardware design, so naturally I started working
with microcontrollers in .asm and C. Most of my work involves low-level
signal conditioning and real-time control algorithms, so C is about as
high-level as one can go without seriously loosing efficiency. The
close-to-the-machine-ness of C is ideal here. This is a realm that I
truly enjoy and am comfortable with.

Hence, being a hardware designer rather than a computer scientist, I am
conditioned to think like a machine. I think this is the main reason
why OOP has always repelled me.



为什么?


我用C ++编写了大量内容,包括硬实时编程
$用于DARPA Grand Challenge车辆的QNX下的C ++中的b $ b。我有一个Atmel

AVR,现在我的桌子上插着JTAG端口的电缆。

即使是那个小东西也可以用C ++编程。


有时你可以在C ++中获得比在C中更好的性能,因为C ++


如果它有状态和函数,它可能应该是一个对象。 br />
对象的实例在C ++中可以是静态的;动态内存
$ c $ b在C ++中不需要分配,就像在Python中一样。


Python是一种相对简单的语言,比C ++,Java更容易,

甚至是Perl。这是非常宽容的。然而,主要的实现,即
CPython,比C慢大约60倍,所以如果你正在尝试实现一个快速变化的数字示波器显示器,

结果可能会很迟钝。


John Nagle

Why?

I''ve written extensively in C++, including hard real-time programming
in C++ under QNX for a DARPA Grand Challenge vehicle. I have an Atmel
AVR with a cable plugged into the JTAG port sitting on my desk right now.
Even that little thing can be programmed in C++.

You can sometimes get better performance in C++ than in C, because C++
has "inline". Inline expansion happens before optimization, so you
can have abstractions that cost nothing.

If it has state and functions, it probably should be an object.
The instances of the object can be static in C++; dynamic memory
allocation isn''t required in C++, as it is in Python.

Python is a relatively easy language, easier than C++, Java,
or even Perl. It''s quite forgiving. The main implementation,
CPython, is about 60x slower than C, though, so if you''re trying
to implement, say, a rapidly changing digital oscilloscope display,
the result may be sluggish.

John Nagle


这篇关于低级程序员可以学习OOP吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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