Live data from Hacker News

Lazarus – A Delphi-compatible cross-platform IDE

lazarus-ide.org

121–130 of 187 posts

Re: Lazarus – A Delphi-compatible cross-platform IDE

#121
post #42

How do you avoid spaghetti code, in an environment like lazarus?

As someone who maintains a multi-MLOC application in fpc (using emacs and lazarus): discipline.

You don't grow an application to that size by simply building on what might be suitable for a 30kloc application. It requires discipline, experience, trial and error and ability to invest time in properly maintaining the codebase.

Disciplined code review by people very familiar with the codebase is vital.

Re: Lazarus – A Delphi-compatible cross-platform IDE

#122
post #58

Earlier quoted context omitted.

Depends on what you define as small but if you remove the GDB debugging information you can trim down your binaries by a huge amount. My last project was 3.4MB.

Back in the day I used to run the exe through and get them even smaller: https://upx.github.io/

UPX is misleading though since it needs more memory than the EXE itself.

Re: Lazarus – A Delphi-compatible cross-platform IDE

#123
post #73

I mentioned Lazarus in other threads a few days ago (since my kids are playing around with it) and it's great to see it as a top-level post. Some random thoughts: - It's somewhat amusing to realize that in 2017 this is pretty much the easiest way to do a desktop app (besides RealBasic/Xojo which I've yet to try - was put off by their mandatory registration) - I wish we had RAD environments like this for more language…

"It's somewhat amusing to realize that in 2017 this is pretty much the easiest way to do a desktop app (besides RealBasic/Xojo which I've yet to try" If you're interested in Basic programming then Gambas might interest you. Although not a clone of VB, it can be roughly considered being to VB what Lazarus is to Delphi: a 100% Open Source implementation. I would prefer Lazarus anyway, but it's indeed nice to see differ…

I remember one BASIC, called RapidQ, which I really enjoyed playing with a long time ago (which was freeware, but unfortunately I think it stopped being maintained as the source was sold to another company).

It had a rather cool graphical interface to create GUIs, kind of like VisualBasic I think.

It even had APIs to interface with DirectX.

Pic of what the IDE looked like: http://basic.mindteq.com/Screenshots/RapidQ.jpg

Re: Lazarus – A Delphi-compatible cross-platform IDE

#124
post #97

I've made the mistake to write a complex project in Free Pascal. As far as I can tell pretty much every release of Lazarus is breaking something. And surprisingly often those breaks are major (like e.g. broken multi-threading, broken-strings, ...). For me the whole thing looks more like a playground for hobbyists and is not really useful for anything productive. There's not much continuity in the language. And for th…

I like your comment. It highlights what misses from so many discussion about languages/tools down here. Being expressive, powerful, compiled, interpreted doesn't matter much if long term stability, reliability, backward compatibility are not a top goal for the devs.

The same was for Delphi, but no one complained in such way. Your sources were to update accordingly, or you simply remained on previous version, which was not a bad thing, because it is your app, it was working yesterday, why would it break tomorrow?

For new projects you took new libraries.

Personally, I don't like the modern idea of autoupdated anything. Once program is tested and deployed, only cherry-picked (or backported) security updates must be applied.

Re: Lazarus – A Delphi-compatible cross-platform IDE

#125

I've made the mistake to write a complex project in Free Pascal. As far as I can tell pretty much every release of Lazarus is breaking something. And surprisingly often those breaks are major (like e.g. broken multi-threading, broken-strings, ...). For me the whole thing looks more like a playground for hobbyists and is not really useful for anything productive. There's not much continuity in the language. And for th…

I work with a multi-mloc application in fpc. We have migrated the code over many compiler versions with hardly any issues at all.

With every update they post a list of things breaks compatibility, and if you are affected, the refactoring tools are almost always enough.

We had two tries at a full recompile migrating from 2.6.something to 3.0.2, and passed all tests within 13 hours of starting the process. (some of the larger stuff were however already fixed since we keep a close eye on the development).

Re: Lazarus – A Delphi-compatible cross-platform IDE

#126
post #115

Earlier quoted context omitted.

The UI part of a database frontend is trivial and the code is very minimal in Qt (but there still code involved, for sure). An image manipulation program, what does Delphi provide out of the box for this? I would assume that if you have anything non-trivial, you'd have some custom code to write? I mean, they can hardly have built-in components for every possible use case so I don't have to write any code. What am I m…

> I mean, they can hardly have built-in components for every possible use case so I don't have to write any code. What am I missing here? The eco-system of companies selling components for every possible use case. Most VB/Delphi shops would get early licenses from such companies. DevExpress is a surviving company from those days. https://www.devexpress.com/Products/VCL/ (over 210 controls) So you had a huge toolbox f…

There are, but they're few and far between and certainly not as diverse as what you've described.

Re: Lazarus – A Delphi-compatible cross-platform IDE

#127
post #73

I mentioned Lazarus in other threads a few days ago (since my kids are playing around with it) and it's great to see it as a top-level post. Some random thoughts: - It's somewhat amusing to realize that in 2017 this is pretty much the easiest way to do a desktop app (besides RealBasic/Xojo which I've yet to try - was put off by their mandatory registration) - I wish we had RAD environments like this for more language…

I've not used Lazarus or Delphi, so I can't really compare properly. Perhaps I'm missing something. But: > if anyone knows of any similar environments (besides QtCreator, etc.) Why "besides QtCreator, etc"? It sounds to me almost like "do you know any X besides all of the popular X". Is there any particular reason you discount QtCreator? Does it not work for your purposes? Or is it just a case of you already know abo…

I want more tools. Qt is popular and I've tried it before, but it keeps cropping up as "the new RAD" in these discussions and I was (unsuccessfully) trying to steer the discussion away from it.

Re: Lazarus – A Delphi-compatible cross-platform IDE

#128
post #42

How do you avoid spaghetti code, in an environment like lazarus?

My personal approach is to create a unit to contain the classes for the "thing" i am working with (e.g. for a 3D world editor, i create a unit that was a TWorld inside, perhaps with TEntity and other classes). Then create another unit for the global stuff (lately i've taken a liking to use a TDataModule which can be edited visually even though it is a non-visual thing - it allows me to place non-visual components in an IDE surface which helps assign event handlers and properties from the editor without writing code for that). Then from the GUI side i just make calls to the global unit/datamodule and/or to methods in the classes i work with.

Of course it all depends on what i'm making, for simple stuff i just throw everything in the form code directly. For more complex stuff i use the method above.

Here is an image showing an example of the approach:

http://i.imgur.com/cm4VTHn.png

The "GlobalState" window is an IDE window that represents a TDataModule (the name sucks and probably is for Delphi compatibility, it doesn't have anything to do with "Data" and because of that i ignored it for years) that contains the "SimpleViewportRenderer1" and "ViewportManager1" non-visual components - instances of the TSimpleViewportRenderer and TViewportManager component classes. This is in its own unit and can be accessed by other units, essentially providing global state (note that a data module is really a class - much like forms - but you can have a global variable with a single instance of it - again like forms). The neat thing with this approach is that it can also be seen by the IDE: the Viewport1, Viewport2, Viewport3 and Viewport4 components in the Form1 form have a property that accepts an optional TViewportRenderer component. This is presented as a combobox in the Object Inspector window and when you pull it down, one of the options is "GlobalState.SimpleViewportRenderer1" - so you can wire together components 100% visually.

Re: Lazarus – A Delphi-compatible cross-platform IDE

#129
post #50
post #4

Lazarus/FPC checks so many nice boxes: [x] Statically compiled [x] Native UI on Linux/Mac/Win [x] Typically compiled without code changes on Linux/Mac/Win [x] Small binaries [x] No GC [x] Readable, somewhat python-like syntax [x] Still, doesn't rely on indentation for nested blocks [ ] (Fill in)

> [x] Readable, somewhat python-like syntax I have a rather different opinion on OP that it has a needlessly verbose syntax. Pythonic it is definitely not. Even C# (which is another creation of Anders Hejlsberg, after MS poached him from Borland) has a better, readable and concise syntax. I used to be a Delphi evangelist in it's glory days. Now I bristle when I read Pascal source code, there's so much unnecessary vis…

> Even C# has a better, readable and concise syntax

C# has amazingly easy-to-read syntax, but maybe I'm biased because I'm most comfortable with C-like syntaxes.

Re: Lazarus – A Delphi-compatible cross-platform IDE

#130

Earlier quoted context omitted.

> Why "besides QtCreator, etc"? It sounds to me almost like "do you know any X besides all of the popular X". Is there any particular reason you discount QtCreator? I know Lazarus (almost) inside out and i've tried several times to use QtCreator, mainly because C++ would allow me to reuse some of my C code. However i could never get used to how QtCreator expects from me to do more stuff, how unweildy the laying out w…

Have you tried QtQuick/QML? It sounds like its anchor/grid/constraints-based layouts work very similarly to Lazarus.

Isn't that a JSON-like language? I find describing UIs in text instead of "drawing" them like done in Lazarus to be going backwards.

Although TBH i haven't really looked into that. Most QtQuick programs i've seen look like something you'd see in a mobile phone or tablet instead of a normal desktop application, so i didn't had the incentive

Post reply on HN