Goravel is a Go web framework heavily inspired by Laravel's elegant syntax and developer-friendly features. It aims to provide a similar experience for Go developers, offering functionalities like routing, middleware, database ORM (using GORM), validation, templating, caching, and queuing. The goal is to boost developer productivity by offering a structured and familiar environment for building robust web applications in Go, leveraging Laravel's conventions and principles.
The author argues against using SQL query builders, especially in simpler applications. They contend that the supposed benefits of query builders, like protection against SQL injection and easier refactoring, are often overstated or already handled by parameterized queries and good coding practices. Query builders introduce their own complexities and can obscure the actual SQL being executed, making debugging and optimization more difficult. The author advocates for writing raw SQL, emphasizing its readability, performance benefits, and the direct control it affords developers, particularly when the database interactions are not excessively complex.
Hacker News users largely agreed with the article's premise that query builders often add unnecessary complexity, especially for simpler queries. Many pointed out that plain SQL is often more readable and performant, particularly when developers are already comfortable with SQL. Some commenters suggested that ORMs and query builders are more beneficial for very large and complex projects where consistency and security are paramount, or when dealing with multiple database backends. However, even in these cases, some argued that the abstraction can obscure performance issues and make debugging more difficult. Several users shared their experiences of migrating away from query builders and finding significant improvements in code clarity and performance. A few dissenting opinions mentioned the usefulness of query builders for preventing SQL injection vulnerabilities, particularly for less experienced developers.
Summary of Comments ( 70 )
https://news.ycombinator.com/item?id=43306797
Hacker News users discuss Goravel, a Go framework inspired by Laravel. Several commenters question the need for such a framework, arguing that Go's simplicity and built-in features make a Laravel-like structure unnecessary and potentially cumbersome. They express skepticism that Goravel offers significant advantages over using standard Go libraries and approaches. Some question the performance implications of mimicking Laravel's architecture in Go. Others express interest in exploring Goravel for personal projects or as a learning experience, acknowledging that it might be suitable for specific use cases. A few users suggest that drawing inspiration from other frameworks can be beneficial, but the overall sentiment leans towards skepticism about Goravel's value proposition in the Go ecosystem.
The Hacker News post about Goravel, a Go framework inspired by Laravel, has generated a moderate amount of discussion. Several commenters express skepticism about the need or benefit of bringing Laravel's design patterns and features into Go. A recurring theme is that Go's simplicity and performance are its strengths, and emulating a framework designed for a different language (PHP) and environment might introduce unnecessary complexity and overhead. Some question whether Goravel truly captures the essence of Laravel or merely replicates surface-level aspects.
One commenter suggests that if a developer prefers Laravel's style, they should simply use Laravel. This sentiment reflects a broader view that choosing the right tool for the job is crucial, and trying to force a specific paradigm onto a language where it might not fit is counterproductive.
There are also concerns about the potential for "magic" and hidden complexity within Goravel, mirroring similar criticisms leveled against Laravel itself. Commenters worry that the framework might obscure underlying Go mechanisms, making it harder to debug and understand the code's behavior. The reliance on reflection is mentioned as a potential performance bottleneck and a source of unexpected issues.
While some appreciate the effort to provide a familiar experience for developers transitioning from PHP and Laravel, others express doubts about the long-term viability and maintainability of the project. The potential for feature creep and divergence from Go's idiomatic style are raised as concerns.
However, not all comments are negative. Some express curiosity and interest in exploring Goravel, particularly those familiar with Laravel. They see potential value in having a framework that offers similar conveniences and conventions in the Go ecosystem. One commenter mentions the potential for Goravel to attract PHP developers to Go.
The discussion also touches upon the broader topic of framework fatigue and the proliferation of frameworks in various languages. Some argue that creating yet another framework, especially one inspired by a different language's paradigm, contributes to this problem. Others counter that having more choices is generally beneficial, as it allows developers to select the tools that best suit their needs and preferences.