Jump to content

Thoughts on frameworks

SoftwareNinja

Hi all,

 

I am thinking of dabbling in a Web Application Project for a car listing website but I'm not sure what framework would be best for this?

 

Could I get some suggestions from you guys on frameworks and thoughts on ASP .net?

 

Thanks

Link to comment
Share on other sites

Link to post
Share on other sites

ASP.NET is just fine. Only 1 framework to maintain. not 20 different framework bundle together. reduce the cyclomatic complexity.

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Nicholatian said:

What do you mean?

I've had clients with website and service with over dozens of tools and frameworks. It's a nightmare to maintain and debug.

Link to comment
Share on other sites

Link to post
Share on other sites

Personally I love .net. Make sure you go with .net core for now.

 

As for front end, React is probably the one you'll see everywhere, but to color the thread with my opinion again give Vue a look. That's assuming you want a JS front end. If you're already in the .net world you could just give Blazor a look. I wouldn't necessarily suggest that, but you could.

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/14/2020 at 11:30 PM, ScottDurkin said:

Could I get some suggestions from you guys on frameworks and thoughts on ASP .net?

For web application Python and PHP or Ruby are very popular. Microsoft technologies like ASP not so much (although I assume it can be popular in some regions or companies that used it over the years). In Python there is a very good framework - Django or if you are going microservices - Flask. Ruby has RoR while PHP also has few like Laravel and other. Still if you are picking a framework you are also picking a language with it specifics, best practices, tools and solutions. Very simple/basic site can be done quickest via PHP with no frameworks even but for anything more decent I would choose a good framework (and I assume you have some experience with given language etc.).

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/15/2020 at 6:48 AM, Nicholatian said:

For the client side, you can’t go wrong with React.

You absolutely can, unless there are very good reasons to have the client's browser execute code only to display text generated on the server.

 

16 hours ago, riklaunim said:

For web application Python and PHP or Ruby are very popular.

I strongly suggest to try C for web applications as well. Admittedly, Go starts to become an adequate alternative though.

Python and Ruby suffer from a horrible performance and a horrible syntax. YMMV.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

21 hours ago, Dat Guy said:

I strongly suggest to try C for web applications as well.

What kind of nonsense is this? This isn't a contest for some elite nobody-sane-uses-it type of a thing.

 

21 hours ago, Dat Guy said:

horrible performance and a horrible syntax.

If you aren't an actual web app developer then everything can be horrible and have horrible performance.

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/16/2020 at 3:27 PM, Dat Guy said:

You absolutely can, unless there are very good reasons to have the client's browser execute code only to display text generated on the server.

 

I strongly suggest to try C for web applications as well. Admittedly, Go starts to become an adequate alternative though.

Python and Ruby suffer from a horrible performance and a horrible syntax. YMMV.

You can use C for building web applications, but there are a number of reasons why people don't. Some that come to mind for me are

  • There aren't many people using C for web applications, so the library ecosystem is considerably less strong than more conventional server languages like go, php, python, java, ruby, js, etc. Yes, if you take any specific thing that you want to do, you might be able to find a library for it if you look hard enough, but that doesn't mean that it's a well supported (bug free) library that has as many features as a comparable library in other languages
  • The dependency management story for C is (as far as I know) non-existent. go has it built in, php has composer, python has pip/conda, java has gradle/maven, ruby has gem, js has npm, but if you want a C library then (afaik) you have to download it manually and add it to the compiler path. Want to build on a different machine? Go find all those dependencies manually until you stop getting linker errors. Sure, you could write a script to automate this, but it's a bunch of extra friction that is not incurred for other languages.
  • Debugging C is far inferior to other languages. If you accidentally read off the end of an array in C, the program will crash with a segmentation fault if you're lucky, and just carry on with garbage data if you're not. If you accidentally read off the end of an array in Java, you'll get an ArrayIndexOutOfBoundsException with the stack trace of the faulting access and the index that it tried to read. During development you can attach a debugger to catch errors like this, but if it happens in production you get nothing to help you debug.
  • C's lack of memory safety accounts for a huge number of security vulnerabilities that simply cannot occur in other languages. There are static and dynamic analysis tools that can help, but the number of these vulnerabilities that still occur in the wild, even in things like web browsers where a huge amount of effort is put into making them safe, shows that this is far from perfect.

Are these issues insurmountable in isolation? Other than the last point, no.

Do they mean that C is always the wrong choice? No.

But is C always the best language to use? No, not by a long shot.

 

Choosing a language is always a trade-off. With C, that trade off is iteration speed, complexity and safety against performance (although even that is far from guaranteed, because it depends a lot on the code that you write). For many companies, the increase in developer efficiency (rate of shipping features) far outweighs the loss in performance, although that is clearly not universal.

 

React has a completely different set of tradeoffs. Moving the logic to the browser means that the site can feel much more responsive to users (because their view starts changing immediately, even if some of the data takes up to a few seconds to load), which is a big plus for some websites. It can also make some of the logic much clearer, because using react is much more declarative than typical back end code for the same goals (especially when you want to do infinite scrolling and other things like that), and it enforces a split between application logic and interface logic, which is generally considered to be a good split to make[citation needed]. However, it does mean more load on potentially low powered client devices, and unless something like graphQL is used it can add a lot more network requests.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, colonel_mortis said:

Yes, if you take any specific thing that you want to do, you might be able to find a library for it if you look hard enough

HTH: https://github.com/fffaraz/awesome-cpp

 

9 minutes ago, colonel_mortis said:

The dependency management story for C is (as far as I know) non-existent.

It (haha) depends. I usually take the submodule approach (my code usually imports the required libraries right from their Git repositories), but Conan might also work for some projects:

https://conan.io

 

Anyway: Yes, this is one of the big advantages of Go over C, I sadly admit.

 

11 minutes ago, colonel_mortis said:

Debugging C is far inferior to other languages.

Debugging any language is directly relating to the developer and the chosen toolset.

 

12 minutes ago, colonel_mortis said:

If you accidentally read off the end of an array in C, the program will crash with a segmentation fault if you're lucky, and just carry on with garbage data if you're not. If you accidentally read off the end of an array in Java, you'll get an ArrayIndexOutOfBoundsException with the stack trace of the faulting access and the index that it tried to read.

Java stack traces are awful in my opinion. Most other languages produce much less annoying error debug output.

Historically, C had to run on very low-end hardware, so it lacked then-known security measurements like type checks right from its initial concept. (That's why Unix was less stable than Multics which was written in PL/I.) So I need to give you this point...

 

15 minutes ago, colonel_mortis said:

C's lack of memory safety accounts for a huge number of security vulnerabilities that simply cannot occur in other languages.

That's why there have been garbage collectors and alternative malloc() implementations for quite some time now.

 

16 minutes ago, colonel_mortis said:

For many companies, the increase in developer efficiency (rate of shipping features) far outweighs the loss in performance, although that is clearly not universal.

Ha! Looking forward to WebAssembly finally achieving DOM functionality... 🙂 but I usually don't recommend languages/"frameworks" from a company (thus, economical) point of view. I usually think of web development as personal projects, which is where "developer efficiency" cannot really shine anymore.

 

18 minutes ago, colonel_mortis said:

However, it does mean more load on potentially low powered client devices, and unless something like graphQL is used it can add a lot more network requests.

And it requires an unsafe browser environment (JavaScript fully enabled - which opens quite another set of Pandora's Box items) for displaying text. I doubt that this is always a great choice.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, Dat Guy said:

I usually think of web development as personal projects, which is where "developer efficiency" cannot really shine anymore.

That's fair, though for personal projects I would argue that brings up the related issue of being able to build something versus just getting frustrated and quitting - a language and framework that is easy to debug, easy to find answers for, and doesn't require much initial setup is even more valuable there.

 

For the vast majority of personal projects, performance is very low on the list of priorities too.

27 minutes ago, Dat Guy said:

That's why there have been garbage collectors and alternative malloc() implementations for quite some time now.

That helps with forgetting to deallocate and use-after-free vulnerabilities, but it doesn't protect against buffer overruns. It's also yet another thing that needs to be set up before you can start using your project.

23 minutes ago, Dat Guy said:

And it requires an unsafe browser environment (JavaScript fully enabled - which opens quite another set of Pandora's Box items) for displaying text. I doubt that this is always a great choice.

React is definitely not always a great choice, and requiring JS to be enabled is definitely not great. Unless you're attracting Tor browser users though, the vast majority of web users have javascript enabled (you must have javascript enabled on LTT to have been able to write that post), so it's definitely not reason to rule out using a client side framework - just another thing to factor into the tradeoff.

 

The point is, please don't go around advocating that everyone use C for all their web projects. It's an option, but "strongly recommending" that people use it is just not right - the tradeoffs just don't make sense for someone who just wants to dabble in web dev.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, colonel_mortis said:

please don't go around advocating that everyone use C for all their web projects

I explicitly - "as well" - suggested it as an alternative (with Go). :) It is not great for many projects, but I have a feeling that most React projects suffer from over-engineering and could really need the opposite part of the scale. I guess the absolute truth lies somewhere in between.

 

The "car listing website" described by the OP sounds like not much more than a HTML table with a database backend which is one of the best use cases for a "C + SQLite" framework as mentioned behind my BCHS link. Then again, Racket and Perl could do that just as well. But I would assume that using a multi-megabyte JS framework would be the same as cracking a walnut with a sledgehammer here.

 

(I hope we can agree that C is probably the language to "find answers for" though. It has decades of UNIX manpages and internet communities behind it!)

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Dat Guy said:

I explicitly - "as well" - suggested it as an alternative (with Go). :) It is not great for many projects, but I have a feeling that most React projects suffer from over-engineering and could really need the opposite part of the scale. I guess the absolute truth lies somewhere in between.

That's fair, though I think your posts do sometimes come across, at least to me, more strongly pushing C than you perhaps intended.

3 hours ago, Dat Guy said:

The "car listing website" described by the OP sounds like not much more than a HTML table with a database backend which is one of the best use cases for a "C + SQLite" framework as mentioned behind my BCHS link. Then again, Racket and Perl could do that just as well. But I would assume that using a multi-megabyte JS framework would be the same as cracking a walnut with a sledgehammer here.

Definitely true. Spending a bunch of time figuring out how to get a C project working, or learning react, for a toy project only really makes sense to me if you can use the experience to work on something bigger later on. I am just of the opinion that react experience is more likely to be more useful than a C web framework.

 

 

For just a simple project like suggested in the OP, without intention of using it for experience, something that just works out of the box, such as Go, ASP.net, Django, etc, is ideal.

3 hours ago, Dat Guy said:

(I hope we can agree that C is probably the language to "find answers for" though. It has decades of UNIX manpages and internet communities behind it!)

There are certainly a lot of answers for core C questions, as long as you can figure out what your question is (I find man pages fairly difficult to digest when I'm trying to do x rather than to understand the semantics of passing y).

C web frameworks have far fewer users than the popular frameworks in the other languages that have been mentioned though, so the documentation is less likely to be as complete and density of problems that are already solved on Stack Overflow will be considerably lower.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, Dat Guy said:

The "car listing website" described by the OP sounds like not much more than a HTML table with a database backend which is one of the best use cases for a "C + SQLite" framework as mentioned behind my BCHS link.

Could someone please enlighten me.. So.. it's heavily IO bound. In this case does C provided performance matter at all? Given that i don't want to host it on a smart fridge. Why would i not use a feature rich database system that can handle concurrent queries much better than SQLite and if the heavy work is done by the DB then why would i not use a more (human) friendly language?

 

ಠ_ಠ

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, shadow_ray said:

Why would i not use a feature rich database system that can handle concurrent queries much better than SQLite

SQLite can handle concurrent SELECT queries quite well. It sucks at concurrent writing though. However, feel free to use any database you like. C can access all of them.

 

16 minutes ago, shadow_ray said:

why would i not use a more (human) friendly language?

Every language has its quirks. C has some disadvantages, Go has others, Racket has others, Perl has others, Python has too many of them :D, JavaScript is a syntax nightmare, ...

 

It depends on the human, I guess.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, shadow_ray said:

Why would i not use a feature rich database system that can handle concurrent queries much better than SQLite and if the heavy work is done by the DB then why would i not use a more (human) friendly language?

You use what's best suited for you. There is no point in forcing technologies that either you don't know, don't want to use, aren't as good and so on. If you want to make a website you make a website as quickly and optimally as possible. And note that pretty much no one uses C for simple websites and for more advanced there are well established and supported frameworks.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×