HN2new | past | comments | ask | show | jobs | submitlogin

Why do people do this to themselves? You can't code in a vacuum. It's about community strength and modernity. If you don't have both you are wasting you time. It's like talking to a island cast away.


> It's about community strength and modernity.

Javascript people have both and they suffer from "javascript fatigue".

Community strength is important and useful but it's by no means the reason people write software. Modernity is only useful if it solves problems. Otherwise it's just superfluous.

> If you don't have both you are wasting you time.

Perhaps you mean that you won't be able to boast your skills in interviews and apply at hip jobs? Perhaps that's true. However, enjoying yourself and making something useful isn't a waste of time.


What is about community strength? If he's creating applications and enjoys doing it, why does it matter who else is using the same language? Worst case scenario, he can translate libraries from other languages into Object Pascal, but realistically it has a decent-sized community.

I don't see the modernity point, either. Object Pascal has modern features.


Re modernity: is is true that Delphi/Object Pascal has no automatic memory management support, and it is up to the programmer to add lots of "try" blocks and manually code up destructors to release the resources?

For example, this tutorial (from 2017) recommends doing "try .. finally: f.Release" block. https://www.thoughtco.com/communicating-between-forms-409254...

This tutorial, which is also from 2017, says that that you need to either explicitly add each member to an owned list, or to explicitly free every class member in destructor: http://newpascal.org/assets/modern_pascal_introduction.html#...

Is this a recommended best practice? I hope not -- most (all?) of the modern languages either have GC, or offer automatic refcounted pointers, and Object Pascal claims to be modern.


Correct. It compiles to binaries without any runtime environment, so you have to manage memory. Apple did something with objective-c (forgot what it was called) that automatically frees your memory based on your code, but it actually inserts the free memory calls. That's the only language that does that AFAIK. Very clever though, memory management can be a pain if you aren't used to it.

The good thing about managing your memory is you don't have memory bloat and you don't have jitters when the GC decides to fire.


I know the disadvantages of GC; what I am asking about is "smart pointer", like C++'s std::shared_ptr, or Rust's Rc. It is used like this:

In the class definition:

    std::shared_ptr<BigStruct> big_struct;
In the constructor (or anywhere else in the program):

    big_struct = std:::make_shared<BigStruct>(arg1, arg2)
and that's it. When there are no more users of the pointer (for example, when the container object disappears), it will get destroyed automatically. There is no magic -- this is a simple reference counting pointer, and the compiler will automatically add the release call to the object destructor, on function exits, or in any other place when the variable is no longer accessible.

I found these things extremely helpful in the modern languages without GC. They are obviously not perfect -- if you have a complex structure with a loop it will never get destroyed -- but they eliminate 99% of all possible memory leaks with a very little effort. And the good news, they have almost no overhead. They are also fully thread-safe, so they become extremely helpful if you have a multi-threaded application and you want to pass the data between the threads.

This is the simplest of things that modern non-GC languages, and this is one of the big reasons why I no longer do C, just C++. There are more advanced features, of course, but I don't think you can call a language "modern" if it does not even have the smart pointers.


You can use interfaces as class wrappers if you want referenced-counted class instances in Delphi. All arrays and strings are automatically reference-counted, and records (structs) are values that can be passed around without allocating memory (Delphi supports variable parameters, or pass-by-reference, but without requiring pointers or address-of notation).

As a Delphi application developer, you will most likely not be manually allocating/freeing memory a lot. Delphi's visual component library has a component ownership model. For example, any components/controls that you drop on a form are automatically "owned" by the form and are created/destroyed for you.


I don't believe it does. Last time I was using it, we had to free memory manually. This was probably 2008 or so. They may have added it since.


It matters because it affects how many third party libraries are available and the number of other people that can understand and work on your code.

Object Pascal may have modern features, but that doesn't mean it is a modern language - nobody is going to start learning it now. Only people that have known it for years already will use it.


Object Pascal is very similar to C# in many ways. It isn't like a developer that has used Java or C# would have a hard time learning and understanding how to use it.

Re: modern languages: a language having modern features isn't a modern language, rather how popular it is at this moment is the most important aspect ? How did that work out for Python ? And where does PHP land using this criteria ? Is PHP better than Object Pascal because more people write PHP code ?


It _is_ a modern language, and people do start learning it when they get jobs that use it. It's just syntax, and it's a really good tool for certain jobs. You should give it a go with Lazarus IDE and see if you still feel that way.


>Why do people do this to themselves?

Wow. That's pretty condescending and patronizing.

>It's like talking to a island cast away.

And, that almost sounds like frustrated anger.

>It's about community strength and modernity.

Development is about this? Since when? According to whom?

Why are devs often so opinionated about what other devs do or "should" do?


If everyone thought like this, there would never be a successful new language or platform. So, while we're bandying about subjective statements, I'll give mine: It's not about community strength and modernity. It's about exploring ideas and finding tools / solutions that work well for you and the problem you're trying to solve.


How do you know Object Pascal doesn't have a good community?

"Modernity" is not a value in and of itself. This developer seems to be delivering real value with Object Pascal, and demonstrates Object Pascal tools are still being actively developed.

If you have concrete criticisms of Object Pascal, that could lead to some interesting discussion. But your comment, as it stands, adds very little value.


I guess we should all use Node.js then. Yes, i will use it, and enjoy having to download 1000 ten-lines-of-code NPM packages every time i need to deploy the server. Yes, i can feel the community strength.

(Note: I do use node.js.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: